Skip to content

refactor: USize/ISize handling in bv_decide#14227

Open
hargoniX wants to merge 4 commits into
masterfrom
hbv/bv_decide_uintx_refactor
Open

refactor: USize/ISize handling in bv_decide#14227
hargoniX wants to merge 4 commits into
masterfrom
hbv/bv_decide_uintx_refactor

Conversation

@hargoniX

@hargoniX hargoniX commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This PR refactors the way that bv_decide handles USize and ISize. This is necessary for SymM support in bv_decide because calling revert in SymM is illegal.

Instead of building a custom motive to replace USize/ISize constants with BitVec ones, it now uses a modified int_toBitVec simp set. For all fixed width IntX this still contains the original lemmas. For USize/ISize it contains lemmas that convert to BitVec 32 or BitVec 64, conditionally on which of the two assumptions is available. Through this USize/ISize already get converted to fixed-width BitVec in the int_toBitVec simp pass in bv_decide.

@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 Jun 30, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-06-30 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. You can force Mathlib CI using the force-mathlib-ci label. (2026-06-30 14:32:21)

@hargoniX hargoniX force-pushed the hbv/bv_decide_uintx_refactor branch from 97077c7 to e3aee1e Compare June 30, 2026 14:36
@hargoniX hargoniX added the changelog-tactics User facing tactics label Jun 30, 2026
@hargoniX hargoniX marked this pull request as ready for review June 30, 2026 14:40
Comment thread src/Init/Data/SInt/Basic.lean Outdated
@hargoniX hargoniX force-pushed the hbv/bv_decide_uintx_refactor branch from e3aee1e to e9edb7b Compare June 30, 2026 14:50
@leanprover-bot

leanprover-bot commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Jun 30, 2026
@hargoniX

Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar

leanprover-radar commented Jun 30, 2026

Copy link
Copy Markdown

Benchmark results for e9edb7b against 28b99ec are in. No significant results found. @hargoniX

  • 🟥 build//instructions: +6.9G (+0.06%)

Small changes (2✅, 13🟥)

  • 🟥 build/module/Init.Data.SInt.Bitwise//instructions: +408.2M (+3.70%) (reduced significance based on *//lines)
  • 🟥 build/module/Init.Data.SInt//instructions: +16.9M (+4.43%) (reduced significance based on *//lines)
  • 🟥 build/module/Init.Data.UInt.Bitwise//instructions: +411.4M (+1.98%) (reduced significance based on *//lines)
  • 🟥 build/module/Lean.Meta.Tactic.BVDecide.Counterexample//instructions: +395.3M (+10.49%) (reduced significance based on *//lines)
  • build/module/Lean.Meta.Tactic.BVDecide.Normalize.IntToBitVec//instructions: -1.5G (-46.97%) (reduced significance based on *//lines)
  • 🟥 build/module/Std.Async//instructions: +10.5M (+1.65%)
  • 🟥 build/module/Std.Http.Data.Body//instructions: +11.5M (+1.68%)
  • 🟥 build/module/Std.Internal.UV.DNS//instructions: +14.3M (+3.42%)
  • 🟥 build/module/Std.Internal.UV.TCP//instructions: +17.3M (+3.29%)
  • 🟥 build/module/Std.Internal.UV//instructions: +15.3M (+3.86%)
  • 🟥 build/module/Std//instructions: +10.3M (+1.34%)
  • 🟥 elab/charactersIn//instructions: +35.6M (+0.10%)
  • 🟥 size/Init/.olean.server//bytes: +33kiB (+0.29%)
  • 🟥 size/Init/.olean//bytes: +246kiB (+0.26%)
  • vcgen/AddSubCancelDeep/500/vcgen//wall-clock: -3ms (-3.49%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR changelog-tactics User facing tactics 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.

4 participants