-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCastStructureABT.agda
38 lines (31 loc) · 1.24 KB
/
CastStructureABT.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
open import Data.Bool using (Bool; true; false)
open import Data.Nat using (ℕ; _≤_; _⊔_; _+_; _*_)
open import Data.Product using (_×_; proj₁; proj₂; Σ; Σ-syntax)
renaming (_,_ to ⟨_,_⟩)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Maybe using (Maybe; just; nothing)
open import Relation.Binary.PropositionalEquality
using (_≡_;_≢_; refl; trans; sym; cong; cong₂; cong-app)
open import Relation.Nullary using (¬_)
open import Types hiding (_⊔_)
open import PreCastStructure
open import Pow2
module CastStructureABT where
import ParamCastCalculusABT
import ParamCastAuxABT
-- import EfficientParamCastAux
record CastStruct : Set₁ where
field
precast : PreCastStruct
open PreCastStruct precast public
open ParamCastCalculusABT precast
open ParamCastAuxABT precast
field
applyCast : ∀ {Γ A B} → (V : Term) → Γ ⊢ V ⦂ A → Value V → (c : Cast (A ⇒ B))
→ {a : Active c} → Term
-- cast application is well-typed
applyCast-wt : ∀ {Γ A B} {V : Term} {c : Cast (A ⇒ B)}
→ (⊢V : Γ ⊢ V ⦂ A)
→ (v : Value V) → (a : Active c)
--------------------------------
→ Γ ⊢ applyCast V ⊢V v c {a} ⦂ B