Skip to content

Commit

Permalink
feat: bitvec_AddSub_1152 proof (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: Siddharth Bhat <[email protected]>
Co-authored-by: Tobias Grosser <[email protected]>
  • Loading branch information
3 people authored May 13, 2024
1 parent 47df14a commit 8abad84
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 @@ -205,6 +205,12 @@ theorem udiv_one_eq_zero (a : BitVec w) (h : a > 1)
assumption
rw [Nat.div_eq_zero_iff] <;> omega

@[simp]
lemma add_eq_xor (a b : BitVec 1) : a.add b = a.xor 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 8abad84

Please sign in to comment.