Public Methods | |
void | caseAddExpr (AddExpr expr) |
void | caseAndExpr (AndExpr expr) |
void | caseArrayExpr (ArrayExpr expr) |
void | caseBoolLit (BoolLit expr) |
void | caseChooseExpr (ChooseExpr expr) |
void | caseConstant (Constant expr) |
void | caseDerefExpr (DerefExpr expr) |
void | caseDivExpr (DivExpr expr) |
void | caseEqExpr (EqExpr expr) |
void | caseInstanceOfExpr (InstanceOfExpr expr) |
void | caseIntLit (IntLit expr) |
void | caseLeExpr (LeExpr expr) |
void | caseLengthExpr (LengthExpr expr) |
void | caseLockTest (LockTest lockTest) |
void | caseLtExpr (LtExpr expr) |
void | caseMulExpr (MulExpr expr) |
void | caseNeExpr (NeExpr expr) |
void | caseNewArrayExpr (NewArrayExpr expr) |
void | caseNewExpr (NewExpr expr) |
void | caseNotExpr (NotExpr expr) |
void | caseNullExpr (NullExpr expr) |
void | caseOrExpr (OrExpr expr) |
void | caseRecordExpr (RecordExpr expr) |
void | caseRefExpr (RefExpr expr) |
void | caseRemExpr (RemExpr expr) |
void | caseStateVar (StateVar expr) |
void | caseSubExpr (SubExpr expr) |
void | caseThreadLocTest (ThreadLocTest threadLocTest) |
void | caseThreadTest (ThreadTest threadTest) |
String | check () |
SmvVar | declareVar (String name, String smvType, StateVar source, String initValue, SmvVar aggregate, boolean constrained, SmvVar deadFlag) |
void | defaultCase (Object obj) |
List | getCounterExample () |
BirTrace | parseOutput () |
String | runSmv () |
Static Public Methods | |
SmvTrans | translate (TransSystem system, SmvOptions options) |
SmvTrans | translate (TransSystem system, SmvOptions options, PrintWriter out) |
Private Methods | |
SmvTrans (TransSystem system, SmvOptions options, PrintWriter out) | |
String | activeVar (BirThread thread) |
SmvNaryExpr | addConditionalContext (SmvNaryExpr expr, SmvCase context) |
SmvExpr | and (SmvExpr expr1, SmvExpr expr2) |
String | blockedVar (BirThread thread) |
SmvExpr | buildTransExpr (Transformation trans, StateVarVector locals, SmvVar locVar) |
void | checkAssign (StateVar lhs, Expr rhs, SmvVar var, SmvExpr value) |
String | countVar (String var) |
void | declareVariables () |
void | definitions () |
String | elementVar (String var, int i) |
SmvExpr | equal (SmvExpr expr1, SmvExpr expr2) |
String | execAndWait (String command, boolean verbose) |
void | fairness () |
String | fieldVar (String var, Field type) |
AssignAction | findLocalAssign (Transformation trans) |
TransSystem | getSystem () |
String | getThreadType () |
SmvVar | getVar (String name) |
SmvExpr | greaterThan (SmvExpr expr1, SmvExpr expr2) |
void | header () |
String | idleVar (BirThread thread) |
void | indent (int delta) |
void | init () |
void | initAllComponents (SmvVar var, SmvExpr cond) |
String | instanceVar (String var, int i) |
String | instNumVar (String var) |
String | inUseVar (String var, int i) |
String | lengthVar (String var) |
SmvExpr | lessThan (SmvExpr expr1, SmvExpr expr2) |
String | locName (Location loc) |
String | locVar (BirThread thread) |
SmvExpr | minus1 (SmvExpr expr) |
SmvExpr | not (SmvExpr expr) |
SmvExpr | or (SmvExpr expr1, SmvExpr expr2) |
String | ownerVar (String var) |
void | parseLine (String line, BirTrace trace) |
void | parseThreadStep (String line, BirTrace trace) |
void | parseTrap (String line, BirTrace trace) |
SmvExpr | plus1 (SmvExpr expr) |
void | prepareParse () |
void | print (String s) |
void | println () |
void | println (String s) |
void | printVariableDecls () |
void | property () |
void | recordGlobalVarAssignments (SmvExpr lhs, SmvExpr rhs, SmvCase context) |
void | recordGlobalVarUpdates () |
void | recordLockStatusUpdates (LockAction action) |
void | recordThreadStatusUpdates (ThreadAction action) |
int | refIndex (StateVar target) |
String | refIndexVar (String var) |
SmvLit | refValue (int refIndex, int instNum) |
SmvTrans | run () |
void | stateVariables () |
String | tempVar (BirThread thread) |
String | terminatedVar (BirThread thread) |
SmvExpr | threadBlockedExpr (BirThread thread) |
SmvExpr | threadTerminatedExpr (BirThread thread) |
SmvNaryExpr | transCouldBeTakenExpr (Transformation trans) |
void | transitions () |
SmvExpr | translate (Expr expr) |
void | translateBinaryOp (Expr e1, Expr e2, String op) |
SmvExpr | translateGlobal (SmvVar var) |
SmvExpr | translateThread (BirThread thread) |
void | translateUnaryOp (Expr e, String op) |
SmvNaryExpr | transTakenExpr (Transformation trans) |
String | waitVar (String var, BirThread thread) |
Static Private Methods | |
SmvExpr | becomes (SmvVar var, SmvExpr expr) |
String | currentDir () |
int | parseInt (String s) |
Private Attributes | |
TransSystem | system |
PrintWriter | out |
boolean | ranVerifier |
SmvOptions | options |
boolean | liveness |
boolean | ctlproperty |
boolean | interleaving |
int | indentLevel = 0 |
boolean | newLine = true |
Hashtable | varTable = new Hashtable() |
Vector | varList = new Vector() |
Hashtable | guardTable = new Hashtable() |
int | maxCollectionSize |
String | threadType |
Transformation | currentTrans |
SmvExpr | currentGuard |
SmvVar | choiceVar |
SmvVar | trapVar |
SmvVar | runningVar |
boolean | doneParsing |
boolean | foundFalse |
boolean | foundTrace |
int | stateCount |
Location[] | threadLocs |
Transformation | lastTrans |
Hashtable | threadTable |
Static Private Attributes | |
final SmvLit | ZERO = new SmvLit("0") |
final SmvLit | ONE = new SmvLit("1") |
final SmvLit | NOTHREAD = new SmvLit("NoThread") |
final String | TRAP_TYPE |
final String | LOCK_COUNT_TYPE = "0 .. 3" |
Runtime | runtime = Runtime.getRuntime() |
final int | BUFSIZE = 50000 |
byte[] | buffer = new byte[BUFSIZE] |
The SMV translator is invoked on a transition system as follows:
// Parameters TransSystem system = ...; // the transition system SmvOptions options = new SmvOptions(); // Options options.setSafety(true); // Safety property options.setInterleaving(true); // Interleaving (vs. simulataneous) model SmvTrans smv = SmvTrans.translate(sys,options); // Generate input smv.runSmv(); // Run nusmv BirTrace trace = smv.parseOutput(); // Parse the output
Definition at line 60 of file SmvTrans.java.
|
Add the conditional context to an N-ary AND-expression. The context passed is an SmvCase that is part of a case tree. The condition on every ancestor of the conext is added to the AND-expression. The context can be null, in which case nothing is added. Definition at line 143 of file SmvTrans.java. |
|
Generate SMV expression that says var becomes expr in next state. To simplify reference assignments (from one var to another), we test to see if the var is an aggregate (which means its a reference) and if the expr is also a variable---in which case we generate a conjunction saying each component is equal (this avoid the multiplication that would otherwise be generated to view the reference as a single value). Definition at line 165 of file SmvTrans.java. |
|
Build an expression for a given transformation. Definition at line 183 of file SmvTrans.java. |
|
Build an SMV expression for a BIR array selection. Reimplemented from ExprSwitch. Definition at line 240 of file SmvTrans.java. |
|
Build an SMV expression for a choose() operation. Given choices C0, C1, ..., CN, we generate: case choiceVar = 0 : C0; choiceVar = 1 : C1; ... 1 : CN; esacwhere choiceVar is an unconstrained variable. Reimplemented from ExprSwitch. Definition at line 293 of file SmvTrans.java. |
|
Generate an SMV expression for a BIR dereference. Reimplemented from ExprSwitch. Definition at line 313 of file SmvTrans.java. |
|
Build SMV expr to check if object is instanceof class. We use an SMV set expression to test if the refIndex var of the reference is "in" the set of refIndexes of the class/interface. Reimplemented from ExprSwitch. Definition at line 370 of file SmvTrans.java. |
|
Build SMV expr to retrieve array length. Reimplemented from ExprSwitch. Definition at line 400 of file SmvTrans.java. |
|
Build an SMV expression for a lock test. Reimplemented from ExprSwitch. Definition at line 423 of file SmvTrans.java. |
|
Build SMV expression for array allocator. Similar to NewExpr, but must initialize length/contents of array. Reimplemented from ExprSwitch. Definition at line 478 of file SmvTrans.java. |
|
Build SMV expression for allocator. Reimplemented from ExprSwitch. Definition at line 525 of file SmvTrans.java. |
|
Build SMV expression for record field selection. Reimplemented from ExprSwitch. Definition at line 580 of file SmvTrans.java. |
|
Check an assignment for ClassCastExceptions (updating trapVar). Check an assignment for IntLimitExceptions (updating trapVar). Definition at line 635 of file SmvTrans.java. |
|
Declare an SMV state variable
Definition at line 694 of file SmvTrans.java. Referenced by SmvTypeDecl::caseArray(), SmvTypeDecl::caseBool(), SmvTypeDecl::caseCollection(), SmvTypeDecl::caseEnumerated(), SmvTypeDecl::caseLock(), SmvTypeDecl::caseRange(), SmvTypeDecl::caseRecord(), and SmvTypeDecl::caseRef().
|
|
Declare all variables using SmvTypeDecl to walk down through composite types. Definition at line 715 of file SmvTrans.java. |
|
Generate DEFINE sectoin, which defines the following symbols:
Definition at line 795 of file SmvTrans.java. |
|
Generate FAIRNESS clause for each thread T of the form: ! T_idle | T_blocked | T_terminated Definition at line 897 of file SmvTrans.java. |
|
Finds an assignment to a local variable in the transformation (or returns null if not found). Definition at line 918 of file SmvTrans.java. |
|
getCounterExample method comment. Definition at line 937 of file SmvTrans.java. |
|
Get SmvVar with given name. Definition at line 946 of file SmvTrans.java. |
|
Generate SMV header Definition at line 957 of file SmvTrans.java. |
|
Generate INIT formula that sets each non-aggregate variable with an initial value to that value. Reimplemented from Analysis. Definition at line 974 of file SmvTrans.java. |
|
Initialize all components in an SmvVar if indicated condition is true. Definition at line 994 of file SmvTrans.java. |
|
Name of location. Definition at line 1027 of file SmvTrans.java. |
|
Parse one line of the SMV output file, updating the trace. Definition at line 1064 of file SmvTrans.java. |
|
Parse the output of SMV and interpret it as either a violation (sequence of transformations) or as a error-free analysis.
Definition at line 1109 of file SmvTrans.java. |
|
Parse line containing update to thread location. Find transformation taken and add to trace. Line of form: threadName_loc = locXXXwhere XXX is a number. Definition at line 1145 of file SmvTrans.java. |
|
Parse line updating trap variable---record trap name. Definition at line 1174 of file SmvTrans.java. |
|
Prepare to parse SMV output file Definition at line 1187 of file SmvTrans.java. |
|
Support for printing things nicely indented. Definition at line 1205 of file SmvTrans.java. |
|
Print variable declarations Aggregate variables (e.g., arrays, records, collections, refs) have a null type and are printed as comments. Definition at line 1230 of file SmvTrans.java. |
|
Records updates to globals made by an assignment. If the LHS may reference more than one variable (e.g., contains a pointer deref or array indexing) then the LHS expression will be an SmvCase whose leaves are all the possible updated variables. In this case, we recurse through all cases of the tree until we reach a leaf (SmvVar). When an SmvVar is finally reached, we add a conditional update to that variable to the value given by the RHS expression on that condition that the current trans is taken *and* the specific case context is true (i.e., all conditions for all cases we're contained in are true). Definition at line 1330 of file SmvTrans.java. |
|
Records updates to global variables made by the current trans. Definition at line 1361 of file SmvTrans.java. |
|
Record updates to the lock variables by a lock action. Definition at line 1380 of file SmvTrans.java. |
|
Records updates to the status of the threads. A start action for a thread changes its T_active var to 1. Definition at line 1519 of file SmvTrans.java. |
|
Return the refIndex of a BIR state variable (i.e., its position in the universal reference type refAny). Definition at line 1532 of file SmvTrans.java. |
|
Build SMV reference value from refIndex and instNum values. Definition at line 1542 of file SmvTrans.java. |
|
Run SMV translator, generate each part of the output in turn. Definition at line 1550 of file SmvTrans.java. |
|
Run SMV. The translator must have been executed for the transition system (the file NAME.trans must exist and contain the translated input).
Definition at line 1569 of file SmvTrans.java. |
|
Generate SMV variables Definition at line 1596 of file SmvTrans.java. |
|
Build an expression that is true if the thread is blocked. The thread is blocked if it is in a location and the guards for all transforms out of that location are false. If there are no transforms out of the location, the thread is considered terminated, not blocked. Definition at line 1615 of file SmvTrans.java. |
|
Build expression that is true if a thread is terminated. A thread is terminated if it is in a location with no out transformations. Definition at line 1651 of file SmvTrans.java. |
|
Generate an expression that is true if a transformation could be taken. Similar to transTakenExpr, except we do not require the location be updated or the thread be running. Definition at line 1669 of file SmvTrans.java. |
|
Build an expression that is true if a given transformation is taken. Definition at line 1812 of file SmvTrans.java. |
|
Generate a TRANS formula for each thread and global variable. Definition at line 1688 of file SmvTrans.java. |
|
Generate SMV source representing a transition system. As above, but the SMV is written to the PrintWriter provided.
Definition at line 1754 of file SmvTrans.java. |
|
Generate SMV source representing a transition system. The SMV input is written to a file NAME.trans where NAME is the name of the transition system. A set of options can be provided in a SmvOptions object.
Definition at line 1730 of file SmvTrans.java. |
|
Translate a BIR expression to an SmvExpr Definition at line 1715 of file SmvTrans.java. |
|
Return update expression for global variable (most work done in SmvVar). Definition at line 1765 of file SmvTrans.java. |
|
Build the TRANS expression for a thread. Definition at line 1773 of file SmvTrans.java. |
|
Initial value: "{ None, NullPointerException, ArrayBoundsException, ClassCastException, RangeLimitException, CollectionLimitException, ArrayLimitException }" Definition at line 95 of file SmvTrans.java. |