Skip to content

Commit e3e17be

Browse files
committed
revert to v4.25.0
1 parent 2fb3dbc commit e3e17be

File tree

13 files changed

+48
-30
lines changed

13 files changed

+48
-30
lines changed

Auto/Embedding/LCtx.lean

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ section push
494494
theorem pushLCtxs_cons (xs : List α) (lctx : Nat → α) :
495495
pushLCtxs (x :: xs) lctx = pushLCtx x (pushLCtxs xs lctx) := by
496496
apply funext; intros n; cases n <;>
497-
simp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]
497+
simp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble, Nat.zero_ble]
498498

499499
theorem pushLCtxs_append (xs ys : List α) (lctx : Nat → α) :
500500
pushLCtxs (xs ++ ys) lctx = pushLCtxs xs (pushLCtxs ys lctx) := by
@@ -512,7 +512,7 @@ section push
512512

513513
theorem pushLCtxs_cons_zero (xs : List α) (lctx : Nat → α) :
514514
pushLCtxs (x :: xs) lctx 0 = x := by
515-
dsimp [pushLCtxs, Nat.blt, Nat.ble, Nat.zero_ble]
515+
simp [pushLCtxs, Nat.blt, Nat.ble, Nat.zero_ble]
516516

517517
theorem pushLCtxs_cons_succ (xs : List α) (lctx : Nat → α) (n : Nat) :
518518
pushLCtxs (x :: xs) lctx (.succ n) = pushLCtxs xs lctx n := by
@@ -608,7 +608,11 @@ section push
608608
HEq (pushLCtxsDep (.cons x xs) lctx) (pushLCtxDep x (pushLCtxsDep xs lctx)) := by
609609
apply HEq.funext; intros n; cases n
610610
case zero =>
611-
simp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble, HList.getD]
611+
simp only [
612+
pushLCtxs, List.length_cons, Nat.blt, Nat.succ_eq_add_one,
613+
Nat.reduceAdd, Nat.ble, List.getD_cons_zero, id_eq, HList.getD, pushLCtx
614+
]
615+
rw [Nat.zero_ble]
612616
case succ n =>
613617
dsimp [pushLCtxs, pushLCtx, Nat.blt, Nat.ble]
614618
rw [Nat.succ_sub_succ]; rfl
@@ -617,7 +621,11 @@ section push
617621
{lctxty : α → Sort u} {ty : α} (x : lctxty ty) {tys : List α}
618622
(xs : HList lctxty tys) {rty : Nat → α} (lctx : ∀ n, lctxty (rty n)) :
619623
HEq (pushLCtxsDep (.cons x xs) lctx 0) x := by
620-
simp [pushLCtxs, Nat.blt, Nat.ble, HList.getD]
624+
simp only [
625+
pushLCtxs, List.length_cons, Nat.blt, Nat.succ_eq_add_one,
626+
Nat.reduceAdd, Nat.ble, List.getD_cons_zero, id_eq, HList.getD
627+
]
628+
rw [Nat.zero_ble]
621629

622630
theorem pushLCtxsDep_cons_succ
623631
{lctxty : α → Sort u} {ty : α} (x : lctxty ty) {tys : List α}
@@ -764,9 +772,17 @@ section push
764772
dsimp at heq; rw [← heq]
765773
rw [HList.ofFun_succ];
766774
congr
775+
case e_3.h =>
776+
simp [pushLCtxs, Nat.blt, Nat.ble, Nat.zero_ble]
767777
case e_4.h =>
768778
dsimp; rw [pushLCtxs_cons_succ_Fn]
769779
apply List.ofFun_ofPushLCtx; rfl
780+
case e_5 =>
781+
simp only [
782+
pushLCtxs, List.length_cons, Nat.blt, Nat.succ_eq_add_one,
783+
Nat.reduceAdd, Nat.ble, List.getD_cons_zero, id_eq, HList.getD
784+
]
785+
rw [Nat.zero_ble]
770786
case e_6 =>
771787
apply HEq.trans _ (ofFun_ofPushLCtxDep rfl xs lctx)
772788
congr

Auto/Embedding/LamConv.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,8 @@ theorem LamWF.interp_instantiate1.{u}
964964
case eqBody => rw [pushLCtxAt_zero]
965965
case eqLarge =>
966966
apply eq_of_heq; apply LamWF.interp_heq <;> try rfl
967+
case h.HLCtxTyEq =>
968+
rw [pushLCtxAt_zero]
967969
case h.HLCtxTermEq =>
968970
apply HEq.trans (HEq.symm (pushLCtxAtDep_zero _ _)) _
969971
apply pushLCtxAtDep_heq <;> try rfl

Auto/EvaluateAuto/NameArr.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def Name.parseUniqRepr (n : String) : Name :=
4040
if s[0]? == '\\' then
4141
if let .some c := s[1]? then
4242
if c.isDigit then
43-
return .inr ((String.toNat? (String.ofList (s.drop 1))).getD 0)
43+
return .inr ((String.toNat? (String.mk (s.drop 1))).getD 0)
4444
let mut ret := ""
4545
let mut escape := false
4646
for c in s do

