|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.upb.swt.mcie.robdds.BinOp
public class BinOp
This class implements binary operations on ROBDDs. A binary operation is
defined by a truth table, which is a two dimensional boolean array passed
to the constructor. Each binary operation belongs to a Context
and has its own hash table for pairs of nodes for which the operation has
already been calculated. The standard binary operations will be
instantiated for each context upon creation of a new context and are
stored in this context:
Context.and
, Context.or
, Context.xor
,
Context.equiv
and Context.impl
.
Field Summary | |
---|---|
private Context |
context
The context for this binary operation. |
private java.util.Map |
table
Hash table for pairs of nodes for which this binary operation has already been applied. |
private boolean[][] |
truthTable
The truth table defining the binary operation. |
Constructor Summary | |
---|---|
BinOp(Context context,
boolean[][] truthTable)
Creates a new binary operation from the truth table. |
Method Summary | |
---|---|
private ROBDD |
apply(InnerNode n1,
InnerNode n2)
Applies the binary operation to the two ROBDDs. |
ROBDD |
apply(ROBDD n1,
ROBDD n2)
Applies the binary operation to the two ROBDDs. |
private ROBDD |
apply(ROBDD n1,
TerminalNode n2)
Applies the binary operation to the two ROBDDs. |
private ROBDD |
apply(TerminalNode n1,
ROBDD n2)
Applies the binary operation to the two ROBDDs. |
void |
clearHashtable()
Clears the hash table keeping track of pairs of ROBDD nodes for which this binary operation has already been computed in this context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Context context
private boolean[][] truthTable
private java.util.Map table
Constructor Detail |
---|
public BinOp(Context context, boolean[][] truthTable)
context
- The context in which this binary operation
is to be applied.truthTable
- The truth table defining the binary
operation. It is a two-dimensional array with length two each.
The first dimension refers to the first operand and the second
to the second operand. In the array, index 0 stands for false
and index 1 stands for true. If the length of one dimension
is less than two or no truth table is provided at all, the
entries not provided are considered to be false.Method Detail |
---|
public ROBDD apply(ROBDD n1, ROBDD n2)
n1
- first operandn2
- second operand
IncorrectUseException
- indicates that the context of the
operation is different from the context of the ROBDDs
InternalError
- indicates that a node of unknown type
was encounteredapply(TerminalNode, ROBDD)
,
apply(ROBDD, TerminalNode)
,
apply(InnerNode, InnerNode)
private ROBDD apply(TerminalNode n1, ROBDD n2)
n1
- first operandn2
- second operand
apply(ROBDD, ROBDD)
private ROBDD apply(ROBDD n1, TerminalNode n2)
n1
- first operandn2
- second operand
apply(ROBDD, ROBDD)
private ROBDD apply(InnerNode n1, InnerNode n2)
n1
- first operandn2
- second operand
apply(ROBDD, ROBDD)
public void clearHashtable()
OutOfMemoryError
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |