-
Notifications
You must be signed in to change notification settings - Fork 31
feat(domain_debugging): add a pretty output option for domain of expressions #1624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5780cc8
feat(domain_debugging): Basic outline
ca1umac 475aa8d
updating error printing
ca1umac 1a9627e
re-correct
ca1umac 4cc02a5
Putting the ExprInfo struct into the model file
ca1umac a724523
change from expr_ to expression-, finish moving Info struct out of CL…
ca1umac 91bb91c
remove redundant closure
ca1umac 5175bf3
Merge branch 'main' into testing-new-domain-output-format
ca1umac 2d177aa
making clippy happy, part two electric boogaloo
ca1umac 7c2bce8
clippy again
ca1umac b8bedd5
add test case
ca1umac 9f03910
Merge branch 'main' into testing-new-domain-output-format
ca1umac ef0d15b
Merge branch 'main' into testing-new-domain-output-format
ca1umac 61a0102
an alternative "expression-domains" format
ozgurakgun 2767acd
hygiene
ozgurakgun ed2ae03
get rid of redundant brackets
ca1umac 80774ed
add new challenge test cases
ozgurakgun 63cec88
update test files
ozgurakgun 5f2d9c0
update test files
ozgurakgun 1d58f5d
remove expression-domains-json
ozgurakgun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| find x,y,z : int(1..3) | ||
| find a,b,c : int(0..4) | ||
| such that (x+y < z-2) -> a + b > c |
This file contains hidden or 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 @@ | ||
| conjure-oxide pretty model.essence --output-format=expression-domains |
This file contains hidden or 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,15 @@ | ||
| ((sum([x,y;int(1..2)]) < (z - 2))) -> ((sum([a,b;int(1..2)]) > c)) :: bool | ||
| (sum([x,y;int(1..2)]) < (z - 2)) :: bool | ||
| sum([x,y;int(1..2)]) :: int(2..6) | ||
| [x,y;int(1..2)] :: matrix indexed by [int(1..2)] of int(1..3) | ||
| x :: int(1..3) | ||
| y :: int(1..3) | ||
| (z - 2) :: int(-1..1) | ||
| z :: int(1..3) | ||
| 2 :: int(2) | ||
| (sum([a,b;int(1..2)]) > c) :: bool | ||
| sum([a,b;int(1..2)]) :: int(0..8) | ||
| [a,b;int(1..2)] :: matrix indexed by [int(1..2)] of int(0..4) | ||
| a :: int(0..4) | ||
| b :: int(0..4) | ||
| c :: int(0..4) |
This file contains hidden or 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,3 @@ | ||
| find x,y,z : int(1..3) | ||
| find a,b,c : int(0..4) | ||
| such that (x+y < z-2) -> a + b > c |
This file contains hidden or 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 @@ | ||
| conjure-oxide pretty model.essence --output-format=expression-domains-json |
252 changes: 252 additions & 0 deletions
252
tests-integration/tests/custom/pretty-03/stdout.expected
This file contains hidden or 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,252 @@ | ||
| [ | ||
| { | ||
| "pretty": "((sum([x,y;int(1..2)]) < (z - 2))) -> ((sum([a,b;int(1..2)]) > c))", | ||
| "domain": { | ||
| "Ground": "Bool" | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "(sum([x,y;int(1..2)]) < (z - 2))", | ||
| "domain": { | ||
| "Ground": "Bool" | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "sum([x,y;int(1..2)])", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 2, | ||
| 6 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "[x,y;int(1..2)]", | ||
| "domain": { | ||
| "Ground": { | ||
| "Matrix": [ | ||
| { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 3 | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| [ | ||
| { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 2 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "x", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 3 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| }, | ||
| { | ||
| "pretty": "y", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 3 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "pretty": "(z - 2)", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| -1, | ||
| 1 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "z", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 3 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| }, | ||
| { | ||
| "pretty": "2", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Single": 2 | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "pretty": "(sum([a,b;int(1..2)]) > c)", | ||
| "domain": { | ||
| "Ground": "Bool" | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "sum([a,b;int(1..2)])", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 0, | ||
| 8 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "[a,b;int(1..2)]", | ||
| "domain": { | ||
| "Ground": { | ||
| "Matrix": [ | ||
| { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 0, | ||
| 4 | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| [ | ||
| { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 1, | ||
| 2 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| }, | ||
| "children": [ | ||
| { | ||
| "pretty": "a", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 0, | ||
| 4 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| }, | ||
| { | ||
| "pretty": "b", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 0, | ||
| 4 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "pretty": "c", | ||
| "domain": { | ||
| "Ground": { | ||
| "Int": [ | ||
| { | ||
| "Bounded": [ | ||
| 0, | ||
| 4 | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "children": [] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do you like this? I kept yours as
expression-domains-jsonbut I am tempted to keep just this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear indentation indicates nesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
::is meant to mean domain-of. like how:is type-of.