|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wis.jtlv.env.module.Module
edu.wis.jtlv.env.module.ModuleWithWeakFairness
edu.wis.jtlv.env.module.ModuleWithStrongFairness
edu.wis.jtlv.env.module.SMVModule
public class SMVModule
An object which represent an SMV module.
Env.loadModule(String)
Nested Class Summary | |
---|---|
static class |
SMVModule.SyncStatus
Enum class to distinguish between synchronous and asynchronous sub module composition. |
Constructor Summary | |
---|---|
SMVModule(edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo a_module_info,
java.lang.String player_name)
An object representing SMV modules. |
|
SMVModule(edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo a_module_info,
java.lang.String player_name,
java.lang.String[] an_args,
java.lang.String[] a_params)
An object representing SMV modules. |
Method Summary | |
---|---|
void |
___addDefine(java.lang.String addr)
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
void |
___addDefineFromParam(java.lang.String addr)
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
void |
___attachParamPointers()
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo |
___getModuleInfo()
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
void |
addCompassion(net.sf.javabdd.BDD p,
net.sf.javabdd.BDD q)
Add strong (compassion) winning condition to the module. |
void |
addInitial(net.sf.javabdd.BDD to_add)
Conjunct the initial condition with the given condition. |
void |
addInstanceVar(SMVModule inner,
boolean is_sync)
Add a module instance as a variable to this module. |
void |
addJustice(net.sf.javabdd.BDD to_add)
Add weak (justice) winning condition to the module. |
void |
addVar(java.lang.String new_var)
Add a variable to the module. |
void |
addVar(java.lang.String new_var,
int range_start,
int range_end)
Add a range variable to this module. |
void |
addVar(java.lang.String new_var,
java.lang.String[] val_names)
Add a set of values variable to this module. |
int |
compassionNum()
Getter for the number of compassion condition defined in the module. |
void |
conjunctTrans(net.sf.javabdd.BDD to_add)
Conjunct the transition relation with the given condition. |
void |
disjunctTrans(net.sf.javabdd.BDD to_add)
Disjunct the transition relation with the given condition. |
ModuleBDDDefine[] |
getAllDefines()
Getter for all the defines declared in this module. |
ModuleBDDField[] |
getAllFields()
Getter for all fields declared in this module. |
SMVModule[] |
getAllInstances()
Getter for all instances declared in this module. |
SMVModule[] |
getAllInstances(SMVModule.SyncStatus status)
Getter for all synchronous or asynchronous instances declared in this module. |
ModuleParamHolder[] |
getAllParams()
Getter for all declared parameters in this module signature. |
ModuleBDDDefine |
getDefine(java.lang.String addr,
boolean look_hard)
Get the define declared in this module with the given name. |
java.lang.String |
getFullInstName()
Getter for the instance string. |
java.lang.String |
getFullInstNameWithParams()
Getter for the full instance name with the parameters. |
SMVModule |
getHolder()
Getter for the module instance holds this instance. |
SMVModule |
getInstance(java.lang.String addr,
boolean look_hard)
Get the instances with the given name. |
SMVModule[] |
getInstanceArray(java.lang.String addr,
boolean look_hard)
Get the array of instances with the given name. |
java.lang.String |
getName()
Getter for the declared field name which holds this instance. |
ModuleParamHolder |
getParam(int at_index)
Getter for the declared parameter and the given index, in this module signature. |
java.lang.String |
getPath()
The path leading to this module. |
net.sf.javabdd.BDD |
getValue(java.lang.String name)
Get A BDD for the disjunct of all variables set to the given value. |
ModuleBDDField |
getVar(java.lang.String addr,
boolean look_hard)
Get the variable with the given name. |
ModuleBDDField[] |
getVarArray(java.lang.String addr,
boolean look_hard)
Get the array of variables with the given name. |
boolean |
hasDefine(java.lang.String addr,
boolean look_hard)
Check whether a define with the given name exists. |
boolean |
hasInstance(java.lang.String addr,
boolean look_hard)
Check whether an instance with the given name exists. |
boolean |
hasInstanceArray(java.lang.String addr,
boolean look_hard)
Check whether an instance array with the given name exists. |
boolean |
hasParam(java.lang.String addr,
boolean look_hard)
Check whether a parameter with the given name exists. |
boolean |
hasValue(java.lang.String name)
Check whether a value with the given name exists in any of the variables of the system. |
boolean |
hasVar(java.lang.String addr,
boolean look_hard)
Check whether a variable with the given name exists. |
boolean |
hasVarArray(java.lang.String addr,
boolean look_hard)
Check whether a variable array with the given name exists. |
net.sf.javabdd.BDD |
initial()
Getter for the initial states in the module. |
net.sf.javabdd.BDD |
justiceAt(int i)
Getter for a justice condition defined at the given index in the module. |
int |
justiceNum()
Getter for the number of justice condition defined in the module. |
net.sf.javabdd.BDD |
pCompassionAt(int i)
Getter for a P part of the compassion condition defined at the given index in the module. |
net.sf.javabdd.BDD |
qCompassionAt(int i)
Getter for a Q part of the compassion condition defined at the given index in the module. |
void |
setFullPrintingMode(boolean to_set)
Set the print mode for the toString procedure. |
java.lang.String |
toString()
Prepare a string describing the module, its variables, define, statement, etc. |
net.sf.javabdd.BDD |
trans()
Getter for the transition relation of the module. |
Methods inherited from class edu.wis.jtlv.env.module.Module |
---|
allPred, allSucc, pred, prime, primeVars, succ, unprime, unprimeVars |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SMVModule(edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo a_module_info, java.lang.String player_name) throws ModuleException
An object representing SMV modules. For now, you are discourage from directly instantiating SMV modules. Please see the references.
a_module_info
- player_name
-
ModuleException
Env.loadModule(String)
public SMVModule(edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo a_module_info, java.lang.String player_name, java.lang.String[] an_args, java.lang.String[] a_params) throws ModuleException
An object representing SMV modules. For now, you are discourage from directly instantiating SMV modules. Please see the references.
a_module_info
- player_name
- an_args
- a_params
-
ModuleException
- If there was a problem with the parameters declared (i.e.
duplicate names).Method Detail |
---|
public void addVar(java.lang.String new_var) throws ModuleException, ModuleVariableException
Module
Add a variable to the module.
addVar
in class Module
new_var
- The name of the new variable to add.
ModuleException
- If there was a problem with adding the variable, e.g. a
variable with this name already exists.
ModuleVariableException
public void addInitial(net.sf.javabdd.BDD to_add) throws ModuleException
Module
Conjunct the initial condition with the given condition.
addInitial
in class Module
to_add
- The condition to add to the module.
ModuleException
- If there was a problem with adding the condition, e.g. a
there where primed variables in the condition.Module.initial()
public void conjunctTrans(net.sf.javabdd.BDD to_add)
Module
Conjunct the transition relation with the given condition.
conjunctTrans
in class Module
to_add
- The transition to conjunct with the module's transitions.Module.trans()
,
Module.disjunctTrans(BDD)
public void disjunctTrans(net.sf.javabdd.BDD to_add)
Module
Disjunct the transition relation with the given condition.
disjunctTrans
in class Module
to_add
- The transition disjunct with to the module's transitions.Module.trans()
,
Module.conjunctTrans(BDD)
public void addJustice(net.sf.javabdd.BDD to_add) throws ModuleException
ModuleWithWeakFairness
Add weak (justice) winning condition to the module.
addJustice
in class ModuleWithWeakFairness
to_add
- The winning condition to add to the module.
ModuleException
- If there was a problem with adding the condition.ModuleWithWeakFairness.justiceNum()
,
ModuleWithWeakFairness.justiceAt(int)
public void addCompassion(net.sf.javabdd.BDD p, net.sf.javabdd.BDD q) throws ModuleException
ModuleWithStrongFairness
Add strong (compassion) winning condition to the module.
addCompassion
in class ModuleWithStrongFairness
p
- The p winning condition to add to the module.q
- The q winning condition to add to the module.
ModuleException
- If there was a problem with adding the condition.ModuleWithStrongFairness.compassionNum()
,
ModuleWithStrongFairness.pCompassionAt(int)
,
ModuleWithStrongFairness.qCompassionAt(int)
public ModuleBDDField[] getAllFields()
Module
Getter for all fields declared in this module.
getAllFields
in class Module
public net.sf.javabdd.BDD initial()
Module
Getter for the initial states in the module.
initial
in class Module
Module.addInitial(BDD)
public net.sf.javabdd.BDD trans()
Module
Getter for the transition relation of the module.
trans
in class Module
Module.disjunctTrans(BDD)
,
Module.conjunctTrans(BDD)
public int justiceNum()
ModuleWithWeakFairness
Getter for the number of justice condition defined in the module.
justiceNum
in class ModuleWithWeakFairness
ModuleWithWeakFairness.addJustice(BDD)
,
ModuleWithWeakFairness.justiceAt(int)
public net.sf.javabdd.BDD justiceAt(int i)
ModuleWithWeakFairness
Getter for a justice condition defined at the given index in the module.
justiceAt
in class ModuleWithWeakFairness
i
- The index of the justice condition to return.
ModuleWithWeakFairness.addJustice(BDD)
,
ModuleWithWeakFairness.justiceNum()
public int compassionNum()
ModuleWithStrongFairness
Getter for the number of compassion condition defined in the module.
compassionNum
in class ModuleWithStrongFairness
ModuleWithStrongFairness.addCompassion(BDD, BDD)
,
ModuleWithStrongFairness.pCompassionAt(int)
,
ModuleWithStrongFairness.qCompassionAt(int)
public net.sf.javabdd.BDD pCompassionAt(int i)
ModuleWithStrongFairness
Getter for a P part of the compassion condition defined at the given index in the module.
pCompassionAt
in class ModuleWithStrongFairness
i
- The index of the compassion condition to return.
ModuleWithStrongFairness.addCompassion(BDD, BDD)
,
ModuleWithStrongFairness.compassionNum()
,
ModuleWithStrongFairness.qCompassionAt(int)
public net.sf.javabdd.BDD qCompassionAt(int i)
ModuleWithStrongFairness
Getter for a Q part of the compassion condition defined at the given index in the module.
qCompassionAt
in class ModuleWithStrongFairness
i
- The index of the compassion condition to return.
ModuleWithStrongFairness.addCompassion(BDD, BDD)
,
ModuleWithStrongFairness.compassionNum()
,
ModuleWithStrongFairness.pCompassionAt(int)
public void addVar(java.lang.String new_var, java.lang.String[] val_names) throws ModuleException
Add a set of values variable to this module.
new_var
- The new variable name.val_names
- The set of values that this variable can be assigned with.
ModuleException
- If an illegal manipulation to the module had been done. e.g.
duplicate variable names.addVar(String)
,
addVar(String, int, int)
,
hasVar(String, boolean)
,
getVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVarArray(String, boolean)
public void addVar(java.lang.String new_var, int range_start, int range_end) throws ModuleException
Add a range variable to this module.
new_var
- The new variable name.range_start
- The starting range of the variable.range_end
- The ending range of the variable.
ModuleException
- If an illegal manipulation to the module had been done. e.g.
duplicate variable names.addVar(String)
,
addVar(String, String[])
,
hasVar(String, boolean)
,
getVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVarArray(String, boolean)
public void addInstanceVar(SMVModule inner, boolean is_sync) throws ModuleException
Add a module instance as a variable to this module.
inner
- The inner instance to compose this module with.is_sync
- Is this a synchronous inner instance or asynchronous.
ModuleException
- If the name of the module does not fit the naming convention
for internal modules. i.e. if this module name is not the
longest prefix of the module to add name.hasInstance(String, boolean)
,
hasInstanceArray(String, boolean)
,
getInstance(String, boolean)
,
getAllInstances()
,
getAllInstances(edu.wis.jtlv.env.module.SMVModule.SyncStatus)
,
getInstanceArray(String, boolean)
public boolean hasVar(java.lang.String addr, boolean look_hard)
Check whether a variable with the given name exists.
addr
- The variable full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addVar(String)
,
addVar(String, String[])
,
addVar(String, int, int)
,
getVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVarArray(String, boolean)
public boolean hasVarArray(java.lang.String addr, boolean look_hard)
Check whether a variable array with the given name exists.
addr
- The array full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addVar(String)
,
addVar(String, String[])
,
addVar(String, int, int)
,
hasVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVar(String, boolean)
public boolean hasDefine(java.lang.String addr, boolean look_hard)
Check whether a define with the given name exists.
addr
- The define full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
getDefine(String, boolean)
,
getAllDefines()
public boolean hasInstance(java.lang.String addr, boolean look_hard)
Check whether an instance with the given name exists.
addr
- The instance full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addInstanceVar(SMVModule, boolean)
,
hasInstanceArray(String, boolean)
,
getInstance(String, boolean)
,
getAllInstances()
,
getAllInstances(edu.wis.jtlv.env.module.SMVModule.SyncStatus)
,
getInstanceArray(String, boolean)
public boolean hasInstanceArray(java.lang.String addr, boolean look_hard)
Check whether an instance array with the given name exists.
addr
- The array full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addInstanceVar(SMVModule, boolean)
,
getInstanceArray(String, boolean)
,
hasInstance(String, boolean)
,
getInstance(String, boolean)
public boolean hasValue(java.lang.String name)
Check whether a value with the given name exists in any of the variables of the system.
name
- The value name.
getValue(String)
public boolean hasParam(java.lang.String addr, boolean look_hard)
Check whether a parameter with the given name exists.
addr
- The parameter full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
getParam(int)
,
getAllParams()
public ModuleBDDField getVar(java.lang.String addr, boolean look_hard)
Get the variable with the given name.
addr
- The variable full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addVar(String)
,
addVar(String, String[])
,
addVar(String, int, int)
,
hasVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVarArray(String, boolean)
public ModuleBDDField[] getVarArray(java.lang.String addr, boolean look_hard)
Get the array of variables with the given name. i.e., for an array of
variables,
var_arr : array 0..3 of boolean;
This procedure with the parameter "var_arr", will return all 4 fields of
this array. To get an exact field, for example "var_arr[3]", you can use
getVar(String, boolean)
, with
the parameter "inst_arr[3]".
addr
- The array full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addVar(String)
,
addVar(String, String[])
,
addVar(String, int, int)
,
hasVar(String, boolean)
,
hasVarArray(String, boolean)
,
getVar(String, boolean)
public ModuleBDDDefine getDefine(java.lang.String addr, boolean look_hard)
Get the define declared in this module with the given name.
addr
- The define full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
hasDefine(String, boolean)
,
getAllDefines()
public SMVModule getInstance(java.lang.String addr, boolean look_hard)
Get the instances with the given name.
addr
- The instance full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addInstanceVar(SMVModule, boolean)
,
hasInstanceArray(String, boolean)
,
hasInstance(String, boolean)
,
getAllInstances()
,
getAllInstances(edu.wis.jtlv.env.module.SMVModule.SyncStatus)
,
getInstanceArray(String, boolean)
public SMVModule[] getInstanceArray(java.lang.String addr, boolean look_hard)
Get the array of instances with the given name. i.e., for an array of
instances,
inst_arr : array 0..7 of some_module;
This procedure with the parameter "inst_arr", will return all 8 instances
of this array. To get an exact instance, for example "inst_arr[3]", you
can use
getInstance(String, boolean)
,
with the parameter "inst_arr[3]".
addr
- The array full name relative to this module.look_hard
- Whether to go into sub modules and keep on looking.
addInstanceVar(SMVModule, boolean)
,
hasInstanceArray(String, boolean)
,
hasInstance(String, boolean)
,
getInstance(String, boolean)
public net.sf.javabdd.BDD getValue(java.lang.String name)
Get A BDD for the disjunct of all variables set to the given value. i.e., if a variable does not have the given string value, it is set to false.
name
- The value name.
hasValue(String)
public ModuleParamHolder getParam(int at_index)
Getter for the declared parameter and the given index, in this module signature.
at_index
- The index of the param to return.
hasDefine(String, boolean)
,
getAllParams()
public ModuleBDDDefine[] getAllDefines()
Getter for all the defines declared in this module.
hasDefine(String, boolean)
,
getDefine(String, boolean)
public SMVModule[] getAllInstances()
Getter for all instances declared in this module.
addInstanceVar(SMVModule, boolean)
,
hasInstance(String, boolean)
,
getInstance(String, boolean)
,
getHolder()
,
getAllInstances(edu.wis.jtlv.env.module.SMVModule.SyncStatus)
public SMVModule[] getAllInstances(SMVModule.SyncStatus status)
Getter for all synchronous or asynchronous instances declared in this module.
status
- The type of modules to fetch.
addInstanceVar(SMVModule, boolean)
,
hasInstance(String, boolean)
,
hasInstanceArray(String, boolean)
,
getInstance(String, boolean)
,
getHolder()
,
getAllInstances()
,
SMVModule.SyncStatus
public ModuleParamHolder[] getAllParams()
Getter for all declared parameters in this module signature.
hasParam(String, boolean)
,
getParam(int)
public SMVModule getHolder()
Getter for the module instance holds this instance.
getAllInstances()
,
getAllInstances(edu.wis.jtlv.env.module.SMVModule.SyncStatus)
public java.lang.String getFullInstName()
Module
Getter for the instance string.
getFullInstName
in class Module
public java.lang.String getFullInstNameWithParams()
Getter for the full instance name with the parameters.
public void setFullPrintingMode(boolean to_set)
Set the print mode for the toString procedure. If printing mode is set to full, then all BDDs and winning conditions will also be printed.
to_set
- Set or reset the printing mode.public java.lang.String toString()
Module
Prepare a string describing the module, its variables, define, statement, etc.
toString
in class Module
public java.lang.String getName()
Module
Getter for the declared field name which holds this instance.
getName
in class Module
public java.lang.String getPath()
Module
The path leading to this module.
getPath
in class Module
public void ___addDefine(java.lang.String addr) throws ModuleException
Add a new define variable to this module. This procedure only creates an
entity and does not attach a value. To attach a value, the user most
obtain the newly created define entity, using
getDefine(String, boolean)
or
getAllDefines()
, and attach a
value using
ModuleBDDDefine.attachStmt(edu.wis.jtlv.env.core.smv.eval.StmtDefineOperator)
addr
- The name for the newly created define entity.
ModuleException
- If an illegal manipulation to the module had been done. e.g.
duplicate variable names.___addDefineFromParam(String)
public void ___addDefineFromParam(java.lang.String addr) throws ModuleException
Add a new define variable from a lower instance to this module. This
procedure only creates an entity and does not attach a value. To attach a
value, the user most obtain the newly created define entity, using
getDefine(String, boolean)
or
getAllDefines()
, and attach a
value using
ModuleBDDDefine.attachStmt(edu.wis.jtlv.env.core.smv.eval.StmtDefineOperator)
addr
- The name for the newly created define entity.
ModuleException
- If an illegal manipulation to the module had been done. e.g.
duplicate variable names.___addDefine(String)
public edu.wis.jtlv.env.core.smv.schema.SMVModuleInfo ___getModuleInfo()
The the module parsing information.
public void ___attachParamPointers() throws ModuleException
Attach the module signature variables to their values.
ModuleException
- If there was a problem evaluating defines.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |