public class Unifier extends Object
Unification of ASTs.
The unify methods in this class assume that all the jokers
in both ASTs implement the Joker
interface. They also
assume that, if a joker gets bound to a term, automatically all
jokers of the same type and with the same name get bound to
that term. The ProverFactory should be used to ensure these
properties.
Modifier and Type | Field and Description |
---|---|
static int |
maxDepth_
Unifications deeper than this fail!
This is a convenient way of detecting infinite loops
in the unification algorithms.
|
static int |
printDepth_
Unifications deeper than this are printed.
|
Constructor and Description |
---|
Unifier() |
Modifier and Type | Method and Description |
---|---|
Set<net.sourceforge.czt.zpatt.ast.Binding> |
getBindings() |
UnificationException |
getCause() |
void |
provideCause(boolean value) |
boolean |
unify(Object o1,
Object o2) |
boolean |
unify(net.sourceforge.czt.base.ast.Term term1,
net.sourceforge.czt.base.ast.Term term2)
Unifies two terms (with occurs check).
|
public static int printDepth_
public static int maxDepth_
public Set<net.sourceforge.czt.zpatt.ast.Binding> getBindings()
public UnificationException getCause()
public void provideCause(boolean value)
public boolean unify(net.sourceforge.czt.base.ast.Term term1, net.sourceforge.czt.base.ast.Term term2)
term1
- the first term.term2
- the second term.true
if both terms unify,
false
otherwise.Copyright © 2003–2016 Community Z Tools Project. All rights reserved.