feat: add BitVec _assoc lemmas (#4299)
This commit is contained in:
parent
0dff5701af
commit
ff116dae5f
1 changed files with 15 additions and 0 deletions
|
|
@ -463,6 +463,11 @@ protected theorem extractLsb_ofNat (x n : Nat) (hi lo : Nat) :
|
|||
ext
|
||||
simp
|
||||
|
||||
theorem or_assoc (x y z : BitVec w) :
|
||||
x ||| y ||| z = x ||| (y ||| z) := by
|
||||
ext i
|
||||
simp [Bool.or_assoc]
|
||||
|
||||
/-! ### and -/
|
||||
|
||||
@[simp] theorem toNat_and (x y : BitVec v) :
|
||||
|
|
@ -489,6 +494,11 @@ protected theorem extractLsb_ofNat (x n : Nat) (hi lo : Nat) :
|
|||
ext
|
||||
simp
|
||||
|
||||
theorem and_assoc (x y z : BitVec w) :
|
||||
x &&& y &&& z = x &&& (y &&& z) := by
|
||||
ext i
|
||||
simp [Bool.and_assoc]
|
||||
|
||||
/-! ### xor -/
|
||||
|
||||
@[simp] theorem toNat_xor (x y : BitVec v) :
|
||||
|
|
@ -509,6 +519,11 @@ protected theorem extractLsb_ofNat (x n : Nat) (hi lo : Nat) :
|
|||
ext
|
||||
simp
|
||||
|
||||
theorem xor_assoc (x y z : BitVec w) :
|
||||
x ^^^ y ^^^ z = x ^^^ (y ^^^ z) := by
|
||||
ext i
|
||||
simp [Bool.xor_assoc]
|
||||
|
||||
/-! ### not -/
|
||||
|
||||
theorem not_def {x : BitVec v} : ~~~x = allOnes v ^^^ x := rfl
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue