{-# OPTIONS --allow-unsolved-metas #-}
module A201602.Try5 where
open import Data.Fin using (Fin; zero; suc; toβ)
open import Data.Nat using (β; zero; suc; _+_)
open import Data.Product using (Ξ£; _Γ_; _,_)
data Vec (X : Set) : β β Set where
β
: Vec X zero
_,_ : β{n} β Vec X n β X β Vec X (suc n)
data _β_ {X : Set} : β{n} β X β Vec X n β Set where
Z : β{n x} {xs : Vec X n}
β x β (xs , x)
S_ : β{n x y} {xs : Vec X n}
β x β xs
β x β (xs , y)
data Pr : Set where
β₯ : Pr
PCx : β β Set
PCx = Vec Pr
infixr 1 _β_
data Ty {m : β} (Ξ : PCx m) : Set where
π_ : β{P} β P β Ξ β Ty Ξ
_β_ : Ty Ξ β Ty Ξ β Ty Ξ
β _ : Ty Ξ β Ty Ξ
TCx : β{m} β PCx m β β β Set
TCx Ξ = Vec (Ty Ξ)
infixl 4 _β_
infixr 3 π_
infixr 0 _β’_
data _β’_ {m n : β} {Ξ : PCx m} (Ξ : TCx Ξ n) : Ty Ξ β Set where
π£_ : β{A} β A β Ξ β Ξ β’ A
π_ : β{A B} β (Ξ , A) β’ B β Ξ β’ (A β B)
_β_ : β{A B} β Ξ β’ (A β B) β Ξ β’ A β Ξ β’ B
infixr 0 β©_
β©_ : Ty β
β Set
β©_ A = β{n} {Ξ : TCx β
n} β Ξ β’ A
F : β{m} (Ξ : PCx m) β Ty Ξ β Set
F Ξ A = β{n} {Ξ : TCx Ξ n} β Ξ β’ A
tI : β{A} β β© A β A
tI = π π£ Z
tK : β{A B} β β© A β B β A
tK = π π π£ S Z
tS : β{A B C} β β© (A β B β C) β (A β B) β A β C
tS = π π π (π£ S S Z β π£ Z) β (π£ S Z β π£ Z)
tJ : β{x} β F (β
, x) (β π Z)
tJ = {!!}