Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Knowledge Bases

v1.3.9-alpha-54

groupID
at.tugraz.ist.ase
artifactID
choco-kb-v2

CA-CDR-V2 allows to represent knowledge bases as Constraint Satisfaction Problems. choco-kb-v2 provides classes managing a (Choco) CSP representation of a knowlege base.

Feature model is a type of knowledge represention. For more details related to what CA-CDR-V2 supports for feature models, we refer to Feature models.


Table of Contents

  1. Features
  2. How tos
    1. Encoding your own knowledge base
    2. Creating a FMKB object for a feature model readed from a file
    3. Creating and using an object of FMKB, PCKB, RenaultKB, and CameraKB
    4. Implementing a new assignment translator
    5. How to for Utility functions

Features

choco-kb-v2 provides the following features:

Negative constraints are used in the algorithms WipeOutR_T, WipeOutR_FM.

How tos

Encoding your own knowledge base

You can implement your knowledge base by inheriting the KB class.

Examples

PCKB, FMKB

Creating a FMKB object for a feature model readed from a file

The following code shows how to create a FMKB object for a feature model which is parsed from a file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
File fileFM = new File("src/test/resources/smartwatch.sxfm");

// create a parser for the given file
@Cleanup("dispose")
FeatureModelParser<Feature, AbstractRelationship<Feature>, CTConstraint>
    parser = FMParserFactory.getInstance().getParser(fileFM.getName());

// parse the feature model file
FeatureModel<Feature, AbstractRelationship<Feature>, CTConstraint>
    fm = parser.parse(fileFM);

// create a FMKB object with the given feature model and requires to generate also the negative constraints
FMKB<Feature, AbstractRelationship<Feature>, CTConstraint>
    kb = new FMKB<>(fm, true);

For more examples related to feature models, we refer to [Feature model].

Creating and using an object of FMKB, PCKB, RenaultKB, and CameraKB

Examples

KBStatistics, FMKBTests, PCKBTest, RenaultKBTest, and CameraKBTest

Implementing a new assignment translator

Example

FMAssignmentsTranslator

How to for Utility functions

TBD