edu.wis.jtlv.env
Class Env

java.lang.Object
  extended by edu.wis.jtlv.env.Env

public final class Env
extends java.lang.Object

The main JTLV environment Facade, which supplies the API to basic functionalities through delegators to the private internal managers. The environment is somewhat corresponding to the Java "System" environment.

The two main field which Env is delegating with are: The JTLVBDDManager, which is responsible of communicating with the actual BDD implementation (through JavaBDD package). The JTLVBDDManagerPairing, which is responsible of all BDD naming and coupling operations (i.e. prime and unprimed versions of all fields).

Version:
"1.3.2"
Author:
yaniv sa'ar.

Nested Class Summary
static class Env.JTLVBDDToString
           The JTLVBDDToString is responsible for naming of the values in the BDD domain.
 
Field Summary
static java.util.LinkedList<ErrorListener> all_error_listeners
           A list of all error listeners which are invoked on any kind of error in the system.
static Env.JTLVBDDToString stringer
           An object responsible for associating BDD variables to their names.
static java.lang.String version
           JTLV version count.
 
Method Summary
static BDD allDeltaPred(BDD trans, BDD to)
           Given a set of state and a transitions, the procedure return all states which can lead in any number of steps to given states, excluding the given states themselves (in some cases this might be more efficient the allPred, and then conjuncting out the negation).
static BDD allDeltaSucc(BDD from, BDD trans)
           Given a set of state and a transitions, the procedure return all states which can be reached in any number of steps from these states, excluding the given states themselves (in some cases this might be more efficient the allSucc, and then conjuncting out the negation).
static BDD allPred(BDD trans, BDD to)
           Given a set of state and a transitions, the procedure return all states which can lead in any number of steps to given states.
static BDD allSucc(BDD from, BDD trans)
           Given a set of state and a transitions, the procedure return all states which can be reached in a any number of steps from these states.
static int assignDedicatedBDDManagerIdx(JTLVThread new_thread)
           A procedure called from within JTLVThread which allocates and assign a manager to the given thread.
static void beQuiet()
           Turning off the entire factory verbose (garbage collection, resize, reorder).
static void clearErrorListener()
           Clears the entire listeners queue.
static boolean containPrimeVars(BDD set)
           Check whether the given BDD contains a prime version of some field.
static boolean containUnprimeVars(BDD set)
           Check whether the given BDD contains an unprime version of some field.
static BDD copyBDDIntoBaseManager(BDD b)
           Copy a given BDD into the base BDD manager.
static BDD copyBDDIntoManager(int idx, BDD b)
           Copy a given BDD into a given BDD manager.
static BDDVarSet copyBDDVarSetIntoBaseManager(BDDVarSet b)
           Copy a given BDDVarSet into the base BDD manager.
static BDDVarSet copyBDDVarSetIntoManager(int idx, BDDVarSet b)
           Copy a given BDDVarSet into a given BDD manager.
static Module[] debugParseModule(java.lang.String filename)
           Parse the given file, add it to the system, and pops a window browser with the parsing tree which the parser read.
static void doError(java.lang.Exception e, java.lang.String msg)
           Invoke the listeners queue with the given exception.
static void doOnGC(java.lang.reflect.Method m_gc)
           Register a procedure to be done at every garbage collection.
static void doOnReorder(java.lang.reflect.Method m_reorder)
           Register a procedure to be done at every reorder to the BDD table.
static void doOnResize(java.lang.reflect.Method m_resize)
           Register a procedure to be done at every resize to the BDD table.
static BDD FALSE()
           The constant FALSE BDD.
static Module[] getAllModules()
           Get all module objects currently loaded into the environment.
static int getCurrentThreadManagerIdx()
           Get the current running thread, BDD manager index.
static BDDVarSet getEmptySet()
           The empty set of fields.
static java.lang.String getFactoryName()
           The factory package which is currently used by the environment to allocate new BDD fields.
static Module getModule(java.lang.String full_inst_name)
           Get a module instance by its associated full path string.
static java.util.Set<java.lang.String> getModuleNames()
           The set of all names which are associated with the modules loaded to the environment.
static int getModuleNum()
           Get the number of modules currently loaded into the environment.
static int getThreadPoolSize()
           The number of BDD managers in this environment.
static ModuleBDDField getVar(java.lang.String preface, java.lang.String name)
           Search and retrieve the BDD field by the given path and field name.
static BDDVarSet globalPrimeVars()
           Get all primed variables in the system.
static BDDVarSet globalUnprimeVars()
           Get all unprimed variables in the system.
