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.
32 lines
713 B
Lean4
32 lines
713 B
Lean4
import Lean.Meta.Tactic.Grind
|
||
import Lean.Elab.Tactic
|
||
|
||
structure A (α : Type u) where
|
||
x : α
|
||
y : α
|
||
f : α → α
|
||
|
||
structure B (α : Type u) extends A α where
|
||
z : α
|
||
b : Bool
|
||
|
||
open Lean Meta Elab Tactic
|
||
elab "fold_projs" : tactic => liftMetaTactic1 fun mvarId => do
|
||
mvarId.replaceTargetDefEq (← Grind.foldProjs (← mvarId.getType))
|
||
|
||
example (a : Nat × Bool) : a.fst = 10 := by
|
||
unfold Prod.fst
|
||
fail_if_success guard_target =ₛ a.fst = 10
|
||
fold_projs
|
||
guard_target =ₛ a.fst = 10
|
||
sorry
|
||
|
||
example (b : B (List Nat)) : b.y = [] := by
|
||
unfold B.toA
|
||
unfold A.y
|
||
fail_if_success unfold A.y
|
||
fail_if_success guard_target =ₛ b.y = []
|
||
fold_projs
|
||
guard_target =ₛ b.y = []
|
||
sorry
|