-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.lagda
51 lines (36 loc) · 1.06 KB
/
Common.lagda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\section{Types}
\begin{code}
open import Data.List using (List; _∷_)
infixr 7 _⇒_
infix 4 _∋_
infix 9 S_
data Type : Set where
`ℕ : Type
_⇒_ : Type → Type → Type
\end{code}
\section{Contexts}
Rather than define the context from scratch like in PLFA, I use lists so that I do not have to define the su-blist (or sub-context) relation from scratch.
\begin{code}
Context : Set
Context = List Type
\end{code}
\section{Variables and the lookup judgment}
\begin{code}
data _∋_ : Context → Type → Set where
Z : ∀ {Γ A}
---------
→ A ∷ Γ ∋ A
S_ : ∀ {Γ A B}
→ Γ ∋ B
---------
→ A ∷ Γ ∋ B
\end{code}
\section{Type synonims}
\begin{code}
Renaming : Context → Context → Set
Renaming Γ Δ = ∀ {C} → Γ ∋ C → Δ ∋ C
Rebasing : (Context → Type → Set) → Context → Context → Set
Rebasing ⊢ Γ Δ = ∀ {C} → ⊢ Γ C → ⊢ Δ C
Substitution : (Context → Type → Set) → Context → Context → Set
Substitution ⊢ Γ Δ = ∀ {C} → Γ ∋ C → ⊢ Δ C
\end{code}