-
Notifications
You must be signed in to change notification settings - Fork 2
/
Closed.agda
43 lines (34 loc) · 1.46 KB
/
Closed.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
{-# OPTIONS --rewriting #-}
-- Closed/intensional modality.
module Calf.Phase.Closed where
open import Calf.Prelude
open import Calf.CBPV
open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; subst)
open import Calf.Phase.Core
-- data ● (A : tp⁺) : tp⁺ where
-- η : A → ● A
-- ∗ : ext → ● A
-- η≡∗ : (a : A) (u : ext) → η a ≡ ∗ u
postulate
● : tp⁺ → tp⁺
η : val A → val (● A)
∗ : ext → val (● A)
η≡∗ : (a : val A) (u : ext) → η {A} a ≡ ∗ u
η≡∗/uni : {x x' : val (● A)} (p p' : x ≡ x') → p ≡ p'
●/ind : (a : val (● A)) (𝕁 : val (● A) → □)
(x0 : (a : val A) → 𝕁 (η a)) →
(x1 : (u : ext) → 𝕁 (∗ u)) →
((a : val A) → (u : ext) → subst (λ a → 𝕁 a) (η≡∗ a u) (x0 a) ≡ x1 u) →
𝕁 a
●/ind/β₁ : (a : val A) (𝕁 : val (● A) → □)
(x0 : (a : val A) → 𝕁 (η a)) →
(x1 : (u : ext) → 𝕁 (∗ u)) →
(h : (a : val A) → (u : ext) → subst (λ a → 𝕁 a) (η≡∗ a u) (x0 a) ≡ x1 u) →
●/ind (η a) 𝕁 x0 x1 h ≡ x0 a
{-# REWRITE ●/ind/β₁ #-}
●/ind/β₂ : (u : ext) (𝕁 : val (● A) → □)
(x0 : (a : val A) → 𝕁 (η a)) →
(x1 : (u : ext) → 𝕁 (∗ u)) →
(h : (a : val A) → (u : ext) → subst (λ a → 𝕁 a) (η≡∗ a u) (x0 a) ≡ x1 u) →
●/ind (∗ u) 𝕁 x0 x1 h ≡ x1 u
{-# REWRITE ●/ind/β₂ #-}