Auto/EvaluateAuto/OS.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ where
1919
| '`' => "\\`"
2020
| '\"' => "\\\""
2121
| '\\' => "\\\\"
22-
| c => String.ofList [c]
22+
| c => String.mk [c]
2323

2424
def runLeanFileUsingNewLeanProcess
2525
(leanFile : String) (memoryLimitKb : Nat) (timeLimitS : Nat) :

Auto/IR/SMT.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def SpecConst.toString : SpecConst → String
9999
| .binary bs => bs.foldl (fun acc b => acc.push (if b then '1' else '0')) "#b"
100100
| .num n => ToString.toString (repr n)
101101
where specCharRepr (c : Char) : String :=
102-
"\\u{" ++ String.ofList (Nat.toDigits 16 c.toNat) ++ "}"
102+
"\\u{" ++ String.mk (Nat.toDigits 16 c.toNat) ++ "}"
103103

104104
mutual
105105

Auto/Lib/HList.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ theorem HList.getD_append_left (xs : HList β as) (ys : HList β bs) (h : i < as
8888
dsimp [append]; cases i
8989
case zero => apply HEq.rfl
9090
case succ i =>
91-
dsimp [getD]; apply IH; apply Nat.le_of_succ_le_succ h
91+
simp only [getD]; apply IH; apply Nat.le_of_succ_le_succ h
9292

9393
theorem HList.getD_append_right (xs : HList β as) (ys : HList β bs) (h : i ≥ as.length) :
9494
HEq ((append xs ys).getD df i) (ys.getD df (i - as.length)) := by
@@ -98,7 +98,7 @@ theorem HList.getD_append_right (xs : HList β as) (ys : HList β bs) (h : i ≥
9898
dsimp [append]; cases i
9999
case zero => contradiction
100100
case succ i =>
101-
dsimp [getD]; rw [Nat.succ_sub_succ];
101+
simp only [getD]; rw [Nat.succ_sub_succ];
102102
apply IH; apply Nat.le_of_succ_le_succ h
103103

104104
def HList.append_get_left (xs : HList β (as ++ bs)) : HList β as :=

Auto/MathlibEmulator/ToExpr.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ instance [ToLevel.{u}] : ToExpr PUnit.{u+1} where
5757
toTypeExpr := mkConst ``PUnit [toLevel.{u+1}]
5858

5959
deriving instance ToExpr for String.Pos.Raw
60-
deriving instance ToExpr for Substring.Raw
60+
deriving instance ToExpr for Substring
6161
deriving instance ToExpr for SourceInfo
6262
deriving instance ToExpr for Syntax.Preresolved
6363
deriving instance ToExpr for Syntax

Auto/Parser/LeanLex.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private def sort : List Nat → List Nat :=
1515
-- Character class
1616
namespace CC
1717

18-
private def alls := String.ofList ((List.range 128).map Char.ofNat)
18+
private def alls := String.mk ((List.range 128).map Char.ofNat)
1919
private def uppers := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2020
private def lowers := "abcdefghijklmnopqrstuvwxyz"
2121
private def alphas := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
@@ -25,9 +25,9 @@ private def xdigits := "0123456789ABCDEFabcdef"
2525
private def puncts := ".,!?:…"
2626
private def blanks := " \t"
2727
private def spaces := " \t\n\r\x0c\x0b"
28-
private def cntrls := String.ofList ((List.range 32).map Char.ofNat)
29-
private def graphs := String.ofList (alls.toList.filter (fun x => !" \t\n\r\x0c\x0b".toList.contains x))
30-
private def prints := String.ofList (alls.toList.filter (fun x => !"\t\n\r\x0c\x0b".toList.contains x))
28+
private def cntrls := String.mk ((List.range 32).map Char.ofNat)
29+
private def graphs := String.mk (alls.toList.filter (fun x => !" \t\n\r\x0c\x0b".toList.contains x))
30+
private def prints := String.mk (alls.toList.filter (fun x => !"\t\n\r\x0c\x0b".toList.contains x))
3131

3232
inductive Ty where
3333
| all
@@ -95,7 +95,7 @@ where
9595
| [] => Std.HashSet.emptyWithCapacity
9696
| b :: bl => (go bl).insertMany (toHashSet b)
9797

98-
def EREBracket.toString (e : EREBracket) := String.ofList e.toHashSet.toList
98+
def EREBracket.toString (e : EREBracket) := String.mk e.toHashSet.toList
9999

100100
instance : ToString EREBracket where
101101
toString := EREBracket.toString
@@ -133,7 +133,7 @@ deriving BEq, Hashable, Inhabited
133133
def ERE.inStr (s : String) := ERE.bracket (.inStr s)
134134

135135
/-- Match the given string -/
136-
def ERE.ofStr (s : String) := ERE.comp ⟨s.toList.map (fun c => .inStr (String.ofList [c]))⟩
136+
def ERE.ofStr (s : String) := ERE.comp ⟨s.toList.map (fun c => .inStr (String.mk [c]))⟩
137137

138138
def ERE.ofCC (c : CC.Ty) := ERE.bracket (.cc c)
139139

@@ -299,7 +299,7 @@ end
299299
def CharGrouping.toStringForChar (cg : CharGrouping Char) : String :=
300300
CharGrouping.toStringAux cg (fun l =>
301301
let sorted := sort (l.toList.map Char.toNat)
302-
let str := String.ofList (sorted.map Char.ofNat)
302+
let str := String.mk (sorted.map Char.ofNat)
303303
ToString.toString (repr str))
304304

305305
instance : ToString (CharGrouping Char) where
@@ -308,7 +308,7 @@ instance : ToString (CharGrouping Char) where
308308
def ADFA.toStringForChar (a : ADFA Char) : String :=
309309
ADFA.toStringAux a (fun l =>
310310
let sorted := sort (l.toList.map Char.toNat)
311-
let str := String.ofList (sorted.map Char.ofNat)
311+
let str := String.mk (sorted.map Char.ofNat)
312312
ToString.toString (repr str))
313313

314314
instance : ToString (ADFA Char) where
@@ -418,7 +418,7 @@ instance : ToString LexResultTy where
418418
structure LexResult where
419419
type : LexResultTy
420420
-- Matched part
421-
matched : Substring.Raw
421+
matched : Substring
422422
-- Whether the appended `end of string` group is matched
423423
endSMatched : Bool
424424
state : Nat
@@ -452,7 +452,7 @@ instance : ToString LexResult where
452452
We prepend `s` with the "beginning of string" group
453453
and append to `s` the "end of string" group
454454
-/
455-
def ERE.ADFALexEagerL (a : ADFA Char) (s : Substring.Raw) (cfg : LexConfig) : LexResult := Id.run <| do
455+
def ERE.ADFALexEagerL (a : ADFA Char) (s : Substring) (cfg : LexConfig) : LexResult := Id.run <| do
456456
-- Current position in `s`
457457
let mut p : String.Pos.Raw := s.startPos
458458
-- The value of `b` will represent where the match begins

Auto/Parser/LexInit.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ namespace SMTSexp
1111

1212
open Regex
1313

14-
def whitespace : String := (String.ofList
14+
def whitespace : String := (String.mk
1515
([9, 10, 13, 32].map Char.ofNat))
1616

17-
def unprintable : String := String.ofList
17+
def unprintable : String := String.mk
1818
((127 :: List.range 32).map Char.ofNat)
1919

2020
def comment : ERE :=

Auto/Parser/SMTSexp.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def LexVal.toString : LexVal → String
3535
let nfrac := n % m
3636
let nfracs := s!"{nfrac}"
3737
let nfracs :=
38-
String.ofList ((List.range (pow - nfracs.length)).map (fun _ => '0')) ++
38+
String.mk ((List.range (pow - nfracs.length)).map (fun _ => '0')) ++
3939
nfracs
4040
s!"{nint}." ++ nfracs
4141
| .str s => "\"" ++ String.intercalate "\"\"" (s.splitOn "\"") ++ "\""
@@ -78,7 +78,7 @@ def LexVal.ofString (s : String) (attr : String) : LexVal :=
7878
| "quotedsymbol" => .symb ((s.drop 1).take (s.length - 2))
7979
| "keyword" => .kw (s.drop 1)
8080
| "comment" =>
81-
let rn : Nat := if String.Pos.Raw.get s (String.Pos.Raw.prev s (String.Pos.Raw.prev s s.rawEndPos)) == '\r' then 1 else 0
81+
let rn : Nat := if String.Pos.Raw.get s (String.Pos.Raw.prev s (String.Pos.Raw.prev s s.endPos)) == '\r' then 1 else 0
8282
.comment ((s.drop 1).take (s.length - 2 - rn))
8383
| _ => panic! s!"LexVal.ofString :: {repr attr} is not a valid attribute"
8484

@@ -139,16 +139,16 @@ local instance : Hashable Char := ⟨fun c => hash c.val⟩
139139
by `ERE.ADFALexEagerL SMTSexp.lexiconADFA`, and never as `done`.
140140
-/
141141
def parseSexp (s : String) (p : String.Pos.Raw) (partialResult : PartialResult) : ParseResult := Id.run <| do
142-
if p == s.rawEndPos then
142+
if p == s.endPos then
143143
return .incomplete partialResult p
144144
let nextLexicon (p : String.Pos.Raw) (lst : Nat) :=
145-
Regex.ERE.ADFALexEagerL SMTSexp.lexiconADFA ⟨s, p, s.rawEndPos
145+
Regex.ERE.ADFALexEagerL SMTSexp.lexiconADFA ⟨s, p, s.endPos
146146
{strict := true, initS := lst, prependBeginS := false, appendEndS := false}
147147
let mut lst := partialResult.lst
148148
let mut lexpart := partialResult.lexpart
149149
let mut pstk := partialResult.pstk
150150
let mut p := p
151-
let endPos := s.rawEndPos
151+
let endPos := s.endPos
152152
while true do
153153
-- If we're not resuming from an incomplete
154154
-- match of lexicon, skip white space

0 commit comments

Comments
 (0)