Skip to content

Commit a5fc24b

Browse files
committed
Update Lean toolchain to v4.26.0.
1 parent e4a1347 commit a5fc24b

15 files changed

Lines changed: 52 additions & 52 deletions

File tree

Smt/Preprocess/Embedding/Nat.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ theorem Int.toNat_eq_toNat_of_nonneg {x y : Int} (hx : x ≥ 0) (hy : y ≥ 0) :
4949
| .negSucc n, _ => contradiction
5050
| _, .negSucc m => contradiction
5151
| .ofNat n, .ofNat m =>
52-
simp only [Int.ofNat_eq_coe, Int.toNat_natCast, Int.natCast_inj]
52+
simp only [Int.ofNat_eq_natCast, Int.toNat_natCast, Int.natCast_inj]
5353

5454
@[embedding ↓]
5555
theorem Int.toNat_ne_toNat_of_nonneg {x y : Int} (hx : x ≥ 0) (hy : y ≥ 0) : (x.toNat ≠ y.toNat) ↔ (x ≠ y) := by
5656
match x, y with
5757
| .negSucc n, _ => contradiction
5858
| _, .negSucc m => contradiction
5959
| .ofNat n, .ofNat m =>
60-
simp only [Int.ofNat_eq_coe, Int.toNat_natCast, ne_eq, Int.natCast_inj]
60+
simp only [Int.ofNat_eq_natCast, Int.toNat_natCast, ne_eq, Int.natCast_inj]
6161

6262
namespace Smt.Preprocess.Embedding
6363

Smt/Reconstruct/Rat/Core.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ protected theorem sub_nonneg {a b : Rat} : 0 ≤ a - b ↔ b ≤ a := by
182182

