TVL - A Text-based Variability Language

TVL is a text-based (as opposed to diagrammatic) language for feature models with a C-like syntax. The goal of the language is to be scalable, by being concise and by offering mechanisms for modularity, and to be comprehensive so as to cover most of the feature model dialects proposed in the literature. The advantage of a text-based language is that there are many well-accepted applications (that is, text editors, source control systems, diff tools, and so on) that will support modelling out of the box. Furthermore, choosing a C-like syntax means lowering learning curves for most IT professionals. We hope that this will lead to an easier adoption of feature models in an industrial context.

More information about TVL can be found in the papers listed below.

At the moment, TVL is a language proposal, and we are requesting feedback from the variability modelling research community. We are in the process of conducting a number of case studies. We are also developing a reference implementation for TVL in Java, more details below.


  1. Classen, A.; Boucher, Q. and Heymans, P. A Text-based Approach to Feature Modelling: Syntax and Semantics of TVL. In Science of Computer Programming, Special Issue on Software Evolution, Adaptability and Variability, 76 (12): 1130-1143, 2011. pdf..  doi..  publisher..  BibTeX..
  2. Hubaux, A.; Boucher, Q.; Hartman, H.; Michel, R. and Heymans, P. Evaluating a Text-based Feature Modelling Language: Four Industrial Case Studies (to appear). , Accepted for publication at the 3rd International Conference on Software Language Engineering (SLE 2010), available online. pdf..  more..  BibTeX..
  3. Boucher, Q.; Classen, A.; Faber, P. and Heymans, P. Introducing TVL, a Text-based Feature Modelling Language. In Proceedings of the Fourth International Workshop on Variability Modelling of Software-intensive Systems (VaMoS'10), Linz, Austria, January 27-29, pages 159-162, University of Duisburg-Essen, 2010. pdf..  BibTeX..
  4. Classen, A.; Boucher, Q.; Faber, P. and Heymans, P. The TVL Specification. Technical Report P-CS-TR SPLBT-00000003, PReCISE Research Center, University of Namur, Namur, Belgium, 2010. pdf..  BibTeX..

Examples & Files

Example TVL models and other files can be found in the file repository.


The BNF grammar of the TVL language can be downloaded here. This grammar is derived from the annotated grammar we feed to CUP. The grammar is a conflict-free LALR grammar and can thus be fed into most LR parser generators out there.

The same grammar in the SDF format can be downloaded here.


You can download the current version (v20100804) of the reference implementation here. The library requires Java 1.6. Please note that this is a research prototype and (more importantly) that it is work in progress. If you are interested in using the library, please contact us so that we can provide you with additional pointers and explanations.

Command-line usage

To simply run the parser (make sure that the Java runtime is installed on your machine), extract the archive and open a command line interface and type:

	java -jar TVLParser.jar path/to/input/file.tvl

This command will cause the file to be parsed and checked for validity.

Other command-line options of the parser are:

Note that all semantical analyses (-sat, -prods, -uprods) currently only work for TVL models without numeric (int and real) attributes. The options -bf and -dimacs will always work for such models only.

Java library usage

The library has two components (although not as such packages in the library code). The syntactic component is a parser implemented with the CUP parser generator. It checks well-formedness, type correctness, and can simplify a model by translating syntactic sugar and advanced constructs into more basic constructs. Among other things, the syntactic component can be used to add TVL support to existing feature modelling tools.

The semantic component of the library implements the semantics defined in the technical report cited above. TVL models without numeric attributes are first normalised and then translated into a Boolean CNF formula. To analyse the model, the CNF formula is fed to the Sat4J SAT solver. We emphasise that this translation can deal with the whole language save for numeric attributes, which means that it takes boolean and enum attributes into account and allows efficient feature model analysis even in the presence of enumerated attributes. For TVL models with numeric attributes we use the CHOCO CSP solver. The translation is very similar, except that now also constraints on numeric attributes are taken into account. The CSP part of the library is still in development.

The library serves as a reference implementation for TVL in Java. The information on this page is sufficient to re-implement TVL from scratch. We are currently doing this using the term rewriting language ASF+SDF which is very natural for implementing model normalisation. The TVL grammar in the SDF (as opposed to EBNF) format is here.

The JAR does contain the source code. If you want to dive into the code start with the Launcher class. This is the class being used in the command above, its sole purpose is to make "executable" what is otherwise an API. The starting point of the parser API itself is the TVLParser class, the API for treatment of a parsed TVL model are the classes in the util package. The library has four main packages:

Syntax highlighting

We have some packages for syntax highlighting in text editors:


The team developing the TVL language consists of the following persons, most are members of the PReCISE research centre at the Faculty of Computer Science at the University of Namur (FUNDP) in Namur, Belgium:

Contact and feedback

Do not hesitate to contact Andreas Classen at in case of questions or other requests.