X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fchr%2FCHRRule.java;h=c668005d7f1f6b07ea714d3101ef944d28957d45;hb=e83a15c556c27b56e856dc26fa4e2d792cf959be;hp=0c81daafd8d3ddfa3b36b5ec327b5ca73f0c8a43;hpb=bf5f7cda1b9b64484cc6e53499e38d6785744aec;p=simantics%2Fplatform.git 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 0c81daafd..c668005d7 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 @@ -45,6 +45,10 @@ public class CHRRule extends Symbol { this.body = body; this.existentialVariables = existentialVariables; } + + public CHRRule(long location, CHRQuery head, CHRQuery body) { + this(location, head, body, null); + } public void resolve(TranslationContext context) { context.pushExistentialFrame(); @@ -104,7 +108,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())); @@ -115,7 +119,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);