Search in sources :

Example 26 with ITermVar

use of mb.nabl2.terms.ITermVar in project nabl by metaborg.

the class VarMultimap method update.

public boolean update(final ITermVar var, IUnifier unifier) {
    final Collection<T> values = map.removeAll(var);
    final Set<ITermVar> reps = unifier.getVars(var);
    boolean change = false;
    for (ITermVar rep : reps) {
        change |= map.putAll(rep, values);
    }
    return change;
}
Also used : ITermVar(mb.nabl2.terms.ITermVar)

Aggregations

ITermVar (mb.nabl2.terms.ITermVar)25 ITerm (mb.nabl2.terms.ITerm)15 Collection (java.util.Collection)3 Occurrence (mb.nabl2.scopegraph.terms.Occurrence)3 SolveResult (mb.nabl2.solver.ISolver.SolveResult)3 HashMultimap (com.google.common.collect.HashMultimap)2 Multimap (com.google.common.collect.Multimap)2 Map (java.util.Map)2 Optional (java.util.Optional)2 NaBL2DebugConfig (mb.nabl2.config.NaBL2DebugConfig)2 IConstraint (mb.nabl2.constraints.IConstraint)2 ImmutableTypeVar (mb.nabl2.poly.ImmutableTypeVar)2 TypeVar (mb.nabl2.poly.TypeVar)2 Scope (mb.nabl2.scopegraph.terms.Scope)2 ISolution (mb.nabl2.solver.ISolution)2 SolverException (mb.nabl2.solver.SolverException)2 TypeException (mb.nabl2.solver.TypeException)2 IUnifier (mb.nabl2.terms.unification.IUnifier)2 HashMultiset (com.google.common.collect.HashMultiset)1 Lists (com.google.common.collect.Lists)1