theorem
sandboxed_functor_confinement
{A B : SCE.Typ}
{body varg v₁ v₂ ρ₁ ρ₂ : SCE.Exp}
{ec_body ec_varg : Core.Exp}
(_hρ₁ : SCE.Value ρ₁)
(_hρ₂ : SCE.Value ρ₂)
(hvarg : SCE.Value varg)
(hbody_elab : elabExp (SCE.Typ.top.and A) body B ec_body)
(hvarg_elab : elabExp SCE.Typ.top varg A ec_varg)
(h₁ : S_Sem.BStep ρ₁ ((SCE.Exp.mfunctor SCE.Sandbox.sandboxed A body).mapp varg) v₁)
(h₂ : S_Sem.BStep ρ₂ ((SCE.Exp.mfunctor SCE.Sandbox.sandboxed A body).mapp varg) v₂)
:
Sandboxed Functor Confinement.
A sandboxed functor applied to a value argument produces a result that is independent of the ambient environment at the call site.
theorem
sandboxed_link_confinement
{A B : SCE.Typ}
{l : String}
{body a e₁ e₂ c₁ c₂ p₁ p₂ w₁ w₂ ρ₁ ρ₂ : SCE.Exp}
{ec_body ec_a : Core.Exp}
(ha : SCE.Value a)
(hbody_elab : elabExp (SCE.Typ.top.and (SCE.Typ.rcd l A)) body B ec_body)
(ha_elab : elabExp SCE.Typ.top a A ec_a)
(hclient₁ : ∀ {v : SCE.Exp}, S_Sem.BStep ρ₁ c₁ v → v = SCE.Exp.unit.mclos (SCE.Typ.rcd l A) body)
(hclient₂ : ∀ {v : SCE.Exp}, S_Sem.BStep ρ₂ c₂ v → v = SCE.Exp.unit.mclos (SCE.Typ.rcd l A) body)
(himport₁ : ∀ {p v : SCE.Exp}, S_Sem.BStep ρ₁ e₁ p → S_Sem.Sel p l v → v = a)
(himport₂ : ∀ {p v : SCE.Exp}, S_Sem.BStep ρ₂ e₂ p → S_Sem.Sel p l v → v = a)
(h₁ : S_Sem.BStep ρ₁ (e₁.mlink c₁) (p₁.mrg w₁))
(h₂ : S_Sem.BStep ρ₂ (e₂.mlink c₂) (p₂.mrg w₂))
:
Link Confinement.
Two terminating links produce the same client result when their clients evaluate only to the same sandboxed closure and their providers supply the same import value. The retained provider values may differ.
The client expressions need not be literal functors: they may, for example, look up a previously constructed sandboxed closure.
theorem
sandboxed_functor_link_confinement
{A B : SCE.Typ}
{l : String}
{body a e₁ e₂ p₁ p₂ w₁ w₂ ρ₁ ρ₂ : SCE.Exp}
{ec_body ec_a : Core.Exp}
(ha : SCE.Value a)
(hbody_elab : elabExp (SCE.Typ.top.and (SCE.Typ.rcd l A)) body B ec_body)
(ha_elab : elabExp SCE.Typ.top a A ec_a)
(himport₁ : ∀ {p v : SCE.Exp}, S_Sem.BStep ρ₁ e₁ p → S_Sem.Sel p l v → v = a)
(himport₂ : ∀ {p v : SCE.Exp}, S_Sem.BStep ρ₂ e₂ p → S_Sem.Sel p l v → v = a)
(h₁ : S_Sem.BStep ρ₁ (e₁.mlink (SCE.Exp.mfunctor SCE.Sandbox.sandboxed (SCE.Typ.rcd l A) body)) (p₁.mrg w₁))
(h₂ : S_Sem.BStep ρ₂ (e₂.mlink (SCE.Exp.mfunctor SCE.Sandbox.sandboxed (SCE.Typ.rcd l A) body)) (p₂.mrg w₂))
:
Literal sandboxed functors satisfy the client premise of link confinement independently of their call-site environments.