31 lines
1004 B
Lean4
31 lines
1004 B
Lean4
|
|
import BidirTT
|
||
|
|
|
||
|
|
open BidirTT
|
||
|
|
|
||
|
|
def runOne (label : String) (r : Raw) : IO Unit := do
|
||
|
|
match checkTop r with
|
||
|
|
| .ok (t, ty) =>
|
||
|
|
IO.println s!"[ok] {label}"
|
||
|
|
IO.println s!" term : {BidirTT.prettyTm t}"
|
||
|
|
match quote 0 ty with
|
||
|
|
| Except.ok qt =>
|
||
|
|
IO.println s!" type : {BidirTT.prettyTm qt}"
|
||
|
|
| Except.error err =>
|
||
|
|
IO.println s!" type : <error: {err}>"
|
||
|
|
| .error e =>
|
||
|
|
IO.println s!"[err] {label}: {e}"
|
||
|
|
|
||
|
|
def main : IO Unit := do
|
||
|
|
runOne "U0" Examples.univ0
|
||
|
|
runOne "id" Examples.idAnn
|
||
|
|
runOne "const" Examples.constAnn
|
||
|
|
runOne "swap" Examples.swapAnn
|
||
|
|
runOne "depPair" Examples.depPairAnn
|
||
|
|
runOne "depPair.1" Examples.fstDepPair
|
||
|
|
runOne "depPair.2" Examples.sndDepPair
|
||
|
|
runOne "let universe" Examples.letUniverse
|
||
|
|
runOne "omega (bad)" Examples.omegaAnn
|
||
|
|
runOne "unknown var" Examples.unknownVar
|
||
|
|
runOne "pair mismatch" Examples.pairMismatch
|
||
|
|
runOne "bad fst" Examples.badFst
|