Skip to content

Commit fb3f51d

Browse files
committed
Update to v4.27.0-rc1
1 parent 3aed9a3 commit fb3f51d

File tree

10 files changed

+35
-35
lines changed

10 files changed

+35
-35
lines changed

Auto/EvaluateAuto/TestAuto.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ def readRunAutoOnConstsResult (resultFile : String) : CoreM (Array (Name × Resu
164164
where
165165
analyzeLine (fileName line : String) : CoreM (Name × Result × Nat × Nat) := do
166166
let line := (line.dropWhile (fun c => c != ' ')).drop 1
167-
let s := line.takeWhile (fun c => c != ' ')
167+
let s := (line.takeWhile (fun c => c != ' ')).toString
168168
let .some res := Result.ofConcise? s
169169
| throwError s!"{decl_name%} :: In file {fileName}, {s} is not a concise representation of a `Result`"
170170
let line := (line.dropWhile (fun c => c != ' ')).drop 1
171-
let s := line.takeWhile (fun c => c != ' ')
171+
let s := (line.takeWhile (fun c => c != ' ')).toString
172172
let .some time := String.toNat? s
173173
| throwError s!"{decl_name%} :: In file {fileName}, {s} is not a string representation of a Nat"
174174
let line := (line.dropWhile (fun c => c != ' ')).drop 1
175-
let s := line.takeWhile (fun c => c != ' ')
175+
let s := (line.takeWhile (fun c => c != ' ')).toString
176176
let .some hb := String.toNat? s
177177
| throwError s!"{decl_name%} :: In file {fileName}, {s} is not a string representation of a Nat"
178178
let line := (line.dropWhile (fun c => c != ' ')).drop 1
179-
let name := Name.parseUniqRepr line
179+
let name := Name.parseUniqRepr line.toString
180180
return (name, res, time, hb)
181181

182182
def runAutoOnNamesFile (cfg : EvalAutoConfig) (fname : String) : CoreM Unit := do
@@ -332,7 +332,7 @@ def readEATAResult (config : EvalAutoAsyncConfig) :
332332
let allFiles := (← System.FilePath.readDir resultFolder).map IO.FS.DirEntry.path
333333
let mut ret := #[]
334334
for file in allFiles do
335-
if !(← System.FilePath.isDir file) && file.toString.takeRight 7 == ".result" then
335+
if !(← System.FilePath.isDir file) && (file.toString.takeEnd 7).toString == ".result" then
336336
ret := ret.append (← readRunAutoOnConstsResult file.toString)
337337
return ret
338338

Auto/EvaluateAuto/TestTactics.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,15 @@ def readEvalTacticsAtModuleResult (resultFile : String) : CoreM (Array (Name ×
335335
where
336336
analyzeLine (fileName line : String) : CoreM (Name × Array (Result × Nat × Nat)) := do
337337
let line := (line.dropWhile (fun c => c != ' ')).drop 3
338-
let tr := (line.takeWhile (fun c => c != ']')).splitOn ", "
338+
let tr := ((line.takeWhile (fun c => c != ']')).toString.splitOn ", ")
339339
let tr : Array (Result × Nat × Nat) ← (Array.mk tr).mapM (fun s => do
340340
let [sr, st, sh] := s.splitOn " "
341-
| throwError "s!{decl_name%} :: In file {fileName}, {s} is not of the form `<result> <time> <heartbeats>`"
341+
| throwError s!"{decl_name%} :: In file {fileName}, {s} is not of the form `<result> <time> <heartbeats>`"
342342
match Result.ofConcise? sr, String.toNat? st, String.toNat? sh with
343343
| .some r, .some t, .some h => return (r, t, h)
344344
| _, _, _ => throwError s!"{decl_name%} :: In file {fileName}, {s} is not of the form `<result> <time> <heartbeats>`")
345345
let line := (line.dropWhile (fun c => c != ']')).drop 2
346-
let name := Name.parseUniqRepr line
346+
let name := Name.parseUniqRepr line.toString
347347
return (name, tr)
348348

349349
structure EvalTacticOnMathlibConfig where
@@ -493,9 +493,9 @@ def readETMHTResult (config : EvalTacticOnMathlibConfig) :
493493
let allPaths ← System.FilePath.walkDir resultFolder
494494
let mut ret := #[]
495495
for path in allPaths do
496-
if !(← System.FilePath.isDir path) && path.toString.takeRight 7 == ".result" then
496+
if !(← System.FilePath.isDir path) && path.toString.takeEnd 7 == ".result" then
497497
let content ← readEvalTacticsAtModuleResult path.toString
498-
let suffix := (path.toString.drop (resultFolder.length + 1)).dropRight 7
498+
let suffix := ((path.toString.drop (resultFolder.length + 1)).dropEnd 7).toString
499499
let modName := (suffix.splitOn "/").foldl (fun a b => Name.str a b) .anonymous
500500
ret := ret.push (modName, content)
501501
return ret
@@ -513,13 +513,13 @@ def readETMHTResultAllowNonRet (config : EvalTacticOnMathlibConfig) :
513513
let mut ret := #[]
514514
let mut nonRet := #[]
515515
for path in allPaths do
516-
if !(← System.FilePath.isDir path) && path.toString.takeRight 7 == ".result" then
516+
if !(← System.FilePath.isDir path) && path.toString.takeEnd 7 == ".result" then
517517
let raw ← IO.FS.readFile path
518518
if raw.length == 0 then
519-
nonRet := nonRet.push (path.toString.dropRight 7)
519+
nonRet := nonRet.push ((path.toString.dropEnd 7).toString)
520520
continue
521521
let content ← readEvalTacticsAtModuleResult path.toString
522-
let suffix := (path.toString.drop (resultFolder.length + 1)).dropRight 7
522+
let suffix := ((path.toString.drop (resultFolder.length + 1)).dropEnd 7).toString
523523
let modName := (suffix.splitOn "/").foldl (fun a b => Name.str a b) .anonymous
524524
ret := ret.push (modName, content)
525525
return (nonRet, ret)
@@ -579,8 +579,8 @@ def readETMHTEvaluateFiles (config : EvalTacticOnMathlibConfig) : CoreM (Array N
579579
if line.contains ':' then
580580
let [name, retCode] := line.splitOn ":"
581581
| throwError "{decl_name%} :: Unexpected line format, line content : `{line}`"
582-
let name := name.dropRight 1
583-
let retCode := retCode.drop 1
582+
let name := (name.dropEnd 1).toString
583+
let retCode := (retCode.drop 1).toString
584584
let some retCode := retCode.toNat?
585585
| throwError "{decl_name%} :: Unexpected line format, line content : `{line}`"
586586
retEnd := retEnd.push (str2Name name, retCode)

Auto/EvaluateAuto/TestTranslation.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ def readEvalMonoSizeResult (resultFile : String) : CoreM (Array (Name × Nat ×
9999
(Array.mk lines).mapM analyzeLine
100100
where analyzeLine (line : String) : CoreM (Name × Nat × Option Nat) := do
101101
let line := (line.dropWhile (fun c => c != ' ')).drop 1
102-
let rawSizeStr := line.takeWhile (fun c => c != ' ')
102+
let rawSizeStr := (line.takeWhile (fun c => c != ' ')).toString
103103
let line := (line.dropWhile (fun c => c != ' ')).drop 1
104104
let .some rawSize := rawSizeStr.toNat?
105105
| throwError "{decl_name%} :: {rawSizeStr} is not a string representation of a Nat"
106-
let monoSizeStr := line.takeWhile (fun c => c != ' ')
106+
let monoSizeStr := (line.takeWhile (fun c => c != ' ')).toString
107107
let line := (line.dropWhile (fun c => c != ' ')).drop 1
108108
let mut monoSize? : Option Nat := .none
109109
if monoSizeStr != "N" then
110110
let .some monoSize := monoSizeStr.toNat?
111111
| throwError "{decl_name%} :: {monoSizeStr} is not a string representation of a Nat"
112112
monoSize? := .some monoSize
113-
let name := Name.parseUniqRepr line
113+
let name := Name.parseUniqRepr line.toString
114114
return (name, rawSize, monoSize?)
115115

116116
/--

Auto/IR/SMT.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace IR.SMT
1414
def isSimpleSymbol (s : String) : Bool :=
1515
let symbSpecials := "~!@$%^&*_-+=<>.?/"
1616
let front := s.front.isAlpha || (symbSpecials.contains s.front)
17-
let body := s.all (fun c => c.isAlphanum || symbSpecials.contains c)
17+
let body := s.all (fun c => Char.isAlphanum c || symbSpecials.contains c)
1818
s.length != 0 && front && body
1919

2020
-- <index> ::= <numeral> | <symbol>

Auto/Parser/SMTParser.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ def LexVal.ofString (s : String) (attr : String) : LexVal :=
7575
let bdigs := s.drop 2
7676
.num (bdigs.foldl (fun x c => x * 2 + c.toNat - '0'.toNat) 0)
7777
| "string" =>
78-
let subs := ((s.drop 1).take (s.length - 2)).splitOn "\"\""
78+
let subs := ((s.drop 1).take (s.length - 2)).toString.splitOn "\"\""
7979
.str (String.intercalate "\"" subs)
8080
| "simplesymbol" => .symb s
81-
| "quotedsymbol" => .symb ((s.drop 1).take (s.length - 2))
82-
| "keyword" => .kw (s.drop 1)
81+
| "quotedsymbol" => .symb ((s.drop 1).take (s.length - 2)).toString
82+
| "keyword" => .kw (s.drop 1).toString
8383
| "comment" =>
8484
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
85-
.comment ((s.drop 1).take (s.length - 2 - rn))
85+
.comment ((s.drop 1).take (s.length - 2 - rn)).toString
8686
| "reserved" => .reserved s
8787
| "forall" => .reserved "forall"
8888
| "exists" => .reserved "exists"

Auto/Parser/TPTP.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def ident2StringConst (s : String) : Option StringConst :=
400400
match x, y.toNat? with
401401
| .some l, .some y' => .some (l.push (Char.ofNat y'))
402402
| _, _ => .none
403-
match s.take 9, (((s.drop 9).splitOn "d").drop 1).foldl foldFn (.some "") with
403+
match s.take 9, (((s.drop 9).toString.splitOn "d").drop 1).foldl foldFn (.some "") with
404404
| "t_strVal_", .some s => .some (.strVal s)
405405
| _, _ => .none
406406

@@ -428,7 +428,7 @@ open Embedding.Lam in
428428
def ident2BitVecConst (s : String) : Option BitVecConst :=
429429
match s.take 7 with
430430
| "t_bvVal" =>
431-
match (s.drop 7).splitOn "_" with
431+
match (s.drop 7).toString.splitOn "_" with
432432
| ["", ns, is] =>
433433
match ns.toNat?, is.toNat? with
434434
| .some n, .some i => .some (.bvVal n i)
@@ -550,35 +550,35 @@ def ident2BitVecConst (s : String) : Option BitVecConst :=
550550
| "ashr", .some n => .some (.bvsmtashr n)
551551
| _, _ => .none
552552
| "t_bvapp" =>
553-
match s.take 11, (s.drop 11).splitOn "_" with
553+
match s.take 11, (s.drop 11).toString.splitOn "_" with
554554
| "t_bvappend_", [ns, ms] =>
555555
match ns.toNat?, ms.toNat? with
556556
| .some n, .some m => .some (.bvappend n m)
557557
| _, _ => .none
558558
| _, _ => .none
559559
| "t_bvext" =>
560-
match s.take 12, (s.drop 12).splitOn "_" with
560+
match s.take 12, (s.drop 12).toString.splitOn "_" with
561561
| "t_bvextract_", [ns, hs, ls] =>
562562
match ns.toNat?, hs.toNat?, ls.toNat? with
563563
| .some n, .some h, .some l => .some (.bvextract n h l)
564564
| _, _, _ => .none
565565
| _, _ => .none
566566
| "t_bvrep" =>
567-
match s.take 11, (s.drop 11).splitOn "_" with
567+
match s.take 11, (s.drop 11).toString.splitOn "_" with
568568
| "t_bvrepeat_", [ws, is] =>
569569
match ws.toNat?, is.toNat? with
570570
| .some w, .some i => .some (.bvrepeat w i)
571571
| _, _ => .none
572572
| _, _ => .none
573573
| "t_bvzer" =>
574-
match s.take 15, (s.drop 15).splitOn "_" with
574+
match s.take 15, (s.drop 15).toString.splitOn "_" with
575575
| "t_bvzeroExtend_", [ws, vs] =>
576576
match ws.toNat?, vs.toNat? with
577577
| .some w, .some v => .some (.bvzeroExtend w v)
578578
| _, _ => .none
579579
| _, _ => .none
580580
| "t_bvsig" =>
581-
match s.take 15, (s.drop 15).splitOn "_" with
581+
match s.take 15, (s.drop 15).toString.splitOn "_" with
582582
| "t_bvsignExtend_", [ws, vs] =>
583583
match ws.toNat?, vs.toNat? with
584584
| .some w, .some v => .some (.bvsignExtend w v)

Auto/Tactic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def addTryThisTacticSeqSuggestion (ref : Syntax) (suggestion : TSyntax ``Lean.Pa
347347
where
348348
dedent (s : String) : String :=
349349
s.splitOn "\n"
350-
|>.map (λ line => dropPrefix? line.toSubstring " ".toSubstring |>.map (·.toString) |>.getD line)
350+
|>.map (λ line => dropPrefix? line.toRawSubstring " ".toRawSubstring |>.map (·.toString) |>.getD line)
351351
|> String.intercalate "\n"
352352

353353
open Embedding.Lam in

Auto/Translation/LamFOL2SMT.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def SMTNamingInfo.exprToSuggestion (e : Expr) : MetaM String := do
114114
return toString (← PrettyPrinter.formatTerm ppSyntax)
115115

116116
def SMTNamingInfo.suggestNameForSort (sni : SMTNamingInfo) (s : LamSort) := do
117-
let suggestion := ((← go s).take 1).toLower
117+
let suggestion := ((← go s).take 1).toString.toLower
118118
trace[auto.lamFOL2SMT.nameSuggestion] "`{suggestion}` for LamSort `{s}`"
119119
return suggestion
120120
where

lakefile.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ post_update pkg do
5757
let v := if args.contains "-q" || args.contains "--quiet" then Verbosity.quiet else v
5858
let v := if args.contains "-v" || args.contains "--verbose" then Verbosity.verbose else v
5959
let exitCode? ← LoggerIO.toBaseIO (cfg := {outLv := v.minLogLv}) <| ws.runLakeT do
60-
if let some pkg ← findPackage? __name__ then
60+
if let some pkg ← findPackageByKey? __name__ then
6161
let zipperpositionZipFile := pkg.buildDir / zipperposition.zip_name
6262
let zipperpositionExeFile := pkg.buildDir / zipperposition.exe_name
6363
if !(← zipperpositionExeFile.pathExists) then
@@ -69,4 +69,4 @@ post_update pkg do
6969
logError "package not found"
7070
return 1
7171
let exitCode := exitCode?.getD 1
72-
if exitCode = 0 then return () else error s!"{pkg.name}: failed to download/setup `zipperposition`"
72+
if exitCode = 0 then return () else error s!"{pkg.baseName}: failed to download/setup `zipperposition`"

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.26.0
1+
leanprover/lean4:v4.27.0-rc1

0 commit comments

Comments
 (0)