-
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.
fix: empty or([]) being parsed as nothing
Constant matrices inside operations were not recognised by our parser, so were ignored. This includes expressions like or([]) and min([1,2,3]). - Add parsing support for constant matrices inside operations. - Add support for top level "false" and "true" with Minion. Ideally, these models would never get passed to the solver; however, this would require solution evaluation and a refactor of our tester, so I have left this for future work. Fixes #366.
- Loading branch information
1 parent
989876b
commit c959e13
Showing
10 changed files
with
332 additions
and
31 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
7 changes: 7 additions & 0 deletions
7
conjure_oxide/tests/integration/bugs/issue-336-empty-or-should-be-false/input.essence
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,7 @@ | ||
|
||
$ "By mathematical tradition (and Essence semantics), an 'empty or' is false, however, this model has 5 answers (one for each value of a)" | ||
$ -- https://github.com/conjure-cp/conjure-oxide/issues/366 | ||
|
||
find a : int(1..5) | ||
such that | ||
or([]) |
1 change: 1 addition & 0 deletions
1
.../integration/bugs/issue-336-empty-or-should-be-false/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
31 changes: 31 additions & 0 deletions
31
.../integration/bugs/issue-336-empty-or-should-be-false/input.expected-parse.serialised.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"constraints": { | ||
"Or": [ | ||
{ | ||
"clean": false, | ||
"etype": null | ||
}, | ||
[] | ||
] | ||
}, | ||
"next_var": 0, | ||
"variables": [ | ||
[ | ||
{ | ||
"UserName": "a" | ||
}, | ||
{ | ||
"domain": { | ||
"IntDomain": [ | ||
{ | ||
"Bounded": [ | ||
1, | ||
5 | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
] | ||
} |
33 changes: 33 additions & 0 deletions
33
...ntegration/bugs/issue-336-empty-or-should-be-false/input.expected-rewrite.serialised.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"constraints": { | ||
"Constant": [ | ||
{ | ||
"clean": false, | ||
"etype": null | ||
}, | ||
{ | ||
"Bool": false | ||
} | ||
] | ||
}, | ||
"next_var": 0, | ||
"variables": [ | ||
[ | ||
{ | ||
"UserName": "a" | ||
}, | ||
{ | ||
"domain": { | ||
"IntDomain": [ | ||
{ | ||
"Bounded": [ | ||
1, | ||
5 | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
] | ||
} |
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
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.