lean4-htt/tests/lean/run/bv_extract.lean
Alex Keizer fa8439a663
refactor: make extractLsb' the primitive bv_decide understands, rather than extractLsb (#5211)
We change the `bv_decide` to understand `BitVec.extractLsb'` as a
primitive, and add a normalization lemma for `extractLsb`.
It's important to pick the primed version as a primitive, because it is
not always possible to rewrite `extractLsb'` back into `extractLsb` (see
#5007 for that direction, and the relevant side-conditions).

That is, with this PR, `bv_decide` is able to bitblast both versions of
extracting bits.
2024-09-04 08:02:04 +00:00

15 lines
372 B
Text

import Std.Tactic.BVDecide
open BitVec
theorem bv_extract_1 (h : x = 1#64) : extractLsb' 32 32 x = 0#32 := by
bv_decide
theorem bv_extract_2 (h : x = 1#64) : extractLsb' 0 32 x = 1#32 := by
bv_decide
theorem bv_extract_3 (h : x = 1#64) : extractLsb 63 32 x = 0#32 := by
bv_decide
theorem bv_extract_4 (h : x = 1#64) : extractLsb 31 0 x = 1#32 := by
bv_decide