protected Pair<RelationshipDelta, AliasDelta> runSingleConstraint(FusionEnvironment<?> env,
Constraint cons, TACInstruction instr) {
ConsList<Binding> boundVars = cons.getOp().matches(types, method, instr);
if (boundVars == null)
return new Pair<RelationshipDelta, AliasDelta>(new RelationshipDelta(), new AliasDelta());
List<RelationshipDelta> relDeltas = new LinkedList<RelationshipDelta>();
List<Substitution> changeSubs = new LinkedList<Substitution>();
List<Substitution> subs = env.findLabels(boundVars, cons.getUniversalFreeVars());
for (Substitution sub : subs) {
Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, sub, cons);
relDeltas.add(deltas.fst());
changeSubs.add(deltas.snd());
}
RelationshipDelta relDelta;
AliasDelta aliasDelta;
if (relDeltas.isEmpty()) {
relDelta = RelationshipDelta.getTrueBottom();
aliasDelta = new AliasDelta();
}
else if (relDeltas.size() == 1) {
relDelta = relDeltas.get(0);
aliasDelta = new AliasDelta(boundVars, changeSubs);
}
else {
relDelta = RelationshipDelta.join(relDeltas);
aliasDelta = new AliasDelta(boundVars, changeSubs);
}
return new Pair<RelationshipDelta, AliasDelta>(relDelta, aliasDelta);
}