kodkod.engine.bool
Class MultiGate

java.lang.Object
  extended by kodkod.engine.bool.BooleanValue
      extended by kodkod.engine.bool.BooleanFormula
          extended by kodkod.engine.bool.MultiGate
All Implemented Interfaces:
java.lang.Comparable<BooleanValue>, java.lang.Iterable<BooleanFormula>

public abstract class MultiGate
extends BooleanFormula

A logic gate with two or more inputs; an AND or an OR gate.

Author:
Emina Torlak
invariant:
#inputs > 1
some components.this => label in [1..Integer.MAX_VALUE), label in [0..Integer.MAX_VALUE)
no c1, c2: inputs | c1.label = -c2.label
this.label > 0 => all c: inputs | |c.label| < this.label
specfield:
op: Operator.Binary

Method Summary
<T,A> T
accept(BooleanVisitor<T,A> visitor, A arg)
          Passes this value and the given argument value to the visitor, and returns the resulting value.
 int hashCode()
          Returns a hashcode for this gate.
 int label()
          Returns the label for this value.
 Operator.Nary op()
          Returns the operator used to combine the input variables of this connective gate.
 java.lang.String toString()
          Returns a string representation of this multigate.
 
Methods inherited from class kodkod.engine.bool.BooleanFormula
input, iterator, size
 
Methods inherited from class kodkod.engine.bool.BooleanValue
compareTo
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

label

public final int label()
Returns the label for this value.

Specified by:
label in class BooleanValue
Returns:
this.label

op

public final Operator.Nary op()
Returns the operator used to combine the input variables of this connective gate.

Specified by:
op in class BooleanValue
Returns:
this.op

accept

public <T,A> T accept(BooleanVisitor<T,A> visitor,
                      A arg)
Passes this value and the given argument value to the visitor, and returns the resulting value.

Specified by:
accept in class BooleanFormula
Returns:
the value produced by the visitor when visiting this node with the given argument.

toString

public java.lang.String toString()
Returns a string representation of this multigate.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this multigate.

hashCode

public final int hashCode()
Returns a hashcode for this gate. The hashcode obeys the Object contract.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this gate.