Map<GdlVariable, Set<GdlConstant>> varDomains = getVarDomains(rule, curDomains, model);
for (int i = 0; i < headTuple.size(); i++) {
ConcurrencyUtils.checkForInterruption();
if (headTuple.get(i) instanceof GdlVariable) {
GdlVariable curVar = (GdlVariable) headTuple.get(i);
Set<GdlConstant> neededConstants = neededConstantsByForm.get(headForm).get(i);
//Whittle these down based on what's possible throughout the rule
Set<GdlConstant> neededAndPossibleConstants = Sets.newHashSet(neededConstants);
neededAndPossibleConstants.retainAll(varDomains.get(curVar));