move
move copied to clipboard
[move-prover] Fixed hyper edge ordering problem
Motivation
This is an attempt to fix the Move prover problem reported and analyzed in https://github.com/move-language/move/issues/270
Please note that the bytecode translator changes are failing - due to changes that have been made expected result no longer matches the expected output - if the solution is correct we should update expected output.
Admittedly this solution has been crated "by feel" rather than by a super-deep knowledge of the borrow analyzer, but perhaps even if it's not 100% correct, it will inspire a proper solution.
Some observations:
- It seems to me that hyper edges in
borrowed_byandborrowed_fromsets should be reverted, which is currently not the case (hence edge revert operation inconsolidate). - The failure in the bytecode translator for the example in the related issue (https://github.com/move-language/move/issues/270) is due to a hyper edge in the
borrowed_fromset being in the wrong order, which means that considering the bullet above, it's theborrowed_fromset should keep the "correct" (from the bytecode translator's perspective) order - The final bit is that in constructing function annotation (in
summarizeand thenconstruct_hyper_edges) we useborrowed_fromedge ("correct" order) to construct aborrowed_byedge (incorrect order), so we have to reverse the hyper edge (but not any edge as before).
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
I don't think we have Boogie backend tests, but with this PR in the test exposing the bug (added in https://github.com/move-language/move/pull/284) no longer crashes the prover.
Thanks! Awesome investigation @awelc ! Your solution looks sensible to me but will let Wolfgang check and approve it.
Superseded by https://github.com/move-language/move/pull/298