mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
34 lines
1.0 KiB
Lean4
34 lines
1.0 KiB
Lean4
import Lean
|
|
open Lean Meta Elab Tactic
|
|
|
|
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.simpTelescope
|
|
post := Sym.Simp.evalGround.andThen rewrite
|
|
}
|
|
liftMetaTactic1 fun mvarId => Sym.SymM.run do
|
|
let mvarId ← Sym.preprocessMVar mvarId
|
|
(← Sym.simpGoal mvarId methods).toOption
|
|
|
|
set_option warn.sorry false
|
|
|
|
/-!
|
|
Recall that `simpTelescope` does not simplify the body of a telescope.
|
|
This is why `0 + x = 0 + id x` is not simplified in the following example.
|
|
-/
|
|
/--
|
|
trace: p q : Prop
|
|
⊢ q →
|
|
∀ (x : Nat),
|
|
p →
|
|
have x := x;
|
|
have y := x;
|
|
x = y → 0 + x = 0 + id x
|
|
-/
|
|
#guard_msgs in
|
|
example (p q : Prop) : q → ∀ x : Nat, p ∧ True → have x := 0 + x; have y := x; True → x = 0 + 0 + id y → 0 + x = 0 + id x := by
|
|
sym_simp [and_true, Nat.zero_add, id_eq]
|
|
trace_state
|
|
admit
|