open import Common.Types
module CC2.Syntax where
open import Data.List
open import Data.Bool renaming (Bool to πΉ)
open import Syntax
open import Common.BlameLabels
open import Common.Coercions public
open import LabelExpr.LabelExpr
renaming (blame to bl; Irreducible to Ir;
Progress to Progressβ; progress to progressβ; β’_β_β_β_ to _β_β_β_)
hiding (_β; _βββ¨_β©_) public
open import Memory.Addr
data Op : Set where
op-addr : (n : RawAddr) β Op
op-lam : Op
op-app : (A B : Type) β (β : StaticLabel) β Op
op-appβ : (A : Type) β (T : RawType) β Op
op-const : β {ΞΉ} (k : rep ΞΉ) β Op
op-if : (A : Type) β (β : StaticLabel) β Op
op-ifβ : (T : RawType) β Op
op-let : (A : Type) β Op
op-ref : (β : StaticLabel) β Op
op-ref? : (β : StaticLabel) β (p : BlameLabel) β Op
op-deref : (A : Type) β (β : StaticLabel) β Op
op-derefβ : (T : RawType) β Op
op-assign : (T : RawType) β (βΜ β : StaticLabel) β Op
op-assign? : (T : RawType) β (gΜ : Label) β BlameLabel β Op
op-cast : β {A B} β Cast A β B β Op
op-prot : β (A : Type) β (PC : LExpr) β LVal PC
β (β : StaticLabel) β Op
op-blame : BlameLabel β Op
op-opaque : Op
sig : Op β List Sig
sig (op-addr n) = []
sig op-lam = (Ξ½ β ) β· []
sig (op-app A B β) = β β· β β· []
sig (op-appβ A B) = β β· β β· []
sig (op-const k) = []
sig (op-if A β) = β β· β β· β β· []
sig (op-ifβ A) = β β· β β· β β· []
sig (op-let A) = β β· (Ξ½ β ) β· []
sig (op-ref β) = β β· []
sig (op-ref? β p) = β β· []
sig (op-deref A β) = β β· []
sig (op-derefβ A) = β β· []
sig (op-assign T βΜ β) = β β· β β· []
sig (op-assign? T gΜ p) = β β· β β· []
sig (op-cast c) = β β· []
sig (op-prot A PC v β) = β β· []
sig (op-blame p) = []
sig op-opaque = []
open Syntax.OpSig Op sig renaming (ABT to Term; plug to plug-abt; βͺ_β« to β¦
_β¦) public
infix 8 _β¨_β©
pattern addr n = (op-addr n) β¦
nil β¦
pattern Ζ N = (op-lam) β¦
cons (bind (ast N)) nil β¦
pattern app L M A B β = (op-app A B β) β¦
cons (ast L) (cons (ast M) nil) β¦
pattern appβ L M A T = (op-appβ A T) β¦
cons (ast L) (cons (ast M) nil) β¦
pattern $_ k = (op-const k) β¦
nil β¦
pattern if L A β M N = (op-if A β) β¦
cons (ast L) (cons (ast M) (cons (ast N) nil)) β¦
pattern ifβ L T M N = (op-ifβ T) β¦
cons (ast L) (cons (ast M) (cons (ast N) nil)) β¦
pattern `let M A N = (op-let A) β¦
cons (ast M) (cons (bind (ast N)) nil) β¦
pattern refβ¦_β§ β M = (op-ref β) β¦
cons (ast M) nil β¦
pattern ref?β¦_β§ β M p = (op-ref? β p) β¦
cons (ast M) nil β¦
pattern ! M A g = (op-deref A g) β¦
cons (ast M) nil β¦
pattern !β M T = (op-derefβ T) β¦
cons (ast M) nil β¦
pattern assign L M T βΜ β = (op-assign T βΜ β) β¦
cons (ast L) (cons (ast M) nil) β¦
pattern assign? L M T gΜ p = (op-assign? T gΜ p) β¦
cons (ast L) (cons (ast M) nil) β¦
pattern _β¨_β© M c = (op-cast c) β¦
cons (ast M) nil β¦
pattern prot PC v β M A = (op-prot A PC v β) β¦
cons (ast M) nil β¦
pattern blame p = (op-blame p) β¦
nil β¦
pattern β = op-opaque β¦
nil β¦