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: characterize BitVec.toInt in terms of BitVec.msb #4200

Merged
merged 2 commits into from
May 22, 2024

Conversation

alexkeizer
Copy link
Contributor

This PR extracts msb_eq_false_iff_two_mul_lt and msb_eq_true_iff_two_mul_ge from #4179, and uses them to prove a theorem that characterizes BitVec.toInt in terms of BitVec.msb. This lemma will be useful to prove a bit-blasting theorem for BitVec.slt and BitVec.sle.

Also cleans up an existing proof (toInt_eq_toNat_cond ), which turns out to be provable by rfl.

@alexkeizer
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added the awaiting-review Waiting for someone to review the PR label May 17, 2024
@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 17, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2024-05-17 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. (2024-05-17 16:32:01)

@semorrison semorrison removed the awaiting-review Waiting for someone to review the PR label May 21, 2024
@semorrison semorrison added this pull request to the merge queue May 21, 2024
@semorrison semorrison removed this pull request from the merge queue due to a manual request May 21, 2024
@semorrison semorrison added awaiting-author Waiting for PR author to address issues will-merge-soon …unless someone speaks up labels May 21, 2024
@alexkeizer
Copy link
Contributor Author

I've addressed the comment, so this should be ready to merge now.
awaiting-review

@github-actions github-actions bot added awaiting-review Waiting for someone to review the PR and removed awaiting-author Waiting for PR author to address issues labels May 21, 2024
@semorrison semorrison removed the awaiting-review Waiting for someone to review the PR label May 22, 2024
@semorrison semorrison added this pull request to the merge queue May 22, 2024
Merged via the queue into leanprover:master with commit 23a202b May 22, 2024
12 checks passed
JovanGerb pushed a commit to JovanGerb/lean4 that referenced this pull request May 22, 2024
…r#4200)

This PR extracts `msb_eq_false_iff_two_mul_lt` and
`msb_eq_true_iff_two_mul_ge` from leanprover#4179, and uses them to prove a
theorem that characterizes `BitVec.toInt` in terms of `BitVec.msb`. This
lemma will be useful to prove a bit-blasting theorem for `BitVec.slt`
and `BitVec.sle`.

Also cleans up an existing proof (`toInt_eq_toNat_cond `), which turns
out to be provable by `rfl`.

---------

Co-authored-by: Kim Morrison <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request May 23, 2024
Prove theorems that relate `BitVec.slt` and `sle` to `carry`, so that
these signed comparisons may be bitblasted in LeanSAT.

This PR is stacked on top of #4200. For the diff without changes from
that PR, see:
opencompl/lean4@opencompl:lean4:bitvec-toInt-iff-msb...bitvec-slt-blast

---------

Co-authored-by: Kim Morrison <[email protected]>
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 will-merge-soon …unless someone speaks up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants