-
Notifications
You must be signed in to change notification settings - Fork 0
/
value-judgements.agda
58 lines (52 loc) · 1.65 KB
/
value-judgements.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
open import Bool
open import Prelude
open import core
module value-judgements where
-- these judgements are placed into their own module separate from the
-- final and indet judgements in order to break some dependency cycles
-- e is a value
data _val : (e : ihexp) → Set where
VUnit : unit val
VNum : ∀{n} →
(N n) val
VLam : ∀{x τ e} →
(·λ x ·[ τ ] e) val
VInl : ∀{e τ} →
e val →
(inl τ e) val
VInr : ∀{e τ} →
e val →
(inr τ e) val
VPair : ∀{e1 e2} →
e1 val →
e2 val →
⟨ e1 , e2 ⟩ val
-- e cannot be a value statically
data _notintro : (e : ihexp) → Set where
NVAp : ∀{e1 e2} →
(e1 ∘ e2) notintro
NVMatch : ∀{e τ rs} →
(match e ·: τ of rs) notintro
NVFst : ∀{e} →
(fst e) notintro
NVSnd : ∀{e} →
(snd e) notintro
NVEHole : ∀{u σ} →
⦇-⦈⟨ u , σ ⟩ notintro
NVHole : ∀{e u σ} →
⦇⌜ e ⌟⦈⟨ u , σ ⟩ notintro
val-notintro-not : ∀{e} →
e val →
e notintro →
⊥
val-notintro-not VNum ()
val-notintro-not VLam ()
val-notintro-not (VInl eval) ()
val-notintro-not (VInr eval) ()
val-notintro-not (VPair eval1 eval2) ()
notintro-pair-not : ∀{e} →
e notintro →
(e1 e2 : ihexp) →
e == ⟨ e1 , e2 ⟩ →
⊥
notintro-pair-not () e1 e2 refl