|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wis.jtlv.env.Env
public final class Env
The main JTLV environment Facade, which supplies all 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 unprime versions of all fields).
Nested Class Summary | |
---|---|
static class |
Env.JTLVBDDToString
TBD. |
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 ModuleBDDField |
___getVarForDomain(net.sf.javabdd.BDDDomain dom)
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
static net.sf.javabdd.BDDPairing |
___makePair()
Deprecated. INTERNAL PROCEDURE - will be encapsulated and removed from the external API in the following few releases. |
static void |
activateErrorListeners(java.lang.Exception e,
java.lang.String msg)
Invoke the listeners queue with the given exception. |
static net.sf.javabdd.BDDDomain |
allocBDD(int values_size)
Allocate a new BDD with the given domain size, i.e. |
static void |
beQuiet()
Turning of the garbage collection verbosity. |
static void |
clearErrorListener()
Clears the entire listeners queue. |
static boolean |
containPrimeVars(net.sf.javabdd.BDD set)
Check whether the given BDD contains prime version of the fields. |
static boolean |
containUnprimeVars(net.sf.javabdd.BDD set)
Check whether the given BDD contains unprime version of the fields. |
static Module[] |
debugParseModule(java.lang.String filename)
This procedure 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 down at every garbage collection. |
static void |
doOnResize(java.lang.reflect.Method m_resize)
Register a procedure to be down at every resize to the BDD table. |
static net.sf.javabdd.BDD |
FALSE()
The constant FALSE BDD. |
static Module[] |
getAllModules()
Get all module objects currently loaded into the environment. |
static net.sf.javabdd.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 ModuleBDDField |
getVar(java.lang.String preface,
java.lang.String name)
Search and retrieve the BDD field by the given path and field name. |
static net.sf.javabdd.BDD |
loadBDD(java.lang.String filename)
Load a BDD from the file system. |
static Module[] |
loadModule(java.lang.String filename)
The main procedure for loading a given file into the system. |
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 Garbage collection verbosity. |
static Module[] |
parseModule(java.lang.String filename)
This procedure only parse the given file and add it to the system. |
static net.sf.javabdd.BDD |
prime(net.sf.javabdd.BDD unp_bdd)
Given an unprimed BDD, returns the exact same BDD with the primed version of the variables. |
static net.sf.javabdd.BDD |
prime(net.sf.javabdd.BDD unp_bdd,
ModuleBDDField[] couples)
Given a BDD, returns the exact same BDD with the primed version of the given fields array. |
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,
net.sf.javabdd.BDD to_save)
Save a BDD to the file system. |
static java.lang.String |
toNiceSignleLineString(Module con,
net.sf.javabdd.BDD b)
Prepare a string representing the If-Then-Else form of the given BDD. |
static java.lang.String |
toNiceString(Module con,
net.sf.javabdd.BDD b)
Prepare a string representing the If-Then-Else form of the given BDD. |
static java.lang.String |
toNiceString(Module con,
net.sf.javabdd.BDD b,
java.lang.String startIndent)
Prepare a string representing the If-Then-Else form of the given BDD. |
static net.sf.javabdd.BDD |
TRUE()
The constant TRUE BDD. |
static net.sf.javabdd.BDD |
unprime(net.sf.javabdd.BDD p_bdd)
Given a primed BDD, returns the exact same BDD with the unprimed version of the fields. |
static net.sf.javabdd.BDD |
unprime(net.sf.javabdd.BDD p_bdd,
ModuleBDDField[] couples)
Given a BDD, returns the exact same BDD with the unprimed version of the given fields array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
JTLV version count.
public static Env.JTLVBDDToString stringer
An object responsible for associating BDD variables to their names.
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.
registerErrorListener(ErrorListener)
,
removeErrorListener(ErrorListener)
,
clearErrorListener()
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
,
ErrorListener
Method Detail |
---|
public static void resetEnv()
Reset the environment. In particular reset the bdd factory and all fields declared in the environment.
public static Module[] getAllModules()
Get all module objects currently loaded into the environment.
putModule(String, Module)
,
getModule(String)
,
Module
,
FDSModule
,
SMVModule
public static Module getModule(java.lang.String full_inst_name)
Get a module instance by its associated full path string.
full_inst_name
- the full path string to the instance.
putModule(String, Module)
,
getAllModules()
,
Module
,
FDSModule
,
SMVModule
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.
full_inst_name
- the string to associate this module with.to_add
- the module to add.getAllModules()
,
getModule(String)
,
Module
,
FDSModule
,
SMVModule
public static int getModuleNum()
Get the number of modules currently loaded into the environment.
public static java.util.Set<java.lang.String> getModuleNames()
The set of all names which are associated with the modules loaded to the environment.
getAllModules()
,
getModule(String)
public static Module[] loadModule(java.lang.String filename) throws java.io.IOException
The main procedure for loading a given file into 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 through the Env error
mechanism. (i.e.
registerErrorListener(ErrorListener)
activateErrorListeners(Exception, String)
doError(Exception, String)
)
filename
- The file to load with file extension *.fds, or *.smv .
java.io.IOException
- If there was a problem with the file.parseModule(String)
,
debugParseModule(String)
,
getAllModules()
,
getModule(String)
,
registerErrorListener(ErrorListener)
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
public static Module[] parseModule(java.lang.String filename) throws java.io.IOException
This procedure only 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 through the Env error
mechanism. (i.e.
registerErrorListener(ErrorListener)
activateErrorListeners(Exception, String)
doError(Exception, String)
)
filename
- The file to load with file extension *.fds, or *.smv .
java.io.IOException
- If there was a problem with the file.loadModule(String)
,
debugParseModule(String)
,
getAllModules()
,
getModule(String)
,
registerErrorListener(ErrorListener)
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
public static Module[] debugParseModule(java.lang.String filename) throws java.io.IOException
This procedure 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 through the Env error
mechanism. (i.e.
registerErrorListener(ErrorListener)
activateErrorListeners(Exception, String)
doError(Exception, String)
)
filename
- The file to load with file extension *.fds, or *.smv .
java.io.IOException
- If there was a problem with the file.loadModule(String)
,
parseModule(String)
,
getAllModules()
,
getModule(String)
,
registerErrorListener(ErrorListener)
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
public static java.lang.String getFactoryName()
The factory package which is currently used by the environment to allocate new BDD fields.
public static void doOnGC(java.lang.reflect.Method m_gc)
m_gc
- The method to perform.beQuiet()
,
doOnResize(Method)
public static void doOnResize(java.lang.reflect.Method m_resize)
m_resize
- The method to perform.beQuiet()
,
doOnGC(Method)
public static void beQuiet()
Turning of the garbage collection verbosity.
doOnGC(Method)
,
doOnResize(Method)
public static void NOP()
public static net.sf.javabdd.BDDDomain allocBDD(int values_size)
Allocate a new BDD with the given domain size, i.e. the domain size is exponential to the actual BDD size.
This procedure does not create the entire BDD field facilities. For
creating a BDD field, please refer to
newVar(String, String)
or
newVar(String, String, int)
values_size
- The size of the domain.
getFactoryName()
,
newVar(String, String)
,
newVar(String, String, int)
public static net.sf.javabdd.BDD FALSE()
The constant FALSE BDD.
TRUE()
public static net.sf.javabdd.BDD TRUE()
The constant TRUE BDD.
FALSE()
public static void saveBDD(java.lang.String filename, net.sf.javabdd.BDD to_save) throws java.io.IOException
Save a BDD to the file system.
filename
- The file to save the BDD to.to_save
- The BDD to save.
java.io.IOException
- If the was a problem with creating the file.loadBDD(String)
public static net.sf.javabdd.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!!
filename
- The file to load the BDD from.
java.io.IOException
- If the was a problem with reading the file.saveBDD(String, BDD)
public static java.lang.String toNiceString(Module con, net.sf.javabdd.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!!
con
- The module context of the BDD.b
- The BDD to prepare string to.
toNiceString(Module, BDD, String)
,
toNiceSignleLineString(Module, BDD)
public static java.lang.String toNiceString(Module con, net.sf.javabdd.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!!
con
- The module context of the BDD.b
- The BDD to prepare string to.startIndent
- The initial indentation.
toNiceString(Module, BDD)
,
toNiceSignleLineString(Module, BDD)
public static java.lang.String toNiceSignleLineString(Module con, net.sf.javabdd.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!!
con
- The module context of the BDD.b
- The BDD to prepare string to.
toNiceString(Module, BDD)
,
toNiceString(Module, BDD, String)
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.
preface
- The path to the field.name
- The field name.
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 domain size is exponential to the actual BDD size.
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)
.
preface
- The path to the field.name
- The field name.values_size
- The size of the domain.
ModuleVariableException
- If the given name for the new field to create is illegal.newVar(String, String)
,
allocBDD(int)
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)
.
preface
- The path to the field.name
- The field name.
ModuleVariableException
- If the given name for the new field to create is illegal.newVar(String, String, int)
,
allocBDD(int)
public static net.sf.javabdd.BDD prime(net.sf.javabdd.BDD unp_bdd) throws net.sf.javabdd.BDDException
Given an unprimed BDD, returns the exact same BDD with the primed version of the variables.
unp_bdd
- The unprimed BDD.
net.sf.javabdd.BDDException
- When trying to prime BDD with primed fields.prime(BDD, ModuleBDDField[])
,
unprime(BDD)
,
unprime(BDD, ModuleBDDField[])
public static net.sf.javabdd.BDD prime(net.sf.javabdd.BDD unp_bdd, ModuleBDDField[] couples) throws net.sf.javabdd.BDDException
Given a BDD, returns the exact same BDD with the primed version of the given fields array.
unp_bdd
- The given BDD.couples
- The fields to prime.
net.sf.javabdd.BDDException
- When trying to prime already primed fields.prime(BDD)
,
unprime(BDD)
,
unprime(BDD, ModuleBDDField[])
public static net.sf.javabdd.BDD unprime(net.sf.javabdd.BDD p_bdd) throws net.sf.javabdd.BDDException
Given a primed BDD, returns the exact same BDD with the unprimed version of the fields.
p_bdd
- The primed BDD.
net.sf.javabdd.BDDException
- When trying to unprime BDD with unprime fields.prime(BDD)
,
prime(BDD, ModuleBDDField[])
,
unprime(BDD, ModuleBDDField[])
public static net.sf.javabdd.BDD unprime(net.sf.javabdd.BDD p_bdd, ModuleBDDField[] couples) throws net.sf.javabdd.BDDException
Given a BDD, returns the exact same BDD with the unprimed version of the given fields array.
p_bdd
- The given BDD.couples
- The fields to unprime.
net.sf.javabdd.BDDException
- When trying to unprime already unprimed fields.prime(BDD)
,
prime(BDD, ModuleBDDField[])
,
unprime(BDD)
public static boolean containPrimeVars(net.sf.javabdd.BDD set)
Check whether the given BDD contains prime version of the fields.
set
- The BDD to check.
public static boolean containUnprimeVars(net.sf.javabdd.BDD set)
Check whether the given BDD contains unprime version of the fields.
set
- The BDD to check.
public static net.sf.javabdd.BDDVarSet getEmptySet()
The empty set of fields.
public static boolean registerErrorListener(ErrorListener lis)
Register an error listener to be invoked on every error which is thrown in the JTLV environment.
lis
- The new listener to add.
all_error_listeners
,
removeErrorListener(ErrorListener)
,
clearErrorListener()
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
,
ErrorListener
public static boolean removeErrorListener(ErrorListener lis)
Remove an error listener from the queue of listeners.
lis
- The listener to be removed.
all_error_listeners
,
registerErrorListener(ErrorListener)
,
clearErrorListener()
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
,
ErrorListener
public static void clearErrorListener()
Clears the entire listeners queue.
all_error_listeners
,
registerErrorListener(ErrorListener)
,
removeErrorListener(ErrorListener)
,
activateErrorListeners(Exception, String)
,
doError(Exception, String)
,
ErrorListener
public static void activateErrorListeners(java.lang.Exception e, java.lang.String msg)
Invoke the listeners queue with the given exception. This is the exact
same procedure as doError(Exception, String)
e
- The exception to invoke the listeners with.msg
- A text message describing the failure.all_error_listeners
,
registerErrorListener(ErrorListener)
,
removeErrorListener(ErrorListener)
,
clearErrorListener()
,
doError(Exception, String)
,
ErrorListener
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)
e
- The exception to invoke the listeners with.msg
- A text message describing the failure.all_error_listeners
,
registerErrorListener(ErrorListener)
,
removeErrorListener(ErrorListener)
,
clearErrorListener()
,
activateErrorListeners(Exception, String)
,
ErrorListener
public static net.sf.javabdd.BDDPairing ___makePair()
Creates a pair object which can then be used to associate two BDD fields.
public static ModuleBDDField ___getVarForDomain(net.sf.javabdd.BDDDomain dom)
Given a BDD domain, search and returns the corresponding BDD field.
dom
- The domain to look his variable for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |