Theory Composing_Security
section ‹Binary compositionality theorem›
text ‹This theory provides the binary version of
the compositionality theorem for BD security.
It corresponds to Theorem 1 from \<^cite>‹"cosmedis-SandP2017"›
and to Theorem 5 (the System Compositionality Theorem) from
\<^cite>‹"BDsecurity-ITP2021"›.
›
theory Composing_Security
imports Bounded_Deducibility_Security.BD_Security_TS
begin
lemma list2_induct[case_names NilNil Cons1 Cons2]:
assumes NN: "P [] []"
and CN: "⋀x xs ys. P xs ys ⟹ P (x # xs) ys"
and NC: "⋀xs y ys. P xs ys ⟹ P xs (y # ys)"
shows "P xs ys"
proof (induction xs)
case Nil show ?case using NN NC by (induction ys) auto next
case (Cons x xs) then show ?case using CN by auto
qed
lemma list22_induct[case_names NilNil ConsNil NilCons ConsCons]:
assumes NN: "P [] []"
and CN: "⋀x xs. P xs [] ⟹ P (x # xs) []"
and NC: "⋀y ys. P [] ys ⟹ P [] (y # ys)"
and CC: "⋀x xs y ys.
P xs ys ⟹
(⋀ ys'. length ys' ≤ Suc (length ys) ⟹ P xs ys') ⟹
(⋀ xs'. length xs' ≤ Suc (length xs) ⟹ P xs' ys) ⟹
P (x # xs) (y # ys)"
shows "P xs ys"
proof (induction rule: measure_induct2[of "λxs ys. length xs + length ys", case_names IH])
case (IH xs ys) with assms show ?case by (cases xs; cases ys) auto
qed
context BD_Security_TS begin
declare O_append[simp]
declare V_append[simp]
declare validFrom_Cons[simp]
declare validFrom_append[simp]
declare list_all_O_map[simp]
declare never_O_Nil[simp]
declare list_all_V_map[simp]
declare never_V_Nil[simp]
end
locale Abstract_BD_Security_Comp =
One: Abstract_BD_Security validSystemTraces1 V1 O1 B1 TT1 +
Two: Abstract_BD_Security validSystemTraces2 V2 O2 B2 TT2 +
Comp?: Abstract_BD_Security validSystemTraces V O B TT
for
validSystemTraces1 :: "'traces1 ⇒ bool"
and
V1 :: "'traces1 ⇒ 'values1" and O1 :: "'traces1 ⇒ 'observations1"
and
TT1 :: "'traces1 ⇒ bool"
and
B1 :: "'values1 ⇒ 'values1 ⇒ bool"
and
validSystemTraces2 :: "'traces2 ⇒ bool"
and
V2 :: "'traces2 ⇒ 'values2" and O2 :: "'traces2 ⇒ 'observations2"
and
TT2 :: "'traces2 ⇒ bool"
and
B2 :: "'values2 ⇒ 'values2 ⇒ bool"
and
validSystemTraces :: "'traces ⇒ bool"
and
V :: "'traces ⇒ 'values" and O :: "'traces ⇒ 'observations"
and
TT :: "'traces ⇒ bool"
and
B :: "'values ⇒ 'values ⇒ bool"
+
fixes
comp :: "'traces1 ⇒ 'traces2 ⇒ 'traces ⇒ bool"
and
compO :: "'observations1 ⇒ 'observations2 ⇒ 'observations ⇒ bool"
and
compV :: "'values1 ⇒ 'values2 ⇒ 'values ⇒ bool"
assumes
validSystemTraces:
"⋀ tr. validSystemTraces tr ⟹
(∃ tr1 tr2. validSystemTraces1 tr1 ∧ validSystemTraces2 tr2 ∧ comp tr1 tr2 tr)"
and
V_comp:
"⋀ tr1 tr2 tr.
validSystemTraces1 tr1 ⟹ validSystemTraces2 tr2 ⟹ comp tr1 tr2 tr
⟹ compV (V1 tr1) (V2 tr2) (V tr)"
and
O_comp:
"⋀ tr1 tr2 tr.
validSystemTraces1 tr1 ⟹ validSystemTraces2 tr2 ⟹ comp tr1 tr2 tr
⟹ compO (O1 tr1) (O2 tr2) (O tr)"
and
TT_comp:
"⋀ tr1 tr2 tr.
validSystemTraces1 tr1 ⟹ validSystemTraces2 tr2 ⟹ comp tr1 tr2 tr
⟹ TT tr ⟹ TT1 tr1 ∧ TT2 tr2"
and
B_comp:
"⋀ vl1 vl2 vl vl'.
compV vl1 vl2 vl ⟹ B vl vl'
⟹ ∃ vl1' vl2'. compV vl1' vl2' vl' ∧ B1 vl1 vl1' ∧ B2 vl2 vl2'"
and
O_V_comp:
"⋀ tr1 tr2 vl ol.
validSystemTraces1 tr1 ⟹ validSystemTraces2 tr2 ⟹
compV (V1 tr1) (V2 tr2) vl ⟹ compO (O1 tr1) (O2 tr2) ol
⟹ ∃ tr. validSystemTraces tr ∧ O tr = ol ∧ V tr = vl"
begin
abbreviation secure where "secure ≡ Comp.secure"
abbreviation secure1 where "secure1 ≡ One.secure"
abbreviation secure2 where "secure2 ≡ Two.secure"
theorem secure1_secure2_secure:
assumes s1: secure1 and s2: secure2
shows secure
unfolding secure_def proof clarify
fix tr vl vl'
assume v: "validSystemTraces tr" and T: "TT tr" and B: "B (V tr) vl'"
then obtain tr1 tr2 where v1: "validSystemTraces1 tr1" and v2: "validSystemTraces2 tr2"
and tr: "comp tr1 tr2 tr" using validSystemTraces by blast
have T1: "TT1 tr1" and T2: "TT2 tr2" using TT_comp[OF v1 v2 tr T] by auto
have Vtr: "compV (V1 tr1) (V2 tr2) (V tr)" using V_comp[OF v1 v2 tr] .
have Otr: "compO (O1 tr1) (O2 tr2) (O tr)" using O_comp[OF v1 v2 tr] .
obtain vl1' vl2' where vl': "compV vl1' vl2' vl'" and
B1: "B1 (V1 tr1) vl1'" and B2: "B2 (V2 tr2) vl2'" using B_comp[OF Vtr B] by auto
obtain tr1' where v1': "validSystemTraces1 tr1'" and O1: "O1 tr1 = O1 tr1'" and vl1': "vl1' = V1 tr1'"
using s1 v1 T1 B1 unfolding One.secure_def by fastforce
obtain tr2' where v2': "validSystemTraces2 tr2'" and O2: "O2 tr2 = O2 tr2'" and vl2': "vl2' = V2 tr2'"
using s2 v2 T2 B2 unfolding Two.secure_def by fastforce
obtain tr' where "validSystemTraces tr' ∧ O tr' = O tr ∧ V tr' = vl'"
using O_V_comp[OF v1' v2' vl'[unfolded vl1' vl2'] Otr[unfolded O1 O2]] by auto
thus "∃tr'. validSystemTraces tr' ∧ O tr' = O tr ∧ V tr' = vl'" by auto
qed
end
type_synonym ('state1,'state2) cstate = "'state1 × 'state2"