Package net.hydromatic.morel.util
Class MartelliUnifier
java.lang.Object
net.hydromatic.morel.util.Unifier
net.hydromatic.morel.util.MartelliUnifier
Unification algorithm due to Martelli, Montanari (1976) and
Paterson, Wegman (1978).
-
Nested Class Summary
Nested classes/interfaces inherited from class net.hydromatic.morel.util.Unifier
Unifier.Action, Unifier.Failure, Unifier.Result, Unifier.Sequence, Unifier.Substitution, Unifier.SubstitutionResult, Unifier.Term, Unifier.TermTerm, Unifier.TermVisitor<R>, Unifier.Tracer, Unifier.Variable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidact(Unifier.Variable variable, Unifier.Term term, List<Unifier.TermTerm> termPairs, Unifier.Substitution substitution, Map<Unifier.Variable, Unifier.Action> termActions, int depth) private intfindDelete(List<Unifier.TermTerm> termPairs) private intfindNonVarVar(List<Unifier.TermTerm> termPairs) private intfindSeqSeq(List<Unifier.TermTerm> termPairs) private intfindVarAny(List<Unifier.TermTerm> termPairs) private voidsubstituteList(List<Unifier.TermTerm> termPairs, Unifier.Tracer tracer, Map<Unifier.Variable, Unifier.Term> map) Applies a mapping to all term pairs in a list, modifying them in place.unify(List<Unifier.TermTerm> termPairs, Map<Unifier.Variable, Unifier.Action> termActions, Unifier.Tracer tracer)
-
Constructor Details
-
MartelliUnifier
public MartelliUnifier()
-
-
Method Details
-
unify
@Nonnull public Unifier.Result unify(List<Unifier.TermTerm> termPairs, Map<Unifier.Variable, Unifier.Action> termActions, Unifier.Tracer tracer) -
substituteList
private void substituteList(List<Unifier.TermTerm> termPairs, Unifier.Tracer tracer, Map<Unifier.Variable, Unifier.Term> map) Applies a mapping to all term pairs in a list, modifying them in place. -
act
private void act(Unifier.Variable variable, Unifier.Term term, List<Unifier.TermTerm> termPairs, Unifier.Substitution substitution, Map<Unifier.Variable, Unifier.Action> termActions, int depth) -
findDelete
-
findSeqSeq
-
findNonVarVar
-
findVarAny
-