-
Notifications
You must be signed in to change notification settings - Fork 42
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
Simple loop invariants #1022
Simple loop invariants #1022
Conversation
generated inside the memory model.
broadly-applicable feature based directly on loop invariants.
713996b
to
4d94ba4
Compare
This feature still needs some error checking, but I think the basics are ready for review. In particular, we still need to check that the indicated loop is single-entry/single-exit, and we need to implement checking that the memory footprint is acceptable (i.e., reaches fixpoint). |
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 feel very underqualified to review this, but I've done a quick pass and left some comments on things that stood out to me.
Set.difference | ||
(foldMap | ||
(\ (MapF.Pair _ e) -> | ||
-- filter out the special "noSatisfyingWrite" boolean constants | ||
-- that are generated as part of the LLVM memory model | ||
Set.filter ( \ (C.Some x) -> | ||
not (List.isPrefixOf "cnoSatisfyingWrite" | ||
(show $ W4.printSymExpr x))) $ | ||
Set.map (\ (C.Some x) -> C.Some (W4.varExpr sym x)) $ | ||
(W4.exprUninterpConstants sym (bodyValue e))) | ||
(MapF.toList (varSubst normal_substitution))) | ||
(Set.fromList (MapF.keys (varSubst normal_substitution))) |
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 is a good candidate for factoring out with a bit of explanation
Typos and such Co-authored-by: Langston Barrett <[email protected]> Co-authored-by: Ryan Scott <[email protected]> Co-authored-by: Tristan Ravitch <[email protected]>
the loop in question. We now check the critical properties required for the fixpoint-finding procedure to work: the loop must be single-entry and have a single backedge.
We don't need the widening varaibles to line up, just the shapes.
This PR reworks the "simple loop fixpoint" feature to be based more directly on user-provided loop invariants instead.