X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fchr%2FCHRRule.java;h=f714497c4212c76c1ccef6e217a06c40f2d71a39;hp=20dda072cfa03cb7bfb9dc8c2f228c2b16dcb186;hb=f5c5f79bf2a62515c8c81103a4c8932fc0dcf79d;hpb=00119bc6c509134e985c11ad4f6aff37801adc3f diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRule.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRule.java index 20dda072c..f714497c4 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRule.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRule.java @@ -49,6 +49,7 @@ public class CHRRule extends Symbol { public void resolve(TranslationContext context) { context.pushExistentialFrame(); head.resolve(context); + context.disallowNewExistentials(); body.resolve(context); existentialVariables = context.popExistentialFrame(); } @@ -103,7 +104,7 @@ public class CHRRule extends Symbol { Variable activeFact = new Variable("activeFact", constraint.factType); QueryPlanningContext context = new QueryPlanningContext(compilationContext, existentialVariables); - if(!head.createQueryPlan(context, new EVariable(activeFact), i)) + if(!head.createQueryPlan(context, new EVariable(activeFact), i, initConstraint)) return; body.createEnforcePlan(context, priority); addPlan(new CHRSearchPlan(constraint, activeFact, context.getPlanOps())); @@ -114,7 +115,7 @@ public class CHRRule extends Symbol { if(!hasLocalActiveLiteral) { Variable activeFact = new Variable("activeFact", initConstraint.factType); QueryPlanningContext context = new QueryPlanningContext(compilationContext, existentialVariables); - if(!head.createQueryPlan(context, null, -1)) + if(!head.createQueryPlan(context, new EVariable(activeFact), -1, initConstraint)) return; body.createEnforcePlan(context, priority); /*System.out.println(this);