-
Notifications
You must be signed in to change notification settings - Fork 0
/
Terms.agda
85 lines (65 loc) · 1.45 KB
/
Terms.agda
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
open import Types
module Terms
(Label : Set)
where
open import Variables
infix 4 _⊢_
data _⊢_ : Context → Type → Set where
-- kind of a constructor
var : ∀ {Γ T}
→ Γ ∋ T
--------
→ Γ ⊢ T
-- constructors
sole : ∀ {Γ}
--------
→ Γ ⊢ ` U
lam : ∀ {Γ}
→ ∀ T1 T2
→ Γ , T1 ⊢ T2
-------------
→ Γ ⊢ ` T1 ⇒ T2
cons : ∀ {Γ T1 T2}
→ Γ ⊢ T1
→ Γ ⊢ T2
---------
→ Γ ⊢ ` T1 ⊗ T2
inl : ∀ {Γ T1 T2}
→ Γ ⊢ T1
--------
→ Γ ⊢ ` T1 ⊕ T2
inr : ∀ {Γ T1 T2}
→ Γ ⊢ T2
--------
→ Γ ⊢ ` T1 ⊕ T2
-- eliminators
app : ∀ {Γ T1 T2}
→ Γ ⊢ ` T1 ⇒ T2
→ Γ ⊢ T1
--------
→ Γ ⊢ T2
car : ∀ {Γ T1 T2}
→ Γ ⊢ ` T1 ⊗ T2
---------------
→ Γ ⊢ T1
cdr : ∀ {Γ T1 T2}
→ Γ ⊢ ` T1 ⊗ T2
---------------
→ Γ ⊢ T2
case : ∀ {Γ T1 T2 T3}
→ Γ ⊢ ` T1 ⊕ T2
→ Γ ⊢ ` T1 ⇒ T3
→ Γ ⊢ ` T2 ⇒ T3
----------------
→ Γ ⊢ T3
-- kind of an eliminator
cast : ∀ {Γ}
→ (l : Label)
→ (T1 T2 : Type)
→ Γ ⊢ T1
--------
→ Γ ⊢ T2
blame : ∀ {Γ T}
→ (l : Label)
---
→ Γ ⊢ T