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

feat: Bitvec.{msb, toInt, toFin}_{sdiv, udiv} lemmas #6360

Closed
wants to merge 17 commits into from

Conversation

alexkeizer
Copy link
Contributor

@alexkeizer alexkeizer commented Dec 10, 2024

This PR adds toInt and msb lemmas for (un)signed bitvector division.

Todo:

  • msb_udiv
  • msb_sdiv
  • toInt_sdiv

We don't have a toInt_udiv lemma, since the only truly general statement we can make does no better than unfolding the definition, and it's not uncontroversially clear how to unfold toInt (see toInt_eq_msb_cond/toInt_eq_toNat_cond/toInt_eq_toNat_bmod for a few options). Instead, we do have toInt_udiv_of_msb that's able to a more meaningful rewrite given an extra side-condition (that x.msb = false)

Similarly, we do have toFin_udiv, but we don't add toFin_sdiv; the latter can do no better than unfolding the definition, which is an unwieldy match statement.

@alexkeizer alexkeizer changed the title feat: Bitvec.{msb, toInt}_{sdiv, udiv} lemmas feat: Bitvec.{msb, toInt, toFin}_{sdiv, udiv} lemmas Dec 10, 2024
@kim-em kim-em self-assigned this Dec 11, 2024
@alexkeizer
Copy link
Contributor Author

This PR has been superseded by #6402, the sdiv stuff is still WIP

@alexkeizer alexkeizer closed this Dec 17, 2024
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.

3 participants