Skip to content

Commit 55b0d39

Browse files
bollutobiasgrosser
andauthored
feat: BitVec.append_add_append_eq_append (#7757)
This PR adds the Bitwuzla rewrite `NORM_BV_ADD_CONCAT` for symbolic simplification of add-of-append. --------- Co-authored-by: Tobias Grosser <[email protected]>
1 parent 32cd701 commit 55b0d39

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Init/Data/BitVec/Bitblast.lean

+5
Original file line numberDiff line numberDiff line change
@@ -1752,4 +1752,9 @@ theorem extractLsb'_mul {w len} {x y : BitVec w} (hlen : len ≤ w) :
17521752
(x * y).extractLsb' 0 len = (x.extractLsb' 0 len) * (y.extractLsb' 0 len) := by
17531753
simp [← setWidth_eq_extractLsb' hlen, setWidth_mul _ _ hlen]
17541754

1755+
/-- Adding bitvectors that are zero in complementary positions equals concatenation. -/
1756+
theorem append_add_append_eq_append {v w : Nat} {x : BitVec v} {y : BitVec w} :
1757+
(x ++ 0#w) + (0#v ++ y) = x ++ y := by
1758+
rw [add_eq_or_of_and_eq_zero] <;> ext i <;> simp
1759+
17551760
end BitVec

0 commit comments

Comments
 (0)