|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.engine.bool.BooleanValue
kodkod.engine.bool.BooleanAccumulator
public final class BooleanAccumulator
An accumulator for easy construction of gates with multiple inputs.
An accumulator cannot be combined with other boolean values
using BooleanFactory methods. To use the circuit
represented by an accumulator, one must first convert it into a gate
by calling BooleanFactory.accumulate(BooleanAccumulator)
.
components: set BooleanValue |
op: Operator.Nary |
Method Summary | |
---|---|
BooleanValue |
add(BooleanValue v)
Adds the given value to this.components and returns the result. |
boolean |
isShortCircuited()
Returns true if this gate is short circuited; that is, its inputs are reduced to this.op.shortCircuit. |
java.util.Iterator<BooleanValue> |
iterator()
Returns an iterator over this.components, in the increasing order of labels. |
int |
label()
Returns 0. |
Operator |
op()
Returns the operator for this accumulator. |
int |
size()
Returns the size of this accumulator. |
java.lang.String |
toString()
|
static BooleanAccumulator |
treeGate(Operator.Nary op)
Returns a tree based implementation of BooleanAccumulator. |
static BooleanAccumulator |
treeGate(Operator.Nary op,
BooleanValue[] inputs)
Returns a tree based implementation of BooleanAccumulator, initialized with the given inputs. |
Methods inherited from class kodkod.engine.bool.BooleanValue |
---|
compareTo |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static BooleanAccumulator treeGate(Operator.Nary op)
java.lang.NullPointerException
- - op = nullpublic static BooleanAccumulator treeGate(Operator.Nary op, BooleanValue[] inputs)
java.lang.NullPointerException
- - op = null || inputs = nullpublic Operator op()
op
in class BooleanValue
public BooleanValue add(BooleanValue v)
v = this.op.shortCircuit || v.negation in this.components => this.components' = this.op.shortCircuit,
v !in BooleanConstant => this.components' = this.components + v,
this.components' = this.components |
public boolean isShortCircuited()
public int size()
public java.util.Iterator<BooleanValue> iterator()
iterator
in interface java.lang.Iterable<BooleanValue>
public int label()
label
in class BooleanValue
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |