kodkod.engine.bool
Class BooleanFormula

java.lang.Object
  extended by kodkod.engine.bool.BooleanValue
      extended by kodkod.engine.bool.BooleanFormula
All Implemented Interfaces:
java.lang.Comparable<BooleanValue>, java.lang.Iterable<BooleanFormula>
Direct Known Subclasses:
BooleanVariable, ITEGate, MultiGate, NotGate

public abstract class BooleanFormula
extends BooleanValue
implements java.lang.Iterable<BooleanFormula>

A non-constant boolean value with zero or more inputs.

Author:
Emina Torlak
invariant:
size >= 0
specfield:
op: Operator
size: int
inputs: [0..size) -> one BooleanFormula

Method Summary
abstract
<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.
abstract  BooleanFormula input(int i)
          Returns the ith input to this gate.
abstract  java.util.Iterator<BooleanFormula> iterator()
          Returns an iterator over the inputs to this gate.
abstract  int size()
          Returns the number of inputs to this gate.
 
Methods inherited from class kodkod.engine.bool.BooleanValue
compareTo, label, op
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

accept

public abstract <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.

Returns:
the value produced by the visitor when visiting this node with the given argument.

iterator

public abstract java.util.Iterator<BooleanFormula> iterator()
Returns an iterator over the inputs to this gate.

Specified by:
iterator in interface java.lang.Iterable<BooleanFormula>
Returns:
an iterator over this.inputs.

size

public abstract int size()
Returns the number of inputs to this gate.

Returns:
#this.inputs

input

public abstract BooleanFormula input(int i)
Returns the ith input to this gate.

Returns:
this.inputs[i]
Throws:
java.lang.IndexOutOfBoundsException - - i < 0 || i >= #this.inputs
requires:
0 <= i < size