static BDDVarSet globalVarsMinus(BDDVarSet minus)
           Get the set of all variables (including the prime and unprime versions), except the given set of variables.
static BDD kDeltaPred(BDD trans, BDD to, int k)
           Given a set of state and a transitions, the procedure return all states which can lead in maximum k number of steps to given states, excluding the given states themselves (in some cases this might be more efficient the kPred, and then conjuncting out the negation).
static BDD kDeltaSucc(BDD from, BDD trans, int k)
           Given a set of state and a transitions, the procedure return all states which can be reached in maximum k number of steps from these states, excluding the given states themselves (in some cases this might be more efficient the allSucc, and then conjuncting out the negation).
static BDD kPred(BDD trans, BDD to, int k)
           Given a set of state and a transitions, the procedure return all states which can lead in maximum k number of steps to given states.
static BDD kSucc(BDD from, BDD trans, int k)
           Given a set of state and a transitions, the procedure return all states which can be reached in maximum k number of steps from these states.
static BDD loadBDD(java.lang.String filename)
           Load a BDD from the file system.
static Module[] loadModule(java.lang.String filename)
           Load a given file into the system without a specified order (i.e.
static Module[] loadModule(java.lang.String filename, java.lang.String ordfile)
           Load a given file into the system with a specified order given by the other file.
static Spec[] loadSpecFile(java.lang.String filename)
           Load any kind of specification from a file.
static Spec[] loadSpecInputStream(java.io.InputStream is)
           Load any kind of specification from a given input stream.
static Spec[] loadSpecString(java.lang.String to_parse)
           Load any kind of specification from a string.
static BDD[] multiCopyBDD(int[] managerIdxs, BDD toCopy)
           Do not call the standard copy procedure.
static ModuleBDDField newVar(java.lang.String preface, java.lang.String name)
           Create and allocate a new BDD field with 2 values domain.
static ModuleBDDField newVar(java.lang.String preface, java.lang.String name, int values_size)
           Create and allocate a new BDD field with the given domain size, i.e.
static void NOP()
           An empty procedure for shutting down the factory verbose.
static Module[] parseModule(java.lang.String filename)
           Parse the given file and add it to the system.
static BDD pred(BDD trans, BDD to)
           Given a set of state and a transitions, the procedure return all states which can lead in a single step to the given states.
static BDD prime(BDD unp_bdd)
           Given a BDD, returns the same BDD in its prime version of the variables.
static BDD prime(BDD unp_bdd, ModuleBDDField[] couples)
           Given a BDD, returns the same BDD with the prime version of the given array of fields.
static void putModule(java.lang.String full_inst_name, Module to_add)
           Add a new module to the collection of all modules, and associate it with the given string.
static boolean registerErrorListener(ErrorListener lis)
           Register an error listener to be invoked on every error which is thrown in the JTLV environment.
static boolean removeErrorListener(ErrorListener lis)
           Remove an error listener from the queue of listeners.
static void resetEnv()
           Reset the environment.
static void saveBDD(java.lang.String filename, BDD to_save)
           Save a BDD to the file system.
static BDD succ(BDD from, BDD trans)
           Given a set of state and a transitions, the procedure return all states which can be reached in a single step from the given states.
static java.lang.String toNiceSignleLineString(BDD b)
           Prepare a string representing the If-Then-Else form of the given BDD.
static java.lang.String toNiceSignleLineString(Module con, BDD b)
           Prepare a string representing the If-Then-Else form of the given BDD.
static java.lang.String toNiceString(BDD b)
           Prepare a string representing the If-Then-Else form of the given BDD.
static java.lang.String toNiceString(BDD b, java.lang.String startIndent)
           Prepare a string representing the If-Then-Else form of the given BDD.
static java.lang.String toNiceString(Module con, BDD b)
           Prepare a string representing the If-Then-Else form of the given BDD.
static java.lang.String toNiceString(Module con, BDD b, java.lang.String startIndent)
           Prepare a string representing the If-Then-Else form of the given BDD.
static BDD TRUE()
           The constant TRUE BDD.
static BDD unprime(BDD p_bdd)
           Given a BDD, returns the same BDD in its unprime version of the fields.
static BDD unprime(BDD p_bdd, ModuleBDDField[] couples)
           Given a BDD, returns the same BDD with the unprime version of the given array of fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version

JTLV version count.

See Also:
Constant Field Values

stringer

public static Env.JTLVBDDToString stringer

An object responsible for associating BDD variables to their names.


all_error_listeners

public static java.util.LinkedList<ErrorListener> all_error_listeners

A list of all error listeners which are invoked on any kind of error in the system.

See Also:
registerErrorListener(ErrorListener), removeErrorListener(ErrorListener), clearErrorListener(), activateErrorListeners(Exception, String), doError(Exception, String), ErrorListener
Method Detail

resetEnv

public static void resetEnv()

Reset the environment. In particular reset the bdd factory and all Modules and fields declared in the environment.


getThreadPoolSize

public static int getThreadPoolSize()

The number of BDD managers in this environment. The number is set by the System.property key "pool_size" (plus one additional manager to the main thread) during the time of the last reset.

Returns:
The number of BDD managers.
See Also:
JTLVThread

assignDedicatedBDDManagerIdx

public static int assignDedicatedBDDManagerIdx(JTLVThread new_thread)

A procedure called from within JTLVThread which allocates and assign a manager to the given thread. Be aware that instantiating and assigning more JTLVThread then the number of managers, will lock this thread until a manager will be freed. (i.e. might lead to a deadlock...)

Parameters:
new_thread - The thread to assign a manager to.
Returns:
The index manager assigned to the given thread.
See Also:
JTLVThread, getThreadPoolSize()

getCurrentThreadManagerIdx

public static int getCurrentThreadManagerIdx()

Get the current running thread, BDD manager index.

Returns:
The current running thread, BDD manager index.
See Also:
JTLVThread.getDedicatedBDDManagerIdx()

copyBDDIntoBaseManager

public static BDD copyBDDIntoBaseManager(BDD b)

Copy a given BDD into the base BDD manager. The user should take care for synchronization issues by himself, i.e. beware not to copy to the same factory at the same time (copy from is safe...).

Parameters:
b - The BDD to copy.
Returns:
The new identical BDD in the base BDD manager.
See Also:
JTLVThread.adjustBDDToBase(BDD), JTLVThread.adjustBDDToManager(BDD)

copyBDDIntoManager

public static BDD copyBDDIntoManager(int idx,
                                     BDD b)

Copy a given BDD into a given BDD manager. The user should take care for synchronization issues by himself, i.e. beware not to copy to the same factory at the same time (copy from is safe...).

Parameters:
idx - The given BDD manager index.
b - The BDD to copy.
Returns:
The new identical BDD in the given BDD manager.
See Also:
JTLVThread.adjustBDDToBase(BDD), JTLVThread.adjustBDDToManager(BDD)

copyBDDVarSetIntoBaseManager

public static BDDVarSet copyBDDVarSetIntoBaseManager(BDDVarSet b)

Copy a given BDDVarSet into the base BDD manager. The user should take care for synchronization issues by himself, i.e. beware not to copy to the same factory at the same time (copy from is safe...).

Parameters:
b - The BDDVarSet to copy.
Returns:
The new identical BDDVarSet in the base BDD manager.
See Also:
JTLVThread.adjustBDDVarSetToBase(BDDVarSet), JTLVThread.adjustBDDVarSetToManager(BDDVarSet)

copyBDDVarSetIntoManager

public static BDDVarSet copyBDDVarSetIntoManager(int idx,
                                                 BDDVarSet b)

Copy a given BDDVarSet into a given BDD manager. The user should take care for synchronization issues by himself, i.e. beware not to copy to the same factory at the same time (copy from is safe...).

Parameters:
idx - The given BDD manager index.
b - The BDDVarSet to copy.
Returns:
The new identical BDDVarSet in the given BDD manager.
See Also:
JTLVThread.adjustBDDVarSetToBase(BDDVarSet), JTLVThread.adjustBDDVarSetToManager(BDDVarSet)

multiCopyBDD

public static BDD[] multiCopyBDD(int[] managerIdxs,
                                 BDD toCopy)

Do not call the standard copy procedure. Instead it perform the recursive copy to all factories at once. (not much better then calling copy one by one)

Parameters:
managerIdxs - all manager indices
toCopy - the BDD to copy
Returns:
An array of identical BDD's. Each BDD is in the BDD manager specified by the given array of indices.

getAllModules

public static Module[] getAllModules()

Get all module objects currently loaded into the environment.

Returns:
an array of modules.
See Also:
putModule(String, Module), getModule(String), Module, FDSModule, SMVModule

getModule

public static Module getModule(java.lang.String full_inst_name)

Get a module instance by its associated full path string.

Parameters:
full_inst_name - the full path string to the instance.
Returns:
the module object or null if not existing.
See Also:
putModule(String, Module), getAllModules(), Module, FDSModule, SMVModule

putModule

public static void putModule(java.lang.String full_inst_name,
                             Module to_add)

Add a new module to the collection of all modules, and associate it with the given string.

Parameters:
full_inst_name - the string to associate this module with.
to_add - the module to add.
See Also:
getAllModules(), getModule(String), Module, FDSModule, SMVModule

getModuleNum

public static int getModuleNum()

Get the number of modules currently loaded into the environment.

Returns:
The number of modules currently loaded into the environment.

getModuleNames

public static java.util.Set<java.lang.String> getModuleNames()

The set of all names which are associated with the modules loaded to the environment.

Returns:
The set of all names.
See Also:
getAllModules(), getModule(String)

loadSpecInputStream

public static Spec[] loadSpecInputStream(java.io.InputStream is)
                                  throws java.io.IOException

Load any kind of specification from a given input stream.

Parameters:
is - The input stream to parse.
Returns:
An array of Specifications.
Throws:
java.io.IOException
See Also:
loadSpecString(String), loadSpecFile(String)

loadSpecString

public static Spec[] loadSpecString(java.lang.String to_parse)

Load any kind of specification from a string.

Parameters:
to_parse - The string to parse.
Returns:
An array of Specifications.
See Also:
loadSpecInputStream(InputStream), loadSpecFile(String)

loadSpecFile

public static Spec[] loadSpecFile(java.lang.String filename)
                           throws java.io.IOException

Load any kind of specification from a file.

Parameters:
filename - The file to load from.
Returns:
An array of Specifications.
Throws:
java.io.IOException - When there where problems reading the file.
See Also:
loadSpecInputStream(InputStream), loadSpecString(String)

loadModule

public static Module[] loadModule(java.lang.String filename,
                                  java.lang.String ordfile)
                           throws java.io.IOException

Load a given file into the system with a specified order given by the other file. The order file must contain all unprimed variable in the system. Currently two file extensions are supported, *.fds an *.smv. The procedure will load according to the file extension. The modules loaded are returned. Alternatively, The modules can also be found through the modules facilities here: getAllModules() or getModule(String).

All paring and interpreting exceptions are thrown to listeners through the Env error mechanism. (i.e. registerErrorListener(ErrorListener) activateErrorListeners(Exception, String) doError(Exception, String))

Parameters:
filename - The file to load with file extension *.fds, or *.smv .
ordfile - The file with the order of variables. all variable (in their unprime version) must be supplied.
Returns:
Array of module which were loaded from the given file.
Throws:
java.io.IOException - If there was a problem with reading the file.
See Also:
loadModule(String), parseModule(String), debugParseModule(String), getAllModules(), getModule(String), registerErrorListener(ErrorListener), activateErrorListeners(Exception, String), doError(Exception, String)

loadModule

public static Module[] loadModule(java.lang.String filename)
                           throws java.io.IOException

Load a given file into the system without a specified order (i.e. the order will be the order of declaration of variables in the file). Currently two file extensions are supported, *.fds an *.smv. The procedure will load according to the file extension. The modules loaded are returned. Alternatively, The modules can also be found through the modules facilities here: getAllModules() or getModule(String).

All paring and interpreting exceptions are thrown to listeners through the Env error mechanism. (i.e. registerErrorListener(ErrorListener) activateErrorListeners(Exception, String) doError(Exception, String))

Parameters:
filename - The file to load with file extension *.fds, or *.smv .
Returns:
Array of module which were loaded from the given file.
Throws:
java.io.IOException - If there was a problem with reading the file.
See Also:
loadModule(String, String), parseModule(String), debugParseModule(String), getAllModules(), getModule(String), registerErrorListener(ErrorListener), activateErrorListeners(Exception, String), doError(Exception, String)

parseModule

public static Module[] parseModule(java.lang.String filename)
                            throws java.io.IOException

Parse the given file and add it to the system. Currently two file extensions are supported, *.fds an *.smv. The procedure will parse according to the file extension. The modules parsed are returned. (BUT NOT FILLED WITH THEIR VARIABLES AND STATEMENT, SINCE THIS IS DONE IN THE INTERPRETATION STAGE.) Alternatively, The modules can also be found through the modules facilities here: getAllModules() or getModule(String).

All paring and interpreting exceptions are thrown to listeners through the Env error mechanism. (i.e. registerErrorListener(ErrorListener) activateErrorListeners(Exception, String) doError(Exception, String))

Parameters:
filename - The file to load with file extension *.fds, or *.smv .
Returns:
Array of module which were loaded from the given file.
Throws:
java.io.IOException - If there was a problem with reading the file.
See Also:
loadModule(String), loadModule(String, String), debugParseModule(String), getAllModules(), getModule(String), registerErrorListener(ErrorListener), activateErrorListeners(Exception, String), doError(Exception, String)

debugParseModule

public static Module[] debugParseModule(java.lang.String filename)
                                 throws java.io.IOException

Parse the given file, add it to the system, and pops a window browser with the parsing tree which the parser read. Currently two file extensions are supported, *.fds an *.smv. The procedure will parse according to the file extension. The modules parsed are returned. (BUT NOT FILLED WITH THEIR VARIABLES AND STATEMENT, SINCE THIS IS DONE IN THE INTERPRETATION STAGE.) Alternatively, The modules can also be found through the modules facilities here: getAllModules() or getModule(String).

All paring and interpreting exceptions are thrown to listeners through the Env error mechanism. (i.e. registerErrorListener(ErrorListener) activateErrorListeners(Exception, String) doError(Exception, String))

Parameters:
filename - The file to load with file extension *.fds, or *.smv .
Returns:
Array of module which were loaded from the given file.
Throws:
java.io.IOException - If there was a problem with reading the file.
See Also:
loadModule(String), loadModule(String, String), parseModule(String), getAllModules(), getModule(String), registerErrorListener(ErrorListener), activateErrorListeners(Exception, String), doError(Exception, String)

getFactoryName

public static java.lang.String getFactoryName()

The factory package which is currently used by the environment to allocate new BDD fields.

Returns:
The BDD factory name.

doOnGC

public static void doOnGC(java.lang.reflect.Method m_gc)

Register a procedure to be done at every garbage collection.

Parameters:
m_gc - The method to perform.
See Also:
beQuiet(), doOnResize(Method), doOnReorder(Method)

doOnResize

public static void doOnResize(java.lang.reflect.Method m_resize)

Register a procedure to be done at every resize to the BDD table.

Parameters:
m_resize - The method to perform.
See Also:
beQuiet(), doOnGC(Method), doOnReorder(Method)

doOnReorder

public static void doOnReorder(java.lang.reflect.Method m_reorder)

Register a procedure to be done at every reorder to the BDD table.

Parameters:
m_reorder - The method to perform.
See Also:
beQuiet(), doOnGC(Method), doOnResize(Method)

beQuiet

public static void beQuiet()

Turning off the entire factory verbose (garbage collection, resize, reorder).

See Also:
doOnGC(Method), doOnResize(Method), doOnReorder(Method)

NOP

public static void NOP()

An empty procedure for shutting down the factory verbose.

See Also:
beQuiet()

FALSE

public static BDD FALSE()

The constant FALSE BDD.

Returns:
The constant FALSE BDD.
See Also:
TRUE()

TRUE

public static BDD TRUE()

The constant TRUE BDD.

Returns:
The constant TRUE BDD.
See Also:
FALSE()

saveBDD

public static void saveBDD(java.lang.String filename,
                           BDD to_save)
                    throws java.io.IOException

Save a BDD to the file system.

Parameters:
filename - The file to save the BDD to.
to_save - The BDD to save.
Throws:
java.io.IOException - If the was a problem with creating the file.
See Also:
loadBDD(String)

loadBDD

public static BDD loadBDD(java.lang.String filename)
                   throws java.io.IOException

Load a BDD from the file system.

Make sure that the system is configured with the same BDD package which saved the BDD to the file!!

Parameters:
filename - The file to load the BDD from.
Returns:
The BDD which was loaded.
Throws:
java.io.IOException - If the was a problem with reading the file.
See Also:
saveBDD(String, BDD)

getVar

public static ModuleBDDField getVar(java.lang.String preface,
                                    java.lang.String name)

Search and retrieve the BDD field by the given path and field name.

Parameters:
preface - The path to the field.
name - The field name.
Returns:
The BDD field, null if not found.
See Also:
newVar(String, String, int), newVar(String, String), allocBDD(int, int)

newVar

public static ModuleBDDField newVar(java.lang.String preface,
                                    java.lang.String name,
                                    int values_size)
                             throws ModuleVariableException

Create and allocate a new BDD field with the given domain size, i.e. the number of values that this BDD contains. (the actual number values rounded to the power of 2)

With this field instantiation The BDD is created with an associated facilities in the environment.
For creating a BDD without the environment field facilities, please refer to allocBDD(int, int).

Parameters:
preface - The path to the field.
name - The field name.
values_size - The size of the domain.
Returns:
The newly created BDD field.
Throws:
ModuleVariableException - If the given name for the new field to create is illegal (for instance duplication).
See Also:
getVar(String, String), newVar(String, String), allocBDD(int, int)

newVar

public static ModuleBDDField newVar(java.lang.String preface,
                                    java.lang.String name)
                             throws ModuleVariableException

Create and allocate a new BDD field with 2 values domain.

With this field instantiation The BDD is created with an associated facilities in the environment.
For creating a BDD without the environment field facilities, please refer to allocBDD(int,int).

Parameters:
preface - The path to the field.
name - The field name.
Returns:
The newly created BDD couple variable.
Throws:
ModuleVariableException - If the given name for the new field to create is illegal (for instance duplication).
See Also:
getVar(String, String), newVar(String, String, int), allocBDD(int, int)

toNiceString

public static java.lang.String toNiceString(Module con,
                                            BDD b)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to the given module, i.e. the path leading to the variable from the given module.
The print is done with line indentation.

It is advise to use this procedure for printing big BDDs!!

Parameters:
con - The module context of the BDD.
b - The BDD to prepare string to.
Returns:
The string representing the BDD.
See Also:
toNiceString(BDD), toNiceString(Module, BDD, String), toNiceString(BDD, String), toNiceSignleLineString(Module, BDD), toNiceSignleLineString(BDD)

toNiceString

public static java.lang.String toNiceString(BDD b)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to "main" module, i.e. the path leading to the variable from the given module.
The print is done with line indentation.

It is advise to use this procedure for printing big BDDs!!

Parameters:
b - The BDD to prepare string to.
Returns:
The string representing the BDD.
See Also:
toNiceString(Module, BDD), toNiceString(Module, BDD, String), toNiceString(BDD, String), toNiceSignleLineString(Module, BDD), toNiceSignleLineString(BDD)

toNiceString

public static java.lang.String toNiceString(Module con,
                                            BDD b,
                                            java.lang.String startIndent)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to the given module, i.e. the path leading to the variable from the given module.
The print is done with line indentation starting with the given initial indentation.

It is advise to use this procedure for printing big BDDs!!

Parameters:
con - The module context of the BDD.
b - The BDD to prepare string to.
startIndent - The initial indentation.
Returns:
The string representing the BDD.
See Also:
toNiceString(Module, BDD), toNiceString(BDD), toNiceString(BDD, String), toNiceSignleLineString(Module, BDD), toNiceSignleLineString(BDD)

toNiceString

public static java.lang.String toNiceString(BDD b,
                                            java.lang.String startIndent)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to "main" module, i.e. the path leading to the variable from the given module.
The print is done with line indentation starting with the given initial indentation.

It is advise to use this procedure for printing big BDDs!!

Parameters:
b - The BDD to prepare string to.
startIndent - The initial indentation.
Returns:
The string representing the BDD.
See Also:
toNiceString(Module, BDD), toNiceString(BDD), toNiceString(Module, BDD, String), toNiceSignleLineString(Module, BDD), toNiceSignleLineString(BDD)

toNiceSignleLineString

public static java.lang.String toNiceSignleLineString(Module con,
                                                      BDD b)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to the given module, i.e. the path leading to the variable from the given module.
The print is done in a single line.

It is advise to use this procedure for printing big BDDs!!

Parameters:
con - The module context of the BDD.
b - The BDD to prepare string to.
Returns:
The string representing the BDD.
See Also:
toNiceString(Module, BDD), toNiceString(BDD), toNiceString(Module, BDD, String), toNiceString(BDD, String), toNiceSignleLineString(BDD)

toNiceSignleLineString

public static java.lang.String toNiceSignleLineString(BDD b)

Prepare a string representing the If-Then-Else form of the given BDD. This kind of printing is better by an order of magnitude with respect to simple BDD.toString, which is exponential to the size of the BDD.
The naming is done respective to the "main" module, i.e. the path leading to the variable from the given module.
The print is done in a single line.

It is advise to use this procedure for printing big BDDs!!

Parameters:
b - The BDD to prepare string to.
Returns:
The string representing the BDD.
See Also:
toNiceString(Module, BDD), toNiceString(BDD), toNiceString(Module, BDD, String), toNiceString(BDD, String), toNiceSignleLineString(Module, BDD)

getEmptySet

public static BDDVarSet getEmptySet()

The empty set of fields.

Returns:
The empty set of fields.

prime

public static BDD prime(BDD unp_bdd)
                 throws BDDException

Given a BDD, returns the same BDD in its prime version of the variables.

Parameters:
unp_bdd - The unprimed BDD.
Returns:
The primed version of the given BDD.
Throws:
BDDException - When trying to prime BDD with primed fields.
See Also:
prime(BDD, ModuleBDDField[]), unprime(BDD), unprime(BDD, ModuleBDDField[]), containPrimeVars(BDD), containUnprimeVars(BDD)

prime

public static BDD prime(BDD unp_bdd,
                        ModuleBDDField[] couples)
                 throws BDDException

Given a BDD, returns the same BDD with the prime version of the given array of fields.

Parameters:
unp_bdd - The given BDD.
couples - The fields to prime.
Returns:
A BDD with primed version of the given fields.
Throws:
BDDException - When trying to prime already primed fields.
See Also:
prime(BDD), unprime(BDD), unprime(BDD, ModuleBDDField[]), containPrimeVars(BDD), containUnprimeVars(BDD)

unprime

public static BDD unprime(BDD p_bdd)
                   throws BDDException

Given a BDD, returns the same BDD in its unprime version of the fields.

Parameters:
p_bdd - The primed BDD.
Returns:
The unprimed version of the given BDD.
Throws:
BDDException - When trying to unprime BDD with unprime fields.
See Also:
prime(BDD), prime(BDD, ModuleBDDField[]), unprime(BDD, ModuleBDDField[]), containPrimeVars(BDD), containUnprimeVars(BDD)

unprime

public static BDD unprime(BDD p_bdd,
                          ModuleBDDField[] couples)
                   throws BDDException

Given a BDD, returns the same BDD with the unprime version of the given array of fields.

Parameters:
p_bdd - The given BDD.
couples - The fields to unprime.
Returns:
A BDD with unprimed version of the given fields.
Throws:
BDDException - When trying to unprime already unprimed fields.
See Also:
prime(BDD), prime(BDD, ModuleBDDField[]), unprime(BDD), containPrimeVars(BDD), containUnprimeVars(BDD)

containPrimeVars

public static boolean containPrimeVars(BDD set)

Check whether the given BDD contains a prime version of some field.

Parameters:
set - The BDD to check.
Returns:
true if the given BDD contains prime version of some field, false otherwise.
See Also:
containUnprimeVars(BDD), prime(BDD), prime(BDD, ModuleBDDField[]), unprime(BDD), unprime(BDD, ModuleBDDField[])

containUnprimeVars

public static boolean containUnprimeVars(BDD set)

Check whether the given BDD contains an unprime version of some field.

Parameters:
set - The BDD to check.
Returns:
true if the given BDD contains unprime version of some field, false otherwise.
See Also:
containPrimeVars(BDD), prime(BDD), prime(BDD, ModuleBDDField[]), unprime(BDD), unprime(BDD, ModuleBDDField[])

globalPrimeVars

public static BDDVarSet globalPrimeVars()

Get all primed variables in the system.

Returns:
All primed variables in the system.
See Also:
globalUnprimeVars(), globalVarsMinus(BDDVarSet)

globalUnprimeVars

public static BDDVarSet globalUnprimeVars()

Get all unprimed variables in the system.

Returns:
All unprimed variables in the system.
See Also:
globalPrimeVars(), globalVarsMinus(BDDVarSet)

globalVarsMinus

public static BDDVarSet globalVarsMinus(BDDVarSet minus)

Get the set of all variables (including the prime and unprime versions), except the given set of variables.

Parameters:
minus - The variable set to remove.
Returns:
A set of all variables except the given ones.
See Also:
globalPrimeVars(), globalUnprimeVars()

pred

public static BDD pred(BDD trans,
                       BDD to)

Given a set of state and a transitions, the procedure return all states which can lead in a single step to the given states.

Parameters:
trans - The given transitions.
to - The set of state to be reach.
Returns:
The set of states which can lead in a single step to the given states.
See Also:
succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

succ

public static BDD succ(BDD from,
                       BDD trans)

Given a set of state and a transitions, the procedure return all states which can be reached in a single step from the given states.

Parameters:
from - The given set of state.
trans - The given transitions.
Returns:
The set of states which can be reached in a single step from the given states.
See Also:
pred(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

allPred

public static BDD allPred(BDD trans,
                          BDD to)

Given a set of state and a transitions, the procedure return all states which can lead in any number of steps to given states.

Parameters:
trans - The given transitions.
to - The set of state to be reach.
Returns:
The set of states which can lead in any number of steps to the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

kPred

public static BDD kPred(BDD trans,
                        BDD to,
                        int k)

Given a set of state and a transitions, the procedure return all states which can lead in maximum k number of steps to given states.

Parameters:
trans - The given transitions.
to - The set of state to be reach.
k - The number of maximum steps allowed.
Returns:
The set of states which can lead in k number of steps to the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

allDeltaPred

public static BDD allDeltaPred(BDD trans,
                               BDD to)

Given a set of state and a transitions, the procedure return all states which can lead in any number of steps to given states, excluding the given states themselves (in some cases this might be more efficient the allPred, and then conjuncting out the negation).

Parameters:
trans - The given transitions.
to - The set of state to be reach.
Returns:
The set of states which can lead in any number of steps to the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

kDeltaPred

public static BDD kDeltaPred(BDD trans,
                             BDD to,
                             int k)

Given a set of state and a transitions, the procedure return all states which can lead in maximum k number of steps to given states, excluding the given states themselves (in some cases this might be more efficient the kPred, and then conjuncting out the negation).

Parameters:
trans - The given transitions.
to - The set of state to be reach.
k - The number of maximum steps allowed.
Returns:
The set of states which can lead in any number of steps to the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaSucc(BDD, BDD, int)

allSucc

public static BDD allSucc(BDD from,
                          BDD trans)

Given a set of state and a transitions, the procedure return all states which can be reached in a any number of steps from these states.

Parameters:
trans - The given transitions.
from - The given set of state.
Returns:
The set of states which can be reached in any number of steps from the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

kSucc

public static BDD kSucc(BDD from,
                        BDD trans,
                        int k)

Given a set of state and a transitions, the procedure return all states which can be reached in maximum k number of steps from these states.

Parameters:
trans - The given transitions.
from - The given set of state.
k - The number of maximum steps allowed.
Returns:
The set of states which can be reached in maximum k number of steps from the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

allDeltaSucc

public static BDD allDeltaSucc(BDD from,
                               BDD trans)

Given a set of state and a transitions, the procedure return all states which can be reached in any number of steps from these states, excluding the given states themselves (in some cases this might be more efficient the allSucc, and then conjuncting out the negation).

Parameters:
trans - The given transitions.
from - The given set of state.
Returns:
The set of states which can be reached in any number of steps from the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), kDeltaPred(BDD, BDD, int), kDeltaSucc(BDD, BDD, int)

kDeltaSucc

public static BDD kDeltaSucc(BDD from,
                             BDD trans,
                             int k)

Given a set of state and a transitions, the procedure return all states which can be reached in maximum k number of steps from these states, excluding the given states themselves (in some cases this might be more efficient the allSucc, and then conjuncting out the negation).

Parameters:
trans - The given transitions.
from - The given set of state.
k - The number of maximum steps allowed.
Returns:
The set of states which can be reached in maximum k number of steps from the given states.
See Also:
pred(BDD, BDD), succ(BDD, BDD), allPred(BDD, BDD), allSucc(BDD, BDD), kPred(BDD, BDD, int), kSucc(BDD, BDD, int), allDeltaPred(BDD, BDD), allDeltaSucc(BDD, BDD), kDeltaPred(BDD, BDD, int)

registerErrorListener

public static boolean registerErrorListener(ErrorListener lis)

Register an error listener to be invoked on every error which is thrown in the JTLV environment.

Parameters:
lis - The new listener to add.
Returns:
true if the listeners queue has been changed.
See Also:
all_error_listeners, removeErrorListener(ErrorListener), clearErrorListener(), activateErrorListeners(Exception, String), doError(Exception, String), ErrorListener

removeErrorListener

public static boolean removeErrorListener(ErrorListener lis)

Remove an error listener from the queue of listeners.

Parameters:
lis - The listener to be removed.
Returns:
true if the listeners queue contained the specified element.
See Also:
all_error_listeners, registerErrorListener(ErrorListener), clearErrorListener(), activateErrorListeners(Exception, String), doError(Exception, String), ErrorListener

clearErrorListener

public static void clearErrorListener()

Clears the entire listeners queue.

See Also:
all_error_listeners, registerErrorListener(ErrorListener), removeErrorListener(ErrorListener), activateErrorListeners(Exception, String), doError(Exception, String), ErrorListener

doError

public static void doError(java.lang.Exception e,
                           java.lang.String msg)

Invoke the listeners queue with the given exception. This is the exact same procedure as activateErrorListeners(Exception, String)

Parameters:
e - The exception to invoke the listeners with.
msg - A text message describing the failure.
See Also:
all_error_listeners, registerErrorListener(ErrorListener), removeErrorListener(ErrorListener), clearErrorListener(), activateErrorListeners(Exception, String), ErrorListener