Package net.hydromatic.morel.util
Class Unifier.Sequence
java.lang.Object
net.hydromatic.morel.util.Unifier.Sequence
- All Implemented Interfaces:
Unifier.Term
- Enclosing class:
Unifier
A sequence of terms.
A sequence [a b c] is often printed "a(b, c)", as if "a" is the type of node and "b" and "c" are its children.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(Unifier.TermVisitor<R> visitor) Accepts a visitor.apply(Map<Unifier.Variable, Unifier.Term> substitutions) Applies a substitution to this term.apply1(Unifier.Variable variable, Unifier.Term term) Applies a single-variable substitution to this term.voidcheckCycle(Map<Unifier.Variable, Unifier.Term> map, Map<Unifier.Variable, Unifier.Variable> active) Throws CycleException if expanding this term leads to a cycle.booleancontains(Unifier.Variable variable) Returns whether this term references a given variable.booleanprivate booleanequalsShallow(Unifier.Sequence sequence) Compares whether two sequences have the same terms.inthashCode()private static <E> booleantoString()
-
Field Details
-
operator
-
terms
-
-
Constructor Details
-
Sequence
Sequence(String operator, List<Unifier.Term> terms) -
Sequence
Sequence(String operator)
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
apply
Description copied from interface:Unifier.TermApplies a substitution to this term.- Specified by:
applyin interfaceUnifier.Term
-
apply1
Description copied from interface:Unifier.TermApplies a single-variable substitution to this term.- Specified by:
apply1in interfaceUnifier.Term
-
checkCycle
public void checkCycle(Map<Unifier.Variable, Unifier.Term> map, Map<Unifier.Variable, throws Unifier.CycleExceptionUnifier.Variable> active) Description copied from interface:Unifier.TermThrows CycleException if expanding this term leads to a cycle.- Specified by:
checkCyclein interfaceUnifier.Term- Throws:
Unifier.CycleException
-
equalsShallow
Compares whether two sequences have the same terms. Compares addresses, not contents, to avoid hitting cycles if any of the terms are cyclic (e.g. "X = f(X)"). -
listEqual
-
contains
Description copied from interface:Unifier.TermReturns whether this term references a given variable.- Specified by:
containsin interfaceUnifier.Term
-
accept
Description copied from interface:Unifier.TermAccepts a visitor.- Specified by:
acceptin interfaceUnifier.Term
-