-
Notifications
You must be signed in to change notification settings - Fork 43
Overhaul predicate simplifier #2599
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
Conversation
| @@ -1,6 +1,6 @@ | |||
| kore-exec: [233424] Error (ErrorException): | |||
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.
This test must have been silently failing for a long time...
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.
I'm confused, won't this test continue to fail on other runs if its output depends on the timestamp?
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.
The test actually only searches the output for a particular string with grep. I will update the test in another pull request so that this is clearer.
02c8574 to
8ebd31f
Compare
|
|
docs/simplify-predicate.md
Outdated
| Assuming the children of `\or` are in disjunctive normal form, then the clause | ||
| is already normalized. |
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.
Maybe add something like "because or is associative", to anticipate normalizeOr better.
docs/simplify-predicate.md
Outdated
|
|
||
| Simplification happens recursively, upward from the bottom. Therefore, we | ||
| describe the simplification steps based on the shape of the top-most | ||
| unsimplified clause of the predicate. |
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.
This phrasing is not clear for me. If we start simplifying from the bottom, wouldn't the top look the same until the end? Maybe my intuition of what is a clause is wrong.
|
|
|
36d5427 to
d727b39
Compare
|
|
|
I tested this locally and found no significant performance difference with master. It's also worth noting that the proofs which show > 5% increased allocation are all very small. |
3eee5f6 to
79299c2
Compare
Although the substitution is assumed to be applied to the predicate, it may also affect variables in the side condition.
88cf681 to
c2bfbd4
Compare
| Note: @L@ is carried through to the right-hand side of 'Implies' to maximize | ||
| the information content of that branch. |
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.
In which cases is the L necessary?
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.
Actually, I'm wondering, do we ever simplify \\implies predicates (outside of the tests)?
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.
We simplify \implies sometimes as the result of \equals simplification, if either side is not a function-like pattern. This isn't very common. Carrying the left-hand side over improves simplification a bit in these cases; it can rule out some branches which were also carrying \not(L) from another part.
| @@ -1,6 +1,6 @@ | |||
| kore-exec: [233424] Error (ErrorException): | |||
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.
I'm confused, won't this test continue to fail on other runs if its output depends on the timestamp?
| #Equals | ||
| Z:MyId in_keys ( MAP | ||
| ( Y:MyId |-> 2 ) ) | ||
| ( Y:MyId |-> 1 ) ) |
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.
This doesn't look right, we have X ==K Y, and we update the value Y points to, so it should be 2 not 1, right?
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.
The meaning of the output is unchanged. The Map appears under in_keys, so actually the values are irrelevant.
|
|
Fixes #2570
Review checklist
The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.