-
Notifications
You must be signed in to change notification settings - Fork 44
Give Predicate a distinct internal representation #2099
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
-- TODO (thomas.tuegel): Lift 'simplified' to the 'Conditional' level once we | ||
-- treat the latter as an aggregate root. |
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.
-- TODO (thomas.tuegel): Lift 'simplified' to the 'Conditional' level once we | |
-- treat the latter as an aggregate root. |
TODO:
|
Here is the actual error message:
It's not shown in Jenkins because many of the tests produce a lot of useless warnings, but you can copy and paste the failing command to remove the redirection. This unsimplified predicate is a case which was handled by |
@MirceaS The next thing we need to do here is check for performance regressions. You can start with the We don't need to collect precise statistics here, just run everything once with the old and new versions to compare. |
@ttuegel runs of tests in |
where | ||
sort = termLikeSort termLikePredicate | ||
termLikePredicate = Predicate.unwrapPredicate predicate | ||
prettyConditional' |
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.
What is the difference between prettyConditional
and prettyConditional'
?
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.
prettyConditional'
doesn't take a sort as input and is used to pretty print Conditionals that don't contain a TermLike that can be used to derive a sort (that is, Conditional variable (Predicate variable)
).
See line 310 below.
{-|'PredicateFalse' is a pattern for matching 'bottom' predicates. | ||
-} | ||
pattern PredicateFalse :: Predicate variable | ||
data HasChanged = Changed | NotChanged |
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.
Please add documentation to new types.
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.
Is the comment I added good?
kore/src/Kore/Internal/Predicate.hs
Outdated
makeTruePredicate' = (synthesize (TopF Top {topSort = ()}) | ||
, NotChanged) |
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.
makeTruePredicate' = (synthesize (TopF Top {topSort = ()}) | |
, NotChanged) | |
makeTruePredicate' = | |
(synthesize (TopF Top {topSort = ()}), NotChanged) |
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 reason why I wrote it like that is so that it is consistent in style with all the other maker functions: the body of the function followed by an extra, separate line where we specify whether the term changed or not. Should I still change it as in your example?
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.
All of the make
functions in this module should change to follow our style guide.
kore/src/Kore/Internal/Predicate.hs
Outdated
| isTop p1 = (p2, Changed) | ||
| isBottom p2 = (makeNotPredicate p1, Changed) | ||
| isTop p2 = (p1, Changed) | ||
-- | p1 == p2 = (makeTruePredicate, Changed) |
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.
Why is this commented out?
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.
For two reasons:
- It might be inefficient to compare two entire predicate trees when calling this maker function (which I believe happens quite often).
- This is not a simplification that existed in the original code, so this would change the behavior of the function. It might not break anything but it requires testing.
I left it in as a comment in case we decide at some point that we do want it.
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.
Please remove the comment.
Co-authored-by: Thomas Tuegel <[email protected]>
Co-authored-by: Thomas Tuegel <[email protected]>
Filtering the .cabal package description files from the source sent to Nix removes the need to re-generate them in ./nix/rematerialize.sh.
Fixes #1442
Reviewer checklist
stack test --coverage
stack haddock