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.
38 lines
982 B
Lean4
38 lines
982 B
Lean4
import Lean
|
|
|
|
open Lean Meta
|
|
|
|
def gen (declName : Name) : MetaM Unit := do
|
|
let info ← getConstInfo declName
|
|
IO.println (← ppExpr info.type)
|
|
IO.println "---"
|
|
forallTelescope info.type (cleanupAnnotations := true) fun xs type => do
|
|
let r ← mkForallFVars xs type
|
|
IO.println (← ppExpr r)
|
|
|
|
/--
|
|
info: {coll : Type u} →
|
|
{idx : Type v} →
|
|
{elem : outParam (Type w)} →
|
|
{valid : outParam (coll → idx → Prop)} →
|
|
[self : GetElem coll idx elem valid] → (xs : coll) → (i : idx) → valid xs i → elem
|
|
---
|
|
{coll : Type u} →
|
|
{idx : Type v} →
|
|
{elem : Type w} →
|
|
{valid : coll → idx → Prop} → [self : GetElem coll idx elem valid] → (xs : coll) → (i : idx) → valid xs i → elem
|
|
-/
|
|
#guard_msgs in
|
|
#eval gen ``GetElem.getElem
|
|
|
|
def f (x := 0) (_ : x = x := by rfl) : Nat := x+1
|
|
|
|
|
|
/--
|
|
info: (x : optParam Nat 0) → autoParam (x = x) f._auto_1 → Nat
|
|
---
|
|
(x : Nat) → x = x → Nat
|
|
-/
|
|
#guard_msgs in
|
|
#eval gen ``f
|