From f5c5f79bf2a62515c8c81103a4c8932fc0dcf79d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Sun, 16 Jul 2017 13:32:05 +0300 Subject: [PATCH] (refs #7365) Fixed the bug in the test CHR11.scl Change-Id: I961c3ae92013ec4085fe61eee9021a3cc0aff6e4 --- .../scl/compiler/elaboration/chr/CHRQuery.java | 6 +++++- .../scl/compiler/elaboration/chr/CHRRule.java | 4 ++-- .../scl/compiler/elaboration/chr/CHRRuleset.java | 10 +++++++++- .../chr/planning/QueryPlanningContext.java | 5 +++++ .../chr/CHRRuntimeRulesetCodeGenerator.java | 14 ++++++++++---- .../scl/runtime/chr/CHRRuntimeRuleset.java | 12 +++++++++++- .../simantics/scl/compiler/tests/ActiveTests.java | 2 -- .../scl/compiler/tests/ModuleRegressionTests.java | 1 + 8 files changed, 43 insertions(+), 11 deletions(-) diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRQuery.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRQuery.java index 9e2bf6f34..5cb0f2aee 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRQuery.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRQuery.java @@ -3,6 +3,7 @@ package org.simantics.scl.compiler.elaboration.chr; import org.simantics.scl.compiler.elaboration.chr.plan.PostCommitOp; import org.simantics.scl.compiler.elaboration.chr.plan.PreCommitOp; import org.simantics.scl.compiler.elaboration.chr.planning.QueryPlanningContext; +import org.simantics.scl.compiler.elaboration.chr.relations.CHRConstraint; import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext; import org.simantics.scl.compiler.elaboration.contexts.TranslationContext; import org.simantics.scl.compiler.elaboration.contexts.TypingContext; @@ -62,7 +63,7 @@ public class CHRQuery extends Symbol { } } - public boolean createQueryPlan(QueryPlanningContext context, Expression inputFact, int activeLiteralId) { + public boolean createQueryPlan(QueryPlanningContext context, Expression inputFact, int activeLiteralId, CHRConstraint initConstraint) { for(int i=0;i currentId) + currentId = context.currentId; + } } diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java index 4b9a3ffd2..c4d1c6f23 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java @@ -19,6 +19,4 @@ public class ActiveTests extends TestBase { */ //@Test public void Bug6989() { test(); } - - @Test public void CHR11() { test(); } } diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java index a5975932b..d8f703afc 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java @@ -32,6 +32,7 @@ public class ModuleRegressionTests extends TestBase { @Test public void CHR8() { test(); } @Test public void CHR9() { test(); } @Test public void CHR10() { test(); } + @Test public void CHR11() { test(); } @Test public void ClosureRecursion() { test(); } @Test public void Collaz() { test(); } @Test public void Compose() { test(); } -- 2.47.0