public class BDD extends NodeTable
NodeTable,
Configuration| Modifier and Type | Field and Description |
|---|---|
protected static int |
CACHE_AND
for the OP cache
|
protected static int |
CACHE_BIIMP
for the OP cache
|
protected static int |
CACHE_EXISTS
for the quant cache
|
protected static int |
CACHE_FORALL
for the quant cache
|
protected static int |
CACHE_IMP |
protected static int |
CACHE_NAND |
protected static int |
CACHE_NOR |
protected static int |
CACHE_OR
for the OP cache
|
protected static int |
CACHE_RESTRICT |
protected static int |
CACHE_XOR
for the OP cache
|
protected SimpleCache |
ite_cache |
protected int |
last_sat_vars |
protected NodeName |
nodeNames |
protected SimpleCache |
not_cache |
protected int |
num_vars |
protected int[] |
oneSat_buffer |
protected SimpleCache |
op_cache |
protected SimpleCache |
quant_cache |
protected boolean |
quant_conj |
protected int |
quant_cube |
protected int |
quant_id |
protected SimpleCache |
relprod_cache |
protected SimpleCache |
replace_cache |
protected int |
restrict_careset |
protected DoubleCache |
sat_cache |
protected boolean[] |
sign_vec |
protected int |
varset_last |
protected boolean[] |
varset_vec |
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 |
|---|
BDD(int nodesize)
create a BDD manager with initially nodesize nodes.
|
BDD(int nodesize,
int cache_size)
create a BDD manager with initially nodesize nodes
and cache_size cache elements.
|
| Modifier and Type | Method and Description |
|---|---|
int |
and(int u1,
int u2)
binary AND.
|
int |
andTo(int bdd1,
int bdd2)
the operation bdd1 &= bdd2; is equal to bdd1 = andTo(bdd1, bdd2);
this operation also handles the ref-counting |
int |
biimp(int u1,
int u2)
binary BI-IMPLICATION (double implication, equivalence, whatever...).
|
void |
cleanup()
this function is called at exit, cleans up and frees allocated memory
|
Permutation |
createPermutation(int[] cube_from,
int[] cube_to)
create a Permutation vector for a given variable permutation.
A permutation is used by replace to re-label nodes in a BDD. NOTE: the from and to-cubes must not overlap! |
int |
createVar()
create a new BDD variable
|
int |
cube(boolean[] v)
create a bdd cube, which is simply a conjunction of a set of variables.
given a list of variables v[], it vill return v[0] AND v[1] AND .... |
int |
cube(String s)
developement code, do not use!
a cube over a set of variables represented as a mintem. |
int |
exists(int bdd,
int cube)
binary EXISTS, existential quantification.
Let exists(bdd, variable) to be bdd(variable) OR bdd(NOT variable). |
int |
forall(int bdd,
int cube)
binary FOR-ALL, universal quantification.
Let forall(bdd, variable) to be bdd(variable) AND bdd(NOT variable). |
long |
getMemoryUsage() |
int |
getOne()
the symbolic ONE
|
int |
getZero()
the symbolic ZERO
|
int |
imp(int u1,
int u2)
binary implication.
|
static void |
internal_test()
testbench.
|
boolean |
isVariable(int bdd)
Is this BDD tree a BDD Variable?
|
int |
ite(int f,
int then_,
int else_)
this is the If-Then-Else BDD function.
it can be used to (inefficiently) simulate and binary operation. (i think it is described in the "Long" paper). |
boolean |
member(int bdd,
boolean[] minterm)
returns true if the given minterm is a included in the bdd.
|
int |
minterm(boolean[] v)
returns an unary minterm based on a vector of boolean assignments.
for example minterm([true, false]) will return NOT v1 and v2. |
int |
minterm(String s)
developement code, do not use!
returns a unary minterm based on a vector of boolean assignments. for example minterm([true, false]) will return NOT v1 and v2. |
int |
mk(int i,
int l,
int h)
mk operator as defined in Andersens lecture notes
|
int |
nand(int u1,
int u2)
binary NAND.
|
int |
nodeCount(int bdd)
compute the number of nodes in the tree (this function is currently somewhat slow)
|
int |
nor(int u1,
int u2)
binary NOR.
|
int |
not(int u1)
binary NOT.
|
int |
numberOfVariables()
how many BDD variables do we have ??
|
protected void |
oneSat_rec(int bdd) |
int |
oneSat(int bdd)
return a satisfying assignment for this BDD as a unary cube.
|
int[] |
oneSat(int bdd,
int[] buffer)
oneSat(bdd, buffer) returns an int vector
x where x[i] is 0/1 or -1 for neg cofactor/pos cofactor and dont care
if buffer is null, a new vector is created otherwise buffer is used an returned
|
int |
or(int u1,
int u2)
binary OR.
|
int |
orTo(int bdd1,
int bdd2)
the operation bdd1 |= bdd2; is equal to bdd1 = orTo(bdd1, bdd2);
this operation also handles the ref-counting |
protected void |
post_removal_callbak()
this function is called after the garbage collector hash changed some internal data.
|
void |
print(int bdd)
printthis BDD to console (prints internal structure)
|
void |
printCubes(int bdd)
print the cubes (true assignment) for the minterms in this BDD
|
void |
printDot(String fil,
int bdd)
creates a DOT file for this BDD and convert to an image using DOT
|
void |
printSet(int bdd)
possibly using dont-cares, print satisfying assignment od this BDD
|
int |
quasiReducedNodeCount(int bdd)
faster nodeCount, but doesn't take the shared child-trees into account
|
int |
relProd(int u1,
int u2,
int c)
This is the relational-product of Clarke et al..
It combines a conjunction and existential quantification that is often seen in image computation: EXISTS c. |
int |
replace(int bdd,
Permutation perm)
Given a permutation, this function will re-label (some) nodes in a BDD
to associate with a new sets of variables.
|
int |
restrict(int u,
int v)
The BDD restrict operation.
|
protected double |
satCount_rec(int bdd) |
double |
satCount(int bdd)
returns the number of satisfying assignments for this BDD.
|
void |
setNodeNames(NodeName nn)
Change the default node-naming procedure, for advanced users only!
|
void |
showStats()
show some statistics ...
|
int |
simplify(int d,
int u)
The BDD simplification operation.
|
int |
support(int bdd)
returns the support set of a variable, that is a cube C where each of its variables
are used somewhere in the ibpu bdd.
|
int |
xor(int u1,
int u2)
binary XOR.
|
add, addDebugger, 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 static final int CACHE_AND
protected static final int CACHE_OR
protected static final int CACHE_XOR
protected static final int CACHE_BIIMP
protected static final int CACHE_IMP
protected static final int CACHE_NAND
protected static final int CACHE_NOR
protected static final int CACHE_RESTRICT
protected static final int CACHE_EXISTS
protected static final int CACHE_FORALL
protected int num_vars
protected int last_sat_vars
protected SimpleCache op_cache
protected SimpleCache relprod_cache
protected SimpleCache not_cache
protected SimpleCache ite_cache
protected SimpleCache quant_cache
protected SimpleCache replace_cache
protected DoubleCache sat_cache
protected boolean[] varset_vec
protected boolean[] sign_vec
protected int[] oneSat_buffer
protected int varset_last
protected int quant_id
protected int quant_cube
protected int restrict_careset
protected boolean quant_conj
protected NodeName nodeNames
public BDD(int nodesize)
public BDD(int nodesize,
int cache_size)
public void cleanup()
public final int getOne()
public final int getZero()
public int numberOfVariables()
public int createVar()
protected void post_removal_callbak()
post_removal_callbak in class NodeTablepublic int mk(int i,
int l,
int h)
public final int cube(boolean[] v)
exists(int, int),
forall(int, int)public final int cube(String s)
cube(boolean[])public final int minterm(boolean[] v)
minterm(boolean[])public final int minterm(String s)
minterm(boolean[])public int ite(int f,
int then_,
int else_)
public int and(int u1,
int u2)
or(int, int)public int nand(int u1,
int u2)
nor(int, int)public int or(int u1,
int u2)
and(int, int)public int nor(int u1,
int u2)
nand(int, int)public int xor(int u1,
int u2)
biimp(int, int)public int biimp(int u1,
int u2)
xor(int, int)public int imp(int u1,
int u2)
public int not(int u1)
public int exists(int bdd,
int cube)
forall(int, int)public int forall(int bdd,
int cube)
exists(int, int)public int relProd(int u1,
int u2,
int c)
public Permutation createPermutation(int[] cube_from, int[] cube_to)
Permutation,
replace(int, jdd.bdd.Permutation)public int replace(int bdd,
Permutation perm)
Permutation,
createPermutation(int[], int[])public int restrict(int u,
int v)
simplify(int, int)public int simplify(int d,
int u)
restrict(int, int)public boolean isVariable(int bdd)
public double satCount(int bdd)
Important note: this works becuase getVar() returns "numbers of variables plus one" for the terminal nodes!
protected double satCount_rec(int bdd)
public int nodeCount(int bdd)
public final int quasiReducedNodeCount(int bdd)
public int oneSat(int bdd)
public int[] oneSat(int bdd,
int[] buffer)
oneSat(bdd, buffer) returns an int vector x where x[i] is 0/1 or -1 for neg cofactor/pos cofactor and dont care if buffer is null, a new vector is created otherwise buffer is used an returned
protected void oneSat_rec(int bdd)
public int support(int bdd)
returns the support set of a variable, that is a cube C where each of its variables are used somewhere in the ibpu bdd.
public boolean member(int bdd,
boolean[] minterm)
public int orTo(int bdd1,
int bdd2)
public int andTo(int bdd1,
int bdd2)
public void showStats()
NodeTablepublic long getMemoryUsage()
getMemoryUsage in class NodeTablepublic void print(int bdd)
public void printDot(String fil, int bdd)
public void printSet(int bdd)
public void printCubes(int bdd)
public void setNodeNames(NodeName nn)
NodeNamepublic static void internal_test()
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.