section‹Sequential Composition› theory
SeqComposition imports
ElementaryPolicies begin
text‹
Sequential composition is based on the idea that two policies are to be combined by applying
the second policy to the output of the first one. Again, there are four possibilities how the
decisions can be combined.›
subsection‹Flattening› text‹
A key concept of sequential policy composition is the flattening of nested decisions. There are
four possibilities, and these possibilities will give the various flavours of policy composition. › fun flat_orA :: "('α decision) decision ==> ('α decision)" where"flat_orA(allow(allow y)) = allow y"
|"flat_orA(allow(deny y)) = allow y"
|"flat_orA(deny(allow y)) = allow y"
|"flat_orA(deny(deny y)) = deny y"
lemma flat_orA_deny[dest]:"flat_orA x = deny y ==> x = deny(deny y)" apply (case_tac "x") apply (rename_tac α) apply (case_tac "α", simp_all)[1] apply (rename_tac α) apply (case_tac "α", simp_all)[1] done
lemma flat_orA_allow[dest]: "flat_orA x = allow y ==> x = allow(allow y) ∨ x = allow(deny y) ∨ x = deny(allow y)" apply (case_tac "x") apply (rename_tac α) apply (case_tac "α", simp_all)[1] apply (rename_tac α) apply (case_tac "α", simp_all)[1] done
lemma flat_2_allow[dest]: "flat_2 x = allow y ==> x = allow(allow y) ∨ x = deny(allow y)" apply (case_tac "x") apply (rename_tac α) apply (case_tac "α", simp_all)[1] apply (rename_tac α) apply (case_tac "α", simp_all)[1] done
lemma flat_2_deny[dest]: "flat_2 x = deny y ==> x = deny(deny y) ∨ x = allow(deny y)" apply (case_tac "x") apply (rename_tac α) apply (case_tac "α", simp_all)[1] apply (rename_tac α) apply (case_tac "α", simp_all)[1] done
subsection‹Policy Composition› text‹
The following definition allows to compose two policies. Denies and allows are transferred. ›
fun lift :: "('α ↦ 'β) ==> ('α decision ↦'β decision)" where"lift f (deny s) = (case f s of ⌊y⌋==>⌊deny y⌋ | ⊥==>⊥)"
| "lift f (allow s) = (case f s of ⌊y⌋==>⌊allow y⌋ | ⊥==>⊥)"
lemma lift_mt [simp]: "lift ∅ = ∅" apply (rule ext)
subgoal for x apply (case_tac "x") apply (simp_all) done done
text‹
Since policies are maps, we inherit a composition on them. However, this results in nestings
of decisions---which must be flattened. As we now that there are four different forms of
flattening, we have four different forms of policy composition:› definition
comp_orA :: "['β↦'γ, 'α↦'β] ==> 'α↦'γ" (infixl‹o'_orA›55) where "p2 o_orA p1 ≡ (map_option flat_orA) o (lift p2 ∘m p1)"
lemma mt_comp_2[simp]:"∅∘2 p = ∅" by(simp add: comp_2_def)
end
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.