diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-18 12:00:01 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-18 12:00:01 +0000 |
commit | b6fb551360b283c38b3ede9ef3e6d2922bd62b58 (patch) | |
tree | 84fbb185fcf3e29c09012fc75a6d394ba88e3e62 /src/Obs/Typing.idr | |
parent | 95de9b2913be536972f3921d41c24d9c0458c538 (diff) |
Add the True type.
Diffstat (limited to 'src/Obs/Typing.idr')
-rw-r--r-- | src/Obs/Typing.idr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Obs/Typing.idr b/src/Obs/Typing.idr index 95ffc19..22994ec 100644 --- a/src/Obs/Typing.idr +++ b/src/Obs/Typing.idr @@ -20,11 +20,13 @@ import Text.PrettyPrint.Prettyprinter.Render.Terminal -- invariant: all definitions fully expanded -- invariant: m |- t, u <- a : s convert : (t, u, a : NormalForm n) -> Sort -> Bool -convert t u a Prop = True +convert Irrel Irrel a Prop = True convert t u (Ntrl _) (Set k) = t == u +convert (Cnstr Top) (Cnstr Top) (Cnstr (Sort Prop)) (Set 0) = True convert (Ntrl t) u (Cnstr (Sort s)) (Set k) = Ntrl t == u convert t (Ntrl u) (Cnstr (Sort s)) (Set k) = t == Ntrl u convert (Cnstr (Sort s')) (Cnstr (Sort s'')) (Cnstr (Sort s)) (Set k) = s' == s'' +convert _ _ _ _ = False -- Typing Contexts ------------------------------------------------------------- @@ -71,6 +73,8 @@ check ctx tm ty s = do infer ctx (Var b i) = pure $ index ctx i infer ctx (Sort b s) = pure $ (Cnstr (Sort s), Cnstr (Sort (suc s)), suc (suc s)) +infer ctx (Top b) = pure $ (Cnstr Top, Cnstr (Sort Prop), Set 0) +infer ctx (Point b) = pure $ (Irrel, Cnstr Top, Prop) -- Checking Definitions and Blocks --------------------------------------------- |