183183
theorem divInt_pos_iff_of_pos_right {a b : Int} (hb : 0 < b) : 0 < a /. b ↔ 0 < a := by
184184
cases hab : a /. b with | mk' n d hd hnd =>
185-
rw [mk'_eq_divInt, divInt_eq_divInt_iff (Int.ne_of_lt hb).symm (mod_cast hd)] at hab
185+
rw [mk_eq_divInt, divInt_eq_divInt_iff (Int.ne_of_lt hb).symm (mod_cast hd)] at hab
186186
rw [ ← Rat.num_pos, <- Int.mul_pos_iff_of_pos_right hb, <- hab,
187187
Int.mul_pos_iff_of_pos_right (mod_cast Nat.pos_of_ne_zero hd)]
188188

@@ -291,12 +291,12 @@ theorem floor_def' (a : Rat) : a.floor = a.num / a.den := by
291291
· next h => simp [h]
292292
· next => rfl
293293

294-
theorem intCast_eq_divInt (z : Int) : (z : Rat) = z /. 1 := mk'_eq_divInt
294+
theorem intCast_eq_divInt (z : Int) : (z : Rat) = z /. 1 := mk_eq_divInt
295295

296296
theorem le_floor {z : Int} : ∀ {r : Rat}, z ≤ Rat.floor r ↔ (z : Rat) ≤ r
297297
| ⟨n, d, h, c⟩ => by
298298
simp only [Rat.floor_def']
299-
rw [mk'_eq_divInt]
299+
rw [mk_eq_divInt]
300300
have h' := Int.ofNat_lt.2 (Nat.pos_of_ne_zero h)
301301
conv =>
302302
rhs

Smt/Reconstruct/Rat/Lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ theorem add_nonneg : 0 ≤ a → 0 ≤ b → 0 ≤ a + b :=
144144
apply Int.add_nonneg
145145
· apply Int.mul_nonneg
146146
· exact (Rat.divInt_nonneg_iff_of_pos_right d₁0).mp n₁0
147-
· exact Int.ofNat_zero_le d₂
147+
· exact Int.natCast_nonneg d₂
148148
· apply Int.mul_nonneg
149149
· exact (Rat.divInt_nonneg_iff_of_pos_right d₂0).mp n₂0
150-
· exact Int.ofNat_zero_le d₁
150+
· exact Int.natCast_nonneg d₁
151151

152152
theorem le_trans (hab : a ≤ b) (hbc : b ≤ c) : a ≤ c := by
153153
rw [Rat.le_iff_sub_nonneg] at hab hbc

Smt/Reconstruct/Real/Lemmas.lean

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,40 @@ namespace Smt.Reconstruct.Real
1717
variable {a b c d x₁ x₂ y₁ y₂ : Real}
1818

1919
theorem sum_ub₁ (h₁ : a < b) (h₂ : c < d) : a + c < b + d := by
20-
have r₁ : a + c < a + d := add_lt_add_left h₂ a
21-
have r₂ : a + d < b + d := add_lt_add_right h₁ d
20+
have r₁ : a + c < a + d := add_lt_add_right h₂ a
21+
have r₂ : a + d < b + d := add_lt_add_left h₁ d
2222
exact lt_trans r₁ r₂
2323

2424
theorem sum_ub₂ (h₁ : a < b) (h₂ : c ≤ d) : a + c < b + d := by
25-
have r₁ : a + c ≤ a + d := add_le_add_left h₂ a
26-
have r₂ : a + d < b + d := add_lt_add_right h₁ d
25+
have r₁ : a + c ≤ a + d := add_le_add_right h₂ a
26+
have r₂ : a + d < b + d := add_lt_add_left h₁ d
2727
exact lt_of_le_of_lt r₁ r₂
2828

2929
theorem sum_ub₃ (h₁ : a < b) (h₂ : c = d) : a + c < b + d := by
3030
rewrite [h₂]
31-
exact add_lt_add_right h₁ d
31+
exact add_lt_add_left h₁ d
3232

3333
theorem sum_ub₄ (h₁ : a ≤ b) (h₂ : c < d) : a + c < b + d := by
34-
have r₁ : a + c < a + d := add_lt_add_left h₂ a
35-
have r₂ : a + d ≤ b + d := add_le_add_right h₁ d
34+
have r₁ : a + c < a + d := add_lt_add_right h₂ a
35+
have r₂ : a + d ≤ b + d := add_le_add_left h₁ d
3636
exact lt_of_lt_of_le r₁ r₂
3737

3838
theorem sum_ub₅ (h₁ : a ≤ b) (h₂ : c ≤ d) : a + c ≤ b + d := by
39-
have r₁ : a + c ≤ a + d := add_le_add_left h₂ a
40-
have r₂ : a + d ≤ b + d := add_le_add_right h₁ d
39+
have r₁ : a + c ≤ a + d := add_le_add_right h₂ a
40+
have r₂ : a + d ≤ b + d := add_le_add_left h₁ d
4141
exact le_trans r₁ r₂
4242

4343
theorem sum_ub₆ (h₁ : a ≤ b) (h₂ : c = d) : a + c ≤ b + d := by
4444
rewrite [h₂]
45-
exact add_le_add_right h₁ d
45+
exact add_le_add_left h₁ d
4646

4747
theorem sum_ub₇ (h₁ : a = b) (h₂ : c < d) : a + c < b + d := by
4848
rewrite [h₁]
49-
exact add_lt_add_left h₂ b
49+
exact add_lt_add_right h₂ b
5050

5151
theorem sum_ub₈ (h₁ : a = b) (h₂ : c ≤ d) : a + c ≤ b + d := by
5252
rewrite [h₁]
53-
exact add_le_add_left h₂ b
54-
53+
exact add_le_add_right h₂ b
5554
theorem sum_ub₉ (h₁ : a = b) (h₂ : c = d) : a + c = b + d := by
5655
rw [h₁, h₂]
5756

Smt/Reconstruct/Real/TransFns/ArithTransSineShift.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ theorem arithTransSineShift₀ : ∀ x , ∃ s y , shift_prop x s y := fun x =>
8787
have := Int.ceil_le_floor_add_one ((x - Real.pi) / (2 * Real.pi))
8888
apply le_trans (Int.cast_le.mpr this)
8989
have : Int.floor ((x - Real.pi) / (2 * Real.pi)) + 1 ≤ (x - Real.pi) / (2 * Real.pi) + 1 :=
90-
add_le_add_right (Int.floor_le _) 1
90+
add_le_add_left (Int.floor_le _) 1
9191
simp only [Int.cast_add, Int.cast_one, ge_iff_le]
9292
apply le_trans this
9393
rw [← div_add_same two_pi_ne_zero, tau]

Smt/Reconstruct/UF.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def getFVarOrConstExpr! (n : String) : ReconstructM Expr := do
3535
| .UNINTERPRETED_SORT_VALUE =>
3636
let some n := (← read).sortCard[t.getSort]? | throwError "unknown sort {t.getSort}"
3737
let s := t.toString
38-
let endPos := (s.endPos - t.getSort.toString).decreaseBy 2
38+
let endPos := (s.rawEndPos - t.getSort.toString).decreaseBy 2
3939
let endPos := if endPos.dec.get? s == some '|' then endPos.dec else endPos
4040
let startPos := (s.revFindAux (· != '_') endPos).get!
4141
let i : Nat := (String.Pos.Raw.extract s startPos endPos).toNat!

Smt/Translate/String.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ private def mkString : Expr :=
2929
@[smt_translate] def translateString : Translator := fun e => do
3030
if let .lit (.strVal s) := e then
3131
return literalT s!"\"{s}\""
32-
else if let some (z, x, y) := e.app3? ``String.replace then
33-
return mkApp3 (symbolT "str.replace_all") (← applyTranslators! z) (← applyTranslators! x) (← applyTranslators! y)
32+
else if e.isAppOfArity ``String.replace 11 then
33+
let #[_, _, _, _, _, _, _, _, x, y, z] := e.getAppArgsN 11 | return none
34+
return mkApp3 (symbolT "str.replace_all") (← applyTranslators! x) (← applyTranslators! y) (← applyTranslators! z)
3435
else if let some (x, y) := e.hAppendOf? mkString mkString then
3536
return mkApp2 (symbolT "str.++") (← applyTranslators! x) (← applyTranslators! y)
3637
else

Test/BitVec/Shift.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ goal: x ++ y = zeroExtend 4 x <<< 2#2 ||| zeroExtend 4 y
22

33
query:
44
(set-logic ALL)
5-
(declare-const y (_ BitVec 2))
65
(declare-const x (_ BitVec 2))
6+
(declare-const y (_ BitVec 2))
77
(assert (not (= (concat x y) (bvor (bvshl ((_ zero_extend 2) x) #b10) ((_ zero_extend 2) y)))))
88
(check-sat)
99
Test/BitVec/Shift.lean:5:8: warning: declaration uses 'sorry'
1010
goal: x ++ y = zeroExtend 6 x <<< 3#2 ||| zeroExtend 6 y
1111

1212
query:
1313
(set-logic ALL)
14-
(declare-const x (_ BitVec 3))
1514
(declare-const y (_ BitVec 3))
15+
(declare-const x (_ BitVec 3))
1616
(assert (not (= (concat x y) (bvor (bvshl ((_ zero_extend 3) x) #b11) ((_ zero_extend 3) y)))))
1717
(check-sat)
1818
Test/BitVec/Shift.lean:10:8: warning: declaration uses 'sorry'

Test/BitVec/XorComm.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ goal: x ^^^ y = y ^^^ x
22

33
query:
44
(set-logic ALL)
5-
(declare-const x (_ BitVec 2))
65
(declare-const y (_ BitVec 2))
6+
(declare-const x (_ BitVec 2))
77
(assert (not (= (bvxor x y) (bvxor y x))))
88
(check-sat)
99
Test/BitVec/XorComm.lean:3:8: warning: declaration uses 'sorry'
1010
goal: x ^^^ y = y ^^^ x
1111

1212
query:
1313
(set-logic ALL)
14-
(declare-const y (_ BitVec 8))
1514
(declare-const x (_ BitVec 8))
15+
(declare-const y (_ BitVec 8))
1616
(assert (not (= (bvxor x y) (bvxor y x))))
1717
(check-sat)
1818
Test/BitVec/XorComm.lean:7:8: warning: declaration uses 'sorry'

Test/Bool/Assoc.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Test/Bool/Assoc.lean:5:2: error: unable to prove goal, either it is false or you
22

33
f = fun _arg_1 _arg_2 => if _arg_1 then ¬_arg_2 else ¬_arg_1 ∧ ¬_arg_2
44
r = False
5-
p = True
65
q = False
6+
p = True

0 commit comments

Comments
 (0)