public interface MDDManager
The manager has:
A number of leaves are defined when creating the manager. They are numbered
[0...nbleaves[. Negative leaves or holes in the values are not allowed, but you
are free to map indices to the values of your choice (including inside custom operators).
The same leaf can thus refer to different values, depending on the context.
Nodes can be created using the get_bnode and get_mnode methods (for Boolean and multi-valued nodes respectively), which create them if needed and return the bloc ID.
Nodes can also be created by combining existing nodes, using the merge method. This method uses MDDOperations to decide how to do the merging. MDDOperation for the common operations are provided (see MDDOperation.ACTION_*), but it was designed to help creating custom ones. A group-merging method allows to efficiently merge many nodes using the same operation.
Nodes also have reference counter, which allows to reuse the space when nodes are no longer used. For this, call the free method with a node ID when you stop using it. Make sure to forget the ID as any further use would result in unexpected results.
| Modifier and Type | Method and Description |
|---|---|
boolean[] |
collectDecisionVariables(int node)
Collect variables on which a MDD depends.
|
String |
dumpMDD(int node)
Write a raw text representation of the MDD
|
MDDVariable |
ensureVariable(Object key,
byte nbval)
get a variable, create it if needed.
|
void |
free(int pos)
Free a node.
|
MDDVariable[] |
getAllVariables()
Get all MDDVariables in this manager.
|
int |
getChild(int node,
int value)
Get a specific child for a node.
|
int[] |
getChildren(int node)
Get all the children of a given node.
|
int |
getLeafCount()
Get the number of leaves
|
MDDManager |
getManager(List<?> order)
Get a new manager for this MDD Store, using a custom variable order.
|
VariableEffect[] |
getMultivaluedVariableEffect(MDDVariable var,
int node)
Determine the effect of a given variable on a MDD.
|
int |
getNodeCount() |
MDDVariable |
getNodeVariable(int n)
Get the variable associated to a given node.
|
NodeRelation |
getRelation(int first,
int other)
Determine the relation between two nodes.
|
int |
getSign(int node,
MDDVariable pivot)
Infer the effect of a variable in a given MDD.
|
VariableEffect |
getVariableEffect(MDDVariable var,
int node)
Determine the effect of a given variable on a MDD.
|
MDDVariable |
getVariableForKey(Object key)
Get the MDDVariable associated to a given key.
|
int |
getVariableIndex(MDDVariable var)
Get the position of a given variable in this manager's list of variables.
|
byte |
groupReach(int node,
byte[] path)
Get the value reached by a group of paths.
|
boolean |
isleaf(int node) |
boolean |
isView(MDDManager ddm) |
int |
mnot(int node,
int v)
Multi-valued not: flip leaves 0 and v.
|
int |
nodeFromState(byte[] state,
int value)
Create a MDD representing a state.
|
int |
nodeFromStates(Collection<byte[]> states,
int value)
Create a MDD representing a group of states.
|
int |
not(int node)
Logical not, performed by flipping leaves 0 and 1.
|
int |
parseDump(String s)
Create a MDD from a dumped structure
|
byte |
reach(int node,
byte[] values)
Find the leaf reached for a given variable assignment
|
int |
use(int node)
Mark a node as used.
|
MDDManager getManager(List<?> order)
order - requested variable order.this if the order is the same)MDDVariable getNodeVariable(int n)
n - the node IDMDDVariable getVariableForKey(Object key)
key - int getVariableIndex(MDDVariable var)
var - getAllVariables().MDDVariable[] getAllVariables()
MDDVariable ensureVariable(Object key, byte nbval)
key - nbval - void free(int pos)
This should be used for each node id that was obtained through one of the get_?node() method,
or for the one explicitly marked as used.
Note that the space will be made available for new nodes, but it will NOT be returned to the garbage collector.
pos - use(int),
get_bnode(int, int, int),
get_mnode(int, int[])int use(int node)
free(int) when you release it.node - boolean isleaf(int node)
node - the ID of the tested node.int getChild(int node,
int value)
node - id of a nodevalue - assignment valueint[] getChildren(int node)
node - int not(int node)
node - int mnot(int node,
int v)
node - v - the positive valueNodeRelation getRelation(int first, int other)
first - other - int getNodeCount()
int getLeafCount()
int getSign(int node,
MDDVariable pivot)
node - the MDDpivot - the variable of interestbyte reach(int node,
byte[] values)
node - values - byte groupReach(int node,
byte[] path)
node - path - boolean[] collectDecisionVariables(int node)
node - VariableEffect getVariableEffect(MDDVariable var, int node)
var - node - VariableEffect[] getMultivaluedVariableEffect(MDDVariable var, int node)
var - node - boolean isView(MDDManager ddm)
int nodeFromState(byte[] state,
int value)
state - value - int nodeFromStates(Collection<byte[]> states, int value)
states - value - String dumpMDD(int node)
node - int parseDump(String s) throws ParseException
s - the string representing the MDD structureParseExceptionCopyright © 2009–2020. All rights reserved.