Skip to content

Commit

Permalink
feat: some debug traces
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX committed Nov 3, 2024
1 parent d174491 commit 48e5eb2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Leanwuzla.lean
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,27 @@ def bvCompare (g : MVarId) (solverPath : System.FilePath) (cfg : TacticContext)
|>.setBool `trace.Meta.Tactic.bv true
|>.setBool `trace.Meta.Tactic.sat true
|>.setNat `trace.profiler.threshold 1
withOptions setTraceOptions do
trace[Meta.Tactic.bv] "running bitwuzla"
let bitwuzlaPerf ←
withoutModifyingEnv <| withoutModifyingState do
resetTraceState
withOptions setTraceOptions <| withoutModifyingEnv <| withoutModifyingState <| withoutModifyingTraceState do
let g' ← mkFreshExprMVar (← g.getType)
evalBitwuzla g'.mvarId! solverPath

let (g', leansatPerf) ← evalLeanSat g cfg
resetTraceState
trace[Meta.Tactic.bv] "running leansat"

let (g', leansatPerf) ←
withOptions setTraceOptions <| withoutModifyingTraceState do
evalLeanSat g cfg

trace[Meta.Tactic.bv] "finished measuring"
return (g', { bitwuzlaPerf, leansatPerf })
where
withoutModifyingTraceState {α : Type} (x : MetaM α) : MetaM α := do
let traces ← getTraceState
resetTraceState
let ret ← x
setTraceState traces
return ret

@[tactic bvCompare]
def evalBvCompare : Tactic := fun
Expand Down

0 comments on commit 48e5eb2

Please sign in to comment.