Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PratherConid committed Jan 6, 2025
1 parent ec1e82e commit 6886c60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Auto/EvaluateAuto/Result.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ inductive Result
| subGoals
| exception (e : Exception)

instance : Inhabited Result where
default := .success

instance : ToMessageData Result where
toMessageData : Result → MessageData
| .success => "Result.success"
Expand All @@ -36,7 +39,7 @@ def Result.concise : Result → String
| .nonterminate => "T"
| .subGoals => "G"
| .exception _ => "E"
#check Exception

def Result.ofConcise? : String → Option Result
| "S" => .some .success
| "N" => .some .nonProp
Expand Down
7 changes: 4 additions & 3 deletions Auto/EvaluateAuto/TestTactics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,10 @@ def readTacticEvalResult (config : EvalTacticOnMathlibConfig) :
if !(← System.FilePath.isDir path) && path.toString.takeRight 7 == ".result" then
let suffix := (path.toString.drop (resultFolder.length + 1)).dropRight 7
let modName := (suffix.splitOn "/").foldl (fun a b => Name.str a b) .anonymous
let lines := (← IO.FS.readFile path).splitOn "\n"
if lines[3]? != .some "Summary:" || lines[4]? != .some "" then
throwError "{decl_name%} :: Format of result file changed, please change analysis code"
let content ← IO.FS.readFile path
let lines := content.splitOn "\n"
if lines[2]? != .some "Summary:" || lines[3]? != .some "" then
throwError "{decl_name%} :: Format of result file changed, please change analysis code. Result file : {path}"
let lines := (lines.drop 4).filter (fun s => s != "")
let lineAnalysis ← (Array.mk lines).mapM analyzeLine
ret := ret.push (modName, lineAnalysis)
Expand Down

0 comments on commit 6886c60

Please sign in to comment.