public class ZDD extends NodeTable
The base implementation will give you the core Z-BDD operation such as change, diff and union. To get more operators, see the sub-classes.
| Modifier and Type | Field and Description |
|---|---|
protected NodeName |
nodeNames |
protected int |
num_vars |
dead_nodes, ht_chain, mark_stack, NODE_MARK, NODE_UNMARK, nodesminfree, stat_gc_count, stat_gc_freed, stat_gc_time, stat_grow_time, stat_lookup_count, stat_notify_time, stat_nt_grow, table_size, work_stack, work_stack_tos| Constructor and Description |
|---|
ZDD(int nodesize)
create a Z-BDD manager
|
ZDD(int nodesize,
int cachesize)
create a Z-BDD manager
|
| Modifier and Type | Method and Description |
|---|---|
Collection |
addDebugger(BDDDebuger d)
for debugging: install a debugger.
|
int |
base()
returns {{}}
|
int |
change(int zdd,
int var) |
void |
cleanup()
cleanup this ZDD, to release its memory and help GC
|
int |
count(int zdd) |
int |
createVar()
create a new ZDD variable
|
int |
cube(boolean[] v)
cube of a selection of variables
|
int |
cube(int v)
cube of a single variable v
|
int |
cube(String s)
cube of a selection of variables, represented as
a string, e.g.
|
int |
cubes_intersect(String s)
Intersection of cubes.
|
int |
cubes_union(String s)
Union of cubes, each represented by a string token.
|
int |
diff(int p,
int q) |
int |
diffTo(int set,
int add)
helper function to compute set' = set - add, derefs the old set!
|
int |
empty()
returns {}
|
boolean |
emptyIn(int X)
returns true if base {{}} is in X
|
int |
follow_high(int zdd)
returns the terminal value along the all-high path
|
int |
follow_low(int zdd)
returns the terminal value along the all-low path
|
long |
getMemoryUsage()
return the amount of internally allocated memory in bytes
|
static void |
internal_test()
testbench.
|
int |
intersect(int p,
int q) |
protected int |
mk(int i,
int l,
int h)
Zero-supressed MK operator
|
int |
nodeCount(int zdd)
compute the number of nodes in the tree (this function is currently somewhat slow)
|
protected void |
post_removal_callbak()
this function is called when something in the node table is changed (GC or grow).
|
void |
print(int zdd) |
void |
printCubes(int bdd) |
void |
printDot(String fil,
int bdd) |
void |
printSet(int bdd) |
boolean[] |
satOne(int zdd,
boolean[] vec)
Returns a satisfying boolean assignment, null if none
XXX: this code is still untested! |
void |
setNodeNames(NodeName nn) |
void |
showStats()
show ZDD statistics
|
int |
single(int var)
create a tree of a variable.
|
int |
subset0(int zdd,
int var)
var is a variable, NOT a tree
|
int |
subset1(int zdd,
int var)
var is a variable, NOT a tree
|
int |
subsets(boolean[] v) |
int |
union(int p,
int q) |
int |
unionTo(int set,
int add)
helper function to compute set' = set UNION add, derefs the old set!
|
int |
universe() |
add, check_all_nodes, check_node, countRootNodes, deref, enableStackMarking, gc, getHigh, getLow, getRef, getVar, getVarUnmasked, grow, invalidate, isNodeMarked, isValid, mark_node, mark_tree, match_table, ref, saturate, setAll, setAll, show_table_all, show_table, show_tuple, signal_removed, tree_depth_changed, unmark_node, unmark_tree, update_grow_parametersprotected int num_vars
protected NodeName nodeNames
public ZDD(int nodesize)
nodesize - is the number of nodes initially allocated in the node-tablepublic ZDD(int nodesize,
int cachesize)
nodesize - is the number of nodes initially allocated in the node-tablecachesize - is the suggested cache size.public void cleanup()
public Collection addDebugger(BDDDebuger d)
NodeTableaddDebugger in class NodeTableprotected void post_removal_callbak()
NodeTablesub-classes must "implement" this function for, for example, flushing caches since it signals that something important has been changed and old data might have become invalid.
post_removal_callbak in class NodeTableprotected final int mk(int i,
int l,
int h)
public int createVar()
public final int empty()
public final int base()
public final int single(int var)
public final int universe()
public final int cube(int v)
public final int cube(boolean[] v)
public final int cube(String s)
public int cubes_union(String s)
public int cubes_intersect(String s)
public int subsets(boolean[] v)
public final int subset1(int zdd,
int var)
public final int subset0(int zdd,
int var)
public final int change(int zdd,
int var)
public final int union(int p,
int q)
public final int intersect(int p,
int q)
public final int diff(int p,
int q)
public final int follow_low(int zdd)
public final int follow_high(int zdd)
public final boolean emptyIn(int X)
public boolean[] satOne(int zdd,
boolean[] vec)
public final int count(int zdd)
public int nodeCount(int zdd)
public int unionTo(int set,
int add)
public int diffTo(int set,
int add)
public long getMemoryUsage()
getMemoryUsage in class NodeTablepublic void setNodeNames(NodeName nn)
public void print(int zdd)
public void printDot(String fil, int bdd)
public void printSet(int bdd)
public void printCubes(int bdd)
public static void internal_test()
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.