-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c774160
commit 9a8e7a6
Showing
3 changed files
with
70 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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) _auto✝ → Nat | ||
--- | ||
(x : Nat) → x = x → Nat | ||
-/ | ||
#guard_msgs in | ||
#eval gen ``f |