diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-06 12:25:26 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-06 12:25:26 +0100 |
commit | bf07a9fe3ee4ff06fe186e33221f7f91871b9217 (patch) | |
tree | ac9597b4ad38a354aec3d6edc8b712179bd23b9c /src/NormalForm.idr | |
parent | d5f8497dbb6de72d9664f48d6acbc9772de77be3 (diff) |
Write an encoding for data types.
Diffstat (limited to 'src/NormalForm.idr')
-rw-r--r-- | src/NormalForm.idr | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/NormalForm.idr b/src/NormalForm.idr deleted file mode 100644 index ea3b2c0..0000000 --- a/src/NormalForm.idr +++ /dev/null @@ -1,51 +0,0 @@ -module NormalForm - -import Data.SnocList.Elem -import Term -import Thinning - --- Neutrals and Normals -------------------------------------------------------- - -public export -data IsNeutral : Term ctx ty -> Type -public export -data IsNormal : Term ctx ty -> Type - -data IsNeutral where - Var : IsNeutral (Var i) - App : IsNeutral t -> IsNormal u -> IsNeutral (App t u) - Rec : IsNeutral t -> IsNormal u -> IsNormal v -> IsNeutral (Rec t u v) - -data IsNormal where - Ntrl : IsNeutral t -> IsNormal t - Abs : IsNormal t -> IsNormal (Abs t) - Zero : IsNormal Zero - Succ : IsNormal t -> IsNormal (Succ t) - -%name IsNeutral prf -%name IsNormal prf - -public export -record Normal (ctx : SnocList Ty) (ty : Ty) where - constructor MkNormal - forget : Term ctx ty - 0 isNormal : IsNormal forget - -%name Normal n, m, k - --- Inversions ------------------------------------------------------------------ - -export -Uninhabited (IsNormal (Sub t sub)) where uninhabited (Ntrl prf) impossible - -export -predNorm : IsNormal (Succ t) -> IsNormal t -predNorm (Succ prf) = prf - -export -appNtrl : IsNormal (App t u) -> IsNeutral (App t u) -appNtrl (Ntrl prf) = prf - -export -recNtrl : IsNormal (Rec t u v) -> IsNeutral (Rec t u v) -recNtrl (Ntrl prf) = prf |