a few tests

This commit is contained in:
rhiannon morris 2023-03-27 00:08:48 +02:00
parent 7d36a7ff54
commit 37dd1ee76d

View file

@ -33,6 +33,8 @@ parameters (0 d : Nat) (ctx : TyContext Three d n)
subTD, equalTD : Term Three d n -> Term Three d n -> Term Three d n -> M () subTD, equalTD : Term Three d n -> Term Three d n -> Term Three d n -> M ()
subTD ty s t = Term.sub ctx ty s t subTD ty s t = Term.sub ctx ty s t
equalTD ty s t = Term.equal ctx ty s t equalTD ty s t = Term.equal ctx ty s t
equalTyD : Term Three d n -> Term Three d n -> M ()
equalTyD s t = Term.equalType ctx s t
subED, equalED : Elim Three d n -> Elim Three d n -> M () subED, equalED : Elim Three d n -> Elim Three d n -> M ()
subED e f = Elim.sub ctx e f subED e f = Elim.sub ctx e f
@ -42,6 +44,8 @@ parameters (ctx : TyContext Three 0 n)
subT, equalT : Term Three 0 n -> Term Three 0 n -> Term Three 0 n -> M () subT, equalT : Term Three 0 n -> Term Three 0 n -> Term Three 0 n -> M ()
subT = subTD 0 ctx subT = subTD 0 ctx
equalT = equalTD 0 ctx equalT = equalTD 0 ctx
equalTy : Term Three 0 n -> Term Three 0 n -> M ()
equalTy = equalTyD 0 ctx
subE, equalE : Elim Three 0 n -> Elim Three 0 n -> M () subE, equalE : Elim Three 0 n -> Elim Three 0 n -> M ()
subE = subED 0 ctx subE = subED 0 ctx
@ -418,6 +422,14 @@ tests = "equality & subtyping" :- [
(F "f") (F "f")
], ],
"natural type" :- [
testEq " = " $ equalTy empty Nat Nat,
testEq " = : ★₀" $ equalT empty (TYPE 0) Nat Nat,
testEq " = : ★₆₉" $ equalT empty (TYPE 69) Nat Nat,
testNeq " ≠ {}" $ equalTy empty Nat (enum []),
testEq "0=1 ⊢ = {}" $ equalTy empty01 Nat (enum [])
],
"natural numbers" :- [ "natural numbers" :- [
testEq "zero = zero" $ equalT empty Nat Zero Zero, testEq "zero = zero" $ equalT empty Nat Zero Zero,
testEq "succ two = succ two" $ testEq "succ two = succ two" $