standup.unify
Class Unification
java.lang.Object
standup.unify.Unification
public class Unification
- extends Object
A class that provides static methods for performing unification of two
Unifiable
objects.
- Author:
- Ruli Manurung
Field Summary |
(package private) static int |
FAIL
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FAIL
static final int FAIL
- See Also:
- Constant Field Values
Unification
public Unification()
unify
public static Bindings unify(Unifiable x,
Unifiable y)
- Unifies
x
and y
and returns the resulting
Bindings
. The unification is non-destructive, in the sense that
x
and y
are unmodified. Use
Bindings.dereference(Unifiable)
to obtain the 'destructively'
unified objects.
- Parameters:
x
- first Unifiable
object to be unifiedy
- second Unifiable
object to be unified
- Returns:
- the resulting
Bindings
of the unification
unify
public static Bindings unify(Unifiable x,
Unifiable y,
Bindings b)
- Unifies
x
and y
using the bindings built so
far in b
, and returns the resulting Bindings
.
The bindings in b
are unmodified.
- Parameters:
x
- first Unifiable
object to be unifiedy
- second Unifiable
object to be unifiedb
- the bindings built so far
- Returns:
- the resulting
Bindings
of the unification
unifyVar
private static Bindings unifyVar(UnifiableVariable v,
Unifiable x,
Bindings b)
occurCheck
private static boolean occurCheck(UnifiableVariable v,
Unifiable x)
isVariableString
public static boolean isVariableString(String obj)