module Dyn.Noninterference 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 Data.List hiding ([_])
open import Relation.Nullary using (Β¬_; Dec; yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Binary.PropositionalEquality using (_β‘_; _β’_; refl; trans; subst; cong; sym)
open import Function using (case_of_)
open import Common.Utils
open import Common.SecurityLabels
open import Common.Types using (Base; Bool; rep)
open import Dyn.Syntax
open import Dyn.Values
open import Dyn.Erasure
open import Dyn.BigStep
open import Dyn.BigStepErased
open import Dyn.BigStepSimulation
open import Dyn.BigStepErasedDeterministic
open import Dyn.HeapSecure using (β
-sec)
noninterference : β {ΞΌβ ΞΌβ M} {bβ bβ bβ bβ : rep Bool}
β β
β£ low β’ M [ $ bβ of high ] β $ bβ of low β£ ΞΌβ
β β
β£ low β’ M [ $ bβ of high ] β $ bβ of low β£ ΞΌβ
β bβ β‘ bβ
noninterference {M = M} {bβ} {bβ} {bβ} {bβ} M[bβ]βbβ M[bβ]βbβ =
let Ο΅M[β]βΟ΅bβ = subst (Ξ» β‘ β _ β£ _ β’ β‘ ββ _ β£ _) (substitution-erase M ($ bβ of high))
(sim β
-sec M[bβ]βbβ)
Ο΅M[β]βΟ΅bβ = subst (Ξ» β‘ β _ β£ _ β’ β‘ ββ _ β£ _) (substitution-erase M ($ bβ of high))
(sim β
-sec M[bβ]βbβ) in
case ββ-deterministic Ο΅M[β]βΟ΅bβ Ο΅M[β]βΟ΅bβ of Ξ» where
β¨ refl , _ β© β refl