Universal Variability Language (UVL)

Community-Driven Language for Variability Models

The Universal Variability Language is a community effort towards a unified language for variability models. UVL is a direct result of the efforts within the MODEVAR initiative.

Want to tryout UVL yourself? Check our Playground

Do you have any questions on UVL? Do you want to contribute? We gladly receive your message (Contact).

Language Design

UVL specifies variability models with a tree-like structure to represent the hierarchical structure of variability models. Below you can see a simple example of a variability model in UVL. The tree structure is visualized on the right side in the FeatureIDE representation. The language core of UVL comes with several concepts to specify constraints:

Small Sandwich


features
    Sandwich
        mandatory
            Bread
        optional
            Sauce
                alternative
                    Ketchup
                    Mustard
            Cheese
constraints
    Ketchup => Cheese

Language Levels

In addition to the language core described above, UVL provides several extensions providing additional language constructs. The following language levels are supported:

The following feature model in UVL syntax enriches the previous version with new language concepts. Further, feature attributes, such as the number of calories, are attached to features.



include
    Boolean.group-cardinality
    Arithmetic.aggregate-function
    Arithmetic.feature-cardinality
    Type

features
    Sandwich
        mandatory
            Bread {Calories 100, Sugar 20}
        optional
            Sauce
                or
                    Ketchup {Calories 40, Sugar 35}
                    Mustard {Calories 25, Sugar 5}
            Cheese
                [0..2] // Group cardinality
                    Cheddar {Calories 60}
                    Gouda {Calories 50}
                    Goat {Calories 35}
            Pickle cardinality [1..3] // Feature cardinality
                    
constraints
    Ketchup => Cheese
    Bread.Sugar + Ketchup.Sugar + Mustard.Sugar < 60 // Attribute constraints
    sum(Calories) < 160 // Attribute aggregate

Import Mechanism

UVL supports referencing submodels for composing larger UVL models. See here for more details

Examples

A set of further example UVL models is available here. We are happy to merge your examples if you want to contribute.

Grammar

Below you can find a simplified grammar for UVL in ANTLR notation. This simplified version is supposed to provide a quick overview on the structure of an UVL model but leaves out many details. A full version of this grammar can be found here.


featureModel: namespace? NEWLINE? includes? NEWLINE? imports? NEWLINE? features? NEWLINE? constraints? EOF;

includes: 'include' NEWLINE INDENT includeLine* DEDENT;
includeLine: LANGUAGELEVEL NEWLINE;

namespace: 'namespace' reference;

imports: 'imports' NEWLINE INDENT importLine* DEDENT;
importLine: ns=reference ('as' alias=reference)? NEWLINE;

features: 'features' NEWLINE INDENT feature DEDENT;

group
    : ORGROUP groupSpec          # OrGroup
    | ALTERNATIVE groupSpec # AlternativeGroup
    | OPTIONAL groupSpec    # OptionalGroup
    | MANDATORY groupSpec   # MandatoryGroup
    | CARDINALITY groupSpec    # CardinalityGroup
    ;

groupSpec: NEWLINE INDENT feature+ DEDENT;

feature: reference featureCardinality? attributes? NEWLINE (INDENT group+ DEDENT)?;

featureCardinality: 'cardinality' CARDINALITY;

attributes: OPEN_BRACE (attribute (COMMA attribute)*)? CLOSE_BRACE;

attribute
    : valueAttribute
    | constraintAttribute;

valueAttribute: key value?;

key: id;
value: BOOLEAN | FLOAT | INTEGER | string | attributes | vector;
vector: OPEN_BRACK (value (COMMA value)*)? CLOSE_BRACK;

constraint
    : equation                              # EquationConstraint
    | reference                             # LiteralConstraint
    | OPEN_PAREN constraint CLOSE_PAREN      # ParenthesisConstraint
    | NOT constraint                        # NotConstraint
    | constraint AND constraint             # AndConstraint
    | constraint OR constraint              # OrConstraint
    | constraint IMPLICATION constraint     # ImplicationConstraint
    | constraint EQUIVALENCE constraint     # EquivalenceConstraint
	;

Software

Any tool support for UVL or tool integrating UVL missing? We are happy to embed your suggestion.

Tool Support for UVL

Tools Integrating UVL

Publications

Here, we only present a small selection of papers. Any interesting work on UVL missing? We are happy to embed your suggestion.

Work on UVL

Work Relevant for the Design of UVL

This is only a small selection of work that was vital for the design of UVL.

Contributors

Think you should be on this list as a past and/or future contributor? Don’t hesitate to contact us.

Core Team

Further and Former Contributors