Download
The feature model calculator is still under heavy development. Please treat this software as a proof of concept. If you're willing to deal with potentially broken software, feel free to download the tool. If you discover a bug, please do report it to me.
MD5 checksum:
18fca9be975160cce271e03afd9f8d84
To run, execute the following command on the console:
java -jar -Xmx 512M
fmcalc-0.3.2.jar
Overview
The Feature Model Calculator is a command-line Java application for performing semantic operations on feature models and propositional formulas. Feature models are converted into a propositional formula through a semantic operation. A propositional formula is converted to a generalized feature model through feature model synthesis or a basic feature model using the render operation. Expressions in the calculator can be one of two types:
- Feature models are surrounded by curly braces { } and are specified using the same notation as in the Feature Modeling Toolkit.
- Propositional formulas (φ) are created by applying semantic operations on the feature models. These operations reduce the FM to its propostional logic representation.
Features and Operations
Note: A feature model is automatically converted into a propositional formula when needed.- Assign a feature model to a variable in the calculator
-
var = ( FM | set | operation )
Example Usage:
a = { a: b? c?; c: (d|e); b->!c; }
b = a - View a graphical representation of a FM
-
view FM
FMOpens a frame showing the feature diagram (FD) component of the feature model. If the FD is in the generalized notation (ie. one or more features have multiple parents), then the DAG layout is used, otherwise the FD is shown as a tree.
The view command can be omitted. view is the default action for feature models.
Example Usage:
view { a: b? c?; }
{ a: b? c?; }
a = { a: (b|c); }
view a
a - Intersect / Union Operation
-
φ
(intersect|union) φ
Returns: Formula
Deselects absent variables prior to the propositional AND / OR.
Example Usage:
a = { a: b? c?; }
b = { a: b?; b: d; }
c = a intersect b
d = { a: (b|c)+; } union { a: (d|e)+; } - Render Operation
-
render φ FM1
- FM1 - A feature model containing a hierarchy to be enforced
Returns: Feature Model
Example Usage:
a = { a: b? c?; }
b = { a: b?; b: d; }
c = a union b
d = render c a
view d - Feature Model Synthesis Operation
-
synth φ
Returns: a FM in generalized feature digram notation
Example Usage:
synth { b->a & c->a & b->(d|e); d->!e; }
- Propositional AND / OR
-
φ (& or
|) φ
Returns: Formula
Example Usage:
a = { a: b? c?; }
b = { d->c; }
c = a & b
d = a | b
view render c a b - Propositional NOT
-
!φ
Returns: Formula
Example Usage:
a = { a: b? c?; }
b = !a
c = a & b - Generate a random feature model
-
generate INT
Generates a random feature model with the specified number of parameters. Each feature may have 2 to 10 The generated model will have all its features evenly distributed among the following categories: mandatory, optional, or-group, xor-group and mutex-group. Extra constraints as added to the model with 20% ECR.
Returns: a FM
Example Usage:
a = generate 20
view a
view generate 100 - Mutate a feature model
-
mutate FM
Applies 10 random mutations to the feature model. The resulting model may be a generalized feature model.
Returns: a FM
Example Usage:
a = generate 20
b = mutate a
c = mutate mutate b
- Display a listing of variables
- vars
- Clear variables and feature domain
- clear
Notes
- The variables in the interpreter are separate from the variables that appear in the features and expressions.
- Extra constraints are not shown in the view operation