diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-22 13:52:03 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-22 13:52:03 +0100 |
commit | 41d1c4a059466833325320e1d494d99af9d36cb2 (patch) | |
tree | 95807a9b73c8b380395c25c67f2a723396c6efb2 /src/Term/Semantics.idr | |
parent | 0ddaf1b2c9ca66cf0ae03d2f6ad792c7885dfc32 (diff) |
WIP: define semantics in Idris.semantics-with-proof
Diffstat (limited to 'src/Term/Semantics.idr')
-rw-r--r-- | src/Term/Semantics.idr | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Term/Semantics.idr b/src/Term/Semantics.idr index 2e61040..dd76f62 100644 --- a/src/Term/Semantics.idr +++ b/src/Term/Semantics.idr @@ -10,6 +10,7 @@ TypeOf : Ty -> Type TypeOf N = Nat TypeOf (ty ~> ty') = TypeOf ty -> TypeOf ty' +public export rec : Nat -> a -> (a -> a) -> a rec 0 x f = x rec (S k) x f = f (rec k x f) @@ -66,3 +67,8 @@ fullSem' (Rec (MakePair t (MakePair u v _ `Over` thin) _)) = do export sem : Term ty ctx -> All TypeOf ctx -> TypeOf ty sem t = runIdentity (sem' t) + +export +arb : (ty : Ty) -> TypeOf ty +arb N = 0 +arb (ty ~> ty') = const (arb ty') |