Formal Method Nusmv Lab Manual 1
Formal Method Nusmv Lab Manual 1
Formal Method Nusmv Lab Manual 1
6 User Manual
Email: [email protected]
This document is part of the distribution package of the N U SMV model checker,
available at http://nusmv.fbk.eu.
Parts of this documents have been taken from “The SMV System - Draft”, by K.
McMillan, available at sdfdsf: http://www.cs.cmu.edu/˜modelcheck/
smv/smvmanual.r2.2.ps.
1 Introduction 4
2 Input Language 6
2.1 Types Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 Enumeration Types . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.4 Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.5 Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.6 Set Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.7 Type Order . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.1 Implicit Type Conversion . . . . . . . . . . . . . . . . . . . . 10
2.2.2 Constant Expressions . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 Basic Expressions . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.4 Simple and Next Expressions . . . . . . . . . . . . . . . . . 21
2.2.5 Type conversion operators . . . . . . . . . . . . . . . . . . . 21
2.3 Definition of the FSM . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.1 Variable Declarations . . . . . . . . . . . . . . . . . . . . . . 23
2.3.2 DEFINE Declarations . . . . . . . . . . . . . . . . . . . . . 27
2.3.3 Array Define Declarations . . . . . . . . . . . . . . . . . . . 27
2.3.4 CONSTANTS Declarations . . . . . . . . . . . . . . . . . . . 27
2.3.5 INIT Constraint . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.6 INVAR Constraint . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.7 TRANS Constraint . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.8 ASSIGN Constraint . . . . . . . . . . . . . . . . . . . . . . 28
2.3.9 FAIRNESS Constraints . . . . . . . . . . . . . . . . . . . . 30
2.3.10 MODULE Declarations . . . . . . . . . . . . . . . . . . . . . 31
2.3.11 MODULE Instantiations . . . . . . . . . . . . . . . . . . . . . 31
2.3.12 References to Module Components (Variables and Defines) . 32
2.3.13 Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.14 A Program and the main Module . . . . . . . . . . . . . . . 34
2.3.15 Namespaces and Constraints on Declarations . . . . . . . . . 34
2.3.16 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.17 ISA Declarations . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.1 CTL Specifications . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.2 Invariant Specifications . . . . . . . . . . . . . . . . . . . . . 38
2
2.4.3 LTL Specifications . . . . . . . . . . . . . . . . . . . . . . . 38
2.4.4 Real Time CTL Specifications and Computations . . . . . . . 40
2.4.5 PSL Specifications . . . . . . . . . . . . . . . . . . . . . . . 41
2.5 Variable Order Input . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.5.1 Input File Syntax . . . . . . . . . . . . . . . . . . . . . . . . 45
2.5.2 Scalar Variables . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.5.3 Array Variables . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.6 Clusters Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Bibliography 119
3
Chapter 1
Introduction
4
• Architecture. A software architecture has been defined. The different compo-
nents and functionalities of N U SMV have been isolated and separated in mod-
ules. Interfaces between modules have been provided. This reduces the effort
needed to modify and extend N U SMV.
• Quality of the implementation. N U SMV is written in ANSI C, is POSIX com-
pliant, and has been debugged with Purify in order to detect memory leaks. Fur-
thermore, the system code is thoroughly commented. N U SMV uses the state
of the art BDD package developed at Colorado University, and provides a gen-
eral interface for linking with state-of the-art SAT solvers. This makes N U SMV
very robust, portable, efficient, and easy to understand by people other than the
developers.
This document is structured as follows.
• In Chapter 2 [Input Language], page 6 we define the syntax of the input language
of N U SMV.
• In Chapter 3 [Running NuSMV interactively], page 48 the commands of the
interaction shell are described.
• In Chapter 4 [Running NuSMV batch], page 114 we define the batch mode of
N U SMV.
N U SMV is available at http://nusmv.fbk.eu.
5
Chapter 2
Input Language
In this chapter we present the syntax and semantics of the input language of N U SMV.
Before going into the details of the language, let us give a few general notes about
the syntax. In the syntax notations used below, syntactic categories (non-terminals)
are indicated by monospace font, and tokens and character set members (terminals)
by bold font. Grammar productions enclosed in square brackets (‘[]’) are optional
while a vertical bar (‘|’) is used to separate alternatives in the syntax rules. Sometimes
one of is used at the beginning of a rule as a shorthand for choosing among several
alternatives. If the characters |, [ and ] are in bold font, they lose their special meaning
and become regular tokens.
In the following, an identifier may be any sequence of characters starting with
a character in the set {A-Za-z } and followed by a possibly empty sequence of char-
acters belonging to the set {A-Za-z0-9 $#-}. All characters and case in an identifier
are significant. Whitespace characters are space (<SPACE>), tab (<TAB>) and new-
line (<RET>). Any string starting with two dashes (‘--’) and ending with a newline
is a comment and ignored by the parser. The multiline comment starts with ‘/--’ and
ends with ‘--/’.
The syntax rule for an identifier is:
identifier ::
identifier_first_character
| identifier identifier_consecutive_character
identifier_first_character :: one of
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z _
identifier_consecutive_character ::
identifier_first_character
| digit
| one of $ # -
digit :: one of 0 1 2 3 4 5 6 7 8 9
6
MODULE, DEFINE, MDEFINE, CONSTANTS, VAR, IVAR, FROZENVAR,
INIT, TRANS, INVAR, SPEC, CTLSPEC, LTLSPEC, PSLSPEC, COMPUTE,
NAME, INVARSPEC, FAIRNESS, JUSTICE, COMPASSION, ISA, ASSIGN,
CONSTRAINT, SIMPWFF, CTLWFF, LTLWFF, PSLWFF, COMPWFF, IN, MIN,
MAX, MIRROR, PRED, PREDICATES, process, array, of, boolean,
integer, real, word, word1, bool, signed, unsigned, extend,
resize, sizeof, uwconst, swconst, EX, AX, EF, AF, EG, AG, E, F, O, G,
H, X, Y, Z, A, U, S, V, T, BU, EBF, ABF, EBG, ABG, case, esac, mod, next,
init, union, in, xor, xnor, self, TRUE, FALSE, count, abs, max, min
To represent various values we will use integer numbers which are any non-
empty sequence of decimal digits preceded by an optional unary minus
integer_number ::
- digit
| digit
| integer_number digit
symbolic_constant :: identifier
2.1.1 Boolean
The boolean type comprises symbolic values FALSE and TRUE.
2.1.2 Integer
The domain of the integer type is simply any whole number, positive or negative. At the mo-
ment, there are implementation-dependent constraints on the this type and integer numbers
can only be in the range −231 + 1 to 231 − 1 (more accurately, these values are equivalent to the
C/C++ macros INT MIN +1 and INT MAX).
7
The symbolic enum type covers enumerations containing only symbolic constants.
For example, the enumerations {stopped, running, waiting} and {FAIL, OK} be-
long to the symbolic enum type.
There is also a integers-and-symbolic enum type. This type comprises enumerations
which contain both integer numbers and symbolic constants, for example, {-1,
1, waiting}, {0, 1, OK}, {running, stopped, waiting, 0}.
Another enumeration type is integer enum. Example of enumerations of integers are {2,
4, -2, 0} and {-1, 1}. In the N U SMV type system an expression of the type integer
enum is always converted to the type integer. Explaining the type of expression we will always
use the type integer instead of integer enum.
Enumerations cannot contain any boolean value (i.e.{FALSE, TRUE}). boolean type
must be declared as boolean.
To summarise, we actually deal only with two enumeration types: symbolic enum and
integers-and-symbolic enum. These types are distinguishable and have different operations
allowed on them.
2.1.4 Word
The unsigned word[•] and signed word[•] types are used to model vector of bits (booleans)
which allow bitwise logical and arithmetic operations (unsigned and signed, respectively). These
types are distinguishable by their width. For example, type unsigned word[3] represents vector
of three bits, which allows unsigned operations, and type signed word[7] represents vector of
seven bits, which allows signed operations.
When values of unsigned word[N] are interpreted as integer numbers the bit representation
used is the most popular one, i.e. each bit represents a successive power of 2 between 0 (bit
number 0) and 2N −1 (bit number N − 1). Thus unsigned word[N] is able to represent values
from 0 to 2N − 1.
The bit representation of signed word[N] type is “two’s complement”, i.e. it is the same as
for unsigned word[N] except that the highest bit (number N − 1) has value −2N −1 . Thus the
possible value for signed word[N] are from −2N −1 to 2N −1 − 1.
2.1.5 Array
Arrays are declared with a lower and upper bound for the index, and the type of the elements in
the array. For example,
The type array 1..8 of array -1..2 of unsigned word[5] means an array of 8
elements (from 1 to 8), each of which is an array of 4 elements (from -1 to 2) that are 5-bit-long
unsigned words.
Array subtype is the immediate subtype of an array type. For example, subtype of array
1..8 of array -1..2 of unsigned word[5] is array -1..2 of unsigned word[5]
which has its own subtype unsigned word[5].
array types are incompatible with set type, i.e. array elements cannot be of set type.
Expression of array type can be constructed with array DEFINE (see 2.3.3) or variables of
array type (see 2.3.1).
8
used in a very limited number of ways. In particular, a variable cannot be of a set type. Only
range constant and union operator can be used to create an expression of a set type, and
only in, case, (• ? • : •) and assignment1 expressions can have imediate operands of a set
type.
Every set type has a counterpart among other types. In particular,
the counterpart of a boolean set type is boolean,
the counterpart of a integer set type is integer,
the counterpart of a symbolic set type is symbolic enum,
the counterpart of a integers-and-symbolic set type is integers-and-symbolic enum.
Some types such as unsigned word[•] and signed word[•] do not have a set type counterpart.
unsigned word[1]
integer symbolic enum
unsigned word[2]
boolean ↓ ↓
integers-and-symbolic enum unsigned word[3]
...
signed word[1]
integer set symbolic set
signed word[2]
boolean set ↓ ↓
integers-and-symbolic set signed word[3]
...
It means, for example, that integer is less than integers-and-symbolic enum, symbolic enum
is less than integers-and-symbolic enum, etc. The unsigned word[•] and signed word[•]
any other type or between each other. Any type is equal to itself.
Note that enumerations containing only integer numbers have the type integer.
For 2 arrays types array N1..M1 of subtype1 and array N2..M2 of
subtype2 the first type is less then the second one if and only if N1=N2, M1=M2 and type
subtype1 is less than subtype2.
2.2 Expressions
The previous versions of NuSMV (prior to 2.4.0) did not have the type system and as such ex-
pressions were untyped. In the current version all expressions are typed and there are constraints
1 For more information on these operators see pages 12, 18, 19, 20 and 28, respectively.
9
on the type of operands. Therefore, an expression may now potentially violate the type system,
i.e. be erroneous.
To maintain backward compatibility, there is a new system variable called
backward compatibility (and a correponding -old command line option) that
disables a few new features of version 2.4 to keep backward compatibility with old version of
N U SMV. In particular, if this system variable is set then type violations caused by expressions
of old types (i.e. enumeration type, boolean and integer) will be ignored by the type checker,
instead, warnings will be printed out. See description at page 50 for further information.
If additionally, the system variable type checking warning on is unset, then even
these warnings will not be printed out.
constant ::
boolean_constant
| integer_constant
| symbolic_constant
| word_constant
| range_constant
Boolean Constant
A boolean constant is one of the symbolic values FALSE and TRUE. The type of a
boolean constant is boolean.
boolean_constant :: one of
FALSE TRUE
Integer Constant
An integer constant is an integer number. The type of an integer constant
is integer.
integer_constant :: integer_number
Symbolic Constant
A symbolic constant is syntactically an identifier and indicates a unique value.
symbolic_constant :: identifier
The type of a symbolic constant is symbolic enum. See Section 2.3.15 [Namespaces],
page 34 for more information about how symbolic constants are distinguished from other
identifiers, i.e. variables, defines, etc.
10
Word Constant
Word constant begins with digit 0, followed by optional character u (unsigned) or s
(signed) and one of the characters b/B (binary), o/O (octal), d/D (decimal) or h/H (hexadeci-
mal) which gives the base that the actual constant is in. Next comes an optional decimal integer
giving the number of bits, then the character , and lastly the constant value itself. Assuming N
is the width of the constant the type of a word constant is signed word[N] if character s is
provided, and unsigned word[N] otherwise. For example:
The number of bits can be skipped, in which case the width is automatically calculated from
the number of digits in the constant and its base. It may be necessary to explicitly give leading
zeroes to make the type correct — the following are all equivalent declarations of the integer
constant 11 as a word of type unsigned word[8]:
0ud8 11
0ub8 1011
0b 00001011
0h 0b
0h8 b
word_constant ::
0 [word_sign_specifier] word_base [word_width] _ word_value
word_sign_specifier :: one of
u s
word_width ::
integer_number -- a number greater than zero
word_base ::
b | B | o | O | d | D | h | H
word_value ::
hex_digit
| word_value hex_digit
| word_value
hex_digit :: one of
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
Note that
• The width of a word must be a number strictly greater than 0.
• Decimal word constants must be declared with the width specifier, since the number
of bits needed for an expression like 0d 019 is unclear.
• Digits are restricted depending on the base the constant is given in.
• Digits can be separated by the underscore character (” ”) to aid clarity, for example
0b 0101 1111 1100 which is equivalent to 0b 010111111100.
11
• For a given width N the value of a constant has to be in range 0 . . . 2N − 1. For decimal
signed words (both s and d are provided) the value of a constant has to be in range
0 . . . 2N −1 .
• The number of bits in word constant has an implementation limit which for most
systems is 64 bits.
Range Constant
A range constant specifies a set of consecutive integer numbers. For example, a con-
stant -1..5 indicates the set of numbers -1, 0, 1, 2, 3, 4 and 5. Other examples of
range constant can be 1..10, -10..-10, 1..300. The syntactic rule of the range
constant is the following:
range_constant ::
integer_number .. integer_number
with an additional constraint that the first integer number must be less than or equal to the second
integer number. The type of a range constant is integer set.
basic_expr ::
constant -- a constant
| variable_identifier -- a variable identifier
| define_identifier -- a define identifier
| ( basic_expr )
| ! basic_expr -- logical or bitwise NOT
| abs ( basic expr ) -- absolute value
| max ( basic expr , basic expr ) -- max
| min ( basic expr , basic expr ) -- min
| basic_expr & basic_expr -- logical or bitwise AND
| basic_expr | basic_expr -- logical or bitwise OR
| basic_expr xor basic_expr -- logical or bitwise exclusive OR
| basic_expr xnor basic_expr -- logical or bitwise NOT exclusive OR
| basic_expr -> basic_expr -- logical or bitwise implication
| basic_expr <-> basic_expr -- logical or bitwise equivalence
| basic_expr = basic_expr -- equality
| basic_expr != basic_expr -- inequality
| basic_expr < basic_expr -- less than
| basic_expr > basic_expr -- greater than
| basic_expr <= basic_expr -- less than or equal
| basic_expr >= basic_expr -- greater than or equal
| - basic_expr -- integer unary minus
| basic_expr + basic_expr -- integer addition
| basic_expr - basic_expr -- integer subtraction
| basic_expr * basic_expr -- integer multiplication
| basic_expr / basic_expr -- integer division
| basic_expr mod basic_expr -- integer remainder
| basic_expr >> basic_expr -- bit shift right
| basic_expr << basic_expr -- bit shift left
| basic_expr [ index ] -- index subscript
| basic_expr [ basic_expr : basic_expr ]
-- word bits selection
12
| basic_expr :: basic_expr -- word concatenation
| word1 ( basic_expr ) -- boolean to unsigned word[1] conversion
| bool ( basic_expr ) -- unsigned word[1] and int to boolean conversion
| toint ( basic_expr ) -- word and boolean to integer constant conversion
| count ( basic_expr_list ) -- count of true boolean expressions
| swconst ( basic_expr , basic_expr )
-- integer to signed word constant conversion
| uwconst ( basic_expr, basic_expr )
-- integer to unsigned word constant conversion
| signed ( basic_expr ) -- unsigned word to signed word conversion
| unsigned ( basic_expr ) -- signed word to unsigned word conversion
| sizeof ( basic_expr ) -- word size as an integer
| extend ( basic_expr , basic_expr)
-- word width extension
| resize ( basic_expr , basic_expr)
-- word width resize
| basic_expr union basic_expr -- union of set expressions
| { set_body_expr } -- set expression
| basic_expr .. basic_expr -- pure integer set expression
| basic_expr in basic_expr -- inclusion in a set expression
| basic_expr ? basic_expr : basic_expr
-- if-then-else expression
| case_expr -- case expression
| basic_next_expr -- next expression
basic_expr_list ::
basic_expr
| basic_expr_list , basic_expr
The order of parsing precedence for operators from high to low is:
[ ] , [ : ]
!
::
- (unary minus)
* / mod
+ -
<< >>
union
in
= != < > <= >=
&
| xor xnor
(• ? • : •)
<->
->
Operators of equal precedence associate to the left, except -> that associates to the right. The
constants and their types are explained in Section 2.2.2 [Constant Expressions], page 10.
13
define_identifier :: complex_identifier
variable_identifier :: complex_identifier
The syntax and semantics of complex identifiers are explained in Section 2.3.12 [Ref-
erences to Module Components], page 32. All defines and variables referenced in expressions
should be declared. All identifiers (variables, defines, symbolic constants, etc) can be used prior
to their definition, i.e. there is no constraint on order such as in C where a declaration of a vari-
able should always be placed in text above the variable use. See more information about define
and variable declarations in Section 2.3.2 [DEFINE Declarations], page 27 and Section 2.3.1
[Variable Declarations], page 23.
A define is a kind of macro. Every time a define is met in expressions, it is substituted by the
expression associated with this define. Therefore, the type of a define is the type of the associated
expression in the current context. Define expressions may contain next operators; Normal rules
apply: No nested next operators.
variable identifier represents state, input, and frozen variables. The type of
a variable is specified in its declaration. For more information about variables, see Sec-
tion 2.3 [Definition of the FSM], page 23, Section 2.3.1 [State Variables], page 24, Sec-
tion 2.3.1 [Input Variables], page 24, and Section 2.3.1 [Frozen Variables], page 25. Since a
symbolic constant is syntactically indistinguishable from variable identifiers
and define identifiers, a symbol table is used to distinguish them from each other.
Parentheses
Parentheses may be used to group expressions. The type of the whole expression is the same as
the type of the expression in the parentheses.
! : boolean → boolean
: unsigned word[N] → unsigned word[N]
: signed word[N] → signed word[N]
This means that the operation can be applied to boolean, unsigned word[•] and signed word[•]
operands. The type of the whole expression is the same as the type of the operand. If the operand
is not boolean, unsigned word[•] or signed word[•] then the expression violates the type
system and N U SMV will throw an error.
14
Equality (=) and Inequality (!=)
The operators = (equality) and != (inequality) have the following signature:
Arithmetic Operators +, -, *, /
The arithmetic operators + (addition), - (unary negation or binary subtraction), * (multiplica-
tion) and / (division) have the following signature:
15
Remainder Operator mod
The result of the mod operator is the algebraic remainder of the division. If the value of the
second operand is zero, the behavior is undefined and an error is thrown by N U SMV.
The signature of the remainder operator is:
Note: in older versions of N U SMV (priori 2.4.0) the semantics of quotient and remainder
were different. Having the division and remainder operators / and mod be of the current, i.e.
C/C++’s, semantics the older semantics of division was given by the formula:
IF (a mod b < 0) THEN (a / b − 1) ELSE (a / b)
and the semantics of remainder operator was given by the formula:
IF (a mod b < 0) THEN (a mod b + b) ELSE (a mod b)
Note that in both versions the equation (a/b)*b + (a mod b) = a holds. For example,
in the current version of NuSMV the following holds:
7/5 = 1 7 mod 5 = 2
-7/5 = -1 -7 mod 5 = -2
7/-5=-1 7 mod -5 = 2
-7/-5=1 -7 mod -5 = -2
whereas in the older versions on NuSMV the equations were
7/5 = 1 7 mod 5 = 2
-7/5 = -2 -7 mod 5 = 3
7/-5=-1 7 mod -5 = 2
-7/-5=0 -7 mod -5 = -7
When supplied, the command line option -old div op switches the semantics of division and
remainder to the old one.
Note: semantics of modulo operator can be obtained from the remainder operator by exploit-
ing the equivalence:
(n modulo M) ≡ ((n mod M) + M) mod M
Where mod is the remainder operator.
16
0ub4 0101 << 2 is equal to 0sb3 1011 >> 2 is equal to
0ub4 0100 << 1 is equal to 0sb3 1110 >> 1 is equal to
0ub4 1000 << 0 is equal to 0sb3 1111 >> 0 is equal to
0ub4 1000 and 0sb3 1111
It has to be remarked that the shifting requires the right operand to be greater or equal to zero
and less then or equal to the width of the word it is applied to. N U SMV raises an error if a shift
is attempted that does not satisfy this restriction.
MODULE main
VAR a : array -1 .. 4 of array 1 .. 2 of boolean;
DEFINE d := [[12, 4], [-1,2]];
VAR r : 0..1;
expressions a[-1], a[0][r+1] and d[r][1] are valid whereas a[0], a[0][r] and
d[0][r-1] will cause out of bound error.
2 See 2.3.3) for array defines and 2.3.1 for array variables.
17
where word[N] is unsigned word[N] or signed word[N]. The left-hand operand will make up
the upper bits of the new word, and the right-hand operand will make up the lower bits. The
result is always unsigned word[•]. For example, given the two words w1 := 0ub4 1101
and w2 := 0sb2 00, the result of w1::w2 is 0ub6 110100.
Set Expressions
The set expression is an expression defining a set of boolean, integer and symbolic enum
values. A set expression can be created with the union operator. For example, 1 union 0
specifies the set of values 1 and 0. One or both of the operands of union can be sets. In this
18
case, union returns a union of these sets. For example, expression (1 union 0) union
-3 specifies the set of values 1, 0 and -3.
Note that there cannot be a set of sets in NuSMV. Sets can contain only singleton values, but
not other sets.
The signature of the union operator is:
union : boolean set * boolean set → boolean set
: integer set * integer set → integer set
: symbolic set * symbolic set → symbolic set
: integers-and-symbolic set * integers-and-symbolic set
→ integers-and-symbolic set
Before checking the expression for being correctly typed, if it is possible, both operands are
converted to their counterpart set types 3 , which virtually means converting individual values
to singleton sets. Then both operands are implicitly converted to a minimal type that covers
both operands. If after these manipulations the operands do not satisfy the signature of union
operator, an error is raised by N U SMV.
There is also another way to write a set expression by enumerating all its values between
curly brackets. The syntactic rule for the values in curly brackets is:
set_body_expr ::
basic_expr
| set_body_expr , basic_expr
Inclusion Operator in
The inclusion operator ‘in’ tests the left operand for being a subset of the right operand. If either
operand is a number or a symbolic value instead of a set, it is coerced to a singleton set.
The signature of the in operator is:
19
possible, both operands are converted to their counterpart set types 4 . Then, if required, implicit
type conversion is carried out on one of the operands.
Case Expressions
A case expression has the following syntax:
case_expr :: case case_body esac
case_body ::
basic_expr : basic_expr ;
| case_body basic_expr : basic_expr ;
A case expr returns the value of the first expression on the right hand side of ‘:’, such that
the corresponding condition on the left hand side evaluates to TRUE. For example, the result of
the expression
case
left_expression_1 : right_expression_1 ;
left_expression_2 : right_expression_2 ;
...
left_expression_N : right_expression_N ;
esac
is right expression k such that for all i from 0 to k−1, left expression i is FALSE,
and left expression k is TRUE. It is an error if all expressions on the left hand side evalu-
ate to FALSE.
The type of expressions on the left hand side must be boolean. If one of the expression on
the right is of a set type then, if it is possible, all remaining expressions on the right are converted
to their counterpart set types 5 . The type of the whole expression is such a minimal type6 that all
of the expressions on the right (after possible convertion to set types) can be implicitly converted
to this type. If this is not possible, N U SMV throws an error.
Note: Prior to version 2.5.1, using 1 as left expression N was pretty common, e.g:
case
cond1 : expr1;
cond2 : expr2;
...
1 : exprN; -- otherwise
esac
Since version 2.5.1 integer values are no longer implicitly casted to boolean, and 1 has to
be written as TRUE instead. For backward compatibility options, please see page 50.
If-Then-Else expressions
In certain cases, the syntax described above may look a bit awkard. In simpler cases, it is possible
to use the alternative, terser, (• ? • : •) expression. This construct is defined as follows:
This expression evaluates to basic expr1 if the condition in cond expr evaluates to true, and
to basic expr2 otherwise. Therefore, the expressions cond1 ? exp1 : exp2 and case
cond1 : exp1; TRUE : expr2; esac are equivalent.
4 See 2.1.6 for more information about the set types and their counterpart types
5 See 2.1.6 for information on set types and their counterpart types
6 See Section 2.1.7 [Type Order], page 9 for the information on the order of types.
20
Basic Next Expression
Next expressions refer to the values of variables in the next state. For example, if a
variable v is a state variable, then next(v) refers to that variable v in the next time step.
A next applied to a complex expression is a shorthand method of applying next to all the
variables in the expressions recursively. Example: next((1 + a) + b) is equivalent to
(1 + next(a)) + next(b). Note that the next operator cannot be applied twice, i.e.
next(next(a)) is not allowed.
The syntactic rule is:
Count Operator
The count operator counts the number of expressions which are true. The count operator is a
syntactic sugar for
toint (bool_expr1) +
toint (bool_expr2) +
... +
toint (bool_exprN)
This operator has been introduced in version 2.5.1, to simplify the porting of those models which
exploited the implicit casting of integer to boolean to encoding e.g. predicates like:
(b0 + b1 + ... + bN) < 3 -- at most two bits are enabled
Since version 2.5.1, this expression can be written as:
count(b0, b1... , bN) < 3
simple_expr :: basic_expr
with the alternative basic next expr not allowed. Simple expressions can be used
to specify sets of states, for example, the initial set of states. The next expression relates
current and next state variables to express transitions in the FSM. The next expression can
have next operation inside, i.e.
next_expr :: basic_expr
21
toint : integer → integer
toint : boolean → integer
toint : unsigned word[•] → integer
toint : signed word[•] → integer
Warning: using the toint operator with word variables may cause bad performances of
the system. Performances may degrade with the increase of the number of bits of the word
expression.
bool(0ub1 0) = FALSE
bool(0ub1 1) = TRUE
word1(FALSE) = 0ub1 0
word1(TRUE) = 0ub1 1
22
2.3 Definition of the FSM
We consider a Finite State Machine (FSM) described in terms of state variables, input variables,
and frozen variables, which may assume different values in different states, of a transition rela-
tion describing how inputs leads from one state to possibly many different states, and of Fairness
conditions that describe constraints on the valid paths of the execution of the FSM. In this docu-
ment, we distinguish among constraints (used to constrain the behavior of a FSM, e.g. a modulo
4 counter increments its value modulo 4), and specifications (used to express properties to verify
on the FSM (e.g. the counter reaches value 3).
In the following it is described how these concepts can be declared in the N U SMV language.
Type Specifiers
A type specifier has the following syntax:
type_specifier ::
simple_type_specifier
| module_type_specifier
simple_type_specifier ::
boolean
| word [ basic_expr ]
| unsigned word [ basic_expr ]
| signed word [ basic_expr ]
| { enumeration_type_body }
| basic_expr .. basic_expr
| array basic_expr .. basic_expr
of simple_type_specifier
enumeration_type_body ::
enumeration_type_value
| enumeration_type_body , enumeration_type_value
enumeration_type_value ::
symbolic_constant
| integer_number
There are two kinds of type specifier: a simple type specifier and a module
type specifier. The module type specifier is explained later in Section 2.3.11
[MODULE Instantiations], page 31. The simple type specifier comprises boolean
type, integer type, enumeration types, unsigned word[•], signed word[•] and arrays types.
The boolean type is specified by the keyword boolean.
A enumeration type is specified by full enumeration of all the values the type comprises.
For example, possible enumeration type specifiers are {0,2,3,-1}, {1,0, OK}, {OK,
FAIL, running}. FALSE and TRUE values cannot be used as enumeration type speci-
fiers The values in the list are enclosed in curly brackets and separated by commas. The values
may be integer numbers, symbolic constants, or both. All values in the list should
be distinct from each other, although the order of values is not important.
Note, expressions cannot be of the actual enumeration types, but only the simplified ver-
sions of enumeration types, such as symbolic enum and integers-and-symbolic enum.
23
A type specifier can be given by two expressions separated by .. (<TWO DOTS>).
The two expressions have both to evaluate to constants integer numbers, and may contain names
of defines and module formal parameters. For example, -1 - P1 .. 5 + D1, where P1
refers to a module formal parameter, and D1 refers to a define. Both P1 and D1 have to be
statically evaluable to integer constants.
This is just a shorthand for a enumeration type containing the list of integer numbers
from the range given in type specifier. For example, the type specifiers -1..5
and {-1,0,1,2,3,4,5} are equivalent. Note that the evaluated number on the left from the
two dots must be less than or equal to the evaluated number on the right.
The unsigned word[•] type is specified by the keywords unsigned word (where
unsigned may be skipped) with a basic expr supplied in square brackets. The expres-
sion must be statically evaluable to a constant integer number whose value must be greater than
zero. The signed word[•] type is specified in a similar way with the keywords signed word.
The purpose of the word types is to offer integer and bitwise arithmetic.
An array type is denoted by a sequence of the keyword array, a basic expr specifying
the lower bound of the array index, two dots .., a basic expr specifying the upper bound of
the array index, the keyword of, and the type of array’s elements. The elements can themselves
be arrays. The two bound expressions have to be statically evaluable to constant integer numbers,
and may contain names of defines and module formal parameters.
State Variables
A state of the model is an assignment of values to a set of state and frozen variables. State
variables (and also instances of modules) are declared by the notation:
A variable declaration specifies the identifier of the variables and its type. A variable
can take the values only from the domain of its type. In particular, a variable of a enumeration
type may take only the values enumerated in the type specifier of the declaration.
Input Variables
IVAR s (input variables) are used to label transitions of the Finite State Machine. The difference
between the syntax for the input and state variables declarations is the keyword indicating the
beginning of a declaration:
Another difference between input and state variables is that input variables cannot be instances
of modules. The usage of input variables is more limited than the usage of state variables which
can occur everywhere both in the model and specifications. Namely, input variables cannot occur
in:
• Left-side of assignments. For example all these assignments are not allowed:
IVAR i : boolean;
ASSIGN
init(i) := TRUE;
next(i) := FALSE;
24
• INIT statements. For example:
IVAR i : boolean;
VAR s : boolean;
INIT i = s
• Scope of next expressions. For example:
IVAR i : boolean;
VAR s : boolean;
TRANS i -> s – this is allowed
TRANS next(i -> s) – this is NOT allowed
• Some specification kinds: CTLSPEC, SPEC, INVARSPEC, COMPUTE, PSLSPEC. For
example:
IVAR i : boolean;
VAR s : boolean;
SPEC AF (i -> s) – this is NOT allowed
LTLSPEC F (X i -> s) – this is allowed
• Anywhere in the FSM when checking invariants with BMC and the “DUAL” algorithm.
See at page 82 for further information.
Frozen Variables
FROZENVAR s (frozen variables) are variables that retain their initial value throughout the evo-
lution of the state machine; this initial value can be constrained in the same ways as for normal
state variables. Similar to input variables the difference between the syntax for the frozen and
state variables declarations is the keyword indicating the beginning of a declaration:
The semantics of some frozen variable a is that of a state variable accompanied by an assignment
that keeps its value constant (it is handled more efficiently, though):
ASSIGN next(a) := a;
As a consequence, frozen variables may not have their current and next value set in an
ASSIGN statement, i.e. statements such as ASSIGN next(a) := expr; and ASSIGN a
:= expr; are illegal. Apart from that frozen variables may occur in the definition of the FSM
in any place in which a state variable may occur. Some examples are as follows:
• Left-side current and next state assignments are illegal, while init state assignments are
allowed:
FROZENVAR a : boolean;
FROZENVAR b : boolean;
FROZENVAR c : boolean;
VAR d : boolean;
FROZENVAR e : boolean;
ASSIGN
init(a) := d; -- legal
next(b) := d; -- illegal
c := d; -- illegal
e := a; -- also illegal
• INIT, TRANS, INVAR, FAIRNESS, JUSTICE, and COMPASSION statements are all
legal. So is the scope of a next expression. For example:
-- the following has an empty state space
FROZENVAR a : boolean;
25
INIT a
INVAR !a
Examples
Below are examples of state, frozen, and input variable declarations:
VAR a : boolean;
FROZENVAR b : 0..1;
IVAR c : {TRUE, FALSE};
The variable a is a state variable, b is a frozen variable, and c is an input variable; In the
following examples:
the variables d, e and f are of enumeration types, and all their possible values are specified in
the type specifiers of their declarations.
VAR h : word[3];
The variables g and h are of 3-bits-wide unsigned word type (i.e. unsigned word[3]), and i is
of 4-bits-wide signed word type (i.e. signed word[4]).
26
2.3.2 DEFINE Declarations
In order to make descriptions more concise, a symbol can be associated with a common expres-
sion, and a DEFINE declaration introduces such a symbol. The syntax for this kind of declaration
is:
DEFINE associates an identifier on the left hand side of the ‘:=’ with an expression
on the right side. A define statement can be considered as a macro. Whenever a define
identifier occurs in an expression, the identifier is syntactically replaced by the ex-
pression it is associated with. The associated expression is always evaluated in the context of
the statement where the identifier is declared (see Section 2.3.16 [Context], page 36 for an
explanation of contexts). Forward references to defined symbols are allowed but circular defini-
tions are not, and result in an error. The difference between defined symbols and variables is that
while variables are statically typed, definitions are not.
array_define_declaration ::
DEFINE identifier := array_expression ;
array_expression :: [ array_contents ]
| [ array_expression_list ]
array_expression_list :: array_expression
| array_expression , array_expression_list
Array DEFINE associates an identifier on the left hand side of the ‘:=’ with an array
expression. As a normal DEFINE statement an array define is considered as a macro. Whenever
an array identifier occurs in an expression, the identifier is syntactically replaced by
the array expression it is associated with. As with normal DEFINE an array DEFINE expression
is always evaluated in the context of the statement where the identifier is declared and
forward references to defined symbols are allowed but circular definitions are not.
The type of an array expression [exp1, exp2, ..., expN] is array 0..N-1 of type
where type is the least type such that all exp1, exp2, ...expN can be converted to it.
It is not possible to declare asymmetrical arrays. This means that it is forbidden to declare
an array with a different number of elements in a dimension. For example, the following code
will result in an error:
DEFINE
x := [[1,2,3], [1,2]];
27
in those conditions that require symbolic constants to occur only in DEFINEs body (e.g. in gen-
erated models). For an example of usage see also the command write boolean model. A
constant is allowed to be declared multiple times, as after the first declaration any further decla-
ration will be ignored. CONSTANTS declarations are an extension of the original SMV grammar,
and they are supported since NuSMV 2.6. The syntax for this kind of declaration is:
constants_body :: identifier
| constants_body , identifier
Since the expression in the INIT constraint is a simple expression, it cannot contain the
next() operator. The expression also has to be of type boolean. If there is more than one
INIT constraint, the initial set is the conjunction of all of the INIT constraints.
Since the expression in the INVAR constraint is a simple expression, it cannot contain the
next() operator. If there is more than one INVAR constraint, the invariant set is the conjunction
of all of the INVAR constraints.
It is an error for the expression to be not of the boolean type. If there is more than one TRANS
constraint, the transition relation is the conjunction of all of TRANS constraints.
assign_list :: assign ;
| assign_list assign ;
assign ::
complex_identifier := simple_expr
| init ( complex_identifier ) := simple_expr
| next ( complex_identifier ) := next_expr
28
On the left hand side of the assignment, identifier denotes the current value of a vari-
able, ‘init(identifier)’ denotes its initial value, and ‘next(identifier)’ denotes
its value in the next state. If the expression on the right hand side evaluates to a not-set expres-
sion such as integer number or symbolic constant, the assignment simply means
that the left hand side is equal to the right hand side. On the other hand, if the expression eval-
uates to a set, then the assignment means that the left hand side is contained in that set. It is an
error if the value of the expression is not contained in the range of the variable on the left hand
side.
Semantically assignments can be expressed using other kinds of constraints:
Notice that, an additional constraint is forced when assignments are used with respect to their
corresponding constraints counterpart: when a variable is assigned a value that it is not an ele-
ment of its declared type, an error is raised.
The allowed types of the assignment operator are:
:= : integer * integer
: integer * integer set
: symbolic enum * symbolic enum
: symbolic enum * symbolic set
: integers-and-symbolic enum * integers-and-symbolic enum
: integers-and-symbolic enum * integers-and-symbolic set
: unsigned word[N] * unsigned word[N]
: signed word[N] * signed word[N]
Before checking the assignment for being correctly typed, the implicit type conversion can be
applied to the right operand.
Example 1 x := expr1 ;
29
Example 1 x := expr1 ;
x := expr2 ;
Example 2 init( x ) := expr1 ;
init( x ) := expr2 ;
Example 3 x := expr1 ;
init( x ) := expr2 ;
Example 4 x := expr1 ;
next( x ) := expr2 ;
30
2.3.10 MODULE Declarations
A module declaration is an encapsulated collection of declarations, constraints and specifica-
tions. A module declaration also opens a new identifier scope. Once defined, a module can be
reused as many times as necessary. Modules are used in such a way that each instance of a mod-
ule refers to different data structures. A module can contain instances of other modules, allowing
a structural hierarchy to be built. The syntax of a module declaration is as follows:
module_parameters ::
identifier
| module_parameters , identifier
module_body ::
module_element
| module_body module_element
module_element ::
var_declaration
| ivar_declaration
| frozenvar_declaration
| define_declaration
| constants_declaration
| assign_constraint
| trans_constraint
| init_constraint
| invar_constraint
| fairness_constraint
| ctl_specification
| invar_specification
| ltl_specification
| compute_specification
| isa_declaration
The identifier immediately following the keyword MODULE is the name associated with
the module. Module names have a separate name space in the program, and hence may clash
with names of variables and definitions. The optional list of identifiers in parentheses are the
formal parameters of the module.
module_type_specifier ::
| identifier [ ( [ parameter_list ] ) ]
| process identifier [ ( [ parameter_list ] ) ]
parameter_list ::
next_expr
| parameter_list , next_expr
A variable declaration with a module type specifier introduces a name for the module
instance. The module type specifier provides the name of the instantiating module and
31
also a list of actual parameters, which are assigned to the formal parameters of the module. An
actual parameter can be any legal next expression (see Section 2.2.4 [Simple and Next
Expressions], page 21). It is an error if the number of actual parameters is different from the
number of formal parameters. Whenever formal parameters occur in expressions within the
module, they are replaced by the actual parameters. The semantic of module instantiation is
similar to call-by-reference.8
Here are examples:
MODULE main
...
VAR
a : boolean;
b : foo(a);
...
MODULE foo(x)
ASSIGN
x := TRUE;
the variable a is assigned the value TRUE. This distinguishes the call-by-reference mechanism
from a call-by-value scheme.
Now consider the following program:
MODULE main
...
DEFINE
a := 0;
VAR
b : bar(a);
...
MODULE bar(x)
DEFINE
a := 1;
y := x;
In this program, the value of y is 0. On the other hand, using a call-by-name mechanism, the
value of y would be 1, since a would be substituted as an expression for x.
Forward references to module names are allowed, but circular references are not, and result in
an error.
The keyword process is explained in Section 2.3.13 [Processes], page 34.
complex_identifier ::
identifier
| complex_identifier . identifier
| complex_identifier [ simple_expression ]
| self
8 This also means that the actual parameters are analyzed in the context of the variable declaration where
the module is instantiated, not in the context of the expression where the formal parameter occurs.
32
Every variable and define used in an expression should be declared. It is possible to have
forward references when a variable or define identifier is used textually before the corresponding
declaration.
Notations with . (<DOT>) are used to access the components of modules. For example, if m
is an instance of a module (see Section 2.3.11 [MODULE Instantiations], page 31 for information
about instances of modules) then the expression m.c identifies the component c of the module
instance m. This is precisely analogous to accessing a component of a structured data type.
Note that actual parameters of a module can potentially be instances of other modules.
Therefore, parameters of modules allow access to the components of other module instances,
as in the following example:
MODULE main
... VAR
a : bar;
m : foo(a);
...
MODULE bar
VAR
q : boolean;
p : boolean;
MODULE foo(c)
DEFINE
flag := c.q | c.p;
MODULE main
VAR c : container(14, 7);
SPEC
c.c1.greatestCounterInContainer;
In this example an instance of the module container is passed to the sub-module counter.
In the main module, c is declared to be an instance of the module container, which de-
clares two instances of the module counter. Every instance of the counter module has a
define greatestCounterInContainer which specifies the condition when this particular
counter has the greatest value in the container it belongs to. So a counter needs access to
the parent container to access all the counters in the container.
33
2.3.13 Processes
Important!
Since N U SMV version 2.5.0 processes are deprecated. In future versions of N U SMV processes
may be no longer supported, and only synchronous FSM will be supported by the input language.
Modeling of asynchronous processes will have to be resolved at higher level.
Processes are used to model interleaving concurrency. A process is a module which is instan-
tiated using the keyword ‘process’ (see Section 2.3.11 [MODULE Instantiations], page 31).
The program executes a step by non-deterministically choosing a process, then executing all of
the assignment statements in that process in parallel. It is implicit that if a given variable is not
assigned by the process, then its value remains unchanged. Note that only assignments of the
form
are influenced by processes. All other kinds of assignments and all constraints (such as TRANS,
INVAR, etc) are always in force, independent of which process is selected for execution.
Each instance of a process has a special boolean variable associated with it, called
running. The value of this variable is TRUE if and only if the process instance is currently
selected for execution. No two processes may be running at the same time.
Note that (only) in the presence of processes NuSMV internally declares special variables
running and process selector . These names should NOT be used in user’s own dec-
larations (when processes are used), but they can be referenced for example in the transition
relation of a module.
Furthermore, if the user declares N processes, there will be N+1 processes allocated, as the
module main has always its own process associated. In the following example there are three
process, p1, p2 and main:
MODULE my_module
-- my module definition...
MODULE main
VAR
p1 : process my_module;
p2 : process my_module;
program :: module_list
module_list ::
module
| module_list module
There must be one module with the name main and no formal parameters. The module main
is the one evaluated by the interpreter.
34
Module identifiers have their own separate namespace. Module identifiers can be used in
module type specifiers only, and no other kind of identifiers can be used there (see
Section 2.3.11 [MODULE Instantiations], page 31). Thus, module identifiers may be equal to
other kinds of identifiers without making the program ambiguous. However, no two modules
should be declared with the same identifier. Modules cannot be declared in other modules,
therefore they are always referenced by simple identifiers.
Variable, define, and module instance identifiers are introduced in a program when the mod-
ule containing their declarations is instantiated. Inside this module the variables, defines and
module instances may be referenced by the simple identifiers. Inside other modules, their
simple identifiers should be preceded by the identifier of the module instance containing their
declaration and . (<DOT>). Such identifiers are called complex identifier. The full
identifier is a complex identifier which references a variable, define, or a module in-
stance from inside the main module.
Let us consider the following:
MODULE main
VAR a : boolean;
VAR b : foo;
VAR c : moo;
MODULE foo
VAR q : boolean;
e : moo;
MODULE moo
DEFINE f := 0 < 1;
MODULE not_used
VAR n : boolean;
VAR t : used;
MODULE used
VAR k : boolean;
The full identifier of the variable a is a, the full identifier of the variable q (from the module
foo) is b.q, the full identifier of the module instance e (from the module foo) is b.e, the
full identifiers of the define f (from the module moo) are b.e.f and c.f, because two module
instances contain this define. Notice that, the variables n and k as well as the module instance
t do not have full identifiers because they cannot be accessed from main (since the module
not used is not instantiated).
In the N U SMV language, variable, define, and module instances belong to one namespace,
and no two full identifiers of different variable, define, or module instances should be equal.
Also, none of them can be redefined.
A symbolic constant can be introduced by a variable declaration if its type specifier
enumerates the symbolic constant. For example, the variable declaration
VAR a : {OK, FAIL, waiting};
declares the variable a as well as the symbolic constants OK, FAIL and waiting. The
full identifiers of the symbolic constants are equal to their simple identifiers with
the additional condition – the variable whose declaration declares the symbolic constants
also has a full identifier.
Symbolic constants have a separate namespace, so their identifiers may potentially
be equal, for example, variable identifiers. It is an error, if the same identifier in an expression
can simultaneously refer to a symbolic constant and a variable or a define. A symbolic
constant may be declared an arbitrary number of times, but it must be declared at least once,
if it is used in an expression.
35
2.3.16 Context
Every module instance has its own context, in which all expressions are analyzed. The context
can be defined as the full identifiers of variables declared in the module without their simple
identifiers. Let us consider the following example:
MODULE main
VAR a : foo;
VAR b : moo;
MODULE foo
VAR c : moo;
MODULE moo
VAR d : boolean;
The context of the module main is ‘’ (empty)9 , the context of the module instance a (and inside
the module foo) is ‘a.’, the contexts of module moo may be ‘b.’ (if the module instance b
is analyzed) and ‘a.c.’ (if the module instance a.c is analyzed).
where identifier must be the name of a declared module. The ISA declaration can be
thought as a simple macro expansion command, because the body of the module referenced by
an ISA command is replaced to the ISA declaration.
Warning: ISA is a deprecated feature and will be removed from future versions of
N U SMV. Therefore, avoid the use of ISA declarations. Use module instances instead.
2.4 Specifications
The specifications to be checked on the FSM can be expressed in temporal logics like Compu-
tation Tree Logic CTL, Linear Temporal Logic LTL extended with Past Operators, and Property
Specification Language (PSL) [psl03] that includes CTL and LTL with Sequencial Extended
Regular Expressions (SERE), a variant of classical regular expressions. It is also possible to an-
alyze quantitative characteristics of the FSM by specifying real-time CTL specifications. Spec-
ifications can be positioned within modules, in which case they are preprocessed to rename the
variables according to their context.
CTL and LTL specifications are evaluated by N U SMV in order to determine their truth or
falsity in the FSM. When a specification is discovered to be false, N U SMV constructs and prints
a counterexample, i.e. a trace of the FSM that falsifies the property.
program.
36
ctl_specification :: CTLSPEC ctl_expr [;]
| SPEC ctl_expr [;]
| CTLSPEC NAME name := ctl_expr [;]
| SPEC NAME name := ctl_expr [;]
ctl_expr ::
simple_expr -- a simple boolean expression
| ( ctl_expr )
| ! ctl_expr -- logical not
| ctl_expr & ctl_expr -- logical and
| ctl_expr | ctl_expr -- logical or
| ctl_expr xor ctl_expr -- logical exclusive or
| ctl_expr xnor ctl_expr -- logical NOT exclusive or
| ctl_expr -> ctl_expr -- logical implies
| ctl_expr <-> ctl_expr -- logical equivalence
| EG ctl_expr -- exists globally
| EX ctl_expr -- exists next state
| EF ctl_expr -- exists finally
| AG ctl_expr -- forall globally
| AX ctl_expr -- forall next state
| AF ctl_expr -- forall finally
| E [ ctl_expr U ctl_expr ] -- exists until
| A [ ctl_expr U ctl_expr ] -- forall until
Since simple expr cannot contain the next operator, ctl expr cannot contain it either.
The ctl expr should also be a boolean expression.
Intuitively the semantics of CTL operators is as follows:
• EX p is true in a state s if there exists a state s0 such that a transition goes from s to s0
and p is true in s0 .
• AX p is true in a state s if for all states s0 where there is a transition from s to s0 , p is true
in s0 .
• EF p is true in a state s0 if there exists a series of transitions s0 → s1 , s1 → s2 , . . . ,
sn−1 → sn such that p is true in sn .
• AF p is true in a state s0 if for all series of transitions s0 → s1 , s1 → s2 , . . . , sn−1 → sn
p is true in sn .
• EG p is true in a state s0 if there exists an infinite series of transitions s0 → s1 , s1 → s2 ,
. . . such that p is true in every si .
• AG p is true in a state s0 if for all infinite series of transitions s0 → s1 , s1 → s2 , . . . p
is true in every si .
• E[p U q] is true in a state s0 if there exists a series of transitions s0 → s1 , s1 → s2 ,
. . . , sn−1 → sn such that p is true in every state from s0 to sn−1 and q is true in state sn .
• A[p U q] is true in a state s0 if for all series of transitions s0 → s1 , s1 → s2 , . . . ,
sn−1 → sn p is true in every state from s0 to sn−1 and q is true in state sn .
A CTL formula is true if it is true in all initial states.
For a detailed description about the semantics of PSL operators, please see [psl03].
37
2.4.2 Invariant Specifications
It is also possible to specify invariant specifications with special constructs. Invariants are propo-
sitional formulas which must hold invariantly in the model. The corresponding command is
INVARSPEC, with syntax:
SPEC AG simple_expr ;
but can be checked by a specialised algorithm during reachability analysis and Invariant Spec-
ifications can contain next operators. Fairness constraints are not taken into account during
invariant checking.
ltl_expr ::
next_expr -- a next boolean expression
| ( ltl_expr )
| ! ltl_expr -- logical not
| ltl_expr & ltl_expr -- logical and
| ltl_expr | ltl_expr -- logical or
| ltl_expr xor ltl_expr -- logical exclusive or
| ltl_expr xnor ltl_expr -- logical NOT exclusive or
| ltl_expr -> ltl_expr -- logical implies
| ltl_expr <-> ltl_expr -- logical equivalence
-- FUTURE
| X ltl_expr -- next state
| G ltl_expr -- globally
| G bound ltl_expr -- bounded globally
| F ltl_expr -- finally
| F bound ltl_expr -- bounded finally
| ltl_expr U ltl_expr -- until
| ltl_expr V ltl_expr -- releases
-- PAST
| Y ltl_expr -- previous state
| Z ltl_expr -- not previous state not
| H ltl_expr -- historically
| H bound ltl_expr -- bounded historically
| O ltl_expr -- once
| O bound ltl_expr -- bounded once
| ltl_expr S ltl_expr -- since
| ltl_expr T ltl_expr -- triggered
38
• X p is true at time t if p is true at time t + 1.
• F p is true at time t if p is true at some time t0 ≥ t.
• F [l,u] p is true at time t if p is true at some time t + l ≤ t0 ≤ t + u.
• G p is true at time t if p is true at all times t0 ≥ t.
• G [l,u] p is true at time t if p is true at all times t + l ≤ t0 ≤ t + u.
• p U q is true at time t if q is true at some time t0 ≥ t, and for all time t00 (such that
t ≤ t00 < t0 ) p is true.
• p V q is true at time t if q holds at all time steps t0 ≥ t up to and including the time step
t00 where p also holds. Alternatively, it may be the case that p never holds in which case
q must hold in all time steps t0 ≥ t.
• Y p is true at time t > t0 if p holds at time t − 1. Y p is false at time t0 .
• Z p is equivalent to Y p with the exception that the expression is true at time t0 .
• H p is true at time t if p holds in all previous time steps t0 ≤ t.
• H [l,u] p is true at time t if p holds in all previous time steps t − u ≤ t0 ≤ t − l.
• O p is true at time t if p held in at least one of the previous time steps t0 ≤ t.
• O [l,u] p is true at time t if p held in at least one of the previous time steps t − u ≤
t0 ≤ t − l.
• p S q is true at time t if q held at time t0 ≤ t and p holds in all time steps t00 such that
t0 < t00 ≤ t.
• p T q is true at time t if p held at time t0 ≤ t and q holds in all time steps t00 such that
t0 ≤ t00 ≤ t. Alternatively, if p has never been true, then q must hold in all time steps t00
such that t0 ≤ t00 ≤ t
An LTL formula is true if it is true at the initial time t0 .
In N U SMV, LTL specifications can be analyzed both by means of BDD-based reasoning, or
by means of SAT-based bounded model checking. In the case of BDD-based reasoning, N U SMV
proceeds according to [CGH97]. For each LTL specification, a tableau of the behaviors falsifying
the property is constructed, and then synchronously composed with the model. With respect to
[CGH97], the approach is fully integrated within N U SMV, and allows full treatment of past
temporal operators. Note that the counterexample is generated in such a way to show that the
falsity of a LTL specification may contain state variables which have been introduced by the
tableau construction procedure.
In the case of SAT-based reasoning, a similar tableau construction is carried out to encode the
paths of limited length, violating the property. N U SMV generates a propositional satisfiability
problem, that is then tackled by means of an efficient SAT solver [BCCZ99].
In both cases, the tableau constructions are completely transparent to the user.
Important Difference Between BDD and SAT Based LTL Model Checking
If a FSM to be checked it not total (i.e. has deadlock state) the model checking may return
different results for the same LTL specification depending on the verification engine used. For
example, for below model:
MODULE main
VAR s : boolean;
TRANS s = TRUE
LTLSPEC G (s = TRUE)
the LTL specification is proved valid by BDD-based model checking but is violated by SAT-
based bounded model checking. The counter-example found consists of one state s=FALSE.
39
This difference between the results is caused by the fact that BDD model checking investi-
gates only infinite paths whereas SAT-based model checking is able to deal also with finite paths.
Apparently infinite paths cannot ever have s=FALSE as then the transition relation will not hold
between the consecutive states in the path. A finite path consisting of just one state s=FALSE
violates the specification G (s = TRUE) and is still consistent with the FSM as the transition
relation is not taken ever and there is not initial condition to violate. Note however that this state
is a deadlock and cannot have consecutive states.
In order to make SAT-based bound model checking ignore finite paths it is enough to add a
fairness condition to the main module:
JUSTICE TRUE;
Being limited to fair paths, SAT-based bounded model checking cannot find a finite counter-
example and results of model checking become consistent with BDD-based model checking.
• EBF m..n p requires that there exists a path starting from a state, such that property p
holds in a future time instant i, with m ≤ i ≤ n
• ABF m..n p requires that for all paths starting from a state, property p holds in a future
time instant i, with m ≤ i ≤ n
• EBG m..n p requires that there exists a path starting from a state, such that property p
holds in all future time instants i, with m ≤ i ≤ n
• ABG m..n p requires that for all paths starting from a state, property p holds in all
future time instants i, with m ≤ i ≤ n
• E [ p BU m..n q ] requires that there exists a path starting from a state, such that
property q holds in a future time instant i, with m ≤ i ≤ n, and property p holds in all
future time instants j, with m ≤ j < i
• A [ p BU m..n q ], requires that for all paths starting from a state, property q holds
in a future time instant i, with m ≤ i ≤ n, and property p holds in all future time instants
j, with m ≤ j < i
Real time CTL specifications can be defined with the following syntax, which extends the syntax
for CTL specifications. (keyword ‘SPEC’ is deprecated)
rtctl_specification :: CTLSPEC rtctl_expr [;]
| SPEC rtctl_expr [;]
| CTLSPEC NAME name := rtctl_expr [;]
| SPEC NAME name := rtctl_expr [;]
40
With the COMPUTE statement, it is also possible to compute quantitative information on the
FSM. In particular, it is possible to compute the exact bound on the delay between two specified
events, expressed as CTL formulas. The syntax is the following:
where
MIN [start , final] returns the length of the shortest path from a state in start to a state
in final. For this, the set of states reachable from start is computed. If at any point, we encounter
a state satisfying final, we return the number of steps taken to reach the state. If a fixed point is
reached and no computed states intersect final then infinity is returned.
MAX [start , final] returns the length of the longest path from a state in start to a state
in final. If there exists an infinite path beginning in a state in start that never reaches a state
in final, then infinity is returned. If any of the initial or final states is empty, then undefined is
returned.
It is important to remark here that if the FSM is not total (i.e. it contains deadlock states)
COMPUTE may produce wrong results. It is possible to check the FSM against deadlock states
by calling the command check fsm.
where
psl_expr ::
psl_primary_expr
| psl_unary_expr
| psl_binary_expr
| psl_conditional_expr
| psl_case_expr
| psl_property
The first five classes define the building blocks for psl property and provide means of com-
bining instances of that class; they are defined as follows:
psl_primary_expr ::
number ;; a numeric constant
| boolean ;; a boolean constant
| word ;; a word constant
| var_id ;; a variable identifier
| { psl_expr , ... , psl_expr }
| { psl_expr "{" psl_expr , ... , "psl_expr" }}
| ( psl_expr )
psl_unary_expr ::
+ psl_primary_expr
41
| - psl_primary_expr
| ! psl_primary_expr
| bool ( psl_expr )
| word1 ( psl_expr )
| uwconst ( psl_expr, psl_expr )
| swconst ( psl_expr, psl_expr )
| sizeof ( psl_expr )
| toint ( psl_expr )
| signed ( psl_expr )
| unsigned ( psl_expr )
| extend ( psl_expr, psl_primary_expr )
| resize ( psl_expr, psl_primary_expr )
| select ( psl_expr, psl_expr, psl_expr )
psl_binary_expr ::
psl_expr + psl_expr
| psl_expr union psl_expr
| psl_expr in psl_expr
| psl_expr - psl_expr
| psl_expr * psl_expr
| psl_expr / psl_expr
| psl_expr % psl_expr
| psl_expr == psl_expr
| psl_expr != psl_expr
| psl_expr < psl_expr
| psl_expr <= psl_expr
| psl_expr > psl_expr
| psl_expr >= psl_expr
| psl_expr & psl_expr
| psl_expr | psl_expr
| psl_expr xor psl_expr
| psl_expr xnor psl_expr
| psl_expr << psl_expr
| psl_expr >> psl_expr
| psl_expr :: psl_expr
psl_conditional_expr ::
psl_expr ? psl_expr : psl_expr
psl_case_expr ::
case
psl_expr : psl_expr ;
...
psl_expr : psl_expr ;
endcase
Among the subclasses of psl expr we depict the class psl bexpr that will be used in the
following to identify purely boolean, i.e. not temporal, expressions. The class of PSL properties
psl property is defined as follows:
psl_property ::
replicator psl_expr ;; a replicated property
| FL_property abort psl_bexpr
| psl_expr <-> psl_expr
| psl_expr -> psl_expr
| FL_property
| OBE_property
42
replicator ::
forall var_id [index_range] in value_set :
index_range ::
[ range ]
range ::
low_bound : high_bound
low_bound ::
number
| identifier
high_bound ::
number
| identifier
| inf ;; inifite high bound
value_set ::
{ value_range , ... , value_range }
| boolean
value_range ::
psl_expr
| range
The instances of FL property are temporal properties built using LTL operators and SEREs
operators, and are defined as follows:
FL_property ::
;; PRIMITIVE LTL OPERATORS
X FL_property
| X! FL_property
| F FL_property
| G FL_property
| [ FL_property U FL_property ]
| [ FL_property W FL_property ]
;; SIMPLE TEMPORAL OPERATORS
| always FL_property
| never FL_property
| next FL_property
| next! FL_property
| eventually! FL_property
| FL_property until! FL_property
| FL_property until FL_property
| FL_property until!_ FL_property
| FL_property until_ FL_property
| FL_property before! FL_property
| FL_property before FL_property
| FL_property before!_ FL_property
| FL_property before_ FL_property
;; EXTENDED NEXT OPERATORS
| X [number] ( FL_property )
| X! [number] ( FL_property )
| next [number] ( FL_property )
| next! [number] ( FL_property )
;;
| next_a [range] ( FL_property )
| next_a! [range] ( FL_property )
| next_e [range] ( FL_property )
| next_e! [range] ( FL_property )
43
;;
| next_event! ( psl_bexpr ) ( FL_property )
| next_event ( psl_bexpr ) ( FL_property )
| next_event! ( psl_bexpr ) [ number ] ( FL_property )
| next_event ( psl_bexpr ) [ number ] ( FL_property )
;;
| next_event_a! ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_a ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_e! ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_e ( psl_bexpr ) [psl_expr] ( FL_property )
;; OPERATORS ON SEREs
| sequence ( FL_property )
| sequence |-> sequence [!]
| sequence |=> sequence [!]
;;
| always sequence
| G sequence
| never sequence
| eventually! sequence
;;
| within! ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within!_ ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within_ ( sequence_or_psl_bexpr , psl_bexpr ) sequence
;;
| whilenot! ( psl_bexpr ) sequence
| whilenot ( psl_bexpr ) sequence
| whilenot!_ ( psl_bexpr ) sequence
| whilenot_ ( psl_bexpr ) sequence
sequence_or_psl_bexpr ::
sequence
| psl_bexpr
Please note that instances of FL property cannot be combined with the “=”, “!=” and “==”.
Sequences, i.e. istances of class sequence, are defined as follows:
sequence ::
{ SERE }
SERE ::
sequence
| psl_bexpr
;; COMPOSITION OPERATORS
| SERE ; SERE
| SERE : SERE
| SERE & SERE
| SERE && SERE
| SERE | SERE
;; RegExp QUALIFIERS
| SERE [* [count] ]
| [* [count] ]
| SERE [+]
| [+]
;;
| psl_bexpr [= count ]
| psl_bexpr [-> count ]
44
count ::
number
| range
Istances of OBE property are CTL properties in the PSL style and are defined as follows:
OBE_property ::
AX OBE_property
| AG OBE_property
| AF OBE_property
| A [ OBE_property U OBE_property ]
| EX OBE_property
| EG OBE_property
| EF OBE_property
| E [ OBE_property U OBE_property ]
The N U SMV parser allows to input any specification based on the grammar above, but currently,
verification of PSL specifications is supported only for the OBE subset, and for a subset of PSL
for which it is possible to define a translation into LTL. For the specifications that belong to these
subsets, it is possible to apply all the verification techniques that can be applied to LTL and CTL
Specifications.
vars_list :: EMPTY
| var_list_item vars_list
var_list_item :: complex_identifier
| complex_identifier . integer_number
where Complete Var Name is just the name of the variable if it appears in the module MAIN,
otherwise it has the module name(s) prepended to the start, for example:
mod1.mod2...modN.varname
10 Note that if the ordering is not provided by a user then N U SMV decides by itself how to order the vari-
ables. Two shell variables bdd static order heuristics (see page 53) and vars order type
(see page 52) allow to control the ordering creation.
45
where varname is a variable in modN, and modN.varname is a variable in modN-1, and
so on. Note that the module name main is implicitely prepended to every variable name and
therefore must not be included in their declarations.
Any variable which appears in the model file, but not the ordering file is placed after all the others
in the ordering. Variables which appear in the ordering file but not the model file are ignored. In
both cases N U SMV displays a warning message stating these actions.
Comments can be included by using the same syntax as regular N U SMV files. That is, by
starting the line with -- or by entering text between limiters /-- and --/.
...
Complete Var Name
...
Complete Var Name.i
...
The result of doing this is that the variable representing the ith bit is located in a different position
to the remainder of the variables representing the rest of the bits. The specific-bit variables
varname.0, ..., varname.i-1, varname.i+1, ..., varname.N are grouped together as before.
If any one bit occurs before the variable it belongs to, the remaining specific-bit variables
are not grouped together:
...
Complete Var Name.i
...
Complete Var Name
...
The variable representing the ith bit is located at the position given in the variable ordering and
the remainder are located where the scalar variable name is declared. In this case, the remaining
bit variables will not be grouped together.
This is just a short-hand way of writing each individual specific-bit variable in the ordering file.
The following are equivalent:
46
... ...
Complete Var Name.0 Complete Var Name.0
Complete Var Name.1 Complete Var Name
.
. ...
.
Complete Var Name.N-1
...
where the scalar variable Complete Var Name requires N boolean variables to encode all the
possible values that it may take. It is still possible to then specify other specific-bit variables at
later points in the ordering file as before.
47
Chapter 3
The main interaction mode of N U SMV is through an interactive shell. In this mode N U SMV
enters a read-eval-print loop. The user can activate the various N U SMV computation steps
as system commands with different options. These steps can therefore be invoked separately,
possibly undone or repeated under different modalities. These steps include the construction
of the model under different partitioning techniques, model checking of specifications, and the
configuration of the BDD package. The interactive shell of N U SMV is activated from the system
prompt as follows (’NuSMV>’ is the default N U SMV shell prompt):
When running interactively, N U SMV first tries to read and execute commands from an
initialization file if such file can be found and is readable unless -s is passed on the command
line.
First, file master.nusmvrc is looked for in directory defined in environment variable
NUSMV LIBRARY PATH or in default library path if no such variable is defined. If no such
file exists, file .nusmvrc is looked for in user’s home directory and as a last attemp, .nusmvrc is
looked for in current directory. Commands in the initialization file (if any) are executed consec-
utively. When initialization phase is completed the N U SMV shell is displayed and the system is
now ready to execute user commands.
A N U SMV command is a sequence of words. The first word specifies the command to be
executed. The remaining words are arguments to the invoked command. Commands separated
by a ‘;’ are executed sequentially; the N U SMV shell waits for each command to terminate
in turn. The behavior of commands can depend on environment variables, similar to “csh”
environment variables.
It is also possible to make N U SMV read and execute a sequence of commands from a file,
through the command line option -source:
-source cmd-file Starts the interactive shell and then executes N U SMV com-
mands from file cmd-file. If an error occurs during a com-
mand execution, commands that follow will not be executed.
See also the variable on failure script quits.
The option -source implies -int.
48
In the following we present the possible commands followed by the related environment vari-
ables, classified in different categories. Every command answers to the option -h by printing out
the command usage. When output is paged for some commands (option -m), it is piped through
the program specified by the UNIX PAGER shell variable, if defined, or through the UNIX com-
mand “more”. Environment variables can be assigned a value with the “set” command. Com-
mand sequences to N U SMV must obey the (partial) order specified in the Figure 3.11 depicted
at page 113. For instance, it is not possible to evaluate CTL expressions before the model is
built.
A number of commands and environment variables, like those dealing with file names,
accept arbitrary strings. There are a few reserved characters which must be escaped if they are
to be used literally in such situations. See the section describing the history command, on
page 106, for more information.
Command Options:
-i model-file Sets the environment variable input file to
model-file, and reads the model from the specified file.
49
This command is responsible of the instantiation of modules and processes. The instantia-
tion is performed by substituting the actual parameters for the formal parameters, and then
by prefixing the result via the instance name.
Command Options:
-d Delays the construction of vars constraints until needed
Since N U SMV 2.5.1, backward compatibility mode introduces a porting feature from old
models which use constant 1 as case conditions, instead of forcing the use of TRUE.
show vars - Shows model’s symbolic variables and defines with Command
their types
show vars [-h] [-s] [-f] [-i] [-t | -V | -D] [-v] [-m | -o
output-file]
Prints a summary of the variables and defines declared in the input file. Moreover, it prints
also the list of symbolic input, frozen and state variables of the model with their range of
values (as defined in the input file) if the proper command option is specified.
By default, if no type specifiers (-s, -f, -i) are used, all variable types will be printed.
When using one or more type specifiers (e.g. -s), only variables belonging to selected
types will be printed.
Command Options:
-s Prints only state variables.
50
-f Prints only frozen variables.
-i Prints only input variables.
-t Prints only the number of variables (among selected kinds),
grouped by type. This option is incompatible with -V or -D
-V Prints only the list of variables with their types (among se-
lected kinds), with no summary information. This option is
incompatible with -t or -D
-D Prints only the list of defines with their types, with no sum-
mary information. This option is incompatible with -t or
-V
-v Prints verbosely. Scalar variable’s values are not truncated
if too long for printing.
-m Pipes the output to the program specified by the PAGER
shell variable if defined, else through the UNIX command
“more”.
-o output-file Writes the output generated by the command to
output-file.
show dependencies - Shows the dependencies for the given expres- Command
sion
51
input order file Environment Variable
Indicates the file name containing the variable ordering to be used in building the model
by the ‘encode variables’ command. A value for this variable can also be provided
with command line option -i. There is no default value.
52
The individual bits of variables may or may not be interleaved. When bits interleaving is
not used then bits belonging to one variable are grouped together in the ordering. Other-
wise, the bits interleaving is applied and all higher bits of all variables are ordered before
all the lower bits, i.e. N-th bits of all variables go before (N-1)th bits. The exception is
boolean variables which are ordered before variables of any other type though boolean
variables consist of only 0-th bit.
The value of vars order type may be:
• inputs before. Input variables are forced to be ordered before state and frozen vari-
ables (default). No bits interleaving is done.
• inputs after. Input variables are forced to be ordered after state and frozen vari-
ables. No bits interleaving is done.
• topological. Input, state and frozen variables are ordered as they are declared in the
input smv file. No bits interleaving is done.
• inputs before bi. Bits are interleaved and in every group of N-th bits input variables
are forced to be ordered before state and frozen variables. This is the default value.
• inputs after bi. Bits are interleaved and in every group of N-th bits input variables
are forced to be ordered after state and frozen variables.
• topological bi. Bits are interleaved and in every group of N-th bits input, state and
frozen variables are ordered as they are declared in the input smv file.
• lexicographic. This is deprecated value. topological has to be used instead.
53
Command Options:
-m Method Sets the environment variable partition method to
the value Method, and then builds the transition relation.
Available methods are Monolithic, Threshold and
Iwls95CP.
-f Forces model construction. By default, only one partition
method is allowed. This option allows to overcome this de-
fault, and to build the transition relation with different parti-
tioning methods.
54
iwls95preorder Environment Variable
+
Enables cluster preordering following heuristic described in [RAP 95], possible values
are 0 or 1. The default value is 0. Preordering can be very slow.
go [-h] [-f]
This command initializes the system for verification. It is equivalent to the
command sequence read model, flatten hierarchy, encode variables,
build flat model, build model.
If some commands have already been executed, then only the remaining ones will be in-
voked.
Command Options:
-f Forces model construction even when Cone Of Influence is
enabled.
get internal status - Prints out the internal status of the system. Command
process model - Performs the batch steps and then returns control Command
to the interactive shell.
55
Command Options:
-f Forces the model construction even when Cone Of Influence
is enabled.
-r Forces a variable reordering at the end of the computation,
and dumps the new variables ordering to the default order-
ing file. This options acts like the command line option
-reorder.
-i model-file Sets the environment variable input file to
file model-file, and reads the model from file
model-file.
-m Method Sets the environment variable partition method to
Method and uses it as partitioning method.
build flat model - Compiles the flattened hierarchy into a Scalar Command
FSM
56
Determines whether the expression daggifier in the model dumping features is enabled or
not. The default is enabled.
write boolean model - Writes a flat and boolean model to a file Command
In NuSMV 2.6 scalar variables are dumped as DEFINEs whose body is their boolean
encoding.
This allows the user to still express and see parts of the generated boolean model in terms
of the original model’s scalar variables names and values, and still keeping the generated
model purely boolean.
Also, symbolic constants are dumped within a CONSTANTS statement to declare the values
of the original scalar variables’ for future reading of the generated file.
When NuSMV 2.6 detects that there were triggered one or more dynamic reorderings in the
BDD engine, the command write boolean model also dumps the current variables
ordering, if the option output order file is set.
The dumped variables ordering will contain single bits or scalar variables depending on the
current value of the option write order dumps bits. See command write order
for further information about variables ordering.
57
dump fsm - Dumps (in DOT format) selected parts of the bdd fsm, Command
with optional expression
dump fsm [-h] -o <fname> [-i] [-I] [-t] [-f] [-r] [-e
<expr>]
Dumps selected parts of the bdd fsm, with optional expression, in DOT format. At least
one among options [iIte] must be specified.
Command Options:
-o fname Dumps to the specified file name.
-i Dumps the initial states of the FSM, among with other se-
lected outputs.
-I Dumps the invariant states of the FSM, among with other
selected outputs.
-t Dumps the (monolithic) transition relation of the FSM,
among with other selected outputs.
-F Dumps the (monolithic) fair states of the FSM, among with
other selected outputs.
-r Dumps the (monolithic) reachable states of the FSM, among
with other selected outputs.
-e expr Dumps the specified expression, among with other selected
outputs (see also command dump expr).
58
print reachable states - Prints out the number of reachable states Command
Checks if the transition relation is total. If the transition relation is not total then a potential
deadlock state is shown.
Command Options:
-m Pipes the output generated by the command to the pro-
gram specified by the PAGER shell variable if defined, else
through the UNIX command “more”.
-o output-file Writes the output generated by the command to the file
output-file.
At the beginning reachable states are computed in order to guarantee that deadlock states
are actually reachable.
print fsm stats - Prints out information about the fsm and cluster- Command
ing.
59
Command Options:
-h Prints the command usage.
-m Pipes the output generated by the command to the pro-
gram specified by the PAGER shell variable if defined, else
through the UNIX command “more”.
-p Prints out the normalized predicates the FSM consists of.
Expressions in properties are ignored.
-o output-file Writes the output generated by the command to the file
output-file.
print fair states - Prints out the number of fair states Command
print fair transitions - Prints out the number of fair transitions, Command
and optionally list them
print fair transitions [-h] [-v [-f format] [-o out fname]]
Prints the number of fair transitions of the given model. In verbose mode, prints also the
list of all fair transitions, with a limit of 216 . The transitions are displayed as state-input-
next triples, in three possible formats: smv (default), dot and csv. Also, each transition is
tagged with a current state ID and next state ID.
60
-P name Checks the CTL property named name in the property
database.
If the ag only search environment variable has been set, then a specialized algorithm
to check AG formulas is used instead of the standard model checking algorithms.
61
Performs invariant checking on the given model. An invariant is a set of states. Checking
the invariant is the process of determining that all states reachable from the initial states lie
in the invariant. Invariants to be verified can be provided as simple formulas (without any
temporal operators) in the input file via the INVARSPEC keyword or directly at command
line, using the option -p.
Option -n can be used for checking a particular invariant of the model. If neither -n nor
-p are used, all the invariants are checked.
During checking of invariants all the fairness conditions associated with the model are
ignored.
If an invariant does not hold, a proof of failure is demonstrated. This consists of a path
starting from an initial state to a state lying outside the invariant. This path has the property
that it is the shortest path leading to a state outside the invariant.
A search strategy can be specified with -s option. This is useful to speed up the check
in some situations. If “forward-backward” or “bdd-bmc” strategy is specified then it is
possible to choose a search heuristic with -e option; “bdd-bmc” strategy has some other
options explained below.
See variable use coi size sorting for changing properties verification order.
62
Command Options:
-m Pipes the output generated by the program in processing
INVARSPEC s to the program specified by the PAGER
shell variable if defined, else through the UNIX command
“more”.
-o output-file Writes the output generated by the command in processing
INVARSPEC s to the file output-file.
-n number Checks the INVAR property with index number in the
property database.
-p "invar-expr The command line specified invariant formula to be verified.
[IN context]" context is the module instance name which the variables
in invar-expr must be evaluated in.
-P name Checks the INVAR property named name in the property
database.
-s strategy Chooses the strategy to use while performing reachability
analysis. Possible strategies are:
• “forward” Explore the search space from initial states
and try to reach bad states.
• “backward” Explore the search space from bad states
and try to reach initial states.
• “forward-backward” Explore the search space using a
heuristic to decide at each step whether to move from
bad states or from reachable states.
• “bdd-bmc” Explore the search space using BDD
with “forward-backward” strategy and use a heuris-
tic (specified with -j option) to decide if to switch
from BDD technology to BMC. The idea is to expand
the sets of states reachable from both bad and initial
states, eventually stop and search for a path between
frontiers using BMC technology. Options -j, -t and
-k are enabled only when using this strategy. Note
that the algorithm used for the BMC approach is the
one specified in the variable “bmc invar alg”.
If this option is not specified, the value of the environment
variable “check invar strategy” is considered.
-e f-b-heuristic Specify the heuristic that decides at each step if we must ex-
pand reachable states or bad states. This option is enabled
only when using “forward-backward” or “bdd-bmc” strate-
gies. Possible values are “zigzag” and “smallest”. “zigzag”
forces to perform a step forward and the next step backward
and so on, while “smallest” performs a step from the fron-
tier with the BDD representing the state is smaller. If this
option is not specified, the value of the environment variable
“check invar forward backward heuristic” is considered.
63
-j b-b-heuristic When using “bdd-bmc” strategy specify the heuristic that
decides at which step we must switch from BDD to BMC
technolgy. You should use the option -t to specify the
threshold for the chosen heuristic. Possible heuristics are
“steps” and “size”. “steps” forces to switch after a num-
ber of steps equal to the threshold, while “size” switch
when BDDs are bigger (in the number of nodes) than the
threshold. If this option is not specified, the value of
the environment variable “check invar bddbmc heuristic” is
considered.
-t threshold When using “bdd-bmc” strategy specify the threshold for the
chosen heuristic. If this option is not specified, the value of
the environment variable “check invar bddbmc threshold”
is considered.
-k length When using “bdd-bmc” strategy specify the maximum
length of the path to search for during BMC search. If this
option is not specified, the value of the environment variable
“bmc length” is considered.
64
Command Options:
-m Pipes the output generated by the command in process-
ing LTLSPECs to the program specified by the PAGER
shell variable if defined, else through the UNIX command
“more”.
-o output-file Writes the output generated by the command in processing
LTLSPECs to the file output-file.
-p "ltl-expr An LTL formula to be checked. context is the module
[IN context]" instance name which the variables in ltl-expr must be
evaluated in.
-P "name" Checks the LTL property named name
-n number Checks the LTL property with index number in the prop-
erty database.
65
-o output-file Writes the output generated by the command in processing
COMPUTEs to the file output-file.
-p "compute-expr A COMPUTE formula to be checked. context is the mod-
[IN context]" ule instance name which the variables in compute-expr
must be evaluated in.
-n number Computes only the property with index number.
-P name Checks the COMPUTE property named name in the property
database.
check property - Checks a property into the current list of proper- Command
ties, or a newly specified property
66
-l Adds an LTL property.
-i Adds an INVAR property.
-s Adds a PSL property.
-q Adds a quantitative (COMPUTE) property.
-p "formula Adds the formula specified on the command-line.
[IN context]" context is the module instance name which the variables
in formula must be evaluated in.
-n "name" Sets the name of the property to “name”
67
-s Prints the number of stored properties
-o filename Writes the output generated by the command to filename
-F format Prints with the specified format. tabular and xml are com-
mon formats, however use -F help to see all available
formats.
-m Pipes the output through the program specified by the
PAGER shell variable if defined, else through the UNIX
”more” command
68
-s Dumps COI model for all PSL properties
-q Dumps COI model for all COMPUTE properties
-C Only prints the list of variables that are in the COI of
properties
-g Dumps the COI model that represents the union of all COI
properties
69
as input by most SAT solvers, so it is possible to use N U SMV with a separate external SAT
solver. At the moment, the DIMACS files can be generated only by commands which do not use
incremental algorithms.
check ltlspec bmc - Checks the given LTL specification, or all LTL Command
specifications if no formula is given. Checking parameters are the
maximum length and the loopback value
70
check ltlspec bmc [-h ] | [-n idx | -p "formula [IN
context]" | -P "name"] [-k max length] [-l loopback] [-o
filename]
This command generates one or more problems, and calls SAT solver for each one. Each
problem is related to a specific problem bound, which increases from zero (0) to the given
maximum problem length. Here max length is the bound of the problem that system is
going to generate and solve. In this context the maximum problem bound is represented
by the -k command parameter, or by its default value stored in the environment variable
bmc length. The single generated problem also depends on the loopback parameter
you can explicitly specify by the -l option, or by its default value stored in the environ-
ment variable bmc loopback.
The property to be checked may be specified using the -n idx or the -p "formula"
options. If you need to generate a DIMACS dump file of all generated problems, you must
use the option -o "filename".
Command Options:
-n index index is the numeric index of a valid LTL specification for-
mula actually located in the properties database.
-p "formula Checks the formula specified on the command-line.
[IN context]" context is the module instance name which the variables
in formula must be evaluated in.
-P name Checks the LTL property named name in the property
database.
-k max length max length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1” .
-o filename filename is the name of the dumped dimacs file. It may con-
tain special symbols which will be macro-expanded to form
the real file name. Possible symbols are:
• @F: model name with path part.
• @f: model name without path part.
• @k: current problem bound.
• @l: current loopback value.
• @n: index of the currently processed formula in the prop-
erty database.
71
• @@: the ‘@’ character.
check ltlspec bmc onepb - Checks the given LTL specification, or Command
all LTL specifications if no formula is given. Checking parameters
are the single problem bound and the loopback value
72
• @@: the ’@’ character.
gen ltlspec bmc - Dumps into one or more dimacs files the given Command
LTL specification, or all LTL specifications if no formula is given.
Generation and dumping parameters are the maximum bound and
the loopback value
73
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopback from
zero to length-1”.
-o filename filename is the name of dumped dimacs files. If this options
is not specified, variable bmc dimacs filename will be con-
sidered. The file name string may contain special symbols
which will be macro-expanded to form the real file name.
Possible symbols are:
• @F: model name with path part.
• @f: model name without path part.
• @k: current problem bound.
• @l: current loopback value .
• @n: index of the currently processed formula in the prop-
erty database.
• @@: the ‘@’ character.
gen ltlspec bmc onepb - Dumps into one dimacs file the problem Command
generated for the given LTL specification, or for all LTL specifi-
cations if no formula is explicitly given. Generation and dumping
parameters are the problem bound and the loopback value
74
• negative number in (-1, -length). Any invalid combination
of length and loopback will be skipped during the genera-
tion process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopback from
zero to length-1”.
-o filename filename is the name of the dumped dimacs file. If this op-
tions is not specified, variable bmc dimacs filename
will be considered. The file name string may contain spe-
cial symbols which will be macro-expanded to form the real
file name. Possible symbols are:
• @F: model name with path part
• @f: model name without path part
• @k: current problem bound
• @l: current loopback value
• @n: index of the currently processed formula in the prop-
erty database
• @@: the ’@’ character
check ltlspec bmc inc - Checks the given LTL specification, or all Command
LTL specifications if no formula is given, using an incremental al-
gorithm. Checking parameters are the maximum length and the
loopback value
75
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopback from
zero to length-1” .
check ltlspec sbmc - Checks the given LTL specification, or all Command
LTL specifications if no formula is given. Checking parameters are
the maximum length and the loopback value
76
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1” .
-o filename filename is the name of the dumped dimacs file. It may con-
tain special symbols which will be macro-expanded to form
the real file name. Possible symbols are:
• @F: model name with path part.
• @f: model name without path part.
• @k: current problem bound.
• @l: current loopback value.
• @n: index of the currently processed formula in the prop-
erty database.
• @@: the ‘@’ character.
check ltlspec sbmc inc - Checks the given LTL specification, or Command
all LTL specifications if no formula is given. Checking parameters
are the maximum length and the loopback value
77
-k max length max length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-N Does not perform virtual unrolling.
-c Performs completeness check.
gen ltlspec sbmc - Dumps into one or more dimacs files the given Command
LTL specification, or all LTL specifications if no formula is given.
Generation and dumping parameters are the maximum bound and
the loopback values.
78
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1” .
-o filename filename is the name of the dumped dimacs file. It may con-
tain special symbols which will be macro-expanded to form
the real file name. Possible symbols are:
• @F: model name with path part.
• @f: model name without path part.
• @k: current problem bound.
• @l: current loopback value.
• @n: index of the currently processed formula in the prop-
erty database.
• @@: the ‘@’ character.
• Any natural number, but less than the current value of the variable bmc length. In
this case the loop point is absolute.
• Any negative number, but greater than or equal to -bmc length. In this case specified
loop is the loop length.
• The symbol ’X’, which means “no loopback”.
• The symbol ’*’, which means “any possible loopbacks”.
79
• @k The currently generated problem length.
• @l The currently generated problem loopback value.
• @@ The ‘@’ character.
check invar bmc - Generates and solves the given invariant, or all Command
invariants if no formula is given
80
-o filename filename is the name of the dumped dimacs file. It may con-
tain special symbols which will be macro-expanded to form
the real file name. Possible symbols are:
• @F: model name with path part
• @f: model name without path part
• @n: index of the currently processed formula in the prop-
erties database
• @@: the ‘@’ character
gen invar bmc - Generates the given invariant, or all invariants if Command
no formula is given
check invar bmc inc - Generates and solves the given invariant, Command
or all invariants if no formula is given, using incremental algo-
rithms
81
There are two incremental algorithms which can be used: “Dual” and “ZigZag”. Both
algorithms are equally powerful, but may show different performance depending on a SAT
solver used and an invariant being proved. At the moment, the “Dual” algorithm cannot
be used if there are input variables in a given model. For additional information about
algorithms, consider [ES04].
Also, notice that during checking of invariants all the fairness conditions associated with
the model are ignored.
See variable use coi size sorting for changing properties verification order.
Command Options:
-n index index is the numeric index of a valid INVAR specification
formula actually located in the property database. The va-
lidity of index value is checked out by the system.
-p "formula Checks the formula specified on the command-line.
[IN context]" context is the module instance name which the variables
in formula must be evaluated in.
-P "name" Checks the INVARSPEC property named name
-k max length max length is the maximum problem bound that can be
reached. Only natural numbers are valid values for this
option. If no value is given the environment variable
bmc length is considered instead.
-K step size Only for falsification: increment the search of
step size at a time. Must be greater than zero (1 by default).
-a alg alg specifies the algorithm to use. The value can be dual
or zigzag. If no value is given the environment variable
bmc inc invar alg is considered instead.
82
sat solver Environment Variable
The SAT solver’s name actually to be used. Default SAT solver is MiniSat. Depending
on the N U SMV configuration, also the Zchaff SAT solver can be available or not. Notice
that Zchaff and MiniSat are for non-commercial purposes only.. If no SAT solver has been
configured, BMC commands and environment variables will not be available.
bmc pick state - Picks a state from the set of initial states Command
83
-t "constraints" Performs a simulation in which computation is restricted
to states satisfying those constraints. The desired se-
quence of states could not exist if such constraints were too
strong or it may happen that at some point of the simulation
a future state satisfying those constraints doesn’t exist: in
that case a trace with a number of states less than steps
trace is obtained. Note: constraints must be enclosed
between double quotes " ". The expression can contain
next operators, and is NOT automatically shifted by one
state as done with option -c
-k steps Maximum length of the path according to the constraints.
The length of a trace could contain less than steps states:
this is the case in which simulation stops in an intermedi-
ate step because it may not exist any future state satisfying
those constraints. The default value is determined by the
default simulation steps environment variable
bmc inc simulate - Generates a trace of the model from 0 (zero) to Command
k
84
-t "constraints" Performs a simulation in which computation is restricted
to states satisfying those constraints. The desired se-
quence of states could not exist if such constraints were too
strong or it may happen that at some point of the simulation
a future state satisfying those constraints doesn’t exist: in
that case a trace with a number of states less than steps
trace is obtained. Note: constraints must be enclosed
between double quotes " ". The expression can contain
next operators, and is NOT automatically shifted by one
state as done with option -c
-k steps Maximum length of the path according to the constraints.
The length of a trace could contain less than steps states:
this is the case in which simulation stops in an intermedi-
ate step because it may not exist any future state satisfying
those constraints. The default value is determined by the
default simulation steps environment variable
AI: upper
check pslspec [-h] [-m | -o output-file] [-n number | -p case for
"psl-expr [IN context]" | -P "name"] ”bdd” in
Check psl properties using bdd-based model checking. the label
A psl-expr to be checked can be specified at command line using option -p. Alterna-
tively, option -n can be used for checking a particular formula in the property database. If
neither -n nor -p are used, all the PSLSPEC formulas in the database are checked.
See variable use coi size sorting for changing properties verification order.
Command Options:
-m Pipes the output generated by the command in process-
ing PSLSPECs to the program specified by the PAGER
shell variable if defined, else through the UNIX command
“more”.
85
-o output-file Writes the output generated by the command in processing
PSLSPEC s to the file output-file
-p "psl-expr A PSL formula to be checked. context is the module
[IN context]" instance name which the variables in psl-expr must be
evaluated in.
-n number Checks the PSL property with index number in the prop-
erty database.
-P name Checks the PSL property named name in the property
database.
86
-1 Generates a single bounded model checking problem with
fixed bound and loopback values, it does not iterate incre-
menting the value of the problem bound.
-k bmc length bmc length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1”. If no value is given the environment
variable bmc loopback is considered instead.
87
-n number Checks the PSL property with index number in the prop-
erty database.
-P name Checks the PSL property named name in the property
database.
-1 Generates a single bounded model checking problem with
fixed bound and loopback values, it does not iterate incre-
menting the value of the problem bound.
-k bmc length bmc length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1”. If no value is given the environment
variable bmc loopback is considered instead.
88
-o output-file Writes the output generated by the command in processing
PSLSPEC s to the file output-file
-p "psl-expr A PSL formula to be checked. context is the module
[IN context]" instance name which the variables in psl-expr must be
evaluated in.
-n number Checks the PSL property with index number in the prop-
erty database.
-P name Checks the PSL property named name in the property
database.
-g Dumps DIMACS version of bounded model checking prob-
lem into a file whose name depends on the system variable
bmc dimacs filename. This feature is not allowed in
combination of the option -i.
-1 Generates a single bounded model checking problem with
fixed bound and loopback values, it does not iterate incre-
menting the value of the problem bound.
-k bmc length bmc length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1”. If no value is given the environment
variable bmc loopback is considered instead.
89
See variable use coi size sorting for changing properties verification order.
Command Options:
-m Pipes the output generated by the command in process-
ing PSLSPECs to the program specified by the PAGER
shell variable if defined, else through the UNIX command
“more”.
-o output-file Writes the output generated by the command in processing
PSLSPEC s to the file output-file
-p "psl-expr A PSL formula to be checked. context is the module
[IN context]" instance name which the variables in psl-expr must be
evaluated in.
-n number Checks the PSL property with index number in the prop-
erty database.
-P name Checks the PSL property named name in the property
database.
-1 Generates a single bounded model checking problem with
fixed bound and loopback values, it does not iterate incre-
menting the value of the problem bound.
-k bmc length bmc length is the maximum problem bound to be checked.
Only natural numbers are valid values for this option. If no
value is given the environment variable bmc length is con-
sidered instead.
-l loopback The loopback value may be:
• a natural number in (0, max length-1). A positive sign
(‘+’) can be also used as prefix of the number. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• a negative number in (-1, -bmc length). In this case loop-
back is considered a value relative to max length. Any in-
valid combination of length and loopback will be skipped
during the generation/solving process.
• the symbol ‘X’, which means “no loopback”.
• the symbol ‘*’, which means “all possible loopbacks from
zero to length-1”. If no value is given the environment
variable bmc loopback is considered instead.
-c Performs completeness check.
-N Does not perform virtual unrolling.
pick state - Picks a state from the set of initial states Command
90
Chooses an element from the set of initial states, and makes it the current state
(replacing the old one). The chosen state is stored as the first state of a new trace ready to
be lengthened by steps states by the simulate command. The state can be chosen
according to different policies which can be specified via command line options. By
default the state is chosen in a deterministic way.
Command Options:
-v Verbosely prints out chosen state (all state and frozen vari-
ables, otherwise it prints out only the label t.1 of the state
chosen, where t is the number of the new trace, that is the
number of traces so far generated plus one).
-r Randomly picks a state from the set of initial states.
-i Enables the user to interactively pick up an initial state. The
user is requested to choose a state from a list of possible
items (every item in the list doesn’t show frozen and state
variables unchanged with respect to a previous item). If the
number of possible states is too high, then the user has to
specify some further constraints as “simple expression”.
-a Displays all state and frozen variables (changed and un-
changed with respect to a previous item) in an interactive
picking. This option works only if the -i options has been
specified.
-c "constraints" Uses constraints to restrict the set of initial states in
which the state has to be picked. constraints must be
enclosed between double quotes " ".
-s trace.state Picks state from trace.state label. A new simulation trace
will be created by copying prefix of the source trace up to
specified state.
Command Options:
-p Prints current generated trace (only those variables whose
value changed from the previous state).
91
-v Verbosely prints current generated trace (changed and un-
changed state and frozen variables).
-r Picks a state from a set of possible future states in a random
way.
-i Enables the user to interactively choose every state of the
trace, step by step. If the number of possible states is too
high, then the user has to specify some constraints as simple
expression. These constraints are used only for a single sim-
ulation step and are forgotten in the following ones. They
are to be intended in an opposite way with respect to those
constraints eventually entered with the pick state com-
mand, or during an interactive simulation session (when the
number of future states to be displayed is too high), that are
local only to a single step of the simulation and are forgotten
in the next one.
To improve readability of the list of the states which the user
must pick one from, each state is presented in terms of dif-
ference with respect of the previous one.
-a Displays all the state and frozen variables (changed and un-
changed) during every step of an interactive session. This
option works only if the -i option has been specified.
-c "constraints" Performs a simulation in which computation is restricted
to states satisfying those constraints. The desired se-
quence of states could not exist if such constraints were too
strong or it may happen that at some point of the simulation
a future state satisfying those constraints doesn’t exist: in
that case a trace with a number of states less than steps
trace is obtained. Note: constraints must be enclosed
between double quotes " ". The expression cannot contain
next operators, and is automatically shifted by one state in
order to constraint only the next steps
-t "constraints" Performs a simulation in which computation is restricted
to states satisfying those constraints. The desired se-
quence of states could not exist if such constraints were too
strong or it may happen that at some point of the simulation
a future state satisfying those constraints doesn’t exist: in
that case a trace with a number of states less than steps
trace is obtained. Note: constraints must be enclosed
between double quotes " ". The expression can contain
next operators, and is NOT automatically shifted by one
state as done with option -c
92
-k steps Maximum length of the path according to the constraints.
The length of a trace could contain less than steps states:
this is the case in which simulation stops in an intermedi-
ate step because it may not exist any future state satisfying
those constraints. The default value is determined by the
default simulation steps environment variable
93
trace number The (ordinal) identifier number of the trace to be printed.
This must be the last argument of the command. Omitting
the trace number causes the most recently generated trace to
be executed.
execute partial traces - Executes partial traces on the model FSM Command
3.7 Traces
A trace consists of an initial state, optionally followed by a sequence of states-inputs pairs
corresponding to a possible execution of the model. Apart, from the initial state, each pair
contains the inputs that caused the transition to the new state, and the new state itself. The
initial state has no such input values defined as it does not depend on the values of any of the
inputs. The values of any constants declared in DEFINE sections are also part of a trace. If
the value of a constant depends only on state and frozen variables then it will be treated as if it
is a state variable too. If it depends only on input variables then it will be treated as if it is an
input variable. If however, a constant depends upon both input and state/frozen variables and/or
NEXTed state variables, then it gets displayed in a separate “combinatorial” section. Since the
values of any such constants depend on one or more inputs, the initial state does not contain this
section either.
Traces are created by N U SMV when a formula is found to be false; they are also generated
as a result of a simulation (Section 3.5 [Simulation Commands], page 90) or partial trace
re-execution (Section 3.6 [Execution Commands], page 93). Each trace has a number, and the
94
states-inputs pairs are numbered within the trace. Trace n has states/inputs n.1, n.2, n.3, ”...”
where n.1 represents the initial state.
When Cone of Influence (COI) is enabled when generating a trace (e.g. when performing
model checking), the generated trace will contain only the relevant symbols (variables and DE-
FINEs) which are in the COI projected by the variables occurring in the property which is being
checked. The symbols which are left out of the COI, will be not visible in the generated trace,
as they do not occur in the problem encoded in the solving engine. Notice that when COI is
enabled, the generated trace may or may not be a valid counter-example trace for the original
model.
95
This determines whether traces are generated when needed. See also command line option
-dcx.
Shows the available plugins that can be used to display a trace which has been generated
by N U SMV, or that has been loaded with the read trace command. The plugin that is
used to read in a trace is also shown. The current default plugin is marked with “[D]”.
All the available plugins are displayed by default if no command options are given.
96
This determines which trace plugin will be used by default when traces that are generated
by N U SMV are to be shown. The values that this variable can take depend on which trace
plugins are installed. Use the command show plugins to see which ones are available.
The default value is 0.
Shows the traces currently stored in system memory, if any. By default it shows the last
generated trace, if any. Optional trace number can be followed by two indexes (from state,
to state), denoting a trace “slice”. Thus, it is possible to require printout only of an arbitrary
fragment of the trace (this can be helpful when inspecting very big traces).
If the XML Format Output plugin is being used to save generated traces to a file with the
intent of reading them back in again at a later date, then only one trace should be saved per
file. This is because the trace reader does not currently support multiple traces in one file.
97
Command Options:
-i filename Reads in a trace from the specified file. Note that the file
must only contain one trace. This option has been depre-
cated. Use the explicit filename argument instead.
-u Turns “undefined symbol” error into a warning. The loader
will ignore assignments to undefined symbols.
-s Turns “wrong section” error into a warning. The loader
will accept symbol assignment even if they are in a different
section than expected. Assignments will be silently moved
to appropriate section, i.e. misplaced assignments to state
symbols will be moved back to previous state section and
assignments to input/combinatorial symbols will be moved
forward to successive input/combinatorial section. Such a
way if a variable in a model was input and became state or
vice versa the existing traces still can be read and executed.
Loads a trace which has been previously output to a file with the XML Format Output
plugin. The model from which the trace was originally generated must be loaded and built
using the command “go” first.
Please note that this command is only available on systems that have the libxml2 XML
parser library installed.
There is also an xml loader which can read in any trace which has been output to a file by
the XML Format Printer. Note however that this loader is only available on systems that have
the libxml2 XML parser library installed.
Once a trace has been generated it is output to stdout using the currently selected plu-
gin. The command show traces can be used to output any previuosly generated, or loaded,
trace to a specific file.
There is the option of printing out the value of every variable in each state, or just those
which have changed from the previous one. The one that is used can be chosen by selecting the
appropriate trace plugin. The values of any constants which depend on both input and state or
frozen variables are printed next. It then prints the set of inputs which cause the transition to a
new state (if the model contains inputs), before actually printing the new state itself. The set of
inputs and the subsequent state have the same number associated to them.
98
In the case of a looping trace, if the next state to be printed is the same as the last state in the
trace, a line is printed stating that this is the point where the loop begins.
With the exception of the initial state, for which no input values are printed, the output syntax
for each state is as follows:
where INPUT VAR, STATE VAR and CONSTANT have the relevant module names
prepended to them (seperated by a period) with the exception of the module “main” .
The version of this plugin which only prints out those variables whose values have changed
is the initial default plugin used by N U SMV.
S1 C2 I2 S2 ... Cn In Sn
where S1 is the initial state, and Ii gives the values of the input variables which caused the
transition from state Si−1 to state Si . Ci gives the values of any combinatorial constants, where
the value depends on the values of the state or frozen variables in state Si−1 and the values of
input variables in state Si .
The variables in the model are placed along the other axis. Only the values of state and
frozen variables are displayed in the State row/column, only the values of input variables are
displayed in the Input row/column and only the values of combinatorial constants are displayed
in the Constants row/column. All remaining cells have ’-’ displayed.
The compact version has the states on the rows and no distinction is made between variables:
<?XML_VERSION_STRING?>
<counter-example type=TRACE_TYPE desc=TRACE_DESC>
99
</state>
<combinatorial id=i+1>
</combinatorial>
<input id=i+1>
</input>
</node>
</counter-example>
Note that for the last state in the trace, there is no input section in the node tags. This is
because the inputs section gives the new input values which cause the transition to the next state
in the trace. There is also no combinatorial section as this depends on the values of the inputs
and are therefore undefined when there are no inputs.
100
reordering is enabled with the shell command dynamic var ordering with the option -e,
and disabled with the -d option. Variable dynamic reorder can also be used to determine
whether dynamic reordering is active. If dynamic reordering is enabled it may be beneficial also
to disable BDD caching by unsetting variable enable sexp2bdd caching.
101
window2 converge:
window3 converge:
window4 converge: The window{2,3,4} method is iterated until no further
improvement is obtained.
group sift: This method is similar to symmetry sift, but uses
more general criteria to create groups.
group sift converge: The group sift method is iterated until no further im-
provement is obtained.
annealing: This method is an implementation of simulated annealing
for variable ordering. This method is potentially very slow.
genetic: This method is an implementation of a genetic algorithm
for variable ordering. This method is potentially very slow.
exact: This method implements a dynamic programming ap-
proach to exact reordering. It only stores one BDD at a
time. Therefore, it is relatively efficient in terms of mem-
ory. Compared to other reordering strategies, it is very
slow, and is not recommended for more than 16 boolean
variables.
linear: This method is a combination of sifting and linear
transformations.
linear conv: The linear method is iterated until no further improve-
ment is obtained.
dynamic var ordering - Deals with the dynamic variable order- Command
ing.
Command Options:
-d Disable dynamic ordering from triggering automatically.
-e <method> Enable dynamic ordering to trigger automatically whenever
a certain threshold on the overall BDD size is reached.
<method> must be one of the following:
• sift: Moves each variable throughout the order to find an
optimal position for that variable (assuming all other vari-
ables are fixed). This generally achieves greater size re-
ductions than the window method, but is slower.
102
• random: Pairs of variables are randomly chosen, and
swapped in the order. The swap is performed by a series of
swaps of adjacent variables. The best order among those
obtained by the series of swaps is retained. The number of
pairs chosen for swapping equals the number of variables
in the diagram.
• random pivot: Same as random, but the two variables
are chosen so that the first is above the variable with the
largest number of nodes, and the second is below that vari-
able. In case there are several variables tied for the maxi-
mum number of nodes, the one closest to the root is used.
• sift converge: The sift method is iterated until no further
improvement is obtained.
• symmetry sift: This method is an implementation of sym-
metric sifting. It is similar to sifting, with one addition:
Variables that become adjacent during sifting are tested
for symmetry. If they are symmetric, they are linked in
a group. Sifting then continues with a group being moved,
instead of a single variable.
• symmetry sift converge: The symmetry sift method is
iterated until no further improvement is obtained.
• window{2,3,4}: Permutes the variables within windows
of ”n” adjacent variables, where ”n” can be either 2, 3 or
4, so as to minimize the overall BDD size.
• window{2,3,4} converge: The window{2,3,4} method is
iterated until no further improvement is obtained.
• group sift: This method is similar to symmetry sift, but
uses more general criteria to create groups.
• group sift converge: The group sift method is iterated
until no further improvement is obtained.
• annealing: This method is an implementation of simu-
lated annealing for variable ordering. This method is po-
tentially very slow.
• genetic: This method is an implementation of a genetic
algorithm for variable ordering. This method is potentially
very slow.
• exact: This method implements a dynamic programming
approach to exact reordering. It only stores a BDD at a
time. Therefore, it is relatively efficient in terms of mem-
ory. Compared to other reordering strategies, it is very
slow, and is not recommended for more than 16 boolean
variables.
• linear: This method is a combination of sifting and linear
transformations.
• linear converge: The linear method is iterated until no
further improvement is obtained.
-f <method> Force dynamic ordering to be invoked immediately. The val-
ues for <method> are the same as in option -e.
103
During conversion of symbolic expressions to ADD and BDD representations the re-
sults of evaluations are normally cached (see additionally the environment variable
enable sexp2bdd caching). This allows to save time by avoid the construction of
BDD for the same symbolic expression several time.
In some situations it may be preferable to clean the cache and free collected ADD and
BDD. This operation can be done, for example, to free some memory. Another possible
reason is that dynamic reordering may modify all existing BDDs, and cleaning the cache
thereby freeing the BDD may speed up the reordering.
This command is designed specifically to free the internal cache of evaluated expressions
and their ADDs and BDDs. Note that only the cache of symbolic-expression-to-bdd eval-
uator is freed. BDDs of variables, constants and expressions collected in BDD FSM or
anywhere else are not freed.
print bdd stats - Prints out the BDD statistics and parameters Command
set bdd parameters - Creates a table with the value of all cur- Command
rently active NuSMV flags and change accordingly the configurable
parameters of the BDD package.
104
Applies the variables table of the N U SMV environnement to the BDD package, so the
user can set specific BDD parameters to the given value. This command works in con-
junction with the print bdd stats and set commands. print bdd stats first
prints a report of the parameters and statistics of the current bdd manager. By using the
command set, the user may modify the value of any of the parameters of the underlying
BDD package. The way to do it is by setting a value in the variable BDD.parameter
name where parameter name is the name of the parameter exactly as printed by the
print bdd stats command.
Command Options:
-s Prints the BDD parameter and statistics after the
modification.
Command Options:
<name> Alias
<string> Command string
It is possible to create aliases that take arguments by using the history substitution
mechanism. To protect the history substitution character ‘ %’ from immediate expansion,
it must be preceded by a ‘ \’ when entering the alias.
For example:
105
NuSMV> alias read "read model -i %:1.smv ; set
input order file %:1.ord"
NuSMV> read short
will create an alias ‘read’, execute ”read model -i short.smv; set input order file
short.ord”. And again:
NuSMV> alias echo2 "echo Hi ; echo %* !"
NuSMV> echo2 happy birthday
will print:
Hi
happy birthday !
CAVEAT: Currently there is no check to see if there is a circular dependency in the alias
definition. e.g.
NuSMV> alias foo "echo print bdd stats; foo"
creates an alias which refers to itself. Executing the command foo will result an infinite
loop during which the command print bdd stats will be executed.
106
Command Options:
<num> Lists the last <num> events. Lists the last 30 events if
<num> is not specified.
History Substitution:
The history substitution mechanism is a simpler version of the csh history substitution
mechanism. It enables you to reuse words from previously typed commands.
The default history substitution character is the ‘%’ (‘!’ is default for shell escapes, and
‘#’ marks the beginning of a comment). This can be changed using the set command. In
this description ’%’ is used as the history char. The ‘%’ can appear anywhere in a line.
A line containing a history substitution is echoed to the screen after the substitution takes
place. ‘%’ can be preceded by a ‘ı́n order to escape the substitution, for example, to enter
a ‘%’ into an alias or to set the prompt.
Each valid line typed at the prompt is saved. If the history variable is set (see help page
for set), each line is also echoed to the history file. You can use the history command
to list the previously typed commands.
Substitutions:
At any point in a line these history substitutions are available.
Command Options:
%:0 Initial word of last command.
%:n n-th argument of last command.
%$ Last argument of last command.
%* All but initial word of last command.
%% Last command.
%stuf Last command beginning with “stuf”.
%n Repeat the n-th command.
%-n Repeat the n-th previous command.
boldbnew Replace “old” with “new” in previous command. Trailing
spaces are significant during substitution. Initial spaces are
not significant.
Command Options:
-s Frees all the used memory before quitting. This is slower,
and it is used for finding memory leaks.
107
-x Leaves immediately. Skip all the cleanup code, leaving it to
the OS. This can save quite a long time.
reset [-h]
Resets the whole system, in order to read in another model and to perform verification on
it.
Command Options:
<name> Variable name
<value> Value to be assigned to the variable.
Using the set command to set a variable, without giving any explicit value is allowed,
and sets the variable to 1:
NuSMV> set foo
will set the variable foo to 1.
Interpolation of variables is allowed when using the set command. The variables are
referred to with the prefix of ’$’. So for example, what follows can be done to check the
value of a set variable:
NuSMV> set foo bar
NuSMV> echo $foo
bar
The last line “bar” will be the output produced by N U SMV. Variables can be extended by
using the character ‘:’ to concatenate values. For example:
NuSMV> set foo bar
NuSMV> set foo $foo:foobar
NuSMV> echo $foo
bar:foobar
The variable foo is extended with the value foobar . Whitespace characters may
be present within quotes. However, variable interpolation lays the restriction that the
characters ’:’ and ’/’ may not be used within quotes. This is to allow for recursive
interpolation. So for example, the following is allowed
NuSMV> set "foo bar" this
NuSMV> echo $"foo bar"
this
108
But in the following, the value of the variable foo/bar will not be interpreted correctly:
NuSMV> set "foo/bar" this
NuSMV> echo $"foo/bar"
foo/bar
If a variable is not set by the set command, then the variable is returned unchanged.
Different commands use environment information for different purposes. The command
interpreter makes use of the following parameters:
Command Options:
autoexec Defines a command string to be automatically executed af-
ter every command processed by the command interpreter.
This is useful for things like timing commands, or tracing
the progress of optimization.
open path “open path” (in analogy to the shell-variable PATH) is a list
of colon-separated strings giving directories to be searched
whenever a file is opened for read. Typically the current di-
rectory (.) is the first item in this list. The standard system
library (typically NuSMV LIBRARY PATH) is always im-
plicitly appended to the current path. This provides a con-
venient short-hand mechanism for reaching standard library
files.
nusmv stderr Standard error (normally ( stderr)) can be re-directed to a
file by setting the variable nusmv stderr.
nusmv stdout Standard output (normally ( stdout)) can be re-directed to a
file by setting the variable nusmv stdout.
Arguments on the command line after the filename are remembered but not evaluated.
Commands in the script file can then refer to these arguments using the history substitution
mechanism. EXAMPLE:
Contents of test.scr:
Typing source test.scr short.smv on the command line will execute the
sequence
109
read model -i short.smv
flatten hierarchy
build variables
build model
compute fairness
(In this case %:0 gets source, %:1 gets test.scr, and %:2 gets short.smv.) If
you type alias st source test.scr and then type st short.smv bozo,
you will execute
because bozo was the second argument on the last command line typed. In other
words, command substitution in a script file depends on how the script file was invoked.
Switches passed to a command are also counted as positional parameters. Therefore, if
you type st -x short.smv bozo, you will execute
To pass the -x switch (or any other switch) to source when the script uses posi-
tional parameters, you may define an alias. For instance, alias srcx source
-x.
See the variable on failure script quits for further information.
time [-h]
Prints the processor time used since the last invocation of the time command, and the
total processor time used since N U SMV was started.
110
unset - Unsets an environment variable Command
usage [-h]
Prints a formatted dump of processor-specific usage statistics. For Berkeley Unix, this
includes all of the information in the getrusage() structure.
Command Options:
<file name> File to be searched
111
filec Environment Variable
Enables file completion a la “csh”. If the system has been compiled with the “readline”
library, the user is able to perform file completion by typing the <TAB> key (in a way
similar to the file completion inside the “bash” shell). If the system has not been compiled
with the “readline” library, a built-in method to perform file completion a la “csh” can be
used. This method is enabled with the ‘set filec’ command. The “csh” file comple-
tion method can be also enabled if the “readline” library has been used. In this case the
features offered by “readline” will be disabled.
112
Figure 3.1: The dependency among N U SMV commands.
113
Chapter 4
When the -int option is not specified, N U SMV runs as a batch program, in the style of SMV,
performing (some of) the steps described in previous section in a fixed sequence.
The program described in input-file is processed, and the corresponding finite state machine
is built. Then, if input-file contains formulas to verify, their truth in the specified structure is
evaluated. For each formula which is not true a counterexample is printed.
The batch mode can be controlled with the following command line options:
N U SMV [-h | -help] [-v vl] [-int] [[-source script_file | -load script_file]]
[-s] [-old] [-old_div_op] [-smv_old]
[-disable_syntactic_checks] [-keep_single_value_vars]
[-disable_daggifier] [-dcx] [-cpp] [-pre pps] [-ofm
fm file] [-obm bm file] [-lp] [-n idx] [-is]
[-ic] [-ils] [-ips] [-ii] [-ctt] [[-f] [-r]]|[-df] [-flt] [-AG]
[-coi] [-i iv file] [-o ov file] [-t
tv file] [-reorder] [-dynamic] [-m method]
[-disable_sexp2bdd_caching] [-bdd_soh heuristics]
[[-mono]|[-thresh cp t]|[-cp cp t]|[-iwls95
cp t]] [-noaffinity] [-iwls95preorder] [-bmc] [-bmc length
k] [-sat solver name] [-sin on|off] [-rin on|off]
[-ojeba algorithm] [ input-file]
where the meaning of the options is described below. If input-file is not provided in batch mode,
then the model is read from standard input.
114
-help
-h Prints the command line help.
-v verbose-level Enables printing of additional information on the internal
operations of N U SMV. Setting verbose-level to 1 gives the
basic information. Using this option makes you feel better,
since otherwise the program prints nothing until it finishes,
and there is no evidence that it is doing anything at all. Set-
ting the verbose-level higher than 1 enables printing of much
extra information.
-int Enables interactive mode
-source sc file Executes NuSMV commands from file sc file
-load sc file same as -source (deprecated)
-s Avoids to load the N U SMV commands con-
tained in ∼/.nusmvrc or in .nusmvrc or in
${NuSMV LIBRARY PATH }/master.nusmvrc.
Keeps backward compatibility with older versions of
-old
NuSMV. This option disables some new features like type
checking and dumping of new extension to SMV files. In ad-
dition, if enabled, case conditions also accepts “1” which
is semantically equivalent to the truth value “TRUE”. This
backward compatibility feature has been added in N U SMV
2.5.1 in order to help porting of old SMV models. Infact,
in versions older than 2.5.1, it was pretty common to use 1
in case conditions expressions. For an example please see
section 2.2.3
-old div op Enables the old semantics of “/” and “mod” operations
(from N U SMV 2.3.0) instead of ANSI C semantics.
-disable syntactic Disables all syntactic checks that will be performed when
checks flattening the input model. Warning: If the model is not
well-formed, N U SMV may result in unpredictable results,
use this option at your own risk.
-disable daggifier Disables the daggification feature of model dumping
-keep single Does not convert variables that have only one single possible
value vars value into constant DEFINEs
-dcx Disables the generation of counter-examples for prop-
erties that are proved to be false. See also variable
counter examples
-cpp Runs pre-processor on SMV files before any of those spec-
ified with the -pre option. The user can set his own
preprocessor by setting system variables pp cpp path and
pp m4 path.
115
-pre pps Specifies a list of pre-processors to run (in the order given)
on the input file before it is parsed by N U SMV. Note that if
the -cpp command is used, then the pre-processors speci-
fied by this command will be run after the input file has been
pre-processed by that pre-processor. pps is either one sin-
gle pre-processor name (with or without double quotes) or
it is a space-separated list of pre-processor names contained
within double quotes.
-ofm fm file prints flattened model to file fn file
-obm bm file Prints boolean model to file bn file
-lp Lists all properties in SMV model
-n idx Specifies which property of SMV model should be checked
-is Does not check SPEC properties. Sets to “1” the
ignore spec environment variable.
-ic Does not check COMPUTE properties. Sets to “1” the
ignore compute environment variable.
-ils Does not check LTLSPEC properties. Sets to “1” the
ignore ltlspec environment variable.
-ips Does not check PSLSPEC properties. Sets to “1” the
ignore pslspec environment variable.
-ii Does not check INVARSPEC properties. Sets to “1” the
ignore invariant environment variable.
-ctt Checks whether the transition relation is total.
-f Computes the set of reachable states before evaluating CTL
expressions. Since NuSMV-2.4.0 this option is set by de-
fault, and it is provided for backward compatibility only. See
also option -df.
-r Prints the number of reachable states before exiting. If
the -f option is not used, the set of reachable states is
computed.
-df Disable the computation of the set of reachable states. This
option is provided since NuSMV-2.4.0 to prevent the com-
putation of reachable states that are otherwise computed by
default.
-flt Forces the computation of the set of reachable states for
the tableau resulting from BDD-based LTL model check-
ing (command check ltlspec). If the option -flt is
not specified (default), the resulting tableau will inherit the
computation of the reachable states from the model, if en-
abled. If the option -flt is specified, the reachable states
set will be calculated for the model and for the tableau
resulting from LTL model checking. This might improve
performances of the command check ltlspec, but may
also lead to a dramatic slowing down. This options has ef-
fect only when the calculation of reachable states is enabled
(see -f).
116
-AG Verifies only AG formulas using an ad hoc algorithm
(see documentation for the ag only search environment
variable).
-coi Enables cone of influence reduction. Sets to “1” the
cone of influence environment variable. We remark
that, when cone of influence reduction is enabled, a counter-
example trace for a property that does not hold may not be a
valid counter-example trace for the original model. We refer
the reader to the Frequently Asked Questions (FAQ) [FAQ].
-i iv file Reads the variable ordering from file iv file.
-o ov file Writes the variable ordering to file ov file.
-t tv file Reads a variable list from file tv file. This list defines
the order for clustering the transition relation. This fea-
ture has been provided by Wendy Johnston, University of
Queensland. The results of Johnston’s et al. research have
been presented at FM 2006 in Hamilton, Canada. See
[WJKWLvdBR06].
-reorder Enables variable reordering after having checked all the
specification if any.
-dynamic Enables dynamic reordering of variables
-m method Uses method when variable ordering is enabled. Pos-
sible values for method are those allowed for the
reorder method environment variable (see Section 3.9
[Interface to DD package], page 100).
-disable sexp2bdd caching
Sets the default value of environment variable
enable bdd cache to 0, i.e. the evaluation of symbolic
expression to ADD and BDD representations are not
cached. See command clean sexp2bdd cache for
reasons of why BDD cache should be disabled sometimes.
-bdd soh heuristics Sets the default value of environment variable
bdd static order heuristics to heuristics,
i.e. the option sets up the heuristics to be used to
compute BDD ordering statically by analyzing the
input model. See the documentation about variable
bdd static order heuristics on page 53 for more
details.
-mono Enables monolithic transition relation
-thresh cp t conjunctive partitioning with threshold of each partition set
to cp t (DEFAULT, with cp t=1000)
-cp cp t DEPRECATED: use thresh instead.
-iwls95 cp t Enables Iwls95 conjunctive partitioning and sets the thresh-
old of each partition to cp t
-noaffinity Disables affinity clustering
-iwls95preoder Enables Iwls95CP preordering
117
-bmc Enables BMC instead of BDD model checking (works only
for LTL properties and PSL properties that can be translated
into LTL)
-bmc length k Sets bmc length variable, used by BMC
-sat solver name Sets sat solver variable, used by BMC so select the sat
solver to be used.
-sin on,off Enables (on) or disables (off) Sexp inlining, by setting sys-
tem variable sexp inlining. Default value is off.
-rin on,off Enables (on) or disables (off) RBC inlining, by setting sys-
tem variable rbc inlining. Default value is on. The
idea about inlining was taken from [ABE00] by Parosh Aziz
Abdulla, Per Bjesse and Niklas Eén.
-ojeba algorithm Sets the algorthim used for BDD-based language emptiness
of Büchi fair transition systems by setting system variable
oreg justice emptiness bdd algorithm (de-
fault is EL bwd). The available algorithms are: EL bwd
EL fwd
118
Bibliography
119
[FAQ] Frequently Asked Questions (FAQ). Available at http://nusmv.fbk.
eu/faq.html or within the N U SMV distribution package.
[HKQ03] T. A. Henzinger, O. Kupferman, and S. Qadeer. From Pre-historic to Post-
modern symbolic model checking. Formal Methods in System Design,
23(3):303–327, 2003.
[KHL05] T. Junttila K. Heljanko and T. Latvala. Incremental and complete bounded
model checking for full PLTL. In K. Etessami and S. K. Rajamani, ed-
itors, Computer Aided Verification, 17th International Conference CAV
2005, number 3576 in Lecture Notes in Computer Science, pages 98–111.
Springer, 2005.
[LBHJ05] T. Latvala, A. Biere, K. Heljanko, and T. Junttila. Simple is better: Efficient
bounded model checking for past LTL. In R. Cousot, editor, Verification,
Model Checking, and Abstract Interpretation, 6th International Conference
VMCAI 2005, number 3385 in Lecture Notes in Computer Science, pages
380–395. Springer, 2005.
[Mar85] A.J. Martin. The design of a self-timed circuit for distributed mutual exclu-
sion. In In H. Fuchs and W.H. Freeman, editors, Proceedings of the 1985
Chapel Hill Conference on VLSI, pages 245–260, New York, 1985.
[McM92] K.L. McMillan. The smv system – draft. In Available at http://www.
cs.cmu.edu/˜modelcheck/smv/smvmanual.r2.2.ps, 1992.
[McM93] K.L. McMillan. Symbolic model checking. In Kluwer Academic Publ.,
1993.
[MHS00] Moon, Hachtel, and Somenzi. Border-block tringular form and conjunction
schedule in image computation. In FMCAD, 2000.
[PSL] Language Front-End for Sugar Foundation Language.
http://www.haifa.il.ibm.com/projects/verification/sugar/parser.html.
[psl03] Accellera, Property Specification Language - Reference Manual - Version
1.01. http://www.eda.org/vfv/docs/psl lrm-1.01.pdf, April 2003.
[RAP+ 95] R. K. Ranjan, A. Aziz, B. Plessier, C. Pixley, and R. K. Brayton. Effi-
cient bdd algorithms for fsm synthesis and verification. In In IEEE/ACM
Proceedings International Workshop on Logic Synthesis, Lake Tahoe (NV),
May 1995.
[sfVS96] ”VIS: A system for Verification and The VIS Group Synthesis”. Proceed-
ings of the 8th international conference on computer aided verification,
p428-432. In Springer Lecture Notes in Computer Science, 1102, Edited
by R. Alur and T. Henzinger, New Brunswick, NJ, 1996.
[She04] Daniel Sheridan. The optimality of a fast cnf conversion and its use with
sat. In SAT, 2004.
[Som98] F. Somenzi. Cudd: Cu decision diagram package — release 2.2.0. In De-
partment of Electrical and Computer Engineering — University of Colorado
at Boulder, May 1998.
[WJKWLvdBR06] P. A. Strooper W. Johnston K. Winter L. van den Berg and P. Robinson.
Model-based variable and transition orderings for efficient symbolic model
checking. In FM 2006: Formal Methods, number 4085 in Lecture Notes in
Computer Science, pages 524–540. Springer Berlin, 2006.
120
Appendix A
The N U SMV language is mostly source compatible with the original version of SMV distributed
at Carnegie Mellon University from which we started. In this appendix we describe the most
common problems that can be encountered when trying to use old CMU SMV programs with
N U SMV.
The main problem is variable names in old programs that conflicts with new reserved key-
words. The list of the new reserved keywords of N U SMV w.r.t. CMU SMV is the following:
The IMPLEMENTS, INPUT, OUTPUT statements are not no longer supported by N U SMV.
N U SMV differs from CMU SMV also in the controls that are performed on the input for-
mulas. Several formulas that are valid for CMU SMV, but that have no clear semantics, are not
accepted by N U SMV.
In particular:
• It is no longer possible to write formulas containing nested‘next’.
TRANS
next(alpha & next(beta | next(gamma))) -> delta
121
• It is no longer possible to write formulas containing ‘next’ in the right hand side of
“normal” and “init” assignments (they are allowed in the right hand side of “next” assign-
ments), and with the statements ‘INVAR’ and ‘INIT’.
INVAR
next(alpha) & beta
INIT
next(beta) -> alpha
ASSIGN
delta := alpha & next(gamma); -- normal assignments
init(gamma) := alpha & next(delta); -- init assignments
• It is no longer possible to write ‘SPEC’, ‘FAIRNESS’ statements containing ‘next’.
FAIRNESS
next(running)
SPEC
next(x) & y
• The check for circular dependencies among variables has been done more restrictive. We
say that variable x depends on variable y if x := f(y). We say that there is a circular
dependency in the definition of x if:
In the case of circular dependencies among variables there is no fixed order in which
we can compute the involved variables. Avoiding circular dependencies among variables
guarantee that there exists an order in which the variables can be computed. In N U SMV
circular dependencies are not allowed.
In CMU SMV the test for circular dependencies is able to detect circular dependencies
only in “normal” assignments, and not in “next” assignments. The circular dependencies
check of N U SMV has been extended to detect circularities also in “next” assignments.
For instance the following fragment of code is accepted by CMU SMV but discarded by
N U SMV.
MODULE main
VAR
y : boolean;
x : boolean;
ASSIGN
next(x) := x & next(y);
next(y) := y & next(x);
Another difference between N U SMV and CMU SMV is in the variable order file. The vari-
able ordering file accepted by N U SMV can be partial and can contain variables not declared in
the model. Variables listed in the ordering file but not declared in the model are simply discarded.
The variables declared in the model but not listed in the variable file provided in input are created
at the end of the given ordering following the default ordering. All the ordering files generated
by CMU SMV are accepted in input from N U SMV but the ordering files generated by N U SMV
may be not accepted by CMU SMV. Notice that there is no guarantee that a good ordering for
CMU SMV is also a good ordering for N U SMV. In the ordering files for N U SMV, identifier
process selector can be used to control the position of the variable that encodes process
selection. In CMU SMV it is not possible to control the position of this variable in the ordering;
it is hard-coded at the top of the ordering. A further difference about variable ordering consists
in the fact that in N U SMV it is allowed to specify single bits of scalar variables. In the example:
122
VAR x : 0..7;
N U SMV will create three variables x.0, x.1 and x.2 that can be explicitly mentioned in
the variable ordering file to fine control their ordering.
123
Appendix B
Typing Rules
This appendix gives the explicit formal typing rules for N U SMV’s input language, as well as
notes on implicit conversion and casting.
In the following, an atomic constant is defined as being any sequence of characters starting
with a character in the set {A-Za-z } and followed by a possible empty sequence of characters
from the set {A-Za-z0-9 $#-\}. An integer is any whole number, positive or negative.
B.1 Types
The main types recognised by N U SMV are as follows:
boolean
integer
symbolic enum
integers-and-symbolic enum
boolean set
integer set
symbolic set
integers-and-symbolic set
unsigned word[N] (where N is any whole number ≥ 1)
signed word[N] (where N is any whole number ≥ 1)
For more detalied description of existing types see Section 2.1 [Types], page 7.
124
unsigned word[1]
integer symbolic enum
unsigned word[2]
boolean ↓ ↓
integers-and-symbolic enum unsigned word[3]
...
signed word[1]
integer set symbolic set
signed word[2]
boolean set ↓ ↓
integers-and-symbolic set signed word[3]
...
Constants
125
Arithmetic Operators
- : integer → integer
: unsigned word[N] → unsigned word[N]
: signed word[N] → signed word[N]
+, -, /, * : integer * integer → integer
: unsigned word[N] * unsigned word[N] → unsigned word[N]
: signed word[N] * signed word[N] → signed word[N]
mod : integer * integer → integer
: unsigned word[N] * unsigned word[N] → unsigned word[N]
: signed word[N] * signed word[N] → signed word[N]
For operations on words, the result is taken modulo 2N
>, <, >=, <= : integer * integer → boolean
: unsigned word[N] * unsigned word[N] → boolean
: signed word[N] * signed word[N] → boolean
Logic Operators
Bit-Wise Operators
126
Set Operators
condi must be of type boolean. If one of resulti is of a set type then all other resultk are
converted to their counterpart set types. The overall type of the expression is such a minimal
type that each resulti can be implicitly converted to.
Formula Operators
127
Miscellaneous Operators
128
Appendix C
Production Rules
This appendix contains the syntactic production rules for writing a N U SMV program.
Identifiers
identifier ::
identifier_first_character
| identifier identifier_consecutive_character
identifier_first_character :: one of
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z _
identifier_consecutive_character ::
identifier_first_character
| digit
| one of $ # -
digit :: one of 0 1 2 3 4 5 6 7 8 9
Note that there are certain reserved keyword which cannot be used as identifiers (see page
6).
variable_identifier :: complex_identifier
Complex Identifiers
complex_identifier ::
identifier
| complex_identifier . identifier
| complex_identifier [ simple_expression ]
| self
Integer Numbers
integer_number ::
129
- digit
| digit
| integer_number digit
Constants
constant ::
boolean_constant
| integer_constant
| symbolic_constant
| word_constant
| range_constant
boolean_constant :: one of
FALSE TRUE
integer_constant :: integer_number
symbolic_constant :: identifier
word_sign_specifier :: one of
u s
word_base :: b | B | o | O | d | D | h | H
word_value ::
hex_digit
| word_value hex_digit
| word_value
hex_digit :: one of
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
Note that there are some additional restrictions on the exact format of word constants (see
page 11).
range_constant ::
integer_number .. integer_number
Basic Expressions
basic_expr ::
constant -- a constant
| variable_identifier -- a variable identifier
| define_identifier -- a define identifier
| ( basic_expr )
| abs basic expr -- absolute value
| max ( basic expr , basic expr ) -- max
| min ( basic expr , basic expr ) -- min
| ! basic_expr -- logical/bitwise NOT
| basic_expr & basic_expr -- logical/bitwise AND
| basic_expr | basic_expr -- logical/bitwise OR
130
| basic_expr xor basic_expr -- logical/bitwise exclusive OR
| basic_expr xnor basic_expr -- logical/bitwise NOT xor
| basic_expr -> basic_expr -- logical/bitwise implication
| basic_expr <-> basic_expr -- logical/bitwise equivalence
| basic_expr = basic_expr -- equality
| basic_expr != basic_expr -- inequality
| basic_expr < basic_expr -- less than
| basic_expr > basic_expr -- greater than
| basic_expr <= basic_expr -- less than or equal
| basic_expr >= basic_expr -- greater than or equal
| - basic_expr -- unary minus
| basic_expr + basic_expr -- integer addition
| basic_expr - basic_expr -- integer subtraction
| basic_expr * basic_expr -- integer multiplication
| basic_expr / basic_expr -- integer division
| basic_expr mod basic_expr -- integer remainder
| basic_expr >> basic_expr -- bit shift right
| basic_expr << basic_expr -- bit shift left
| basic_expr [ index ] -- index subscript
| basic_expr [ integer_number : integer_number ]
-- word bits selection
| basic_expr :: basic_expr -- word concatenation
| word1 ( basic_expr )
-- boolean to word[1] convertion
| bool ( basic_expr )
-- word[1] and integer to boolean convertion
| toint ( basic_expr )
-- word[N] and boolean to integer convertion
| signed ( basic_expr )
-- unsigned to signed word convertion
| unsigned ( basic_expr )
-- signed to unsigned word convertion
| extend ( basic_expr , basic_expr)
-- word width increase
| resize ( basic_expr , basic_expr)
-- word width resizing
| basic_expr union basic_expr
-- union of set expressions
| { set_body_expr } -- set expression
| basic_expr in basic_expr -- inclusion expression
| basic_expr ? basic_expr : basic_expr
-- if-then-else expression
| count ( basic_expr_list )
-- count of TRUE boolean expressions
| case_expr -- case expression
| next ( basic_expr ) -- next expression
basic_expr_list ::
basic_expr
| basic_expr_list , basic_expr
set_body_expr ::
basic_expr
| set_body_expr , basic_expr
case_body ::
131
basic_expr : basic_expr ;
| case_body basic_expr : basic_expr ;
Simple Expression
simple_expr :: basic_expr
Next Expression
next_expr :: basic_expr
Type Specifier
type_specifier ::
simple_type_specifier
| module_type_spicifier
simple_type_specifier ::
boolean
| word [ integer_number ]
| unsigned word [ integer_number ]
| signed word [ integer_number ]
| { enumeration_type_body }
| integer_number .. integer_number
| array integer_number .. integer_number
of simple_type_specifier
enumeration_type_body ::
enumeration_type_value
| enumeration_type_body , enumeration_type_value
enumeration_type_value ::
symbolic_constant
| integer_number
parameter_list ::
simple_expr
| parameter_list , simple_expr
132
frozenvar_declaration :: FROZENVAR simple_var_list
DEFINE Declaration
define_declaration :: DEFINE define_body
CONSTANTS Declaration
constants_declaration :: CONSTANTS constants_body ;
constants_body :: identifier
| constants_body , identifier
ASSIGN Declaration
assign_constraint :: ASSIGN assign_list
assign_list :: assign ;
| assign_list assign ;
assign ::
complex_identifier := simple_expr
| init ( complex_identifier ) := simple_expr
| next ( complex_identifier ) := next_expr
TRANS Statement
trans_constraint :: TRANS next_expr [;]
INIT Statement
init_constrain :: INIT simple_expr [;]
INVAR Statement
invar_constraint :: INVAR simple_expr [;]
Module Declarations
module :: MODULE identifier [(module_parameters)] [module_body]
module_parameters ::
identifier
| module_parameters , identifier
module_body ::
133
module_element
| module_body module_element
module_element ::
var_declaration
| ivar_declaration
| frozenvar_declaration
| define_declaration
| constants_declaration
| assign_constraint
| trans_constraint
| init_constraint
| invar_constraint
| fairness_constraint
| ctl_specification
| invar_specification
| ltl_specification
| compute_specification
| isa_declaration
ISA Declaration
isa_declaration :: ISA identifier
Warning: this is a deprecated feature and will eventually be removed from N U SMV. Use
module instances instead.
CTL Specification
ctl_specification :: SPEC ctl_expr ;
ctl_expr ::
simple_expr -- a simple boolean expression
| ( ctl_expr )
| ! ctl_expr -- logical not
| ctl_expr & ctl_expr -- logical and
| ctl_expr | ctl_expr -- logical or
| ctl_expr xor ctl_expr -- logical exclusive or
| ctl_expr xnor ctl_expr -- logical NOT exclusive or
| ctl_expr -> ctl_expr -- logical implies
| ctl_expr <-> ctl_expr -- logical equivalence
| EG ctl_expr -- exists globally
| EX ctl_expr -- exists next state
| EF ctl_expr -- exists finally
| AG ctl_expr -- forall globally
| AX ctl_expr -- forall next state
| AF ctl_expr -- forall finally
| E [ ctl_expr U ctl_expr ] -- exists until
| A [ ctl_expr U ctl_expr ] -- forall until
INVAR Specification
invar_specification :: INVARSPEC simple_expr ;
This is equivalent to
134
SPEC AG simple_expr ;
LTL Specification
ltl_specification :: LTLSPEC ltl_expr [;]
ltl_expr ::
simple_expr -- a simple boolean expression
| ( ltl_expr )
| ! ltl_expr -- logical not
| ltl_expr & ltl_expr -- logical and
| ltl_expr | ltl_expr -- logical or
| ltl_expr xor ltl_expr -- logical exclusive or
| ltl_expr xnor ltl_expr -- logical NOT exclusive or
| ltl_expr -> ltl_expr -- logical implies
| ltl_expr <-> ltl_expr -- logical equivalence
-- FUTURE
| X ltl_expr -- next state
| G ltl_expr -- globally
| F ltl_expr -- finally
| ltl_expr U ltl_expr -- until
| ltl_expr V ltl_expr -- releases
-- PAST
| Y ltl_expr -- previous state
| Z ltl_expr -- not previous state not
| H ltl_expr -- historically
| O ltl_expr -- once
| ltl_expr S ltl_expr -- since
| ltl_expr T ltl_expr -- triggered
rtctl_expr ::
ctl_expr
| EBF range rtctl_expr
| ABF range rtctl_expr
| EBG range rtctl_expr
| ABG range rtctl_expr
| A [ rtctl_expr BU range rtctl_expr ]
| E [ rtctl_expr BU range rtctl_expr ]
range :: integer_number .. integer_number
135
PSL Specification
pslspec_declaration :: "PSLSPEC " psl_expr ";"
psl_expr ::
psl_primary_expr
| psl_unary_expr
| psl_binary_expr
| psl_conditional_expr
| psl_case_expr
| psl_property
psl_primary_expr ::
number ;; a numeric constant
| boolean ;; a boolean constant
| var_id ;; a variable identifier
| { psl_expr , ... , psl_expr }
| { psl_expr "{" psl_expr , ... , "psl_expr" }}
| ( psl_expr )
psl_unary_expr ::
+ psl_primary_expr
| - psl_primary_expr
| ! psl_primary_expr
psl_binary_expr ::
psl_expr + psl_expr
| psl_expr union psl_expr
| psl_expr in psl_expr
| psl_expr - psl_expr
| psl_expr * psl_expr
| psl_expr / psl_expr
| psl_expr % psl_expr
| psl_expr == psl_expr
| psl_expr != psl_expr
| psl_expr < psl_expr
| psl_expr <= psl_expr
| psl_expr > psl_expr
| psl_expr >= psl_expr
| psl_expr & psl_expr
| psl_expr | psl_expr
| psl_expr xor psl_expr
psl_conditional_expr ::
psl_expr ? psl_expr : psl_expr
psl_case_expr ::
case
psl_expr : psl_expr ;
...
psl_expr : psl_expr ;
endcase
Among the subclasses of psl expr we depict the class psl bexpr that will be used in the
following to identify purely boolean, i.e. not temporal, expressions.
psl_property ::
replicator psl_expr ;; a replicated property
| FL_property abort psl_bexpr
136
| psl_expr <-> psl_expr
| psl_expr -> psl_expr
| FL_property
| OBE_property
replicator ::
forall var_id [index_range] in value_set :
index_range ::
[ range ]
range ::
low_bound : high_bound
low_bound ::
number
| identifier
high_bound ::
number
| identifier
| inf ;; inifite high bound
value_set ::
{ value_range , ... , value_range }
| boolean
value_range ::
psl_expr
| range
FL_property ::
;; PRIMITIVE LTL OPERATORS
X FL_property
| X! FL_property
| F FL_property
| G FL_property
| [ FL_property U FL_property ]
| [ FL_property W FL_property ]
;; SIMPLE TEMPORAL OPERATORS
| always FL_property
| never FL_property
| next FL_property
| next! FL_property
| eventually! FL_property
| FL_property until! FL_property
| FL_property until FL_property
| FL_property until!_ FL_property
| FL_property until_ FL_property
| FL_property before! FL_property
| FL_property before FL_property
| FL_property before!_ FL_property
| FL_property before_ FL_property
;; EXTENDED NEXT OPERATORS
| X [number] ( FL_property )
| X! [number] ( FL_property )
| next [number] ( FL_property )
| next! [number] ( FL_property )
;;
| next_a [range] ( FL_property )
| next_a! [range] ( FL_property )
| next_e [range] ( FL_property )
137
| next_e! [range] ( FL_property )
;;
| next_event! ( psl_bexpr ) ( FL_property )
| next_event ( psl_bexpr ) ( FL_property )
| next_event! ( psl_bexpr ) [ number ] ( FL_property )
| next_event ( psl_bexpr ) [ number ] ( FL_property )
;;
| next_event_a! ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_a ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_e! ( psl_bexpr ) [psl_expr] ( FL_property )
| next_event_e ( psl_bexpr ) [psl_expr] ( FL_property )
;; OPERATORS ON SEREs
| sequence ( FL_property )
| sequence |-> sequence [!]
| sequence |=> sequence [!]
;;
| always sequence
| G sequence
| never sequence
| eventually! sequence
;;
| within! ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within!_ ( sequence_or_psl_bexpr , psl_bexpr ) sequence
| within_ ( sequence_or_psl_bexpr , psl_bexpr ) sequence
;;
| whilenot! ( psl_bexpr ) sequence
| whilenot ( psl_bexpr ) sequence
| whilenot!_ ( psl_bexpr ) sequence
| whilenot_ ( psl_bexpr ) sequence
sequence_or_psl_bexpr ::
sequence
| psl_bexpr
sequence ::
{ SERE }
SERE ::
sequence
| psl_bexpr
;; COMPOSITION OPERATORS
| SERE ; SERE
| SERE : SERE
| SERE & SERE
| SERE && SERE
| SERE | SERE
;; RegExp QUALIFIERS
| SERE [* [count] ]
| [* [count] ]
| SERE [+]
| [+]
;;
| psl_bexpr [= count ]
| psl_bexpr [-> count ]
count ::
number
138
| range
OBE_property ::
AX OBE_property
| AG OBE_property
| AF OBE_property
| A [ OBE_property U OBE_property ]
| EX OBE_property
| EG OBE_property
| EF OBE_property
| E [ OBE_property U OBE_property ]
139
Command Index
140
Variable Index
141
Index
142
compassion constraints, 29 interactive, running N U SMV, 47
concatenation operator, 16 interactive shell, 47
constant expressions, 9 interface to DD Package, 99
CONSTANTS declarations, 26 INVAR constraint, 27
context, 35 Invariant Specifications, 37
CTL specifications, 35 INVARSPEC Specifications, 37
ISA declarations, 35
D
DD package interface, 99 J
declarations, 33 justice constraints, 29
DEFINE : array, 26
DEFINE declarations, 26 K
defines, 12 keywords, 5
definition of the FSM, 22
Displaying Traces, 94 L
LTL Specifications, 37
E
Empty Trace, 99 M
enumeration types, 6 main module, 33
Execution Commands, 92 master.nusmvrc, 114
expressions, 8 model compiling, 48
basic expressions, 11 model parsing, 48
basic next, 20 model reading, 48
case, 19 MODULE declarations, 30
constants, 9 MODULE instantiations, 30
next, 20
sets, 18 N
simple, 20 namespaces, 33
extend operator, 17 next expressions, 20
NOT
F logical and bitwise, 13
fair execution paths, 29
fairness constraints, 29 O
fair paths, 29 operator
frozen variables syntax, 24 mod, 15
operators
I AND, 13
identifiers, 31 arithmetic, 14
if-then-else expressions, 19 bit selection, 16
IFF cast, 20
logical and bitwise, 13 count, 20
implicit type conversion, 9 equality, 14
IMPLIES IFF, 13
logical and bitwise, 13 IMPLIES, 13
Important Difference Between BDD and inclusion, 18
SAT Based LTL Model Check- index subscript, 16
ing, 38 inequality, 14
inclusion operator, 18 NOT, 13
index subscript operator, 16 OR, 13
infinity, 40 precedence, 12
INIT constraint, 27 relational, 14
Input File Syntax, 44 shift, 15
input variables syntax, 23, 25 union, 17
Inspecting Traces, 94 word concatenation, 16
integer type, 6 XNOR, 13
143
XOR, 13 set, 7
options, 113 word, 7
OR type specifiers, 22
logical and bitwise, 13
U
P unsigned operator, 21
parentheses, 13 uwconst operator, 21
process, 33
processes, 33 V
process keyword, 33 variable declarations, 22
PSL Specifications, 40 variables, 12
R W
Real Time CTL Specifications and Compu- word1 operator, 21
tations, 39 word type, 7
resize operator, 17
X
S XML Format Printer, 98
Scalar Variables, 45 XML Format Reader, 99
self, 32 XNOR
set expressions, 17 logical and bitwise, 13
set types, 7 XOR
Shell configuration Variables, 110 logical and bitwise, 13
Shift Operator, 15
signed operator, 21
simple expressions, 20
Simulation Commands, 89
sizeof operator, 17
States/Variables Table, 98
state variables, 23
state variables syntax, 25
swconst operator, 21
syntax rules
complex identifiers, 31
identifiers, 5
main program, 33
module declarations, 30
symbolic constants, 6
type specifiers, 22
T
toint operator, 20
Trace Plugin Commands, 95
Trace Plugins, 97
Traces, 93
TRANS constraint, 27
Type conversion operators, 20
type order, 8
types, 6
array, 7
boolean, 6
enumerations, 6
implicit conversion, 9
integer, 6
ordering, 8
144