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

Removing #rangeBool reasoning #2616

Merged
merged 5 commits into from
Sep 10, 2024
Merged

Removing #rangeBool reasoning #2616

merged 5 commits into from
Sep 10, 2024

Conversation

PetarMax
Copy link
Contributor

@PetarMax PetarMax commented Sep 10, 2024

The lemmas removed in this PR slow down execution of some real-world proofs considerably because the rangeBool constraints are SMT-checked for every expression of the form notBool ( X ==Int 0 ) or notBool ( X ==Int 1 ).

The lemmas brought in reflect the (so-far-observed) checks made by the compiler, and their LHS is complex enough so they it will not be matched against unnecessarily.

@PetarMax PetarMax self-assigned this Sep 10, 2024
@PetarMax PetarMax changed the title Removing rangeBool reasoning Removing #rangeBool reasoning Sep 10, 2024
@PetarMax
Copy link
Contributor Author

(Some of) the added lemmas are tested by some of the dsvalue tests in the mcd and mcd-structured test suites, via the compiler-introduced checks.

I am not sure what a reasonable test that is not direct would look like.

@PetarMax PetarMax marked this pull request as ready for review September 10, 2024 16:56
Comment on lines +93 to +96
// Relationship with `#rangeBool`
rule [b2w-rangeBool-eq-not-zero-l]: bool2Word (notBool (X ==Int 0)) => X requires #rangeBool(X) [simplification, comm]
rule [b2w-rangeBool-eq-not-zero-r]: bool2Word (notBool (0 ==Int X)) => X requires #rangeBool(X) [simplification, comm]

Copy link
Member

Choose a reason for hiding this comment

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

Do we also want the ones for X ==Int 1 and 1 ==Int X?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, at least not for now, because these ones (the one with X ==Int 0 specifically, and then I added the commutative version) come from the compiler as a check that something is a bool.

@PetarMax PetarMax merged commit 3ea7ed5 into master Sep 10, 2024
12 checks passed
@PetarMax PetarMax deleted the petar/rangeBool-correction branch September 10, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants