Search in sources :

Example 11 with IUnifier

use of mb.nabl2.terms.unification.IUnifier 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)8 ITerm (mb.nabl2.terms.ITerm)4 HashMultimap (com.google.common.collect.HashMultimap)1 HashMultiset (com.google.common.collect.HashMultiset)1 Multimap (com.google.common.collect.Multimap)1 Multiset (com.google.common.collect.Multiset)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 TermOrigin (mb.nabl2.stratego.TermOrigin)1 IUnifier (mb.nabl2.terms.unification.IUnifier)1 FileObject (org.apache.commons.vfs2.FileObject)1 ISourceRegion (org.metaborg.core.source.ISourceRegion)1