Files
iris/Main.lean
T

38 lines
1.3 KiB
Lean4
Raw Normal View History

2026-04-19 04:17:45 +00:00
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 "nat fold id" Examples.natFoldId
runOne "unit elim" Examples.unitToNat
runOne "empty absurd" Examples.absurdNat
runOne "refl zero" Examples.reflZero
runOne "id elim" Examples.idElimNat
2026-04-19 04:17:45 +00:00
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
runOne "bad succ" Examples.badSucc
runOne "bad refl" Examples.badRefl