Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PratherConid committed Jan 7, 2025
1 parent 2e43ab8 commit ce5671f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Auto/EvaluateAuto/TestAuto.lean
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ def Array.groupBySize (xs : Array α) (size : Nat) : Option (Array (Array α)) :
let ret := Array.mk <| (List.range n).map (fun i => Array.mk <| (xs.toList.drop (size * i)).take size)
some ret

/--
This should be run after `import Mathlib, import Auto.EvaluateAuto.TestTactics`,
and should be run with a `cwd` where `lake env` creates an environment in which
`Mathlib` and `lean-auto` are available
-/
def evalAutoAtMathlibHumanTheorems (config : EvalAutoOnMathlibConfig) : CoreM Unit := do
if !(← System.FilePath.isDir config.resultFolder) then
IO.FS.createDir config.resultFolder
Expand All @@ -214,7 +219,7 @@ def evalAutoAtMathlibHumanTheorems (config : EvalAutoOnMathlibConfig) : CoreM Un
evaluateFilesHandle.putStrLn (toString idx)
evaluateFilesHandle.flush
let evalProc ← EvalProc.create "lake" #["env", "lean", "--stdin"]
let logPath := config.resultFolder ++ toString idx
let logPath := config.resultFolder ++ "/" ++ toString idx
evalProc.stdin.putStr (evalFile batch logPath)
let (_, evalProc) ← evalProc.takeStdin
running := running.push (idx, evalProc)
Expand Down Expand Up @@ -248,7 +253,7 @@ where
"import Auto.Tactic",
"open Lean EvalAuto",
"",
"def thms : Std.HashSet Name := Std.HashSet.ofList ["
"def thms : Array Name := #["
] ++ thmsStrs ++ [
"]",
"",
Expand Down
5 changes: 3 additions & 2 deletions Auto/EvaluateAuto/TestTactics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ structure EvalTacticOnMathlibConfig where
nthreads : Nat

/--
This should be run after `import Mathlib`, and should be run with a `cwd` where
`lake env` creates an environment in which `Mathlib` and `lean-auto` are available
This should be run after `import Mathlib` and `import Auto.EvaluateAuto.TestTactics`,
and should be run with a `cwd` where `lake env` creates an environment in which
`Mathlib` and `lean-auto` are available
-/
def evalTacticsAtMathlibHumanTheorems (config : EvalTacticOnMathlibConfig) : CoreM Unit := do
let mms ← mathlibModules
Expand Down

0 comments on commit ce5671f

Please sign in to comment.