Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop BitVec over constant value rewrites #544

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions SSA/Projects/InstCombine/ForLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -459,30 +459,10 @@ theorem toInt_width_zero (x : BitVec 0) : BitVec.toInt x = 0 := by
rw [BitVec.width_zero_eq_zero x]
simp

@[simp]
theorem toInt_ofInt_width_one_one : BitVec.toInt (BitVec.ofInt 1 1) = -1 := rfl

@[simp]
theorem toInt_ofInt_zero : BitVec.toInt (BitVec.ofInt w 0) = 0 := by
simp [BitVec.msb, BitVec.getMsb, BitVec.getLsb, BitVec.ofInt, BitVec.toInt]

@[simp]
theorem toInt_ofInt_1_width_zero :
BitVec.toInt (BitVec.ofInt (n := 0) 1) = 0 := rfl

@[simp]
theorem toInt_ofInt_1_width_one :
BitVec.toInt (BitVec.ofInt (n := 1) 1) = -1 := rfl

-- if w = 0. then value is 0
-- if w = 1, then value is -1.

@[simp]
theorem toNat_ofInt_one_width_zero : BitVec.toNat (BitVec.ofInt (n := 0) 1) = 0 := rfl

@[simp]
theorem toNat_ofInt_one_width_one : BitVec.toNat (BitVec.ofInt (n := 1) 1) = 1 := rfl

@[simp]
theorem ofNat_toNat_zero :
BitVec.toNat (BitVec.ofInt w 0) = 0 := by
Expand Down
Loading