Skip to content

Commit

Permalink
chore: update to nightly-2024-09-27 (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgrosser authored Sep 28, 2024
1 parent 73e02a9 commit 19b8e1b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 36 deletions.
32 changes: 1 addition & 31 deletions SSA/Projects/InstCombine/ForLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -514,25 +514,7 @@ theorem not_sshiftRight_not {x : BitVec w} {n : Nat} :
~~~((~~~x).sshiftRight n) = x.sshiftRight n := by
simp [not_sshiftRight]

@[simp]
theorem shiftLeft_shiftRight {x : BitVec w} {n : Nat}:
x >>> n <<< n = x &&& BitVec.allOnes w <<< n := by
induction n generalizing x
case zero =>
ext; simp
case succ n ih =>
rw [BitVec.shiftLeft_add, Nat.add_comm, BitVec.shiftRight_add, ih,
Nat.add_comm, BitVec.shiftLeft_add, BitVec.shiftLeft_and_distrib]
ext i
simp only [getLsbD_and, getLsbD_shiftLeft, Fin.is_lt, decide_True, Nat.lt_one_iff,
Bool.true_and, getLsbD_ushiftRight, getLsbD_allOnes]
rw [Nat.add_comm]
by_cases hw : w = 0
· simp [hw]
· by_cases h : i.val = 0
· simp [h]
· rw [Nat.sub_add_cancel (by omega)]
simp [h]
attribute [simp] shiftLeft_ushiftRight

theorem ofInt_neg_one : BitVec.ofInt w (-1) = -1#w := by
simp only [Int.reduceNeg, toNat_eq, toNat_ofInt, Nat.cast_pow, Nat.cast_ofNat, toNat_neg,
Expand All @@ -551,18 +533,6 @@ theorem ofInt_neg_one : BitVec.ofInt w (-1) = -1#w := by
Int.pred_toNat]
norm_cast

@[simp]
theorem shiftLeft_add_distrib {x y : BitVec w} {n : Nat} :
(x + y) <<< n = x <<< n + y <<< n := by
induction n
case zero =>
simp
case succ n ih =>
simp only [shiftLeft_add, ih, toNat_eq, toNat_shiftLeft, toNat_add, Nat.shiftLeft_eq_mul_pow,
Nat.add_mod_mod, Nat.mod_add_mod, pow_one, Nat.mod_mul_mod]
rw [Nat.mod_eq_of_eq]
omega

@[simp]
theorem shiftLeft_and_distrib' {x y : BitVec w} {n m : Nat} :
x <<< n &&& y <<< (m + n) = (x &&& y <<< m) <<< n := by
Expand Down
6 changes: 3 additions & 3 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "2c9497c893a4f81411023b56c51f2473c7c3c452",
"rev": "cfb438195e4513212997bdff25a436c1e99a3440",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "nightly-testing",
Expand Down Expand Up @@ -75,10 +75,10 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "0510a8eb7a3628edd2b79c33efa04c93f377281d",
"rev": "c0c2c8fac501e8c0580177432e21fd461cb64580",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": "nightly-testing-2024-09-26",
"inputRev": "nightly-testing-2024-09-27",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/acmepjz/md4lean",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defaultTargets = ["SSA"]
[[require]]
name = "mathlib"
git = "https://github.com/leanprover-community/mathlib4"
rev = "nightly-testing-2024-09-26"
rev = "nightly-testing-2024-09-27"

[[require]]
name = "Cli"
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2024-09-26
leanprover/lean4:nightly-2024-09-27

0 comments on commit 19b8e1b

Please sign in to comment.