diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2021-03-05 14:59:58 +0000 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2021-03-05 14:59:58 +0000 |
commit | 8fa61609ca049d960922128f32d7509e4055227d (patch) | |
tree | 8f1aa5de7a0b24dc410e5fe3662893546a2302d7 | |
parent | 29c4bfe1440efb1de1ed6d000fcc1cd73dc26f12 (diff) |
Add base types and operators
-rw-r--r-- | src/Cfe/Type/Base.agda | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/Cfe/Type/Base.agda b/src/Cfe/Type/Base.agda index ea4a657..90506b7 100644 --- a/src/Cfe/Type/Base.agda +++ b/src/Cfe/Type/Base.agda @@ -6,13 +6,15 @@ module Cfe.Type.Base {c ā} (over : Setoid c ā) where -open Setoid over using () renaming (Carrier to C) +open Setoid over using () renaming (Carrier to C; _ā_ to _ā¼_) open import Cfe.Language over -open import Data.Bool -open import Level renaming (suc to lsuc) -open import Relation.Unary +open import Data.Bool as š¹ hiding (_āØ_) +open import Level as L renaming (suc to lsuc) +open import Relation.Unary as U +infix 7 _ā_ +infix 6 _āØ_ infix 4 _āØ_ record Type fā lā : Set (c ā lsuc (fā ā lā)) where @@ -23,6 +25,29 @@ record Type fā lā : Set (c ā lsuc (fā ā lā)) where open Type public +Ļā„ : Type 0ā 0ā +Ļā„ = record { Null = false ; First = U.ā
; Flast = U.ā
} + +Ļε : Type 0ā 0ā +Ļε = record { Null = true ; First = U.ā
; Flast = U.ā
} + +Ļ[_] : C ā Type ā 0ā +Ļ[ c ] = record { Null = false ; First = c ā¼_ ; Flast = U.ā
} + +_āØ_ : ā {fāā lāā fāā lāā} ā Type fāā lāā ā Type fāā lāā ā Type (fāā ā fāā) (lāā ā lāā) +Ļā ⨠Ļā = record + { Null = Null Ļā š¹.⨠Null Ļā + ; First = First Ļā āŖ First Ļā + ; Flast = Flast Ļā āŖ Flast Ļā + } + +_ā_ : ā {fāā lāā fāā lāā} ā Type fāā lāā ā Type fāā lāā ā Type (fāā ā fāā) (lāā ā fāā ā lāā) +_ā_ {lāā = lāā} {fāā} {lāā} Ļā Ļā = record + { Null = Null Ļā ā§ Null Ļā + ; First = First Ļā āŖ (if Null Ļā then First Ļā else Ī» x ā L.Lift fāā (x U.ā U.ā
)) + ; Flast = Flast Ļā āŖ (if Null Ļā then First Ļā āŖ Flast Ļā else Ī» x ā L.Lift (lāā ā fāā) (x U.ā U.ā
)) + } + record _āØ_ {a} {aā} {fā} {lā} (A : Language a aā) (Ļ : Type fā lā) : Set (c ā a ā fā ā lā) where field nān : null A ā T (Null Ļ) |