Skip to content

Commit

Permalink
move time tactic to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
lecopivo committed Jun 18, 2024
1 parent 3f5d37d commit d24fec2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 10 additions & 0 deletions SciLean/Tactic/TimeTactic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Lean
import Aesop

open Lean Meta Elab Term Tactic Conv in
elab "time_tactic" t:conv : conv => do

let target ← getMainTarget
let ((targetNew, proof),time) ← Aesop.time <| convert target (withTacticInfoContext (← getRef) (evalTactic t))
liftMetaTactic1 fun mvarId => mvarId.replaceTargetEq targetNew proof
IO.println s!"tactic {t.raw.prettyPrint} took {time.printAsMillis}"
8 changes: 0 additions & 8 deletions test/lsimp_basic_tests.lean
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ open SciLean
-- set_option trace.Meta.Tactic.simp.steps true


open Lean Meta Elab Term Tactic Conv in
elab "timeTactic" t:conv : conv => do

let target ← getMainTarget
let ((targetNew, proof),time) ← Aesop.time <| convert target (withTacticInfoContext (← getRef) (evalTactic t))
liftMetaTactic1 fun mvarId => mvarId.replaceTargetEq targetNew proof
IO.println s!"tactic {t.raw.prettyPrint} took {time.printAsMillis}"


#check (∇ x : Float, let y := x * x; x * y)
rewrite_by
Expand Down

0 comments on commit d24fec2

Please sign in to comment.