Skip to content
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

Use Boogie's "argument" encoding for polymorphism #4210

Merged
merged 15 commits into from
Jul 21, 2023
Merged

Use Boogie's "argument" encoding for polymorphism #4210

merged 15 commits into from
Jul 21, 2023

Conversation

atomb
Copy link
Member

@atomb atomb commented Jun 22, 2023

This generally has better performance than the previously-default "predicate" encoding, though a few tests need to be updated to pass with this encoding.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@atomb atomb self-assigned this Jun 26, 2023
@atomb atomb force-pushed the arg-encoding branch 2 times, most recently from 80b1fb4 to cc1e5bf Compare June 29, 2023 23:54
atomb added a commit that referenced this pull request Jul 3, 2023
…ings in Boogie (anticipating #4210) (#4229)

This PR updates counterexample parsing so that it works with different
polymorphism encodings, anticipating #4210.

Here is a list of changes that were necessary to support the new type
encoding:
1) Create a wrapper around Boogie's `Model.Func` that ignores type
arguments, making counterexample extraction independent from the type
encoding.
2) For the same purpose, remove all references to `type` function, which
Boogie only emits when using the `Predicates` type encoding.
3) Update all counterexample and test generation tests to run twice,
once under each encoding.
4) Remove several bugs and sources of nondeterminism in tests that
surface after these changes (including having to do with the choice
between reporting a nullable or a non-nullable type, a base type vs
subset type, sorting counterexamples by position in the program, etc.).
Add corresponding tests and fix existing ones.
5) Remove DatatypeType class that was used by counterexample code to
distinguish between class types and datatype types but which is no
longer necessary given how test generation works. Propagate this change
to test generation.

By submitting this pull request, I confirm that my contribution
is made under the terms of the MIT license.

---------

Co-authored-by: Aleksandr Fedchin <[email protected]>
Co-authored-by: Aaron Tomb <[email protected]>
This changes the default. The previously-default `Predicates` mode is
still available with the `/typeEncoding:p` flag.
This again fails to prove one assertion it failed to prove with
Z3 4.8.5, and some errors are reordered.
Account for reordering and different counterexamples.
@atomb atomb marked this pull request as ready for review July 19, 2023 18:34
@@ -1,6 +1,7 @@
Fuel.dfy(129,8): Error: Fuel can only increase within a given scope.
Fuel.dfy(407,8): Error: Fuel can only increase within a given scope.
Fuel.dfy(17,22): Error: assertion might not hold
Fuel.dfy(65,27): Error: assertion might not hold
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you fixed a test here, nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one disappeared during the Z3 upgrade and has now reappeared. It seems very sensitive to SMT encoding details.

@atomb atomb enabled auto-merge (squash) July 20, 2023 21:49
@atomb atomb merged commit 6da881f into master Jul 21, 2023
18 checks passed
@atomb atomb deleted the arg-encoding branch July 21, 2023 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants