Compare commits

...

1 Commits

Author SHA1 Message Date
Leonardo de Moura
7c950fc96c chore: minor tweaks to Sym.simp test and benchmark
This PR applies two minor tweaks:
- `tests/bench/sym/simp_1.lean`: share-common the proof term before
  counting objects in `getProofSize`, so the reported size reflects
  the shared representation.
- `tests/elab/sym_simp_3.lean`: use `>>` instead of `.andThen` when
  composing `Sym.Simp` methods.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 23:00:47 +02:00
2 changed files with 4 additions and 2 deletions

View File

@@ -10,7 +10,9 @@ namespace SimpBench
def getProofSize (r : Sym.Simp.Result) : MetaM Nat :=
match r with
| .rfl _ _ => return 0
| .step _ p _ _ => p.numObjs
| .step _ p _ _ =>
let p := ShareCommon.shareCommon' p
p.numObjs
def checkWithKernel (r : Sym.Simp.Result) : MetaM Float := do
match r with

View File

@@ -5,7 +5,7 @@ elab "sym_simp" "[" declNames:ident,* "]" : tactic => do
let rewrite Sym.mkSimprocFor ( declNames.getElems.mapM fun s => realizeGlobalConstNoOverload s.raw) Sym.Simp.dischargeSimpSelf
let methods : Sym.Simp.Methods := {
pre := Sym.Simp.simpControl
post := Sym.Simp.evalGround.andThen rewrite
post := Sym.Simp.evalGround >> rewrite
}
liftMetaTactic1 fun mvarId => Sym.SymM.run do
let mvarId Sym.preprocessMVar mvarId