module CoercionExpr.SimBackBlame where open import Data.Nat open import Data.Unit using (β€; tt) open import Data.Bool using (true; false) renaming (Bool to πΉ) open import Data.List hiding ([_]) open import Data.Product renaming (_,_ to β¨_,_β©) open import Data.Sum using (_β_) open import Data.Maybe open import Relation.Nullary using (Β¬_; Dec; yes; no) open import Relation.Binary.PropositionalEquality using (_β‘_; refl) open import Function using (case_of_) open import Common.Utils open import Common.SecurityLabels open import Common.BlameLabels open import CoercionExpr.CoercionExpr open import CoercionExpr.Precision sim-back-blame : β {β ββ² g gβ²} {cΜ β² : CExpr (l ββ²) β gβ²} {p} β β’ β₯ (l β) g p β cΜ β² β β[ q ] (cΜ β² ββ β₯ (l ββ²) gβ² q) Γ (β’ β₯ (l β) g p β β₯ (l ββ²) gβ² q) sim-back-blame (β-castr β₯βcΜ β² x gβgβ²) with sim-back-blame β₯βcΜ β² | precββ _ _ β₯βcΜ β² ... | β¨ q , cΜ β²β β₯ , leq β© | β¨ ββββ² , _ β© = β¨ q , β -trans (plug-cong cΜ β²β β₯) (_ βββ¨ ΞΎ-β₯ β© _ β) , β-β₯ ββββ² gβgβ² β© sim-back-blame (β-β₯ ββββ² gβgβ²) = β¨ _ , _ β , β-β₯ ββββ² gβgβ² β©