section‹Elementary Policies› theory
ElementaryPolicies imports
UPFCore begin text‹
In this theory, we introduce the elementary policies of UPF that build the basis
for more complex policies. These complex policies, respectively, embedding of
well-known access control or security models, are build by composing the elementary
policies defined in this theory. ›
subsection‹The Core Policy Combinators: Allow and Deny Everything›
definition
deny_pfun :: "('α ⇀'β) ==> ('α ↦ 'β)" (‹AllD›) where "deny_pfun pf ≡ (λ x. case pf x of ⌊y⌋==>⌊deny (y)⌋ |⊥==>⊥)"
definition
allow_pfun :: "('α ⇀'β) ==> ('α ↦ 'β)" ( ‹AllA›) where "allow_pfun pf ≡ (λ x. case pf x of ⌊y⌋==>⌊allow (y)⌋ |⊥==>⊥)"
text‹
Since policies are essentially maps, we inherit the basic definitions for
domain and range on Maps: \\ \verb+Map.dom_def+ : @{thm Map.dom_def} \\
whereas range is just an abrreviation for image: \begin{verbatim}
abbreviation range :: "('a => 'b) => 'b set"
where -- "of function" "range f == f ` UNIV" \end{verbatim}
As a consequence, we inherit the following properties on
policies: \begin{itemize} \item\verb+Map.domD+ @{thm Map.domD} \item\verb+Map.domI+ @{thm Map.domI} \item\verb+Map.domIff+ @{thm Map.domIff} \item\verb+Map.dom_const+ @{thm Map.dom_const} \item\verb+Map.dom_def+ @{thm Map.dom_def} \item\verb+Map.dom_empty+ @{thm Map.dom_empty} \item\verb+Map.dom_eq_empty_conv+ @{thm Map.dom_eq_empty_conv} \item\verb+Map.dom_eq_singleton_conv+ @{thm Map.dom_eq_singleton_conv} \item\verb+Map.dom_fun_upd+ @{thm Map.dom_fun_upd} \item\verb+Map.dom_if+ @{thm Map.dom_if} \item\verb+Map.dom_map_add+ @{thm Map.dom_map_add} \end{itemize} ›
text‹
However, some properties are specific to policy concepts: › lemma sub_ran : "ran p ⊆ Allow ∪ Deny" apply (auto simp: Allow_def Deny_def ran_def full_SetCompr_eq[symmetric])[1]
subgoal for x a apply (case_tac "x") apply (simp_all) done done
lemma dom_allow_pfun [simp]:"dom(allow_pfun f) = dom f" apply (auto simp: allow_pfun_def)
subgoal for x y apply (case_tac "f x", simp_all) done done
text‹
Reasoning over \verb+dom+ is most crucial since it paves the way for simplification and
reordering of policies composed by override (i.e. by the normal left-to-right rule composition
method. \begin{itemize} \item\verb+Map.dom_map_add+ @{thm Map.dom_map_add} \item\verb+Map.inj_on_map_add_dom+ @{thm Map.inj_on_map_add_dom} \item\verb+Map.map_add_comm+ @{thm Map.map_add_comm} \item\verb+Map.map_add_dom_app_simps(1)+ @{thm Map.map_add_dom_app_simps(1)} \item\verb+Map.map_add_dom_app_simps(2)+ @{thm Map.map_add_dom_app_simps(2)} \item\verb+Map.map_add_dom_app_simps(3)+ @{thm Map.map_add_dom_app_simps(3)} \item\verb+Map.map_add_upd_left+ @{thm Map.map_add_upd_left} \end{itemize}
The latter rule also applies to allow- and deny-override. ›
definition dom_restrict :: "['α set, 'α↦'β] ==> 'α↦'β" (infixr‹◃›55) where"S ◃ p ≡ (λx. if x ∈ S then p x else ⊥)"
lemma dom_dom_restrict[simp] : "dom(S ◃ p) = S ∩ dom p" apply (auto simp: dom_restrict_def)
subgoal for x y apply (case_tac "x ∈ S") apply (simp_all) done
subgoal for x y apply (case_tac "x ∈ S") apply (simp_all) done done
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.