Home

NuSMV 2.4 User Manual

image

Contents

1. NuSMV h help v vl s old old_div_op dcx cpp pre pps ofm fm file obm bm file lp n idx is ic ils ips 1i ctt 1 r df flt AG coi i ivfile o ov file t tvfile reorder dynamic m method mono thresh cp_t cp cpt iw1s95 cp t noaffinity iwls95preorder bmc bmc length k sat solver name sin on off rin onoff 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 help h Prints the command line help v verbose level Enables printing of additional information on the internal operations of NUSMV 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 87 old old_div_op Cpp pre pps ofm fm file obm bm file lp n idx is ic ils ips HUA ett Si df Avoids to load the NUSMV commands con tained in nusmvre or in nusmvrc or in NUSMV_LIBRARY_PATH master nusmvrc Keeps backward compatibility with older versions of NuSMV This option disables some new features like type checking and dumping of new extension to SMV files Enables the
2. 1t1_expr simple_expr a simple boolean expression 1tl_expr 1t1l_ expr logical not 1t1l_expr ltl_expr logical and 1t1_expr 1t1_expr logical or ltl_expr xor ltl_expr logical exclusive or 1t1l_expr gt 1t1l_expr logical implies 1t1_expr lt gt ltl_expr logical equivalence FUTURE X 1t1_expr next state G 1t1l_expr globally F 1t1_expr finally 1t1_expr U 1t1_expr until 32 1t1_expr V 1t1_expr releases PAST Y 1t1_expr previous state Z 1t1l_expr not previous state not H 1t1_expr historically O 1t1_expr once 1t1_expr S 1t1_expr since 1t1_expr T 1t1_expr triggered Intuitively the semantics of LTL operators is as follows e X pis true at time t if p is true at time t 1 e F pis true at time t if p is true at some time t gt t e G pis true at time t if p is true at all times t gt t e p U qis true at time t if q is true at some time t gt t and for all time t such that t lt t lt t pis true e p V gis true at time t if q holds at all time steps t gt t up to and including the time step t where p also holds Alternatively it may be the case that p never holds in which case q must hold in all time steps t gt t e Y pis true at time t gt 0 if p holds at time t 1 Y pis false at time to e Z pis equivalent to Y p with the exception that the expression is true at time to e H pis true at time t if p holds in al
3. xnor basic_expr gt basic_expr lt gt basic_expr basic_expr basic_expr asic_expr asic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr mod basic_expr gt gt basic_expr lt lt basic_expr 2 basic_expr integer_number logical or logical or logical or equality inequality less than greater than less than or equal greater integer unary minus addition subtraction integer integer integer integer division int ger remainder bit shift right bit shift left word concatenation integer_number word bits selection bitwise NOT exclusive OR bitwise implication bitwise equivalence than or equal multiplication wordl basic_expr bool basic_expr basic_expr union basic_expr set_body_expr boolean word 1 basic_expr in case_expr basic_next_ex basic_expr a to word 1 convertion to boolean convertion union of set expressions set expression inclusion in a set expression ssion a cas a next xpr ssion pr The order of parsing precedence for operators from high to low is xpr Operators of equal precedence associate to the left except gt that associates to the right The constants and their types are explained in Section 2 2 2 Constant Expressions page 9 Variables and Defines A variable_identifier and define_identifier are expressions which identify a variable or a defin
4. VAR e 2 4 2 O VAR f 1 a 3 d q 4 the variables d e and are of enumeration types and all their possible values are specified in the type specifiers of their declarations VAR g word 3 The variable g is of 3 bits wide word type i e word 3 VAR k array 1 1 of array 0 TRUE The variable k is an array of boolean elements with indexes 1 0 and 1 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_declaration DEFINE define_body define_body identifier simple_expr define_body identifier simple_expr 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 21 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 expression where the identifier is met see Section 2 3 15 Context page 30 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 2 3 3 CONSTANTS De
5. w2 is 0b6_110100 Boolean and word 1 Explicit Conversions bool converts a word 1 to a boolean while word1 converts a boolean to a word 1 The signatures of these conversion operators are bool word 1 boolean wordl boolean word 1 The conversion obeys the following table boo1 0b1 0 0 bool 0b1_1 1 word1 0 0b1_0 word1 1 0b1_1 16 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 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 which virtually means converting individual values to singleton sets Then both operands are implicitly converted to a minimal type that covers both operands If
6. dynamic_var_ordering Deals with the dynamic variable order Command ing dynamic_var_ordering al lt method gt f lt method gt h Controls the application and the modalities of dynamic variable ordering Dynamic ordering is a technique to reorder the BDD variables to reduce the size of the existing BDDs When no options are specified the current status of dynamic ordering is displayed At most one of the options e and d should be specified Dynamic ordering may be time consuming but can often reduce the size of the BDDs dramatically A good point to invoke dynamic ordering explicitly using the option is after the commands build_model once the transition relation has been built It is possible to save the ordering found using write_order in order to reuse it using build model i order file in the future Command Options d Disable dynamic ordering from triggering automatically e lt method gt Enable dynamic ordering to trigger automatically whenever a certain threshold on the overall BDD size is reached lt method gt must be one of the following 76 e 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 e random Pairs of variables are randomly chosen and swapped in the order The swap is performed by a
7. logical bitwise exclusive OR basic_expr xnor basic_expr logical bitwise NOT xor basic_expr gt basic_expr logical bitwise implication basic_expr lt gt basic_expr logical bitwise equivalence basic_expr basic_expr equality basic_expr basic_expr inequality basic_expr lt basic_expr less than 101 basic_expr gt basic_expr greater than basic_expr lt basic_expr less than or equal basic_expr gt basic_expr greater than or equal 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 gt gt basic_expr bit shift right basic_expr lt lt basic_expr bit shift left basic_expr basic_expr word concatenation basic_expr integer_number integer_number word bits selection wordl basic_expr boolean to word 1 convertion bool basic_expr word 1 to boolean convertion basic_expr union basic_expr union of set expressions set_body_expr set expression basic_expr in basic_expr inclusion expression case_expr a case expression next basic_expr a next expression set_body_expr basic_expr set_body_expr basic_expr Case Expression case_expr case case_body esac case_body basic_expr basic_expr case_body basic_expr basic_expr Simple Expressio
8. simple_type_specifier ivar_list identifier simple_type_specifier 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 e Left side of assignments For example all these assignments are not allowed IVAR i boolean ASSIGN init i TRUE next i FALSE e INIT statements For example IVAR i boolean VAR s boolean INIT i s 20 e Scope of next expressions For example IVAR i boolean VAR s boolean TRANS i gt s this is allowed TRANS next i gt s this is NOT allowed e Some specification kinds CTLSPEC SPEC INVARSPEC COMPUTE PSLSPEC For example IVAR i boolean VAR s boolean SPEC AF i gt s this is NOT allowed LTLSPEC F X i gt s this is allowed e Anywhere in the FSM when checking invariants with BMC and the DUAL algorithm See at page 66 for further information Examples Below are examples of input and state variable declarations VAR a boolean VAR b O 1 IVAR c TRUE FALSE The variables a b are state variables and c is an input variable all of them are of boolean type In the following examples VAR d stopped running waiting finished
9. 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 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 7 OPERATORS ON SERES sequence FL property sequence gt sequence sequence gt 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 Sequences i e istances of class sequence are defined as follows sequence SERE S
10. INPUT_VARi VALUI gt State TRACE_NO S E_NO lt for each state var being printed j STATE_VARJ VALUE for each combinatorial constant being printed k CONSTANTk VALUE D gt El 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 NUSMV 3 7 2 States Variables Table This trace plugin prints out the trace as a table either with the states on each row or in each column The entries along the state axis are SOL TE St nae Sen in Sn 73 where SO is the initial state and J gives the values of the input variables which caused the transition from state S _1 to state S Ci gives the values of any combinatorial constants where the value depends on the values of the state variables in state S _1 and the values of input variables in state S The variables in the model are placed along the other axis Only the values of state 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 3 7 3 XML Format Printer This plugin prints out the trace either to
11. VAR q boolean e moo MODULE moo DEFINE f 0 lt 1 MODULE not_used VAR n boolean VAR t used 29 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 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 NUSMV 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 equ
12. model Note however that this may mean that the trace is not valid for the model M 75 symmetry_sift_converge window2 window3 window4 window2_converge window3_converge window4_converge group sift group sift _ converge annealing genetic exact linear linear _conv The symmet ry sift method is iterated until no further improvement is obtained Permutes the variables within windows of n adjacent vari ables where n can be either 2 3 or 4 so as to minimize the overall BDD size The window 2 3 4 method is iterated until no further improvement is obtained This method is similar to symmetry sift but uses more general criteria to create groups The group sift method is iterated until no further im provement is obtained This method is an implementation of simulated annealing for variable ordering This method is potentially very slow This method is an implementation of a genetic algorithm for variable ordering This method is potentially very slow 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 This method is a combination of sifting and linear transformations The linear method is iterated until no further improve ment is obtained
13. word M word N M boolean word N word N 1 word N boolean word N 1 exp1 lexp2 exp3 word N integer integer word exp3 exp2 1 exressions expa and exp3 must evaluate to integers such that 0 lt expo lt exp3 lt N lt lt gt gt shift word N integer word N word N boolean word N 97 Set Operators exp1 expz expr equivalent to consecutive union operations 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 At first if it is possible the operands are converted to their set counterpart types then both operands are implicitly converted to a minimal common type in 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 At first if itis possible the operands are converted to their set counterpart types then implicit convertion is performed on one of the operands Case Expression case cond resulti conda resulta condn result esac cond must be of type boolean If one of result is of a Set type then all other result are converted to their counterpart set types The overall type of the expression is such a minimal type
14. after these manipulations the operands do not satisfy the signature of union operator an error is raised by NUSMV 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 Enumerating values in curly brackets is semantically equivalent to writing them connected by union operators For example expression exp1 exp2 exp3 is equivalent to exp1 union exp2 union exp3 Note that according to the semantics of union operator ex pression 1 2 3 4 sequivalentto 1 2 3 4 i e there is no actually set of sets Set expressions can be used only as operands of union and in operations and as the right operand of case expressions and assignments In all other places the use of set expressions is prohibited 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 in boolean set boolean set boolean integer set integer set boolean symbolic set symbolic set boolean integers and symbolic set integers and symbolic set boolean Similar to union operation before checking the expression for being correctly typed if it is possible both operands are converted
15. 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 ASSIGN next var_name 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 1 if and only if the process instance is currently se lected for execution No two processes may be running at the same time Note that 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 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 28 MODULE main VAR pl process my_module p2 process my_module 2 3 13 A Program and the main Module The syntax of a NUSMV program is program module_list module_list module module_list module There must be one module with the name main and no formal
16. 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 e F model name with path part e f model name without path part e Ok current problem bound e 1 current loopback value e On index of the currently processed formula in the prop erty database e 00 the character gen_Itlspec_bme 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 gen 1t1spec bme h n idx p formula IN context k max_length 1 loopback o filename This command generates one or more problems and dumps each problem into a dimacs file Each problem is related to a specific problem bound which increases from zero 0 to the given maximum problem bound In this short description length is the bound of the problem that system is going to dump out In this context the maximum problem bound is represented by the max_length parameter or by its default value stored in the environment variable bmc_length Each dumped problem also depends on the loopback you can explicitly specify by the 1 option or by its default value stored in the environment variable bmc_loopback The property to be checked may be specified using the n idxorthe p formula options You may specify dimac
17. gt 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 81 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 source Executes a sequence of commands from a file Command sourc h p s x lt file gt lt args gt Reads and executes commands from a file Command Options p Prints a prompt before reading each command s Silently ignores an attempt to execute commands from a nonexiste
18. 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 shell_char Environment Variable shell_char specifies a character to be used as shell escape The default value of this environment variable is history_char Environment Variable history char specifies a character to be used in history substitutions The default value of this environment variable is open_path Environment Variable 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 directory is first in this list The standard system library NuSMV_LIBRARY_PATH is always implicitly appended to the current path This provides a convenient short hand mechanism for reaching standard library files nusmv_stderr Environment Variable Standard error normally stderr can be re directed to a file by setting the variable nusmv_stderr nusmv stdout Environment Variable Standard output normally stdout can be re directed to a file by setting the internal variable nu
19. integer numbers 0 and 1 or their symbolic equivalents 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 2 1 to 23 1 more accurately these values are equivalent to the C C macros INT_MIN and INT_MAX 2 1 3 Enumeration Types An enumeration type is a type specified by full enumerations of all the values that the type com prises For example the enumeration of values may be stopped running waiting finished 2 4 2 O FAIL 1 3 7 OK etc All elements of an enumer ation have to be unique although the order of elements is not important However in the NUSMV type system expressions cannot be of actual enumeration types but of their simplified and generalised versions only Such generalised enumeration types do not contain information about the exact values constituting the types but only the flag whether all values are integer numbers symbolic constants or both Below only generalised versions of enumeration types are explained 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 number
20. is a sequence of states inputs pairs corresponding to a possible execution of the model 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 DEF INE sections are also part of a trace If the value of a constant depends only on state 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 variables then it gets displayed in a seperate combinatorial section Since the values of any such constants depend on one or more inputs the initial state does not contain this section either 70 Traces are created by NUSMV when a formula is found to be false they are also generated as a result of a simulation Section 3 5 Simulation Commands page 68 Each trace has a number and the 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 3 6 1 Inspecting Traces The trace inspection commands of NUSMV allow for navigation along the labelled states inputs pairs of the traces produced During the navigation there is a current state and the current trace is the trace the current state belongs to The comm
21. must call this command before use any other bmc related command Only one call per session is required go_bmce Initializes the system for the BMC verification Command go bmc h This command initializes the system for verification It is equivalent to the command sequence read model flatten_hierarchy encode_variables build_boolean model bmc_setup If some commands have already been executed then only the remaining ones will be invoked Command Options f Forces model construction even when Cone Of Influence is enabled 54 sexp inlining Environment Variable This variable enables the Sexp inlining when the boolean model is built Sexp inlining is performed in a similar way to RBC inlining see system variable rbc_inlining but the underlying structures and kind of problem are different because inlining is applied at the Sexp level instead of the RBC level Inlining is applied to initial states invariants and transition relations By default Sexp inlining is disabled rbc_inlining Environment Variable When set this variable makes BMC perform the RBC inlining before committing any problem to the SAT solver Depending on the problem structure and length the inlining may either make SAT solving much faster or slow it down dramatically Experiments showed an average improvement in time of SAT solving when RBC inlining is enabled RBC inlining is enabled by default The idea about inlining was taken from ABE00 by
22. number on the left from the two dots must be less than or equal to the number on the right The word e type is specified by the keyword word with an integer number supplied in square brackets This number must be greater than zero 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 an integer number specifying the lower bound of the array index two dots an integer number specifying the upper bound of the array index the keyword of and the type of array s elements The elements can themselves be arrays State Variables A state of the model is an assignment of values to a set of state variables These variables and also instances of modules are declared by the notation var_declaration VAR var_list var_list identifier type_specifier var_list identifier type_specifier 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 ivar_declaration IVAR ivar_list ivar_list identifier
23. numeric index of a valid LTL specification for mula actually located in the properties database p formula IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in 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 60 1 loopback o filename The loopback value may be e 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 e 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 e the symbol X which means no loopback e the symbol which means all possible loopbacks from zero to length 1 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 e F model name with path part e Cf model name without path part e Ok current problem bound e l current loopback value e On index of the currently processed formula in the p
24. of the hierarchy The input order file can be partial and can contain variables not declared in the model Variables not declared in the model are simply discarded Variables declared in the model which are not listed in the ordering input file will be created and appended at the end of the given ordering list according to the default ordering Command Options i order file Sets the environment variable input_order_file to order file and reads the variable ordering to be used from file order file This can be combined with the write_order command The variable ordering is written to a file which can be inspected and reordered by the user and then read back in input_order fi le Environment Variable Indicates the file name containing the variable ordering to be used in building the model by the encode_variables command There is no default value write_order_dumps_bits Environment Variable Changes the behaviour of the command write order When this variable is set write_order will dump the bits constituting the boolean en coding of each scalar variable instead of the scalar variable itself This helps to work at bits level in the variable ordering file See the command write_order for further information The default value is 0 43 write_order Writes variable order to file Command write order h b o f order file Writes the current order of BDD variables in the file specified via the o option If no op
25. parameters The module main is the one evaluated by the interpreter 2 3 14 Namespaces and Constraints on Declarations Identifiers in the NUSMV input language may reference five different entities modules vari ables defines module instances and symbolic constants 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 10 MODULE Instantiations page 26 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 lt DOT gt 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
26. problem that system is going to generate and dump In this context the maximum prob lem 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 1 option or by its default value stored in the environment variable bmc_loopback The property to be used for tghe problem dumping may be specified using the n idx or the p formula options You may specify dimacs file name by using the op tion o filename otherwise the default value stored in the environment variable bmc_dimacs_filename will be considered Command Options n index index is the numeric index of a valid LTL specification for mula actually located in the properties database p formula IN Dumps the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in k max_length max_length is the maximum problem bound to be generated Only natural numbers are valid values for this option If no value is given the environment variable bmc_length is con sidered instead 1 loopback The loopback value may be e 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 62 e a negati
27. stdout or to a specified file using the command show_traces If traces are to be output to a file with the intention of them being loaded again at a later date then each trace must be saved in a separate file This is because the XML Reader plugin does not currently support multiple traces per file The format of a dumped XML trace file is as follows lt XML_VERSION_STRING gt lt counter example type TRACE_TYPE desc TRACE_DESC gt for each state i lt node gt lt state id i gt for each state var j lt value variable j gt VALUE lt value gt lt state gt lt combinatorial id i 1 gt for each combinatorial constant k lt value variable k gt VALUE lt value gt lt combinatorial gt lt input id i 1 gt for each input var 1 lt value variable 1 gt VALUE lt value gt lt input gt lt node gt lt counter example gt 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 3 7 4 XML Format Reader This plugin makes use of the Expat XML parser library and as such can only be used on systems where this library is available Previously generated traces for a given mo
28. that each result can be implicitly converted to Formula Operators EX AX EF AF EG AG X Y Z G H F O boolean boolean A U E U U S boolean boolean boolean A BU E BU boolean integer integer boolean boolean EBF ABF EBG ABG integer integer boolean boolean 98 Miscellaneous Operators Integer Integer integer_number integer_number integer bool word 1 boolean wordl boolean gt word 1 next init any type the same type any type the same type boolean boolean no type boolean boolean set no type integer integer no type integer integer set no type symbolic enum symbolic enum no type symbolic enum symbolic set no type integers and symbolic enum integers and symbolic enum no type integers and symbolic enum integers and symbolic set no type word N word N no type boolean word 1 no type word 1 boolean no type Implicit type conversion is performed on the right operand only 99 Appendix C Production Rules This appendix contains the syntactic production rules for writing a NUSMV program Identifiers identifier identifier _first_character identifier identifier consecutive_character identifier _first_character one of ABCDEFGHIJIKLUMNOPQRS TUVWXYZ abcdefghijkl1lmnopqrstuvwxyz_ identifier_consecutive_character identifier_f
29. to output file p plugin no Uses the specified trace plugin to display the trace 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 printed 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 read_trace Loads a previously saved trace Command read trace h i file name Command Options i file name Reads in a trace from the specified file Note that the file must only contain one trace 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 Expat XML parser library installed 72 3 7 Trace Plugins NUS MV comes with three plugins which can be used to diaplay a trace that has been generated Basic Trace Explainer States Variables Table XML Format Printer There is also a plugin which can read in any trace which has been output to a file by the XML Format Printer Note however that this reader is only available on systems that have
30. to their counterpart set types Then if required implicit type conversion is carried out on one of the operands Case Expressions A case expression has the following syntax 3See 2 1 6 for more information about the set types and their counterpart types 4See 2 1 6 for more information about the set types and their counterpart types 17 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 1 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 from 0 to k 1 left_expression i is 0 and left_expression xk is 1 It is an error if all expressions on the left hand side evaluate to 0 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 The type of the whole expression is such a minimal type 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 NUS MV throws an error Basic Ne
31. trace of the model from 0 zero to k Command bmc simulate h k bmc simulate does not require a specification to build the problem because only the model is used to build it The problem length is represented by the k command parameter or by its default value stored in the environment variable bmc_length Command Options k length length is the length of the generated simulation 66 3 4 Commands for checking PSL specifications The following command allow for model checking of PSL specifications check_pslspec Performs PSL model checking Command check pslspec h m o output file n number p osl expr IN context b i g 1 k bmc_lenght 1 loopback Depending on the characteristics of the PSL property and on the options the commands applies CTL based model checking or LTL based possibily bounded model checking 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 If option b is used LTL bounded model checking is applied otherwise bdd based model checking is applied For LTL bounded model checking options k and 1 can be used to define the maximum problem bound and the value of the loopback for the single generated problems respectively their values can be stored in the environment
32. uses an incremental algorithm and therefore usually runs considerably quicker The incremental algorithms exploit the fact that satisfiability problems generated for a particular invariant have common subparts so information obtained during solving of one problem can be used in solving another one A SAT solver with an incremental interface is required by this command If no such SAT solver is provided then this command will be unavailable 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 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 IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in 65 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 e
33. variable ordering is as follows where the file can be considered as a list of variable names each of which must be on a separate line vars_list EMPTY var_list_item vars_list var_list_item complex_identifier complex_identifier integer_number Where EMPTY means parsing nothing This grammar allows for parsing a list of variable names of the following forms Complete_Var_Name to specify an ordinary variable Complete_Var_Name index to specify an array variable element Complete_Var_Name NUMBER to specify a specific bit of a scalar variable 38 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 modl mod2 modN varname 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 NUSMV displays a warning message stating these actions Comments can be included by using the same syntax as regular NUSMV files That is by starting the line with 2 5 2 Scalar Variables A variable which has a finite range of values that i
34. variables bmc lenght and bmc_loopback Single problems can be generated by using option 1 By using op tion i the incremental version of bounded model checking is activated Bounded model checking problems can be generated and dumped in a file by using option g 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 IN A PSL formula to be checked context is the module context instance name which the variables in ps1 expr must be evaluated in n number Checks the PSL property with index number in the prop erty database p Applies SAT based bounded model checking The SAT solver to be used will be chosen according to the current value of the system variable sat solver i Applies incremental SAT bounded model checking if avail able i e if an incremental SAT solver has been linked to NuSMV This option can be used only in combination with the option b 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 1 67 k bmc_length 1 loopback Generates a single bounded model checking problem with fixed bound and
35. 50 nusmv_stderr 85 nusmv_stdin 85 nusmv_stdout 85 on failure script quits 84 open path 85 output_boolean_model _file 48 output_flatten_model _file 47 output order file 44 output_word_format 48 partitionmethod 45 pp list 42 rbc_inlining 55 reorder method 75 sat_solver 66 sexp_inlining 55 shell _char 85 showed_states 69 trans order file 45 111 type checking warning on 43 vars order type 44 verbose_level 42 write_order_dumps_bits 43 Index Symbols 14 nusmvrc 88 Li i5 i 14 AG 89 bmc_length k 89 bmc 89 coi 89 cpp 88 cp cp t 89 ctt 88 dynamic 89 f1t 89 f 88 help 87 h 87 ic 88 ii 88 ils 88 is 88 iwls95preorder 89 iwls95 cp t 89 i ivfile 89 load cmd file 41 1p 88 mono 89 m method 89 noaffinity 89 n idx 88 obm bm_file 88 ofm fm_file 88 old_div op 88 old 88 o ov file 89 pre pps 88 reorder 89 rin on off 90 r 88 sat solver name 89 sin on off 90 thresh cp t 89 t tfile 89 v verbose level 87 112 ASSIGN constraint 23 FAIRNESS constraints 24 IVAR declaration 20 21 VAR declaration 20 21 running 28 temp ord 44 mod 15 7 nusmvre 88 A administration commands 78 AND logical and bitwise 13 array type 8 Array Variables 40 B basic next expression 18 Basic Trace Explainer 73 batch running NUSMV 87 bit selection operator 16 boolean ty
36. ER sequence psl_bexpr COMPOSITION OPERATORS SERE SERE SERE SERE SERE amp SERE 37 SERE amp amp SERE SERE SERE 7 RegExp QUALIFIERS SERE count count S psl_bexpr count psl_bexpr gt count 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 E OBE_property U OBE_property Y property The NUS MV 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 2 5 Variable Order Input It is possible to specify the order in which variables should appear in the BDD s generated by NUSMV The file which gives the desired order can be read in using the i option in batch mode or by setting the input_order_file environment variable in interactive mode 2 5 1 Input File Syntax The syntax for input files describing the desired
37. INVARSPEC simple_expr This is equivalent to SPEC AG simple_expr but is checked by a specialised algorithm during reachability analysis LTL Specification 1t1_specification LTLSPEC 1t1_expr 1t1_expr simple_expr a simple boolean expression 1tl_expr 1t1l_expr logical not ltl_expr ltl_expr logical and ltl_expr 1t1_expr logical or ltl_expr xor ltl_expr logical exclusive or ltl_expr gt ltl_expr logical implies ltl_expr lt gt ltl_expr logical equivalence FUTURE X 1t1_expr next state G ltl_expr globally F 1t1_ expr finally 1t1_expr U 1t1_expr until 1t1_expr V 1t1_expr releases PAST Y 1t1_expr previous state Z 1t1l_expr not previous state not H 1t1_ expr historically O 1t1_expr once 1t1_expr S 1t1_expr since 1t1_expr T 1t1_expr triggered Real Time CTL Specification rtctl_specification rtctl_expr ctl_expr EBF range rtctl_expr ABF range rtctl_expr EBG range rtctl_expr ABG range rtctl_expr AT ET integer_number SPEC rtctl_expr rtctl_expr BU range rtctl_expr rtctl_expr BU range rtctl_expr integer_number 105 It is also possible to compute quantative information for the FSM compute_specification COMPUTE compute_expr compute_expr MIN rtctl_expr rtctl_expr MAX rtctl_ expr rtctl_expr PSL Specification psl psl psl psl psl ps psl spec_declaration _expr psl_primary_expr psl_unary_
38. 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 51 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 p invar expr IN The command line specified invariant formula to be verified context context is the module instance name which the variables in invar expr must be evaluated in check_ltlspec Performs LTL model checking Command check 1t1spec h m o output file n number p ltl expr IN context Performs model checking of LTL formulas LTL model checking is reduced to CTL model checking as described in the paper by CGH97 A 1t1 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 LTLSPEC formulas in the database are checked 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 U
39. L properties not already checked If p is used the given formula is expected to be a PSL formula Checks all the COMPUTE properties not already checked If p is used the given formula is expected to be a COMPUTE formula p formula IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in add_property Adds a property to the list of properties Command add property h IN context Adds a property in the list of properties It is possible to insert LTL CTL INVAR PSL and quantitative COMPUTE properties Every newly inserted property is initialized to unchecked A type option must be given to properly execute the command ec l i q s p formula 53 Command Options C Adds a CTL property 1 Adds an LTL property i Adds an INVAR property s Adds a PSL property q Adds a quantitative COMPUTE property p formula IN Adds the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in 3 3 Commands for Bounded Model Checking In this section we describe in detail the commands for doing and controlling Bounded Model Checking in NUSMV Bounded Model Checking is based on the reduction of the bounded model checking problem to a propositional satisfiability problem After the problem is gen erated NUSMV internally c
40. MV Command read model h i model file Reads a NUSMV file If the i option is not specified it reads from the file specified in the environment variable input_file Command Options i model file Sets the environment variable input file to model fi le and reads the model from the specified file input fi le Environment Variable Stores the name of the input file containing the model It can be set by the set command or by the command line option i There is no default value pp list Environment Variable Stores the list of pre processors to be run on the input file before it is parsed by NUSMV The pre processors are executed in the order specified by this variable The argument must either be the empty string specifying that no pre processors are to be run on the input file one single pre processor name or a space seperated list of pre processor names inside double quotes Any invalid names are ignored The default is none flatten_hierarchy Flattens the hierarchy of modules Command flatten hierarchy h 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 backward_compatibility Environment Variable It is used to enable or disable type checking and other features provided by NuSMV 2 4 If set to 1 then the type checking is turned of
41. NIX command more o output file Writes the output generated by the command in processing LTLSPECs to the file output file p ltl expr IN An LTL formula to be checked context is the module context instance name which the variables in 1t1 expr must be evaluated in n number Checks the LTL property with index number in the prop erty database compute Performs computation of quantitative characteristics Command comput 5 Lem o output file n number p compute expr IN context This command deals with the computation of quantitative characteristics of real time sys tems It is able to compute the length of the shortest longest path from two given set of states MAX alpha beta MIN alpha beta td Properties of the above form can be specified in the input file via the keyword COMPUT or directly at command line using option p 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 52 Option n can be used for computing a particular expression in the model If neither n nor p are used all the COMPUTE specifications are computed 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 call
42. NuSMV 2 4 User Manual Roberto Cavada Alessandro Cimatti Charles Arthur Jochim Gavin Keighren Emanuele Olivetti Marco Pistore Marco Roveri and Andrei Tchaltsev ITC irst Via Sommarive 18 38055 Povo Trento Italy Email nusmv irst itc it This document is part of the distribution package of the NUSMV model checker available at http nusmv irst itc it Parts of this documents have been taken from The SMV System Draft by K McMillan available at http www cs cmu edu modelcheck smv smvmanual r2 2 ps Copyright 1998 2005 by CMU and ITC irst Contents 1 Introduction 2 Input Language 2 1 2 2 2 3 2 4 TY Pes OVELVIEW eane Bai hoe a a a do oR a a as Dell BOOLE i os ce 8k ees Bee oe ae Efe Bae es ee SE A 212 Integer sie ge ae at ee De a eee ea 2 1 3 Enumeration Types gt s s s socs a oc ocea sace erais PA E Word N E e E AO a kh atl Bal ea a a a Be e LL a olat PAG Set Types cis New lite A Wee e a ee AG ULT Type Order ese ie aig GR HO A Beka Expressions 3 oe aita ce Get ee Ane ee ee LO we A A 2 2 1 Implicit Type Conversion 0 0 2 2 2 Constant Expressions o o e 2 2 3 Basic Expressions e 2 2 4 Simple and Next Expressions Definition oftheFSM o e 0022 ee e 2 3 1 Variable Declarations o a 2 32 DEFINE Declarations 2 3 3 C
43. ONSTANTS Declarations 2 34 INIT Constraint 2 3 5 INVAR Constraint c se 48 066 p25 eS pee a te 2 3 6 TRANS Constraint 2 3 7 ASSIGN Constraint lt p 3 84 6 a0 ada he eb wae 2 3 8 FAIRNESS Constraints 2 3 9 MODULE Declarations 2 3 10 MODULE Instantiations 0 0 2 3 11 References to Module Components Variables and Defines and Array Elements in Expressions 23 12 PLOCESSES ouA se BO BG hh els ate di 2 3 13 A Program and the main Module 2 3 14 Namespaces and Constraints on Declarations 2 3 19 CONERE id Se RP Bae Ba Hae WS Ss 2 3 16 ISA Declarations 00022 SPecIfCatIONS wives a le E A eed BE de 2 4 1 CTL Specifications i cs sye o e N 2 4 2 Invariant Specifications o o 2 4 3 LTL Specifications o o A O O NW 00 00 00 00 l JO 2 4 4 Real Time CTL Specifications and Computations 2 45 PSL Specifications o o 2 5 Variable Order Input o o 2 5 1 InputFile Syntax o 2 5 2 Scalar Variables y iis sss se ro rs e O 2 53 Array Variables o 2 67 Clusters Order o 6 4 mat A al reis Running NuSMV interactively 3 1 Model Reading and Building 3 2 Commands for Checking Spe
44. Parosh Aziz Abdulla Per Bjesse and Niklas E n 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 check ltlspec bmc h n idx p formula IN context k max 1ength 1 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 1 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 IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated
45. SMV compassion constraints are supported only for BDD based LTL model checking We plan to add support for compassion constraints also for CTL specifications and in Bounded Model Checking in the next releases of NUSMV 25 with names of variables and definitions The optional list of identifiers in parentheses are the formal parameters of the module 2 3 10 MODULE Instantiations An instance of a module is created using the VAR declaration see Section 2 3 1 State Variables page 20 with a module type specifier see Section 2 3 1 Type Specifiers page 19 The syntax ofamodule type specifier is module_type_specifier identifier parameter_list process identifier parameter_list parameter_list simple_expr parameter_list simple_expr A variable declaration with amodule type specifier introduces a name for the module instance The module type specifier provides the name of the instantiating module and also a list of actual parameters which are assigned to the formal parameters of the module An actual parameter can be any legal simple expression see Section 2 2 4 Simple and Next Expressions page 18 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 Here are examp
46. _first_character one of ABCDEFGHIJIKLUMNOPQRSTUVWX YZ abcdefghigjgkimnopqrstuvwxyz identifier consecutive_character identifier _first_character digit one of HN digit one of 0123456789 An identifier is always distinct from the NUSMV language reserved keywords which are MODULE DEFINE CONSTANTS VAR IVAR INIT TRANS INVAR SPEC CTLSPEC LTLSPEC PSLSPEC COMPUTE INVARSPEC FAIRNESS JUSTICE COMPASSION ISA ASSIGN CONSTRAINT SIMPWFF CTLWFF LTLWFF PSLWFF COMPWFF IN MIN MAX process array of boolean integer real word wordl bool 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 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 and symbolic constants which are identifiers symbolic_constant identifier Examples of integer numbers and symbolic constants are 3 14 007 OK FAIL waiting stop The values of symbolic constants and integer numbers do not intersect with the exceptions of the reserved symbolic constants TRUE and FALSE which are equal to the integer numbers 1 and 0 respec tively 2 1 Types Overview This section provides an overview of the types that are recognised by NUSMV 2 1 1 Boolean The boolean type comprises two
47. a simple CPU elapsed time value Command time h Prints the processor time used since the last invocation of the time command and the total processor time used since NUSMV was started unalias Removes the definition of an alias Command unalias h lt alias names gt Removes the definition of an alias specified via the alias command Command Options lt alias names gt Aliases to be removed 83 unset Unsets an environment variable Command unset h lt variables gt A variable environment is maintained by the command interpreter The set command sets a variable to a particular value and the unset command removes the definition of a variable Command Options lt variables gt Variables to be unset usage Provides a dump of process statistics 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 which Looks for a file called filename Command which h lt file_name gt Looks for a file in a set of directories which includes the current directory as well as those in the NUSMV path If it finds the specified file it reports the found file s path The searching path is specified through the set open path command in nusmvrc Command Options lt file name gt File to be searched 3 10 Other Environment Variables The behavior of the system depends on the value of some environment variab
48. ained e 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 77 e linear This method is a combination of sifting and linear transformations i e e linear_converge The linear method is iterated until no further improvement is obtained f lt method gt Force dynamic ordering to be invoked immediately The val ues for lt method gt are the same as in option e print_bdd stats Prints out the BDD statistics and parameters Command print bdd stats h Prints the statistics for the BDD package The amount of information depends on the BDD package configuration established at compilation time The configurtion parameters are printed out too More information about statistics and parameters can be found in the documentation of the CUDD Decision Diagram package 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 set_bdd_pa
49. al for example variable identifiers It is an error if the same identifier in an expression can simultaneously refer toa 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 2 3 15 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 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 2 3 16 ISA Declarations There are cases in which some parts of a module could be shared among different modules or could be used as a module themselves In NUSMV it is possible to declare the common parts as separate modules and then use the ISA declaration to import the common parts inside a module declaration The syntax of an isa_declarationisas follows The module main is instantiated with the so called empty identifier which cannot be referenced in a program 30 isa_declaration ISA identifier where iden
50. alls a propositional SAT solver in order to find an assignment which satisfies the problem Currently NUSMV supplies three SAT solvers SIM Zchaff and MiniSat Notice that Zchaff and MiniSat are for non commercial purposes only They are therefore not included in the source code distribution or in some of the binary distributions of NUSMV Some commands for Bounded Model Checking use incremental algorithms These algo rithms exploit the fact that satisfiability problems generated for a particular bounded model checking problem often share common subparts So information obtained during solving of one satisfiability problem can be used in solving of another one The incremental algorithms usually run quicker then non incremental ones but require a SAT solver with incremental inter face At the moment only Zchaff and MiniSat offer such an interface If none of these solvers are linked to NUSMV then the commands which make use of the incremental algorithms will not be available Itis also possible to generate the satisfiability problem without calling the SAT solver Each generated problem is dumped in DIMACS format to a file DIMACS is the standard format used as input by most SAT solvers so it is possible to use NUSMV with a separate external SAT solver At the moment the DIMACS files can be generated only by commands which do not use incremental algorithms bmc_setup Builds the model in a Boolean Epression format Command bmc_setup h You
51. ands are the following goto_state Goes to a given state of a trace Command goto state h state_label Makes state_label the current state This command is used to navigate along traces produced by NUSMV During the navigation there is a current state and the current trace 1s the trace the current state belongs to print_current state Prints out the current state Command print current state h v Prints the name of the current state if defined Command Options v Prints the value of all the state variables of the current state 3 6 2 Displaying Traces NUSMV comes with three trace plugins see Section 3 7 Trace Plugins page 73 which can be used to display traces in the system Once a trace has been generated by NUSMYV it is printed to stdout using the trace explanation plugin which has been set as the current default The command show_t races see Section 3 5 Simulation Commands page 68 can then be used to print out one or more traces using a different trace plugin as well as allowing for output to a file 3 6 3 Trace Plugin Commands The following commands relate to the plugins which are available in NUSMV show_plugins Shows the available trace explanation plugins Command show plugins h n plugin no a Command Options n plugin no Shows the plugin with the index number equal to plugin no a Shows all the available plugins Shows the available plugins that can be used to display a trace wh
52. as 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 Sin n th argument of last command Last argument of last command Be All but initial word of last command 5 Last command Sstuf Last command beginning with stuf n Repeat the n th command n Repeat the n th previous command old new Replace old with new in previous command Trailing spaces are significant during substitution Initial spaces are not significant print_usage Prints processor and BDD statistics Command print usage h Prints a formatted dump of processor specific usage statistics and BDD usage statistics For Berkeley Unix this includes all of the information in the get rusage structure quit exits NuSMV Command quit h s Stops the program Does not save the current network before exiting 80 Command Options zS Frees all the used memory before quitting This is slower and it is used for finding memory leaks reset Resets the whole system Command reset h Resets the whole system in order to read in another model and to perform verification on it set Sets an environment var
53. ate 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 SN Verbosely prints out chosen state all state variables oth erwise 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 Randomly picks a state from the set of initial states 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 state variables un changed 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 68 a Displays all state variables changed and unchanged 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 showed_states Environment Variable Controls the maximum number of states showed during an interactive simulation session Possible values are integers from 1 to 100 The default value is 25 simulate Perf
54. ation about variables ordering output_boolean_model fi le Environment Variable 47 The file where the flattened and booleanized model has to be written The default value is stdout output_word_format Environment Variable This variable sets in which base word e constants are outputted during traces counterex amples etc printing Possible values are 2 8 10 and 16 Note that if a part of an input file is outputted for example if a specification expression is outputted then the word e constants remain in same format as they were written in the input file 3 2 Commands for Checking Specifications The following commands allow for the BDD based model checking of a NUSMV model compute_reachable Computes the set of reachable states Command compute _reachable h Computes the set of reachable states The result is then used to simplify image and preim age computations This can result in improved performances for models with sparse state spaces Sometimes this option may slow down the performances because the computation of reachable states may be very expensive The environment variable forward_search is set during the execution of this command Since version 2 4 0 the computation of the reachable states is automatically performed as the variable forward_search is set by default print_reachable_states Prints out the number of reachable states Command print reachable_states h v Prints the number of rea
55. ation contained in it If the environment variable orward_search has been set before then the set of reachable states is computed If the option r is specified the reordering of variables is performed and a dump of the variable ordering is performed accordingly This command simulates the batch behavior of NUSMV and then returns the control to the interactive shell Command Options f Forces the model construction even when Cone Of Influence is enabled 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 46 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 write_flat_model Writes a flat model to a file Command write_flat_model h o filename Writes the currently loaded SMV model in the specified file after having flattened it Processes are eliminated and a corresponding equivalent model is printed out If no file is specified the file specified via the environment variable output_flatten_model_file is used if any otherwise standard output is used Command Options o filename Attempts to write the flat SMV model in filename output _flatten_model_fi le Environment Variable The file where the flatten
56. ay 0 2 of boolean bo Le dz expressions a 1 and aa 3 0 are legal whereas a 5 and a b are not It is possible to refer to the name that the current module has been instantiated to by using the self built in identifier MODULE container init_valuel init_value2 VAR cl counter init_valuel self VAR c2 counter init_value2 self MODULE counter init_value my_container VAR v 1 100 ASSIG init v init_value DEF INE greatestCounterInContainer v gt my_container cl v v gt my_container c2 v MODULE main VAR c container 14 7 SPEC c cl 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 2 3 12 Processes Processes are used to model interleaving concurrency A process is a module which is instan tiated using the keyword process see Section 2 3 10 MODULE Instantiations page 26 The program executes a step by non deterministically choosing a process then executing
57. ch of which is an array of 4 elements from 1 to 2 that are 5 bit long words The use of arrays in expressions are quite limited See 2 3 11 for more information 2 1 6 Set Types set types are used to identify expressions representing a set of values There are four set types boolean set integer set symbolic set integers and symbolic set The set types can be 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 assignment 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 word e do not have a set type counterpart 2 1 7 Type Order Figure 2 1 depicts the order existing between types in NUSMV For more information on these operators see pages 11 17 17 17 and 23 respectively boolean word 1 l integer symbolic enum wordi l f word 3 integers and symbolic enum boolean set l integer set symbolic set integers and symbolic set Figure 2 1 The ordering on the types in NUSMV It means for example that boolean is less than integer inte
58. chable states of the given model In verbose mode prints also the list of all reachable states The reachable states are computed if needed check_fsm Checks the transition relation for totality Command check fsm h m 0o output file 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 check_fsm Environment Variable Controls the activation of the totality check of the transition relation during the process model call Possible values are 0 or 1 Default value is 0 48 print_fsm_stats Prints out information about the fsm and cluster ing print fsm_ stats h m o output file Command This command prints out information regarding the fsm and each cluster In particular for each cluster it prints out the cluster number the size of the cluster in BDD nodes the variables occurring in it the size of the cube that has to be quantified out relative to the cluster and the variables to be quantified out Command Options m o output file Pipes the output gene
59. cifications 3 3 Commands for Bounded Model Checking 3 4 Commands for checking PSL specifications 3 5 Simulation Commands 000 3 02 Traces a e che foe Soe a Gu oe Bo eh ek ee eae e 3 6 1 Inspecting Traces o o aE 3 6 2 Displaying Traces o o 3 6 3 Trace Plugin Commands 321 Trace PIUGINS gt roe 8 SP we ra ra BUR HN beis we a 3 7 1 Basic Trace Explainer o a 3 7 2 States Variables Table 3 7 3 XML Format Printer 3 74 XML Format Reader 3 8 Interface to the DD Package onoo 3 9 Administration Commands oa a 3 10 Other Environment Variables Running NuSMV batch Compatibility with CMU SMV Typing Rules Bull DY Pes etico rr A a ele ed B 2 Implicit Conversions era aa eB ER 2 eh t B 3 Type Rules fx 3 e es ahd ea E Cees Ba eA ee es Bee Production Rules Chapter 1 Introduction NUS MV is a symbolic model checker originated from the reengineering reimplemen tation and extension of CMU SMV the original BDD based model checker developed at CMU McM93 The NUSMV project aims at the development of a state of the art symbolic model checker designed to be applicable in technology transfer projects it is a well structured open flexible and documented platform for model checking and is r
60. clarations CONSTANTS declarations allow the user to explicitly declare symbolic constants that might oc cur or not within the FSM that is being defined CONSTANTS declarations are expecially useful 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 4 The syntax for this kind of declaration is constants_declaration CONSTANTS constants_body constants_body identifier constants_body identifier 2 3 4 INIT Constraint The set of initial states of the model is determined by a boolean expression under the INIT keyword The syntax of an INIT constraint is init_constrain INIT simple_expr 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 2 3 5 INVAR Constraint The set of invariant states can be specified using a boolean expression under the INVAR key word The syntax of an INVAR constraint is invar_constraint INVAR simple_expr Since the expression
61. d method of defining a list of variables that all have the same type Nothing is gained by declaring it as an array over declaring each of the elements individually and there is no difference in terms of the internal representation of the variables 2 6 Clusters Ordering When NUSMV builds a clusterized BDD based FSM during model construction an initial sim ple clusters list is roughly constructed by iterating through a list of variables and by constructing the clusters by picking the transition relation associated to each variable in the list Later the clusters list will be refined and improved by applying the clustering alghorithm that the user previoulsy selected see partitioning methods at page 3 1 for further information In WJKWLvdBR06 Wendy Johnston and others from University of Queensland showed that choosing a good ordering for the initial list of variables that is used to build the clusters list may lead to a dramatic improvement of performances They did experiments in a modified version of NUSMV by allowing the user to specify a variable ordering to be used when con structing the initial clusters list The prototype code has been included in version 2 4 1 that offers the new option trans_order_file to specify a file containing a variable ordering see at page 44 for further information Grammar of the clusters ordering file is the same of variable ordering file presented in section 2 5 at page 38 40 Chapter 3 Runnin
62. del can be loaded using 74 this plugin provided that the original model file has been loaded and built using the command go When a trace is loaded it is given the smallest available trace number to identify it It can then be manipulated in the same way as any generated trace 3 8 Interface to the DD Package NUS MV uses the state of the art BDD package CUDD Som98 Control over the BDD package can very important to tune the performance of the system In particular the order of variables is critical to control the memory and the time required by operations over BDDs Reordering methods can be activated to determine better variable orders in order to reduce the size of the existing BDDs Reordering of the variables can be triggered in two ways by the user or by the BDD package In the first way reordering is triggered by the interactive shell command dynamic_var_ordering with the f option Reordering is triggered by the BDD package when the number of nodes reaches a given threshold The threshold is initialized and automatically adjusted after each reordering by the package This is called dynamic reordering and can be enabled or disabled by the user Dynamic reordering is enabled with the shell command dynamic_var_ordering with the option e and disabled with the d option reorder_method Environment Variable Specifies the ordering method to be used when dynamic variable reordering is fired The possible values correspond
63. digit 0 followed by one of the characters b B binary o O octal d D decimal or h H hexadecimal 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 The type of a word constant is word N where N is the width of the constant For example 0b5_10111 has type word 5 006 37 has type word 6 0d11_9 has type word 1 1 Oh12_a9 has type word 12 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 word 8 Od8_11 Ob8_1011 Ob 00001011 Oh_0b Oh8_b The syntactic rule of the word constant is the following 10 word_constant 0 word_base word_width _ word_value word_width integer_number a number greater than zero word_base b B o O d D hj H word_value hex_digit word_value hex_digit word_value _ hex_digit one of 012345678 9abcdefABCDEF Note that e The width of a word must be a number strictly greater than 0 e Decimal word constants must be declared with the width specifier since the number of bits needed for an expression like 0d_019 is unclear e Digits are restricted depending on the base the constant is given
64. e respectively Their syntax rules are define_identifier complex_identifier 12 variable_identifier complex_identifier The syntax and semantics of complex_identifiers are explained in Section 2 3 11 Ref erences to Module Components page 27 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 21 and Section 2 3 1 Variable Declarations page 19 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 variable_identifier represents state and input variables The type of a variable is specified in its declaration For more information about variables see Section 2 3 Defini tion of the FSM page 19 Section 2 3 1 State Variables page 20 and Section 2 3 1 Input Variables page 20 Since a symbolic constant is syntactically indistinguishable from variable_identifiers and define_identifiers a symbol table is used to distin guish them from each other Parentheses Parentheses may be
65. e on_failure _script _quits The option load must be used with int to be effective 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 NUSMV must obey the partial order specified in the Figure 3 10 depicted at page 86 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 41 page 79 for more information The verbosity of NUSMV is controlled by the following environment variable verbose_level Environment Variable Controls the verbosity of the system Possible values are integers from 0 no messages to 4 full messages The default value is 0 3 1 Model Reading and Building The following commands allow for the parsing and compilation of the model into a BDD read_model Reads a NuSMV file into NuS
66. e series of transitions so gt 1 1 Se such that p is true in every si e AG pis true in a state so if for all infinite series of transitions so 1 1 gt 82 p is true in every si e E p U q is true in a state so if there exists a series of transitions so 1 1 Se 8n 1 Sn Such that p is true in every state from so to sn 1 and q is true in state sn e A p U q is true in a state so if for all series of transitions so 81 51 82 Sn 1 Sn p is true in every state from so 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 ps103 2 4 2 Invariant Specifi cations 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 invar_specification INVARSPEC simple_expr This statement is equivalent to SPEC AG simple_expr but can be checked by a specialised algorithm during reachability analysis Fairness constraints are not taken into account during invariant checking 2 4 3 LTL Specifi cations LTL specifications are introduced by the keyword LTLSPEC The syntax of this specification is ltl_specification LTLSPEC 1t1_expr The syntax of LTL formulas recognized by NUSMV is as follows
67. e 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 NUSMYV it is allowed to specify single bits of scalar variables In the example VAR X 2 Dot NUSMV 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 94 Appendix B Typing Rules This appendix gives the explicit formal typing rules for NUSMV 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_S An integer is any whole number positive or negative B 1 Types The main types recognised by NUSMV are as follows boolean integer symbolic enum integers and symbolic enum boolean set integer set symbolic set integers and symbolic set word N where N is any whole number gt 1 For more detalied description of existing types see Section 2 1 Types page 7 B 2 Implicit Conversion In certain situations NUSMV is able to carry out implicit conversion of types There are two kind of implicit convertion The first one converts expr
68. eadlock states COMPUTE may produce wrong results It is possible to check the FSM against deadlock states by calling the command check_ sm 34 2 4 5 PSL Specifi cations NUS MV allows for PSL specifications as from version 1 01 of PSL Language Reference Manual psl03 PSL specifications are introduced by the keyword PSLSPEC The syntax of this declaration as from the PSL parsers distributed by IBM PSL is PSLSPEC pslspec_declaration where psl_expr psl_primary_expr psl_unary_expr psl_binary_expr psl_conditional_expr psl_case_expr psl_property psl_expr won The first five classes define the building blocks for ps1 propert y and provide means of com bining instances of that class they are defined as follows psl_primary_expr number boolean var_id 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 lt psl_expr lt psl_expr gt psl_expr psl_expr gt psl_expr psl_expr amp 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
69. ed model has to be written The default value is stdout write_boolean_model Writes a flat and boolean model to a file Command write_boolean_model h o filename Writes the currently loaded SMV model in the specified file after having flattened and booleanized it Processes are eliminated and a corresponding equivalent model is printed out If no file is specified the file specified via the environment variable output boolean model_file is used if any otherwise standard output is used Command Options o filename Attempts to write the flat and boolean SMV model in filename In NuSMV 2 4 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 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 inform
70. ed 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 NUSMV 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 NUSMV 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 NUSMV MODULE main VAR y boolean x boolean ASSIGN next x x amp next y next y y next x Another difference between NUSMV and CMU SMV is in the variable order file The vari able ordering file accepted by NUSMV 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 NUSMV but the ordering files generated by NUSMV 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 NUSMV In the ordering files for NUSMV identifier process selector can b
71. efore Input variables are forced to be ordered before state variables de fault e inputs_after Input variables are forced to be ordered after state variables e lexicographic Input and state variables will be ordered as they are declared in the input smv file in a lexicographic order build_model Compiles the flattened hierarchy into a BDD Command build model h f m Method Compiles the flattened hierarchy into a BDD initial states invariants and transition relation using the method specified in the environment variable part itionmethod for building the transition relation 44 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 partition_method Environment Variable The method to be used in building the transition relation and to compute images and preimages Possible values are e Monolithic No partitioning at all e Threshold Conjunctive partitioning with a simple threshold heuristic Assign ments are collected in a single cluster until its size grows over the value specified in the variable conj_part_threshold It is possible default to use affinity clusteri
72. ems and calls the SAT solver on each one of them The incremental algorithm exploits the fact that subproblems have common subparts so information obtained during a previous call to the SAT solver can be used in the consecutive ones Logically this command does the same thing as check_1t1spec_bmc see the description on page 55 but usually runs considerably quicker A SAT solver with an incremental interface is required by this command therefore if no such SAT solver is provided then this command will be unavailable Command Options n index index is the numeric index of a valid LTL specification for mula actually located in the properties database 59 p formula context k max_length 1 loopback IN Checks the formula specified on the command line context is the module instance name which the variables in formula must be evaluated in max_length is the maximum problem bound must be reached Only natural numbers are valid values for this option If no value is given the environment variable bmc _length is considered instead The loopback value may be e 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 e 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
73. ence 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 7 COMPOSITION OPERATORS SERE SERE SERE SERE SERE amp SERE SERE amp amp SERE SERE SERE 7 RegExp QUALIFIERS SERE count count SERE 108 r psl_be psl_be count OBI number range EK prope AX OBE AG OBE AF OBE Aro EX OBI EG OBI EF OBI E OBI Y A a xpr count xpr gt count rty property property property E_property U OB property property property E_property U OB E_property E_property 109 Command Index see bang 78 78 add_property 53 alias 78 bmc_setup 54 bmc_simulate 66 build_model 44 check _ctlspec 49 check_fsm 48 check_invar_bmc_inc 65 check_invar_bmc 64 check_invar 50 check_1t1spec bmc inc 59 check_1t1spec bmc_ onepb 56 c
74. endcase 35 7 a numeric constant a boolean constant 7 a variable identifier psl_expr 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 lt gt psl_expr psl_expr gt 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 7 inifite high bound value_set value_range value_range boolean value_range psl_expr range The instances of FL_propert y are temporal properties built using LTL operators and SEREs operators and are defined as follows FL_property PRIMITIVE LTL OPERATORS X FL_property FL_property L_property L_property L_property U FL_property L_property W FL_property 7 SIMPLE EMPORAL 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 H 36
75. ents are not no longer supported by NUSMV NUSMV 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 NUSMV In particular e Itis no longer possible to write formulas containing nested next TRANS next alpha amp next beta next gamma gt delta e 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 93 next alpha beta INIT next beta gt alpha ASSIG delta alpha amp next gamma normal assignments init gamma alpha amp next delta init assignments e Itis no longer possible to write SPEC FAIRNESS statements containing next FAIRNESS next running SPEC next x amp y e 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 x depends on itself e g x f x y x depends on y and y depends on x e g x f y and y f x or x f z z f y and y f x In the case of circular dependencies among variables there is no fix
76. epb h n idx p formula IN context k length 1 loopback o filename As command check_1t1lspec_bmc but it produces only one single problem with fixed bound and loopback values with no iteration of the problem bound from zero to max_length Command Options n index index is the numeric index of a valid LTL specification for mula actually located in the properties database The valid ity of index value is checked out by the system p formula IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in k length length is the problem bound used when generating the sin gle problem Only natural numbers are valid values for this option If no value is given the environment variable bmc_length is considered instead 1 loopback The loopback value may be e a natural number in 0 max_length 1 A positive sign C 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 56 e a negative number in 1 bmc_length In this case loop back is considered a value relative to length Any invalid combination of length and loopback will be skipped during the generation solving process e the symbol X which means no loopback e the symbol which means all possible loopback from zero to length 1 o filename
77. er one in accordance with the ordering depicted in Figure 2 1 This means for example that word e types cannot be implic itly converted to other types or each other implicitly while the type boolean can be implicitly converted to integer or integers and symbolic enum Also in some expressions operands may be converted from one type to its set type counter part see 2 1 6 For example integer can be converted to integer set type 2 2 2 Constant Expressions A constant can be a boolean integer symbolic word or range constant constant boolean _constant integer_constant symbolic_constant word_constant range_constant Boolean Constant A boolean constant is one of the integer numbers 0 and 1 or their symbolic equiv alents FALSE and TRUE The type of a boolean constant is boolean boolean_constant one of O 1 FALSE TRUE Integer Constant An integer constant is an integer number with the exception of 0 and 1 which are taken to be boolean constants 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 asymbolic constant is symbolic enum See Section 2 3 14 Namespaces page 29 for more information about how symbolic constants are distinguished from other identifiers i e variables defines etc Word Constant Word constants begin with
78. ession of one type to a greater type The order to types is given in Figure B 1 For more information on type ordering see Section 2 2 1 Implicit Type Conversion page 9 Another kind of implicit type convertions changes the type of an expression to its counterpart set type The Figure B 2 shows the direction of such convertions For more information on set types and their counterpart types see Section 2 1 6 Set Types page 8 95 boolean l integer symbolic enum l integers and symbolic enum boolean set integer set symbolic set l integers and symbolic set word 1 word 2 word 3 Figure B 1 The ordering on the types in NUSMV boolean boolean set integer integer set symbolic enum symbolic set integers and symbolic enum integers and symbolic set B 3 Type Rules The type rules are presented below with the operators on the left and the signatures of the rules on the right To save space more than one operator may be on the left hand side and it is also the case that an individual operator may have more than one signature For more information on these expressions and their type rules see Section 2 2 Expressions page 9 Constants boolean_constant boolean integer_constant integer symbolic_constant symbolic enum word_constant range_constant integer set Variable and Defi ne Figure B 2 Implicit convertion to counterpart set types word N where N is the number of bits re
79. expr psl_binary_expr psl_conditional_expr psl_case_expr psl_property PSLSPEC psl_expr _primary_expr number j a numeric constant boolean 7 a boolean constant var_id a variable identifier psl_expr psl_expr psl_expr psl_expr psl_expr psl_expr _unary_expr psl_primary_expr psl_primary_expr psl_primary_expr _binary_expr psl_expr 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 lt psl_expr psl_expr lt psl_expr psl_expr gt psl_expr psl_expr gt psl_expr psl_expr amp psl_expr psl_expr psl_expr _conditional_expr l_expr psl_expr _case_expr case psl_expr union psl_expr psl_expr xor psl_expr psl_expr psl_expr psl_expr psl_expr psl_expr endcase 106 Among the subclasses of ps1_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 psl_expr lt gt psl_expr psl_expr gt 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
80. f and NUSMV behaves as the old versions w r t type checking and other features like writing of flattened and booleanized SMV files If set to O then the type checking is turned on and whenever a type error is encountered while compiling a NUSMV program the user is informed and the execution stopped As default it set to 0 type_checking_warning_on Environment Variable 42 Enables notification of warning messages generated by the type checking If set to 0 then messages are disregarded otherwise if set to 1 they are notified to the user As default it set to 1 show_vars Shows model s symbolic variables and their values Command show_vars h s i m o output file Prints symbolic input and state variables of the model with their range of values as defined in the input file Command Options S Prints only state variables i Prints only input variables 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 encode_variables Builds the BDD variables necessary to compile Command the model into a BDD encode_variables h i order file Generates the boolean BDD variables and the ADD needed to encode propositionally the symbolic variables declared in the model The variables are created as default in the order in which they appear in a depth first traversal
81. f remainder operator was given by the formula IF a mod b lt 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 15 1 7mod5 2 71 5 7 mod 5 2 7 5 1 7 mod 5 2 7 S 1 7 mod 5 2 whereas in the older versions on NuSMV the equations were 7 5 1 7mod5 2 71 5 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 Shift Operators lt lt gt gt The signature of the shift operators is lt lt gt gt word N integer word N word N word M word N Before checking the expression for being correctly typed the right operand can be implicitly converted from boolean to integer type Left shift lt lt and and right shift gt gt operations shift bits to the left and right respectively A shift by N bits is equivalent to N shifts by 1 bit A bit shifted behind the word bound is lost 15 During shifting the word is padded with zeros For instance 0b4_0001 lt lt 2 is equal to 0b4_0100 lt lt 1 is equal to 0b4_1000 lt lt 0 is equal to 0b4_1000 It has to be remarked that the shifting requires the right operand to be greater or equal to zero and less then the width of the word it is applied to NUSMUV raises an error if a shift is attempted that d
82. f state variables and input vari ables which may assume different values in different states of a transition relation 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 document 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 NUS MV language 2 3 1 Variable Declarations A variable can be an input or a state variable The declaration of a variable specifies the variable s type with the help of type specifier Type Specifiers Atype specifier has the following syntax type_specifier simple_type_specifier module_type_specifier simple_type_specifier boolean 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 There are two kinds of type specifier asimple type specifier and a module type specifier The module type specifier is explained later in Section 2 3 10 MODULE Ins
83. g NuSMV interactively The main interaction mode of NUSMV is through an interactive shell In this mode NUSMV enters a read eval print loop The user can activate the various NUSMV 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 NUS MV is activated from the system prompt as follows NuSMV gt is the default NUSMV shell prompt system prompt gt NuSMV int lt RET gt NuSMV gt A NUSMV 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 NUSMV 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 NUSMV read and execute a sequence of commands from a file through the command line option load system_prompt gt NuSMV int load cmd_file lt RET gt load cmd file Starts the interactive shell and then executes NUSMV 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 variabl
84. ger is less than integers and symbolic enum etc The word e types are not comparable with any other type or between each other Any type is equal to itself Note that enumerations containing only integer numbers have the type integer unless the only elements are 1 and 0 in which case the type is boolean 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 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 NUSMV 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 42 for further information If additionally the system variable type _checking_warning on is unset then even these warnings will not be printed out 2 2 1 Implicit Type Conversion In certain expressions NUSMV can implicitly convert operands from one type to another Such implicit conversion can be performed from a smaller type to a bigg
85. h page 87 we define the batch mode of NUSMV NUSMV is available at http nusmv irst itc it Chapter 2 Input Language In this chapter we present the syntax and semantics of the input language of NUSMV 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 lt SPACE gt tab lt TAB gt and new line lt RET gt Any string starting with two dashes and ending with a newline is a comment and ignored by the parser The syntax rule for an identifier is identifier identifier _first_character identifier identifier consecutive_character identifier
86. he 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 ASSIGN a exp is equivalent to INVAR a in exp ASSIGN init a exp is equivalent to INIT a in exp ASSIGN next a exp is equivalent to TRANS next a in exp 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 boolean boolean boolean boolean set 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 word N word N boolean word 1 word 1 boolean Before checking the assignment for being correctly typed the implicit type conversion can be applied to the right operand Rules for assignments Assignments describe a system of equations that say how the FSM evolves through time With an arbitrary set of equations there is no guarantee that a solution exists or that it is unique We tackle this problem by placing certain restrictive syntactic rules on the structure of assignments t
87. heck_1tlspec_bme 55 check_1t1spec sbmc_inc 61 check_1t1spec _sbmc 60 check_1t1spec 52 check_property 53 check_pslspec 67 check_spec 50 compute reachable 48 compute 52 dynamic var ordering 76 echo 79 encode variables 43 flatten_hierarchy 42 gen_invar _bmc 64 gen 1t1spec bmc_ onepb 58 gen_1t1spec_bmc 57 gen 1t1spec sbmc 62 go_bme 54 goto state 71 go 46 help 79 history 79 pick_state 68 print_bdd_stats 78 print current state 71 print fair_states 49 print fair transitions 49 print_fsm_stats 49 110 print_iwls95options 46 print _reachable_states 48 print _usage 80 process_model 46 quit 80 read_model 42 read_trace 72 reset 81 set_bdd_parameters 78 set 81 show plugins 71 show_traces 72 show_vars 43 simulate 69 source 82 time 83 unalias 83 unset 84 usage 84 which 84 write_boolean_model 47 write_flat_model 47 write_order 44 Variable Index NuSMV_LIBRARY_PATH 85 88 affinity 45 ag_only _search 50 autoexec 84 backward_compatibility 42 bmc_dimacs_filename 63 bmc_inc_invar _alg 66 bmc_invar_alg 66 bmc_invar_dimacs_filename 66 bmc_length 63 bmc_loopback 63 bmc_sbmc_gf_fg_opt 64 check_fsm 48 conj_part_threshold 45 default_trace_plugin 72 filec 85 forward_search 50 history char 85 image W 1 2 3 4 45 image cluster size 45 image verbosity 46 input_file 42 input order file 43 iwls95preorder 46 1tl_tableau_forward_search
88. hus guaranteeing that the program is implementable The restriction rules for assignments are e The single assignment rule each variable may be assigned only once 23 e The circular dependency rule a set of equations must not have cycles in its depen dency graph not broken by delays The single assignment rule disregards conflicting definitions and can be formulated as one may either assign a value to a variable x or to next x and init x but not both For instance the following are legal assignments Example 1 x expri Example 2 init x expr1 Example 3 next x expri Example 4 init x expri next x expra while the following are illegal assignments Example 1 x expri X expr2 Example 2 init x expri init x expra Example 3 x expri init x expra Example 4 x expri next x expra If we have an assignment like x y then we say that x depends on y A combinatorial loop is a cycle of dependencies not broken by delays For instance the assignments x y y r x form a combinatorial loop Indeed there is no fixed order in which we can compute x and y since at each time instant the value of x depends on the value of y and vice versa We can introduce a unit delay dependency using the next operator x i Y next y x In this case there is a unit delay dependency between x and y A combi
89. iable Command set h lt name gt lt value gt A variable environment is maintained by the command interpreter The set command sets a variable to a particular value and the unset command removes the definition of a variable If set is given no arguments it prints the current value of all variables Command Options lt name gt Variable name lt value gt Value to be assigned to the variable 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 gt set foo bar NuSMV gt echo foo bar The last line bar will be the output produced by NUSMV Variables can be extended by using the character to concatenate values For example NuSMV gt set foo bar NuSMV gt set foo foo foobar NuSMV gt 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 gt set foo bar this NuSMV gt echo foo bar this The last line will be the output produced by NUSMV But in the following the value of the variable foo bar will not be interpreted correctly NuSMV gt set foo bar this NuSMV
90. ich has been generated by NUSMV or that has been loaded with the read_t race command The plugin that is used to read in a trace is also shown The current default plugin is marked with D 71 All the available plugins are displayed by default if no command options are given default_trace_plugin Environment Variable This determines which trace plugin will be used by default when traces that are generated by NUSMV 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 show_traces Shows the traces generated in a NuSMV session Command show_traces h v t m o output file p plugin no Ta trace_number Shows the traces currently stored in system memory if any By default it shows the last generated trace if any Command Options v Verbosely prints traces content all state variables otherwise it prints out only those variables that have changed their value from previous state This option only applies when the Basic Trace Explainer plugin is used to display the trace t Prints only the total number of currently stored traces a Prints all the currently stored traces m Pipes the output through 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
91. ification is ctl_specification CTLSPEC ctl_expr SPEC ctl_expr The syntax of CTL formulas recognized by NUSMV is as follows 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 gt ctl_expr logical implies ctl_expr lt gt 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 ct l_expr cannot contain it either The ct 1_expr should also be a boolean expression Intuitively the semantics of CTL operators is as follows e EX pis true in a state s if there exists a state s such that a transition goes from s to s and pis true in s 31 e AX pis true in a state s if for all states s where there is a transition from s to s pis true ins e EF pis true in a state so if there exists a series of transitions so S1 1 S2 Sn 1 Sn Such that p is true in sn e AF pistrue ina state so if for all series of transitions so 1 1 S2 Sn 1 Sn pis true in Sn e EG pistrue in a state so if there exists an infinit
92. in gt gt gt e Digits can be separated by the underscore character _ to aid clarity for example 0b_0101_1111_1100 which is equivalent to 0b 010111111100 e 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 4and 5 Other examples of range constant canbe 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 2 2 3 Basic Expressions A basic expression is the most common kind of expression used in NUSMV basic_expr constant a Constant variable_identifier a variable identifier define_identifier a define identifier basic_expr basic_expr logical or bitwise NOT basic_expr amp basic_expr logical or bitwise AND basic_expr basic_expr logical or bitwise OR basic_expr xor basic_expr logical or bitwise exclusive OR 11 basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_exp basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr basic_expr
93. in 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 55 1 loopback The loopback value may be e 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 e 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 e the symbol X which means no loopback e 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 e F model name with path part e Cf model name without path part e Ok current problem bound e l current loopback value e On index of the currently processed formula in the prop erty database e 00 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 check_1t1spec bmc on
94. 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 2 3 6 TRANS Constraint The transition relation of the model is a set of current state next state pairs Whether or not a given pair is in this set is determined by a boolean expression introduced by the TRANS keyword The syntax of a TRANS constraint is trans_constraint TRANS next_expr 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 22 2 3 7 ASSIGN Constraint An assignment has the form 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 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 t
95. ing after having checked all the specification if any Enables dynamic reordering of variables Uses method when variable ordering is enabled Pos sible values for method are those allowed for the reorder_method environment variable see Section 3 8 Interface to DD package page 75 Enables monolithic transition relation conjunctive partitioning with threshold of each partition set to cp_t DEFAULT with cp 1000 DEPRECATED use thresh instead Enables Iwls95 conjunctive partitioning and sets the thresh old of each partition to cp_t Disables affinity clustering Enables Jwis95CP preordering Enables BMC instead of BDD model checking works only for LTL properties and PSL properties that can be translated into LTL Sets bmc_length variable used by BMC Sets sat_solver variable used by BMC so select the sat solver to be used 89 sin on off rin onoff Enables on or disables off Sexp inlining by setting sys tem variable sexp_inlining Default value is 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 90 Bibliography ABE00 BCCZ99 BCL 94 CBM90 CCG 02 CCGR00 CGH97 Di188 EMSS91 ES04 KHLOS P A Abdulla P Bjesse and N E n Symbolic reachability analysis based on sat solvers In Proceedi
96. ing the command check _fsm Command Options m 0o output file p compute expr context n number Pipes the output generated by the command in process ing COMPUTEs to the program specified by the PAGER shell variable if defined else through the UNIX command more Writes the output generated by the command in processing COMPUTESs to the file output file IM COMPUTE formula to be checked context is the module instance name which the variables in compute expr must be evaluated in Computes only the property with index number check_property Checks a property into the current list of proper Command ties or a newly specified property check_property n number c l i s q p formula IN context Checks the specified property taken from the property list or adds the new specified prop erty and checks it It is possible to check LTL CTL INVAR PSL and quantitative COMPUTE properties Every newly inserted property is inserted and checked Command Options C m Checks all the CTL properties not already checked If p is used the given formula is expected to be a CTL formula Checks all the LTL properties not already checked If p is used the given formula is expected to be a LTL formula Checks all the INVAR properties not already checked If p is used the given formula is expected to be a INVAR formula Checks all the P S
97. ing to the reordering methods available with the CUDD pack age are listed below The default value is sift sift Moves each variable throughout the order to find an opti mal position for that variable assuming all other variables are fixed This generally achieves greater size reductions than the window method but is slower random Pairs of variables are randomly chosen and swapped in random _pivot sift_converge symmetry_sift 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 Same as random but the two variables are chosen so that the first is above the variable with the largest num ber of nodes and the second is below that variable In case there are several variables tied for the maximum number of nodes the one closest to the root is used The sift method is iterated until no further improvement 1s obtained This method is an implementation of symmetric sifting It is similar to sifting with one addition Variables that be come 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 sin gle variable lTo be exact M C Ma where M is the model from which the trace was generated and Ma is the currently loaded and built
98. irst_character digit one of HN digit one of 0123456789 Note that there are certain reserved keyword which cannot be used as identifiers see page 6 Variable and DEFINE Identifiers define_identifier complex_identifier variable_identifier complex_identifier Complex Identifiers complex_identifier identifier complex_identifier identifier complex_identifier simple expression self Integer Numbers integer_number 100 digit digit integer_number digit Constants constant boolean_constant integer_constant symbolic_constant word_constant range_constant boolean_constant one of 0 1 FALSE TRUE integer_constant integer_number symbolic_constant identifier word_constant word_width word_base word_value word_width integer_number gt 0 word_base b B o oj dj D4ftthi H word_value hex_digit word_value hex_digit word_value _ hex_digit one of 012345678 9abcde fABCDEF 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 basic_expr logical bitwise NOT basic_expr basic_expr logical bitwise AND basic_expr basic_expr logical bitwise OR basic_expr xor basic_expr
99. l previous time steps t lt t e O pis true at time t if p held in at least one of the previous time steps t lt t e p S qis true at time t if q held at time t lt t and p holds in all time steps from t to t inclusive e p T qis true at time t if p held at time t lt t and q holds in all time steps from t to t inclusive Alternatively if p has never been true then q must hold in all time steps from to to t An LTL formula is true if it is true at the initial time t 0 In NUSMV 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 NUSMV 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 NUSMV 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 NUSMV generates a propositional satisfiability problem that is then tackled by means of an efficient SAT solver BCCZ99 In both cases the tableau cons
100. le Forces the computation of the set of reachable states for the tableau resulting from BDD based LTL model checking performed by command check_1t1spec If the variable 1tl tableau forward_search is not set default the resulting tableau will inherit the computation of the reachable states from the model if enabled If the variable is set 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_1t1spec but may also lead to a dramatic slowing down This variable has effect only when the calculation of reachable states for the model is enabled see forward_search check_invar Performs model checking of invariants Command check invar h m o output file n number p invar expr IN context 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 50
101. les MODULE main VAR a boolean b foo ahs MODULE foo x ASSIGN x i 1 the variable a is assigned the value 1 This distinguishes the call by reference mechanism from a call by value scheme Now consider the following program MODULE main DEFINI a 0 VAR b bar a E MODULE bar x E DEFINE a 1 Y Xi 8This 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 26 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 12 Processes page 28 2 3 11 References to Module Components Variables and Defi nes and Array Elements in Expressions As described in Section 2 2 3 Variables and Defines page 12 defines and variables can be referenced in expressions as variable_identifiers and define identifiers respectively both of which are complex identifiers The syntax of a complex identifieris complex_identifier identifier complex_identifier identifier complex_identifier simple expression self Every variable and define used in an expre
102. les For instance an environment variable specifies the partitioning method to be used in building the transition rela tion The value of environment variables can be inspected and modified with the set command Environment variables can be either logical or utility autoexec Environment Variable Defines a command string to be automatically executed after every command processed by the command interpreter This may be useful for timing commands or tracing the progress of optimization on_failure_script_quits Environment Variable When a non fatal error occurs during the interactive mode the interactive interpreter sim ply stops the currently executed command prints the reason of the problem and prompts for a new command When set this variables makes the command interpreter quit when an error occur and then quit NUSMV This behaviour might be useful when the command source is controlled by either a system pipe or a shell script Under these conditions a mistake within the script interpreted by source or any unexpected error might hang the controlling script or pipe as by default the interpreter would simply give up the current execution and wait for further commands The default value of this environment variable is 0 84 fi lec 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 lt TAB gt key
103. loopback values it does not iterate incre menting the value of the problem bound 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 The loopback value may be e 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 e 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 e the symbol X which means no loopback e the symbol which means all possible loopbacks from zero to length 1 If no value is given the environment vari able bmc_loopback is considered instead 3 5 Simulation Commands In this section we describe the commands that allow to simulate a NUSMV specification See also the section Section 3 6 Traces page 70 that describes the commands available for manip ulating traces pick_state Picks a state from the set of initial states Command pick stat h r i a c constraints 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 st
104. loopback will be skipped during the generation solving process e the symbol X which means no loopback e 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 check 1t1spec sbmc h n idx p formula IN context k max_length 1 loopback o filename This command generates one or more problems and calls SAT solver for each one The BMC encoding used is the one by of Latvala Biere Heljanko and Junttila as described in LBHJOS 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 1 option or by its default value stored in the environment 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
105. mand line context is the module instance name which the variables in formula must be evaluated in 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 61 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 e OF model name with path part e f model name without path part e Ok current problem bound e 1 current loopback value e On index of the currently processed formula in the prop erty database e 00 the character N Does not perform virtual unrolling 6 Performs completeness check gen_Itlspec_sbme 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 gen 1t1spec sbmec h n idx p formula IN context k max l1ength 1 loopback o filename This command generates one or more problems and dumps each problem into a dimacs file The BMC encoding used is the one by of Latvala Biere Heljanko and Junttila as de scribed in LBHJOS 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
106. n simple_expr basic_expr Note that simple expressions cannot contain next operators Next Expression next_expr basic_expr Type Specifier type_specifier simple_type_specifier module_type_spicifier simple_type_specifier boolean word integer_number enumeration_type_body integer_number integer_number array integer_number integer_number of simple_type_specifier enumeration_type_body 102 enumeration_type_value enumeration_type_body enumeration_type_value enumeration_type_value symbolic_constant integer_number Input Variable ivar_declaration IVAR var_list DEFINE Declaration define_declaration DEFINE define_body define_body identifier simple_expr define _body identifier simple_expr 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 init complex_identifier simple_expr 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 iden
107. n 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_st ate 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 Displays all the state variables changed and unchanged during every step of an interactive session This option works only if the i option has been specified 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 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 intermediate step because it may not exist any future state satisfying those constraints A trace
108. n In H Fuchs and W H Freeman editors Proceedings of the 1985 Chapel Hill Conference on VLSI pages 245 260 New York 1985 K L McMillan The smv system draft In Available at http www cs cmu edu modelcheck smv smvmanual r2 1992 K L McMillan Symbolic model checking In Kluwer Academic Publ 1993 Moon Hachtel and Somenzi Border block tringular form and conjunction schedule in image computation In FMCAD 2000 Language Front End for Sugar Foundation Language http www haifa il ibm com projects verification sugar parser html Accellera Property Specification Language Reference Manual Version 1 01 http www eda org vfv docs psl_lrm 1 01 pdf April 2003 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 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 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 P A Strooper W Johnston K Winter L van den Berg and P Robinson Model based variable and transi
109. n_invar_bmc Generates the given invariant or all invariants if Command no formula is given gen invar bmc h n idx p formula IN context o filename At the moment the invariants are generated using classic algorithm only see the de scription of check_invar_bmc on page 64 64 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 IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in o filename filename is the name of the dumped dimacs file If you do not use this option the dimacs file name is taken from the environment variable bmc_invar_dimacs_filename File name may contain special symbols which will be macro expanded to form the real dimacs file name Possi ble symbols are e F model name with path part e f model name without path part e n index of the currently processed formula in the prop erties database e the character check_invar_bmc_ine Generates and solves the given invariant Command or all invariants if no formula is given using incremental algo rithms check_invar bmc inc h n idx p formula IN context Ta algorithm This command does the same thing as check_invar_bmc see the description on page 64 but
110. name Environment Variable This is the default file name used when generating DIMACS problem dumps This variable may be taken into account by all commands which belong to the gen ltlspec_ bmc family DIMACS file name can contain special symbols which will be expanded to represent the actual file name Possible symbols are e F The currently loaded model name with full path e f The currently loaded model name without path part e n The numerical index of the currently processed formula in the property database e k The currently generated problem length e I The currently generated problem loopback value e The character The default value is _k k_1 1mn n 63 bmc_ sbmc_gf fg_opt Environment Variable Controls whether the system exploits an optimization when performing SBMC on formu lae in the form FGp or GF p The default value is 1 active check_invar_bmc Generates and solves the given invariant or all Command invariants ifno formula is given check_invar_bmc h n idx p formula IN context Ta alg o filename In Bounded Model Checking invariants are proved using induction For this satisfiability problems for the base and induction step are generated and a SAT solver is invoked on each of them At the moment two algorithms can be used to prove invariants In one algorithm which we call classic the base and induction steps are built on one state and one transition respectivel
111. natorial loop is a cycle of dependencies whose total delay is zero In NUSMV combinatorial loops are illegal This guarantees that for any set of equations describing the behavior of variable there is at least one solution There might be multiple solutions in the case of unassigned variables or in the case of non deterministic assignments such as in the following example next x case x 1 1 1 3 0 1 esac 2 3 8 FAIRNESS Constraints A fairness constraint restricts the attention only to fair execution paths When evaluating speci fications the model checker considers path quantifiers to apply only to fair paths NUSMV supports two types of fairness constraints namely justice constraints and com passion constraints A justice constraint consists of a formula f which is assumed to be true infinitely often in all the fair paths In NUSMV justice constraints are identified by keywords 24 JUSTICE and for backward compatibility FAIRNESS A compassion constraint consists of a pair of formulas p q if property p is true infinitely often in a fair path then also formula q has to be true infinitely often in the fair path In NUSMV compassion constraints are identified by keyword COMPASSION If compassion constraints are used then the model must not con tain any input variables Currently NUSMV does not enforce this so it is the responsibility of the user to make sure that this is the case Fairness constraints are declared u
112. ng to improve model checking performance See affinity variable e Iwls95CP Conjunctive partitioning with clusters generated and ordered according to the heuristic described in RAPT95 Works in conjunction with the variables image cluster_size image W1 image_W2 image_W3 image_W4 It is possible default to use affinity clustering to improve model checking performance See affinity variable It is also possible to avoid default preordering of clusters see RAP 95 by setting the iwls95preorder variable appropriately conj_part_threshold Environment Variable The limit of the size of clusters in conjunctive partitioning The default value is 0 BDD nodes affi nity Environment Variable Enables affinity clustering heuristic described in MHS00 possible values are 0 or 1 The default value is 1 trans_order_file Environment Variable Reads the a variables list from file tvfile to be used when clustering the transition rela tion This feature has been provided by Wendy Johnston University of Queensland The results of Johnston s research have been presented at FM 2006 in Hamilton Canada See WJKWLvdBRO6 image_cluster_size Environment Variable One of the parameters to configure the behaviour of the Jw s95CP partitioning algorithm image cluster size is used as threshold value for the clusters The default value is 1000 BDD nodes image_W 1 2 3 4 Environment Variable The other parameters for the Jwis95CP partitio
113. ngs of Tools and Algorithms for Construction and Analysis of Systems 6th International Conference TACAS 2000 volume 1785 of Lecture Notes in Computer Science pages 411 425 Springer 2000 A Biere A Cimatti E Clarke and Y Zhu Symbolic model checking without bdds In Tools and Algorithms for Construction and Analysis of Systems In TACAS 99 March 1999 J R Burch E M Clarke D E Long K L McMillan and D L Dill Sym bolic model checking for sequential circuit verification In JEEE Trans actions on Computer Aided Design of Integrated Circuits and Systems 13 4 401 424 April 1994 O Coudert C Berthet and J C Madre Verification of synchronous se quential machines based on symbolic execution In In J Sifakis editor Proceedings of the International Workshop on Automatic Verification Meth ods for Finite State Systems volume 407 of LNCS pages 365 373 Berlin June 1990 A Cimatti E Clarke E Giunchiglia F Giunchiglia M Pistore M Roveri R Sebastiani and A Tacchella Nusmv 2 An opensource tool for symbolic model checking In Proceedings of Computer Aided Verification CAV 02 2002 A Cimatti E Clarke F Giunchiglia and M Roveri Nusmv a new sym bolic model checker In International Journal on Software Tools for Tech nology Transfer STTT 2 4 March 2000 E Clarke O Grumberg and K Hamaguchi Another look at Itl model checking In Formal Methods in System Design 10 1 57 71 Februar
114. ning algorithm These attribute different weights to the different factors in the algorithm The default values are 6 1 1 6 respec tively For a detailed description please refer to RAPT 95 45 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 image_verbosity Environment Variable Sets the verbosity for the image method wls95CP possible values are 0 or 1 The default value is 0 print_iwls95options Prints the Iwls95 Options Command print iwls95o0ptions h This command prints out the configuration parameters of the IWLS95 clustering algorithm ie image_verbosity image cluster size and imageW 1 ECO A 4 go Initializes the system for the verification Command go h f This command initializes the system for verification It is equivalent to the command sequence readmodel 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 process model Performs the batch steps and then returns control Command to the interactive shell process model h 7r i model file m Method Reads the model compiles it into BDD and performs the model checking of all the specifi c
115. nt file x Echoes each command before it is executed lt file gt File name 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 o read model i 2 flatten hierarchy build variables build model compute_fairness Typing source test scr short smv on the command line will execute the sequence 82 readmodel i short smv flatten_ hierarchy build ivariables build model compute_fairness In this case 3 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 read model i bozo flatten_ hierarchy build variables build model compute_fairness 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 readmodel i short smv flatten_ hierarchy build variables build model compute_fairness 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 Provides
116. nvironment variable bmc_length is considered instead 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 bmc_invar_alg Environment Variable Sets the default algorithm used by the command check_invar_bmc Possible values are classic and een sorensson The default value is classic bmc_inc_invar_alg Environment Variable Sets the default algorithm used by the command check_invar_bmc inc Possible val ues are dual and zigzag The default value is dual bmc_invar_dimacs_fi lename Environment Variable This is the default file name used when generating DIMACS invar dumps This variable may be taken into account by the command gen_invar_bmc DIMACS file name can contain special symbols which will be expanded to represent the actual file name Possible symbols are e F The currently loaded model name with full path e f The currently loaded model name without path part e On The numerical index of the currently processed formula in the properties database e The character The default value is Rf_invar_ntn sat_solver Environment Variable The SAT solver s name actually to be used Default SAT solver is SIM Depending on the NUSMV configuration also the Zchaff and MiniSat SAT solvers can be available or not Notice that Zchaff and MiniSat are for non commercial purposes only bmc_simulate Generates a
117. obust and close to industrial systems standards CCGROO Version 1 of NUSMV basically implements BDD based symbolic model check ing Version 2 of NUSMV NUSMV2 in the following inherits all the functionalities of the previous version and extends them in several directions CCG 02 The main novelty in NUSMV2 is the integration of model checking techniques based on proposi tional satisfiability SAT BCCZ99 SAT based model checking is currently enjoying a substantial success in several industrial fields and opens up new research directions BDD based and SAT based model checking are often able to solve different classes of problems and can therefore be seen as complementary techniques Starting from NUSMV2 we are also adopting a new development and license model NUSMV2 is distributed with an OpenSource license that allows anyone interested to freely use the tool and to participate in its development The aim of the NUSMV OpenSource project is to provide to the model checking community a common platform for the research the implementation and the comparison of new symbolic model checking techniques Since the release of NUSMV2 the NUSMV team has received code contributions for different parts of the system Several research institutes and commercial companies have expressed interest in collaborating to the development of NUSMV The main features of NUSMV are the following e Functionalities NUSMV allows for the representation of synchron
118. oes not satisfy this restriction Bit Selection Operator The bit selection operator extracts consecutive bits from a word e expression resulting in a new word e expression This operation always decreases the width of word e or leaves it intact The left expression in the brackets is the high bound and the right one is the low bound The high bound must be greater than or equal to the low bound The bits count from 0 The result of the operations is a word e value consisting of the consecutive bits beginning from the high bound of the operand down to and including the low bound bit For example 0b7_1011001 4 1 extracts bits 1 through 4 including 1st and 4th bits and is equal to 0b4_1100 0b3_101 0 0 extracts bit number 0 and is equal to 0b1_1 The signature of the bit selection operator is word N integer integer gt word integer integer 1 where 0 lt integer ou lt integer lt N Word Concatenation Operator The concatenation operator joins two words together to create a larger word type The operator itself is two colons and its signature is as follows word M word N word M N boolean word N word N 1 word N boolean word N 1 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 For example given the two words w1 0b4_1101andw2 0b2_00 then the result of w1
119. old semantics of and mod operations from NUSMV 2 3 0 instead of ANSI C semantics Runs preprocessor on SMV files before any of those speci fied with the pre option Specifies a list of pre processors to run in the order given on the input file before it is parsed by NUSMV 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 itis a space seperated list of pre processor names contained within double quotes prints flattened model to file fn_file Prints boolean model to file bn_file Lists all properties in SMV model Specifies which property of SMV model should be checked Does not check SPEC Does not check COMPUTE Does not check LTLSPEC Does not check PSLSPEC Does not check INVARSPEC Checks whether the transition relation is total 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 Prints the number of reachable states before exiting If the option is not used the set of reachable states is computed 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 other
120. oolean word 1 boolean boolean Before checking the expression for being correctly typed implicit type conversion can be carried out on one of the operands For example in the expression TRUE 5 the left operand is of type boolean and the right one is of type integer Though the signature of the operation does not have a boolean integer rule the expression is correct because after implicit type conversion on the left operand the types of the operands will be integer integer which is a valid signature for the operator This is also true if one of the operands is of type word 1 and the other one is of the type boolean In this case one of the operands is converted to the type of the other one and then the equality is checked Relational Operators gt lt gt lt The relational operators gt greater than lt less than gt greater than or equal to and lt less than or equal to have the following signature gt lt gt lt boolean boolean boolean integer integer boolean word N word N boolean boolean word 1 boolean word 1 boolean boolean Before checking the expression for being correctly typed implicit type conversion can be carried out on one of the operands boolean and word e types are implicitly converted to their integer equivalents before the result of these operations is calculated Arithmetic Operators The arithmetic
121. operators addition subtraction multiplication and division have the following signature boolean boolean integer integer integer integer word N word N word N integer integer word N word N Before checking the expression for being correctly typed the implicit type conversion can be applied to one of the operands The boolean operands are converted to the integer type before performing the arithmetic operation If the operators are applied to a word N type then the operations are performed modulo 2 The result of the operator is the quotient from the division of the first operand by the second When integers are divided the result of the operator is the algebraic quotient with any fractional part discarded this is often called truncation towards zero If the quotient 2It is does not matter which operand is converted the result will be the same 14 a b is representable the expression a b b a mod b shall equal a If the value of the second operand is zero the behavior is undefined and an error is thrown by NUSMV The semantics is equivalent to the corresponding one of C C languages In the versions of NUSMV prior to 2 4 0 the semantics of division was different See page 15 for more detail 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 beha
122. operators AND 13 arithmetic 14 bit selection 16 equality 13 IFF 13 IMPLIES 13 inclusion 17 inequality 13 NOT 13 OR 13 precedence 12 relational 14 shift 15 union 17 word concatenation 16 XNOR 13 XOR 13 options 87 OR logical and bitwise 13 P parentheses 13 process 28 processes 28 process keyword 28 PSL Specifications 35 R Real Time CTL Specifications and Compu tations 33 S Scalar Variables 39 self 28 set expressions 17 set types 8 Shell configuration Variables 84 Shift Operator 15 simple expressions 18 Simulation Commands 68 States Variables Table 73 state variables 20 state variables syntax 21 syntax rules complex identifiers 27 identifiers 6 main program 29 module declarations 25 symbolic constants 7 type specifiers 19 T Trace Plugin Commands 71 Trace Plugins 73 Traces 70 TRANS constraint 22 type order 8 types 7 array 8 boolean 7 enumerations 7 implicit conversion 9 integer 7 ordering 8 set 8 word 8 type specifiers 19 A4 variable declarations 19 variables 12 W wordl operator 16 word type 8 X XML Format Printer 74 XML Format Reader 74 XNOR logical and bitwise 13 XOR logical and bitwise 13 114
123. orms a simulation from the current selected state Command simulat A p wl e l i a c constraints steps Generates a sequence of at most steps states representing a possible execution of the model starting from the current state The current state must be set via the pick state or goto_state commands It is possible to run the simulation in three ways according to different command line policies deterministic the default mode random and interactive The resulting sequence is stored in a trace indexed with an integer number taking into account the total number of traces stored in the system There is a different behavior in the way traces are built according to how current state is set current state is always put at the beginning of a new trace so it will contain at most steps 1 states except when it is the last state of an existent old trace In this case the old trace is lengthened by at most steps states 69 Command Options P c constraints steps 3 6 Traces Prints current generated trace only those variables whose value changed from the previous state Verbosely prints current generated trace changed and un changed state variables Picks a state from a set of possible future states in a random way 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 expressio
124. ous and asynchronous finite state systems and for the analysis of specifications expressed in Computation Tree Logic CTL and Linear Temporal Logic LTL using BDD based and SAT based model checking techniques Heuristics are avail able for achieving efficiency and partially controlling the state explosion The interaction with the user can be carried on with a textual interface as well as in batch mode Architecture A software architecture has been defined The different compo nents and functionalities of NUSMV have been isolated and separated in mod lsee http www opensource org ules Interfaces between modules have been provided This reduces the effort needed to modify and extend NUSMV Quality of the implementation NUSMV 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 NUSMV 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 NUSMV very robust portable efficient and easy to understand by people other than the developers This document is structured as follows e In Chapter 2 Input Language page 6 we define the syntax of the input language of NUSMV e In Chapter 3 Running NuSMV interactively page 41 the commands of the interaction shell are described e In Chapter 4 Running NuSMV batc
125. pe 7 bool operator 16 C case expressions 17 Commands for Bounded Model Checking 54 Commands for checking PSL specifica tions 67 comments in NUSMV language 6 compassion constraints 24 concatenation operator 16 constant expressions 9 CONSTANTS declarations 22 context 30 CTL specifications 31 D DD package interface 75 declarations 29 DEFINE declarations 21 defines 12 definition of the FSM 19 Displaying Traces 71 E enumeration types 7 expressions 9 basic expressions 11 basic next 18 case 17 constants 9 next 18 sets 17 simple 18 F fair execution paths 24 fairness constraints 24 fair paths 24 I identifiers 27 IFF logical and bitwise 13 implicit type conversion 9 IMPLIES logical and bitwise 13 inclusion operator 17 infinity 34 INIT constraint 22 Input File Syntax 38 input variables syntax 20 21 Inspecting Traces 71 integer type 7 interactive running NUSMV 41 interactive shell 41 interface to DD Package 75 INVAR constraint 22 Invariant Specifications 32 INVARSPEC Specifications 32 ISA declarations 30 J justice constraints 24 K keywords 6 L LTL Specifications 32 M main module 29 master nusmvrc 88 model compiling 42 model parsing 42 model reading 42 113 MODULE declarations 25 MODULE instantiations 26 N namespaces 29 next expressions 18 NOT logical and bitwise 13 O operator mod 15
126. pecified 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 e F model name with path part e f model name without path part e Ok current problem bound e 1 current loopback value e On index of the currently processed formula in the prop erty database e 00 the character gen_Itlspec_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 gen_ltlspec bmc_onepb h n idx p formula IN context k length 1 loopback o filename As the gen_1t lspec_bmc command but it generates and dumps only one problem given its bound and loopback Command Options n index index is the numeric index of a valid LTL specification for mula actually located in the properties database The valid ity of index value is checked out by the system 58 p formula IN context k length 1 loopback Checks the formula specified on the command line context is the module instance name which the variables in formula must be evaluated in length is the single problem bound used to generate and dump it Only natural numbers are valid values for this option If no value is given the environmen
127. quired variable_identifier Type where Type is the type of the variable define_identifier 96 Type where Type is the type of the define s expression Arithmetic Operators boolean integer integer integer word N word N The implicit type conversion can be applied to the operand boolean boolean integer integer integer integer word N word N word N The implicit type conversion can be applied to one of the operands mod integer 2 boolean integer integer integer word N word N word N For operations on words the result is taken modulo 2N lt boolean boolean boolean integer integer boolean word N word N boolean boolean word 1 boolean word 1 boolean boolean The implicit type conversion can be applied to one of the operands Logic Operators negation boolean boolean word N word N amp gt lt gt xor xnor boolean boolean boolean word N word N word N boolean boolean boolean integer integer boolean symbolic enum symbolic enum boolean integers and symbolic enum integers and symbolic enum boolean word N word N boolean boolean word 1 boolean word 1 boolean boolean The implicit type conversion can be applied to one of the operands Bit Wise Operators concatenation word N
128. rameters h s Applies the variables table of the NUSMV 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 3 9 Administration Commands This section describes the administrative commands offered by the interactive shell of NUSMV shell_command Command 1 executes a shell command The shell command is executed by calling bin sh c shelllcommand If the command does not exists or you have not the right to execute it then an error message is printed alias Provides an alias for a command Command alias h lt name gt lt string gt The alias command if given no arguments will print the definition of all current aliases Given a single argument it will print the definition of that alias if any Given two arguments the keyword lt name gt becomes an alias for the command string lt string gt replacing any other alia
129. rated by the command to the pro gram specified by the PAGER shell variable if defined else through the UNIX command more Writes the output generated by the command to the file output file print fair_states Prints out the number of fair states print fair states h v Command Prints the number of fair states of the given model In verbose mode prints also the list of all fair states print fair_transitions Prints out the number of fair states print_fair_transitions h v Command Prints the number of fair transitions of the given model In verbose mode prints also the list of all fair transitions The transitions are displayed as state input pairs check_ctlspec Performs fair CTL model checking Command check ctlspec h m o output file n number p ctl expr IN context Performs fair CTL model checking A ctl expr to be checked can be specified at command line using option p Alternatively option n can be used for checking a particular formula in the property database If neither n nor p are used all the SPEC formulas in the database are checked Command Options m o output file p ctl expr IN context Pipes the output generated by the command SPEC s to the program specified by the PAG in processing ER shell vari able if defined else through the UNIX command more Writes the output generated by the command SPEC s to the file outp
130. rop erty database e 00 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 check_1t1spec sbmc inc h n idx p formula IN context k max length o filename N c This command generates one or more problems and calls SAT solver for each one The In cremental BMC encoding used is the one by of Heljanko Junttila and Latvala as described in KHLOS For each problem this command incrementally generates many satisfiability subproblems and calls the SAT solver on each one of them 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 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 p formula context k max_length IN index is the numeric index of a valid LTL specification for mula actually located in the properties database Checks the formula specified on the com
131. s 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 O and 1 1 In the NUSMV 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 The values in an enumeration may potentially contain only the boolean values for example 0 l or FALSE TRUE In this case the type will be boolean see Section 2 1 1 Boolean Type page 7 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 word e types are used to model arrays of bits booleans which allow bitwise logical and arithmetic operations These types are distinguishable by their width For example the type word 3 represents arrays of three bits and the type word 7 represents arrays of seven bits Note that the width has to be greater than zero 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 array 0 3 of boolean array 10 20 of OK y z array 1 8 of array 1 2 of word 5 The type array 1 8 of array 1 2 of word 5 means an array of 8 ele ments from 1 to 8 ea
132. s file name by using the option o filename otherwise the default value stored in the environment variable bmc_dimacs_filename will be con sidered 57 Command Options n index index is the numeric index of a valid LTL specification for mula actually located in the properties database The valid ity of index value is checked out by the system p formula IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in k max_length max_length is the maximum problem bound used when in creasing problem bound starting from zero Only natural numbers are valid values for this option If no value is given the environment variable bmc_length value is consid ered instead 1 loopback The loopback value may be e a natural number in 0 max_length 1 A positive sign C can be also used as prefix of the number Any in valid combination of bound and loopback will be skipped during the generation and dumping process e 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 bound and loopback will be skipped during the generation process e the symbol X which means no loopback e 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 s
133. s with the same name 78 Command Options lt name gt Alias lt string gt 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 uSMV gt alias read readmodel i 1 smv set input order_file l ord uSMV gt read short will create an alias read execute read_model i short smv set input_order_file short ord And again uSMV gt alias echo2 echo Hi echo uSMV gt 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 uSMV gt 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 echo Merely echoes the arguments Command cho h o filename a lt string gt Echoes the specified string either to standard output or to filename if the option o is specified Command Options o filename Echoes to the specified filename instead of to standard out put If the option a is not specified the file filename will be overwritten if it already exists a Appends the output to the file specified by option o in stead of overwrit
134. 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 e sift_converge The sift method is iterated until no further improvement is obtained e 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 e 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 e group sift_converge The group sift method is iterated until no further improvement is obt
135. sing the following syntax all expressions are expected to be boolean fairness_constraint FAIRNESS simple_expr JUSTICE simple _expr COMPASSION simple_expr simple _expr A path is considered fair if and only if it satisfies all the constraints declared in this manner 2 3 9 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 MODULE identifier module_parameters module_body module_parameters identifier module_parameters identifier module_body module_element module_body module_element module_element var_declaration ivar_declaration define_declaration constants_declaration assign_constraint trans_constraint init_constraint invar_constraint fairness_constraint ctl_specification invar_specification 1t1_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 TIn the current version of NU
136. smv_stdout nusmv stdin Environment Variable Standard input normally st din can be re directed to a file by setting the internal variable nusmv_stdin 85 flatten_hierarchy ee show_property show_traces show_vars write_flat_model build_flat_model build_boolean_model build_model write_boolean_model check_ctlspec check_fsm goto_state bmc_simulate check_invar compute_reachable pick_state check_invar_bmc check_ltlspec print_fsm_stats simulate check_invar_bmc_inc check_property print_fair_states check_ltlspec_bmc check_pslspec print_fair_transitions check_ltlspec_bmc_inc compute print_reachable_states check_ltlspec_bmc_onepb check_Itlspec_sbmc check_Itlspec_sbmc_inc check_pslspec gen_invar_bmc gen_ltlispec_bmc gen_ltispec_bmc_onepb gen_ltlispec_sbmc Figure 3 1 The dependency among NUSMV commands 86 Chapter 4 Running NuSMV batch When the int option is not specified NUSMV runs as a batch program in the style of SMV performing some of the steps described in previous section in a fixed sequence system_prompt gt NuSMV command line options input file lt RET gt 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
137. ssion 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 lt DOT gt are used to access the components of modules For example if m is an instance of a module see Section 2 3 10 MODULE Instantiations page 26 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 a boolean p boolean MODULE foo c DEFINE flag Sal crip Here the value of m flag is the logical OR of a p and a q Individual elements of an array are accessed in the typical fashion with the index required given in square brackets For example if a identifies an array the expression a N identifies element N of array a It is an error for the expression N to evaluate to a number outside the subscript bounds of array a or to a symbolic value For example for a module definition MODULE main VAR a array 1 4 of boolean 27 aa array 1 4 of arr
138. t can take is encoded as a set of boolean variables These boolean variables represent the binary equivalents of all the possible values for the scalar variable Thus a scalar variable that can take values from 0 to 7 would require three boolean variables to represent it It is possible not only to declare the position of a scalar variable in the ordering file but each of the boolean variables which represent it If only the scalar variable itself is named then all the boolean variables which are actually used to encode it are grouped together in the BDD package Variables which are grouped together will always remain next to each other in the BDD package and in the same order When dynamic variable re ordering is carried out the group of variables are treated as one entity and moved as such If a scalar variable is omitted from the ordering file then it will be added at the end of the variable order and the specific bit variables that represent it will be grouped together However if any specific bit variables have been declared in the ordering file see below then these will not be grouped with the remaining ones It is also possible to specify that specific bit variables are placed elsewhere in the ordering This is achieved by first specifying the scalar variable name in the desired location then simply specifying Complete_Var_Name i at the position where you want that bit variable to appear Complete_Var_Name Complete_Var_Name i The res
139. t variable bmc_length is considered instead The loopback value may be e a natural number in 0 length 1 A positive sign can be also used as prefix of the number Any invalid combi nation of length and loopback will be skipped during the generation and dumping process e negative number in 1 ength Any invalid combination of length and loopback will be skipped during the genera tion process e the symbol x which means no loopback e 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 e OF model name with path part e Cf model name without path part e k current problem bound e l current loopback value e On index of the currently processed formula in the prop erty database e 00 the character check_Itlspec_bmc_ine 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 check 1t1spec bmc inc h n idx p formula IN context k max length 1 loopback For each problem this command incrementally generates many satisfiability subprobl
140. tantiations page 26 The simple type specifier comprises boolean type integer type enumeration types 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 The values in the list are enclosed in curly brackets and separated by com mas 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 that the symbolic constants TRUE and FALSE are just symbolic representations of the integer numbers 1 and 0 respectively If the list of values in the enumeration type specifier consists of just the two values 1 and 0 then the type it represents is boolean For example type specifiers TRUE FALSE and boolean are equivalent 19 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 A type specifier can be given by two integer numbers separated by lt TWO DOTS gt for example 1 5 This is just a shorthand for a enumeration type containing the listof integer numbers from the range given in type specifier For example the type specifiers 1 5and 1 0 1 2 3 4 5 are equivalent Note that the
141. tarting from a state property q holds in a future time instant i with m lt i lt n and property p holds in all future time instants j withm lt j lt i Real time CTL specifications can be defined with the following syntax which extends the syntax for CTL specifications rtctl_specification SPEC rtctl_expr 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 compute_specification COMPUTE compute_expr where compute_expr MIN rtctl_expr rtctl_expr MAX rtctl_ expr rtctl_expr 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 d
142. the Expat 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 3 7 1 Basic Trace Explainer This plugin prints out each state the current values of the variables in the trace one after the other The initial state contains all the state variables and their initial values States are numbered in the following fasion trace_number state_number 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 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 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 gt Input TRACE_NO STATE_NO lt for each input var being printed i
143. tifier 103 module_parameters identifier module_body module_element module_body module_element module_element var_declaration ivar_declaration define _declaration constants_declaration assign_constraint trans_constraint init_constraint invar_constraint fairness_constraint ctl_specification invar_specification 1t1_specification compute_specification isa_declaration Module Type Specifier module_type_specifier identifier parameter_list process identifier parameter_list parameter_list simple_expr parameter_list simple_expr ISA Declaration isa_declaration ISA identifier Warning this is a deprecated feature and will eventually be removed from NUSMV 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 gt ctl_expr logical implies ctl_expr lt gt 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
144. tifier 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 NuSMV 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 NUSMV in order to determine their truth or falsity in the FSM When a specification is discovered to be false NUSMV constructs and prints a counterexample i e a trace of the FSM that falsifies the property 2 4 1 CTL Specifi cations A CTL specification is given as a formula in the temporal logic CTL introduced by the keyword CTLSPEC however deprecated keyword SPEC can be used instead The syntax of this spec
145. ting it Use only with the option o help Provides on line information on commands Command help a h lt command gt If invoked with no arguments he 1 p prints the list of all commands known to the command interpreter If a command name is given detailed information for that command will be provided Command Options a Provides a list of all internal commands whose names begin with the underscore character by convention history list previous commands and their event numbers Command 79 history h lt num gt Lists previous commands and their event numbers This is a UNIX like history mechanism inside the NUSMV shell Command Options lt num gt Lists the last lt num gt events Lists the last 30 events if lt num gt 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 P 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 in order to escape the substitution for example to enter a into an ali
146. tion is specified the environment variable output_order_file will be considered If the variable output_ order_file is unset or set to an empty value then standard output will be used By default the bits constituting the scalar variables encoding are not dumped When a variable bit should be dumped the scalar variable which the bit belongs to is dumped instead if not previously dumped The result is a variable ordering containing only scalar and boolean model variables To dump single bits instead of the corresponding scalar variables either the option b can be specified or the environment variable write order_dumps_bits must be previ ously set When the boolean variable dumping is enabled the single bits will occur within the result ing ordering file in the same position that they occur at BDD level Command Options b Dumps bits of scalar variables instead of the single scalar variables See also the variable write_order_dumps bits o order file Sets the environment variable output_order_file to order file and then dumps the ordering list into that file f order file Alias for the o option Supplied for backward compatibility output_order_fi le Environment Variable The file where the current variable ordering has to be written The default value is temp ord vars_order_type Environment Variable Controls the manner variables are ordered by default when a variable ordering is not specified e inputs_b
147. tion 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 92 2 pS Appendix A Compatibility with CMU SMV The NUSMV 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 NUSMV The main problem is variable names in old programs that conflicts with new reserved words The list of the new reserved words of NUSMV w r t CMU SMV is the following F G X U V These names are reserved for the LTL temporal operators W H O Y Z S5 T B CTLSPEC It is used to introduce CTL specifications LTLSPEC It is used to introduce LTL specifications INVARSPEC It is used to introduce invariant specifications PSLSPEC It is used to introduce PSL specifications IVAR It is used to introduce input variables JUSTICE It is used to introduce justice fairness constraints COMPASSION It is used to introduce compassion fairness constraints CONSTANT It is used to force declaration of constants word It is used to declare word type variables wordl It is used to cast boolean expressions to word type bool It is used to cast word expressions to boolean type The IMPLEMENTS INPUT OUTPUT statem
148. tructions are completely transparent to the user 2 4 4 Real Time CTL Specifi cations and Computations NuSMYV allows for Real Time CTL specifications EMSS91 NUSMV assumes that each transition takes unit time for execution RTCTL extends the syntax of CTL path expressions with the following bounded modalities rtctl_expr ctl_expr EBF range rtctl_expr ABF range rtctl_expr 33 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 Intuitively the semantics of the RTCTL operators is as follows e EBF m n prequires that there exists a path starting from a state such that property p holds in a future time instant i with m lt i lt n e ABF m n prequires that for all paths starting from a state property p holds in a future time instant i with m lt i lt n e 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 lt i lt n e ABG m n p requires that for all paths starting from a state property p holds in all future time instants i with m lt i lt n eE 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 lt i lt n and property p holds in all future time instants j with m lt j lt i e A p BU m n q J requires that for all paths s
149. ult of doing this is that the variable representing the 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 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 39 This is just a short hand way of writing each individual specific bit variable in the ordering file The following are equivalent Complete_Var_Name 0 Complete_Var_Name 0 Complete_Var_Name 1 Complete_Var_Name Complete_Var_Name N 1 where the scalar variable Complet e_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 2 5 3 Array Variables When declaring array variables in the ordering file each individual element must be specified separately It is not permitted to specify just the name of the array The reason for this is that the actual definition of an array in the model file is essentially a shorthan
150. used to group expressions The type of the whole expression is the same as the type of the expression in the parentheses Logical and Bitwise The signature of the logical and bitwise NOT operator is boolean boolean word N word N This means that the operation can be applied to boolean or word e operands The type of the whole expression is the same as the type of the operand If the operand is not boolean or word e then the expression violates the type system and NUSMV will throw an error Logical and Bitwise xor xnor gt lt gt Logical and bitwise binary operators amp AND OR xor exclusive OR xnor negated exclusive OR gt implies and lt gt if and only if are similar to the unary operator except that they take two operands Their signature is xor xnor gt lt gt boolean boolean boolean word N word N word N the operands can be of boolean or word e type and the type of the whole expression is the type of the operands Note that both word e operands should have the same width Equality and Inequality The operators equality and inequality have the following signature 13 boolean boolean boolean integer integer boolean symbolic enum symbolic enum boolean integers and symbolic enum integers and symbolic enum boolean word N word N boolean boolean word 1 b
151. ut file in processing A CTL formula to be checked context is the module instance name which the variables in ct l expr must be evaluated in 49 n number Checks the CTL property with index number in the prop erty 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 Since version 2 4 1 this command substitutes check_spec that is deprecated check_spec Performs fair CTL model checking Command check spec h m o output file n number p ctl expr IN context Performs fair CTL model checking Since version 2 4 1 this command is deprecated but still provided for backward compati bility reasons Use check_ct 1spec instead ag only_search Environment Variable Enables the use of an ad hoc algorithm for checking AG formulas Given a formula of the form AG alpha the algorithm computes the set of states satisfying alpha and checks whether it contains the set of reachable states If this is not the case the formula is proved to be false forward_search Environment Variable Enables the computation of the reachable states during the process_model command and when used in conjunction with the ag only_search environment variable enables the use of an ad hoc algorithm to verify invariants Since version 2 4 0 this option is set by default ltl_tableau_forward_search Environment Variab
152. value_range boolean value_range psl_expr range FL_property PRIMITIVE LTL OPERATORS X FL_property FL_property L_property L_property L_property U FL_property L_property W FL_property 7 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 107 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 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 7 OPERATORS ON SERES sequence FL property sequence gt sequence sequence gt sequ
153. ve 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 e the symbol X which means no loopback e 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 e F model name with path part e f model name without path part e Ok current problem bound e 1 current loopback value e On index of the currently processed formula in the prop erty database e 00 the character bmc_length Environment Variable Sets the generated problem bound Possible values are any natural number but must be compatible with the current value held by the variable bmcoopback The default value is 10 bmc_loopback Environment Variable Sets the generated problem loop Possible values are e Any natural number but less than the current value of the variable bmc_length In this case the loop point is absolute e Any negative number but greater than or equal to bmc length In this case specified loop is the loop length e The symbol X which means no loopback e The symbol which means any possible loopbacks The default value is bmc_dimacs file
154. vior is undefined and an error is thrown by NUSMV The signature of the remainder operator is mod integer integer integer word N word N word N integer 2 boolean Note that when the left operand is an integer and the right one is a constant 2 then the type of the expression is Boolean In such a way mod 2 expressions can be used as boolean expressions to check whether the left operand is even or odd Note also that the signature does not allow the operands to be boolean since such expressions are useless For example if the left operand is a boolean expression and on the right is 3 the result will always be equal to the left operand Actu ally in some cases it can be useful to allow boolean operands for example if text of expressions is automatically generated therefore before applying the operation NuSMV converts boolean operand to integer but prints out a warning in this case In all other respects the semantics of mod operator is equivalent to the corresponding operator of C C languages Thus if the quotient a b is representable the expression a b b a mod b shall equal a Note in older versions of NUSMV 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 lt 0 THEN a b 1 ELSE a b and the semantics o
155. wise computed by default 88 flt AG coi i ivfile o ov file t tvfile reorder dynamic m method mono thresh cp t cp cp t iwls95 cpt noaffinity iwls95preoder bmc bmc_length k sat solver name 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 f1t 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_1t1spec 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 Verifies only AG formulas using an ad hoc algorithm see documentation for the ag only search environment variable Enables cone of influence reduction Reads the variable ordering from file iv file Reads the variable ordering from file ov_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 WJKWLvdBRO6 Enables variable reorder
156. xt Expression Next expressions refer to next state variables For example if a variable v is a state vari able 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 recur sively 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 basic_next_expr next basic_expr Anext expression does not change the type 2 2 4 Simple and Next Expressions Simple_expressions are expressions built only from current state variables Therefore the simple_expression cannot have a next operation inside and the syntax of simple_ex pressions is as follows 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 with the alternative basic_next_expr allowed 5See 2 1 6 for information on set types and their counterpart types See Section 2 1 7 Type Order page 8 for the information on the order of types 18 2 3 Definition of the FSM We consider a Finite State Machine FSM described in terms o
157. y 1997 D Dill Trace theory for automatic hierarchical verification of speed independent circuits In ACM Distinguished Dissertations MIT Press 1988 E Allen Emerson A K Mok A Prasad Sistla and Jai Srinivasan Quan titative temporal reasoning In Edmund M Clarke and Robert P Krushan editors Proceedings of Computer Aided Verification CAV 90 volume 531 of LNCS pages 136 145 Berlin Germany June 1991 Niklas E n and Niklas S rensson Temporal induction by incremental sat solving In Ofer Strichman and Armin Biere editors Electronic Notes in Theoretical Computer Science volume 89 Elsevier 2004 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 17 International Conference CAV 2005 number 3576 in Lecture Notes in Computer Science pages 98 111 Springer 2005 91 LBHJOS Mar85 McM92 McM93 MHS00 PSL ps103 RAPT95 sfVS96 Som98 WIKWLvdBRO6 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 A J Martin The design of a self timed circuit for distributed mutual exclu sion I
158. y Another algorithm which we call een sorensson ES04 can build the base and induction steps on many states and transitions As a result the second algorithm is more powerful Also notice that during checking of invariants all the fairness conditions associated with the model are ignored 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 IN Checks the formula specified on the command line context context is the module instance name which the variables in formula must be evaluated in k max_length max_length is the maximum problem bound that can be reached Only natural numbers are valid values for this op tion Use this option only if the een sorensson algorithm is selected If no value is given the environment variable bmc_length is considered instead a alg alg specifies the algorithm The value can be classic or een sorensson If no value is given the environment variable bmc_invar_alg is considered instead 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 e F model name with path part e Cf model name without path part e On index of the currently processed formula in the prop erties database e 00 the character ge

Download Pdf Manuals

image

Related Search

Related Contents

I. J `9 - Enviro-Soil  取扱説明書    ADDENDUM #1 Notice for Bids - Fire Truck Bid  Oce North America TCS400 User's Manual  En savoir plus  FRESH AIR INLET BOX Model: TCB-GB1601UE2  Classic Client 6.2 for Mac OS X User Guide  Suomeksi  Jenn-Air JXT5830 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file