Skip to content

Commit

Permalink
bitvec_283 (#327)
Browse files Browse the repository at this point in the history
This resolves #306.

---------

Co-authored-by: Tobias Grosser <[email protected]>
  • Loading branch information
eurquhart1 and tobiasgrosser authored May 22, 2024
1 parent e23346c commit 069ec67
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SSA/Projects/InstCombine/ForLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ lemma add_eq_xor (a b : BitVec 1) : a + b = a ^^^ b := by
have hb : b = 0 ∨ b = 1 := width_one_cases _
rcases ha with h | h <;> (rcases hb with h' | h' <;> (simp [h, h']))

@[simp]
lemma mul_eq_and (a b : BitVec 1) : a * b = a &&& b := by
have ha : a = 0 ∨ a = 1 := width_one_cases _
have hb : b = 0 ∨ b = 1 := width_one_cases _
rcases ha with h | h <;> (rcases hb with h' | h' <;> (simp[h, h']))

lemma toNat_neq_of_neq_ofNat {a : BitVec w} {n : Nat} (h : a ≠ n#w) : a.toNat ≠ n := by
intros haeq
have hn : n < 2 ^ w := by
Expand Down

0 comments on commit 069ec67

Please sign in to comment.