Model Manipulation Tools

Here you can find a description of tools for preprocessing, translation and compilation of models.

Model checking tools, simulator and some of other tools cannot work with sources of models immediately. Often the sequence of code transformations is needed to get the source to the required format.

First translation of DVE and Promela is discussed, second single tools and their invocation are described below.

DVE input

The sequence of translations is the following:

$ \left.\begin{array}{lcl} \mbox{model.mdve} & \stackrel{(preprocesor)}{\longrightarrow} & \mbox{model.dve}\\ \mbox{model.mltl} & \stackrel{(preprocesor)}{\longrightarrow} & \mbox{model.ltl} \end{array}\right\} \stackrel{combine}{\longrightarrow} \mbox{model.prop1.dve, model.prop2.dve, \dots} $

Preprocessed DVE is ready to use as an input for simulator. But model checking algorithms furthermore need LTL formula encoded in a source as a neverclaim automaton. This can be done using divine.combine. This script implicitly calls divine.preprocessor, therefore precocessor usage is in parenthesis above.

model.ltl may contain several formulas, therefore also several combined files (model.prop1.dve, model.prop2.dve) may be produced.

Summary: Translation of DVE is easy - it needs at most one call (of divine.combine). LTL formulas can be in a separate file.

Promela input

The sequence of translations is the following:

$ \mbox{model.cpp.pml} \stackrel{preprocessor}{\longrightarrow} \mbox{model.pml} \stackrel{pml2s}{\longrightarrow} \mbox{model.pml.s} \stackrel{nips\_asm.pl}{\longrightarrow} \mbox{model.pml.b} $

Preprocessed Promela needs to be translated to an assembler using divine.pml2s.sh and then to a bytecode using divine.nips_asm.pl. Unfortunatelly currently divine.combine cannot work with Promela, therefore neverclaim automaton expressing LTL formula must be encoded already in a Promela source code.

Summary: Translation of DVE is little laborious for now - it needs 3 calls of different translation scripts. LTL formulas have to be currently encoded inside a Promela source code.

preprocessor

Synopsis

divine.preprocessor [-D macros] model_source

where macros is of the type 'parameter1=value1 parameter2=value2 ...' and model_source is a source code of a model written in DVE with m4 preprocessor macros or in Promela with cpp preprocessor macros.

Description

Call appropriate preprocesor with DiVinE specific parameters on the given source of the model. In the resulting source code there are all macros expanded and it is printed to the standard output.

combine - Combining Model and Formula

Synopsis

divine.combine [-hoqv] [-p number] model_source formula_source

where:

Description

This script combines model_source with formula_source. If any of sources contains macros and has an appropriate extension (*.mdve, *.mltl), then macros are expanded first. Defaultly the script produces one DVE source for each LTL property in formula_source.

Parameters:

pml2s - Promela to Assembler Translator

Synopsis

divine.pml2s model_source

Description

Translates Promela source code to the special assembler for compilation by divine.nips_asm.pl. The resulting assembler code is written to the file model_source.s.

nips_asm.pl - Promela assembler compiler

Synopsis

divine.bymoc_asm.pl input.s [ output.b [output.l] ]

or

divine.nips_asm.pl input.s [ output.b [output.l] ]

Note:
divine.nips_asm.pl and divine.bymoc_asm.pl are the same scripts with different names (for historical reasons).

Description

Translates an assembler source to the binary bytecode (input of model checking algorithms).

This script produces always 2 files. User can only change their default names (original name + .b or .l):

syntax - Syntax Checking

Synopsis

divine.syntax model_source

Description

Checks, whether given DVE source is syntactically correct. This script does not work for Promela models.

draw_automata - Automata Drawing

Synopsis

divine.draw_automata model_source

Description

Prints a graph in a dot format to the standard output. Graph consists of process states and possible transitions between them. Details like guards and effects are ommited from the graph.

It works only with DVE models.


Tutorial, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University