for(PartnerFact activeFact : planContext.partnerFacts) {
if(activeFact.killAfterMatch) {
if(activeFact.nextFact == null)
- w.jump(activeFact.finishCont);
+ w.jump(location, activeFact.finishCont);
else {
CodeWriter iterateAlive = w.createBlock(activeFact.constraint.factType);
- w.jump(iterateAlive.getContinuation(), w.apply(location, activeFact.nextFact, activeFact.factVar));
+ w.jump(location, iterateAlive.getContinuation(), w.apply(location, activeFact.nextFact, activeFact.factVar));
iterateUntilLiveFactFound(iterateAlive, activeFact);
}
break;
}
else if(activeFact.mayBeRemoved) {
if(activeFact.nextFact == null) {
- w.branchAwayUnless(activeFact.isAlive(location, w), activeFact.finishCont);
+ w.branchAwayUnless(location, activeFact.isAlive(location, w), activeFact.finishCont);
}
else {
CodeWriter failure = w.createBlock();
CodeWriter iterateAlive = w.createBlock(activeFact.constraint.factType);
- w.branchAwayUnless(activeFact.isAlive(location, w), failure.getContinuation());
- failure.jump(iterateAlive.getContinuation(), failure.apply(location, activeFact.nextFact, activeFact.factVar));
+ w.branchAwayUnless(location, activeFact.isAlive(location, w), failure.getContinuation());
+ failure.jump(location, iterateAlive.getContinuation(), failure.apply(location, activeFact.nextFact, activeFact.factVar));
iterateUntilLiveFactFound(iterateAlive, activeFact);
}
}
CHRConstraint constraint = activeFact.constraint;
IVal fact = w.getParameters()[0];
CodeWriter dead = w.createBlock();
- w.branchAwayIf(w.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact), activeFact.finishCont);
- w.branchAwayUnless(activeFact.isAlive(location, w, fact), dead.getContinuation());
- w.jump(activeFact.continueCont, fact);
- dead.jump(initialContinuation, dead.apply(location, activeFact.nextFact, fact));
+ w.branchAwayIf(location, w.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact), activeFact.finishCont);
+ w.branchAwayUnless(location, activeFact.isAlive(location, w, fact), dead.getContinuation());
+ w.jump(location, activeFact.continueCont, fact);
+ dead.jump(location, initialContinuation, dead.apply(location, activeFact.nextFact, fact));
}
}