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: getLsb_{rotateLeft, rotateRight} #4257

Merged
merged 7 commits into from
Jun 1, 2024

Conversation

bollu
Copy link
Contributor

@bollu bollu commented May 23, 2024

These will be used by LeanSAT for bitblasting rotations by constant distances.

We first reduce the case when the rotation amount is larger than the width to the case where the rotation amount is less than the width (x.rotateLeft/Right r = x.rotateLeft/Right (r%w)).

Then, we case analyze on the low bits versus the high bits of the rotation, where we prove equality by extensionality.

@bollu bollu requested a review from semorrison as a code owner May 23, 2024 12:39
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented May 23, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 73a0c73c7cc465ce8674eacaaa831e9ee0e95950 --onto ff37e5d512efcd3981290270a2fc3ecb100bbd0c. (2024-05-23 12:58:01)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 73a0c73c7cc465ce8674eacaaa831e9ee0e95950 --onto d984030c6a683a80313917b6fd3e77abdf497809. (2024-05-23 14:33:17)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 73a0c73c7cc465ce8674eacaaa831e9ee0e95950 --onto b0c1112471a3f38859d9738184d21132b7d9cd0c. (2024-05-25 01:31:53)

Copy link
Contributor

@alexkeizer alexkeizer left a comment

Choose a reason for hiding this comment

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

I've golved some of the proofs, but otherwise the proof strategy LGTM

src/Init/Data/BitVec/Lemmas.lean Outdated Show resolved Hide resolved
src/Init/Data/BitVec/Lemmas.lean Outdated Show resolved Hide resolved
src/Init/Data/BitVec/Lemmas.lean Outdated Show resolved Hide resolved
src/Init/Data/BitVec/Lemmas.lean Outdated Show resolved Hide resolved
src/Init/Data/BitVec/Lemmas.lean Outdated Show resolved Hide resolved
Proof golfs

Co-authored-by: Alex Keizer <[email protected]>
Co-authored-by: Tobias Grosser <[email protected]>
Co-authored-by: Alex Keizer <[email protected]>
@bollu
Copy link
Contributor Author

bollu commented May 23, 2024

awaiting-review

@github-actions github-actions bot added the awaiting-review Waiting for someone to review the PR label May 23, 2024
@semorrison
Copy link
Collaborator

Otherwise, I'm happy with the statements and proofs.

@bollu
Copy link
Contributor Author

bollu commented May 25, 2024

@semorrison all comments addressed.

@semorrison semorrison removed the awaiting-review Waiting for someone to review the PR label Jun 1, 2024
@semorrison semorrison added this pull request to the merge queue Jun 1, 2024
Merged via the queue into leanprover:master with commit 9a597ae Jun 1, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants