module Dyn.BigStepErasedDeterministic where
open import Data.Empty using (β₯; β₯-elim)
open import Data.Bool using (true; false) renaming (Bool to πΉ)
open import Data.Sum using (_β_; injβ; injβ)
open import Data.Product using (_Γ_; β; β-syntax; Ξ£; Ξ£-syntax) renaming (_,_ to β¨_,_β©)
open import Relation.Nullary using (Β¬_; Dec; yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Binary.PropositionalEquality using (_β‘_; _β’_; refl; trans; cong; sym)
open import Function using (case_of_)
open import Common.Utils
open import Common.SecurityLabels
open import Memory.Heap
open import Dyn.Syntax
open import Dyn.Values
open import Dyn.BigStepErased
ββ-deterministic : β {M ΞΌ ΞΌβ ΞΌβ pc} {Vβ Vβ}
β ΞΌ β£ pc β’ M ββ Vβ β£ ΞΌβ
β ΞΌ β£ pc β’ M ββ Vβ β£ ΞΌβ
β Vβ β‘ Vβ Γ ΞΌβ β‘ ΞΌβ
ββ-deterministic (ββ-val _) (ββ-val _) = β¨ refl , refl β©
ββ-deterministic (ββ-app LβΖN MβV N[V]βW) (ββ-app LβΖNβ MβVβ N[V]βWβ ) =
case ββ-deterministic LβΖN LβΖNβ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic N[V]βW N[V]βWβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-app LβΖN _ _) (ββ-app-β Lββ _) =
contradiction (ββ-deterministic LβΖN Lββ) (Ξ» ())
ββ-deterministic (ββ-app-β Lββ _) (ββ-app LβΖN _ _) =
contradiction (ββ-deterministic Lββ LβΖN) (Ξ» ())
ββ-deterministic (ββ-app-β Lββ MβV) (ββ-app-β Lβββ MβVβ ) =
case ββ-deterministic Lββ Lβββ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-if-true Lβtrue MβV) (ββ-if-true Lβtrueβ MβVβ ) =
case ββ-deterministic Lβtrue Lβtrueβ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-if-true Lβtrue _) (ββ-if-false Lβfalse _) =
contradiction (ββ-deterministic Lβtrue Lβfalse) (Ξ» ())
ββ-deterministic (ββ-if-true Lβtrue _) (ββ-if-β Lββ) =
contradiction (ββ-deterministic Lβtrue Lββ) (Ξ» ())
ββ-deterministic (ββ-if-false Lβfalse NβV) (ββ-if-false Lβfalseβ NβVβ ) =
case ββ-deterministic Lβfalse Lβfalseβ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic NβV NβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-if-false Lβfalse _) (ββ-if-true Lβtrue _) =
contradiction (ββ-deterministic Lβfalse Lβtrue) (Ξ» ())
ββ-deterministic (ββ-if-false Lβfalse _) (ββ-if-β Lββ) =
contradiction (ββ-deterministic Lβfalse Lββ) (Ξ» ())
ββ-deterministic (ββ-if-β Lββ) (ββ-if-true Lβtrue _) =
contradiction (ββ-deterministic Lββ Lβtrue ) (Ξ» ())
ββ-deterministic (ββ-if-β Lββ) (ββ-if-false Lβfalse _) =
contradiction (ββ-deterministic Lββ Lβfalse) (Ξ» ())
ββ-deterministic (ββ-if-β Lββ) (ββ-if-β Lβββ ) =
case ββ-deterministic Lββ Lβββ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-ref? MβV fresh _) (ββ-ref? MβVβ freshβ _) =
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β
case trans fresh (sym freshβ ) of Ξ» where
refl β β¨ refl , refl β©
ββ-deterministic (ββ-ref?-β MβV) (ββ-ref?-β MβVβ ) =
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-deref Mβa eq) (ββ-deref Mβaβ eqβ ) =
case ββ-deterministic Mβa Mβaβ of Ξ» where
β¨ refl , refl β© β
case trans (sym eq) eqβ of Ξ» where
refl β β¨ refl , refl β©
ββ-deterministic (ββ-deref Mβa _) (ββ-deref-β Mββ) =
contradiction (ββ-deterministic Mβa Mββ) (Ξ» ())
ββ-deterministic (ββ-deref-β Mββ) (ββ-deref Mβa _) =
contradiction (ββ-deterministic Mββ Mβa) (Ξ» ())
ββ-deterministic (ββ-deref-β Mββ) (ββ-deref-β Mβββ ) =
case ββ-deterministic Mββ Mβββ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-assign? Lβa MβV _) (ββ-assign? Lβaβ MβVβ _) =
case ββ-deterministic Lβa Lβaβ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©
ββ-deterministic (ββ-assign? Lβa _ _) (ββ-assign?-β Lββ _) =
contradiction (ββ-deterministic Lβa Lββ) (Ξ» ())
ββ-deterministic (ββ-assign?-β Lββ _) (ββ-assign? Lβa _ _) =
contradiction (ββ-deterministic Lββ Lβa) (Ξ» ())
ββ-deterministic (ββ-assign?-β Lββ MβV) (ββ-assign?-β Lβββ MβVβ ) =
case ββ-deterministic Lββ Lβββ of Ξ» where
β¨ refl , refl β© β
case ββ-deterministic MβV MβVβ of Ξ» where
β¨ refl , refl β© β β¨ refl , refl β©