uk.ac.man.cs.rainbow.rapa.data
Class Unifier

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.rapa.data.Unifier
All Implemented Interfaces:
Serializable

public class Unifier
extends Object
implements Serializable

The most general unifier of two expressions.

See Also:
Serialized Form

Constructor Summary
Unifier(Value v1, Value v2)
          Create a unifier that is the MGU of the two expressions.
 
Method Summary
 void combine(Unifier u)
          Merge the given unifier into this unifier.
 Value lookup(Variable v)
          What does the unifier map the given variable to?
 String toString()
           
static Substitution unify(Substitution sub, Value[] v1, Value[] v2)
          Compute a substitution that will unify two arrays of expressions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Unifier

public Unifier(Value v1,
               Value v2)
        throws NotUnifiable
Create a unifier that is the MGU of the two expressions.
Method Detail

lookup

public Value lookup(Variable v)
What does the unifier map the given variable to?

unify

public static Substitution unify(Substitution sub,
                                 Value[] v1,
                                 Value[] v2)
                          throws NotUnifiable
Compute a substitution that will unify two arrays of expressions.

combine

public void combine(Unifier u)
Merge the given unifier into this unifier.

toString

public String toString()
Overrides:
toString in class Object