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

Fix encoding of primitive operators with refined domains #3427

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

nikswamy
Copy link
Collaborator

Fixes #3426

This adds preconditions in the SMT encoding to Prims.op_Modulus, op_Division, and Real.op_Slash_dot.

I also had an everest run with no meaningful regressions---one brittle proof in Hacl.Spec.Chacha.Equiv needed a restart-solver to go through.

@@ -584,7 +584,7 @@ let lemma_lognot_value_zero #n a =
private
val lemma_mod_variation: #n:pos -> a:uint_t n ->
Lemma (a <> 0 ==> ((-a) % pow2 n) - 1 % pow2 n = (((-a) % pow2 n) - 1) % pow2 n)
let lemma_mod_variation #n a = ()
let lemma_mod_variation #n a = assert (pow2 n =!= 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This proof was a bit flaky and uses a very large rlimit. It seems to stabilizes with this assertion.

@nikswamy nikswamy enabled auto-merge August 30, 2024 22:22
@nikswamy nikswamy merged commit d56e791 into master Aug 30, 2024
3 checks passed
@nikswamy nikswamy deleted the nik_3426 branch August 30, 2024 22:31
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.

Refinement subtypes being discarded
1 participant