-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change rule priorities to run simplifiers first; add reify
Create a rule priority taxonomy, and refactor rules to follow this new convention. In particular, ensure that partial and total evaluation and simplification rules happen before representation changes and solver specific rules. DESCRIPTION Simplifying a model before applying representation changes should ensure that nested sums do not get propagated across the model. For example, the transformation for min turns it into many binary constraints. If simplification was not done first, simplification steps would have to be ran on each of these binary constraints, instead of just on the input model. Ensuring that everything is always in canonical forms should stop rules looping, and help with pattern matching. The implementation of canonical forms is incomplete and outside the scope of this patch. These rule changes caused basic-div-04 to fail. To fix this, this patch also does the following: - add reify constraint (reify(X,1) if constraint X is SAT, reify(X,0) if constraint X is UNSAT) - add rule not(X) ~> reify(X,0) (where X is a constraint), allowing negated constraints to be passed to Minion. MOTIVATION The commit c2b7460 (add broken complex partial evaluator test (arithmetic, nesting, min), 2024-10-12) added a test case for the partial evaluator that never terminated. Simplification steps should be ran before the decomposition of the min constraint and the conversion of expressions into more specialised / solver specific forms (such as ineq, sumgeq, etc); however, this was not the case in this test. In this test, ineq / sumgeq were being applied before the sums had been flattened. After this refactor, this test now terminates with failure. A flattening rule for ineq is needed before this test passes and will be added in a later commit.
- Loading branch information
1 parent
c2b7460
commit b25c3bb
Showing
32 changed files
with
963 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,3 +182,5 @@ fabric.properties | |
*.eprime.solution | ||
*.eprime.solution.* | ||
*.eprime.info | ||
|
||
.MINION* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- dont want to do ineq of a sum when we can do a leq! | ||
before this patch, a leq was being rewritten to ineq(sum(...)) causing | ||
partial-eval-03 to fail. Also, this was being done before the sums were | ||
flattened. | ||
- now have not(X) ~ reify(X,0) where X is a constraint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
conjure_oxide/tests/integration/basic/div/01/input.expected-minion.solutions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
conjure_oxide/tests/integration/basic/div/03/input.expected-minion.solutions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
[ | ||
{ | ||
"MachineName(0)": 2, | ||
"UserName(a)": 3 | ||
}, | ||
{ | ||
"MachineName(0)": 2, | ||
"UserName(a)": 4 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.