uk.ac.man.cs.rainbow.wvmc
Class FormulaSet

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.wvmc.FormulaSet

public class FormulaSet
extends Object

A set of formulae organised as a linked list.


Constructor Summary
protected FormulaSet(Formula head, FormulaSet tail)
          Create a new linked list node.
 
Method Summary
 FormulaSet add(Formula f)
          Add the given formula to this set.
 FormulaSet add(FormulaSet set)
          Add the given set of formulae to this set.
static FormulaSet add(FormulaSet set, Formula f)
          Add the given formula to the given set.
static FormulaSet add(FormulaSet one, FormulaSet two)
          Add the given set of formulae to the given set.
static boolean equal(FormulaSet set1, FormulaSet set2)
          Equality between sets of formulae.
 Formula getHead()
          The head formula of this set.
 int getSize()
          The number of elements in this set.
static int getSize(FormulaSet set)
          The number of elements in the given set.
 FormulaSet getTail()
          The tail of this set.
 boolean present(Formula f)
          Is the given formula present in this set?
static boolean present(FormulaSet set, Formula f)
          Is the given formula present in the given set?
static void print(FormulaSet set)
          Print a set to System.out.
static void print(FormulaSet set, PrintStream p)
          Print a set to the given stream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormulaSet

protected FormulaSet(Formula head,
                     FormulaSet tail)
Create a new linked list node.
Parameters:
head - The formula in this node of the list.
tail - The rest of the list.
Method Detail

present

public boolean present(Formula f)
Is the given formula present in this set?
Parameters:
f - The formula to search for.

present

public static boolean present(FormulaSet set,
                              Formula f)
Is the given formula present in the given set?
Parameters:
set - Search this set...
f - ...for this formula.

add

public FormulaSet add(Formula f)
Add the given formula to this set. Note that if the formula is already in the set, this does nothing.
Parameters:
f - The formula to add.

add

public static FormulaSet add(FormulaSet set,
                             Formula f)
Add the given formula to the given set. Note that if the formula is already in the set, this does nothing.
Parameters:
set - The set to add to.
f - The formula to add.

add

public FormulaSet add(FormulaSet set)
Add the given set of formulae to this set. A union operation.
Parameters:
set - The set of formulae to add.

add

public static FormulaSet add(FormulaSet one,
                             FormulaSet two)
Add the given set of formulae to the given set. A union operation.
Parameters:
one - The set of formulae to add to.
two - The set of formulae to add.

getSize

public int getSize()
The number of elements in this set.

getSize

public static int getSize(FormulaSet set)
The number of elements in the given set.

getHead

public Formula getHead()
The head formula of this set.

getTail

public FormulaSet getTail()
The tail of this set. A set consisting of all the formulae in this set except the head formula.

print

public static void print(FormulaSet set)
Print a set to System.out.

print

public static void print(FormulaSet set,
                         PrintStream p)
Print a set to the given stream.

equal

public static boolean equal(FormulaSet set1,
                            FormulaSet set2)
Equality between sets of formulae.

toString

public String toString()
Overrides:
toString in class Object