diff --git a/UPF/ElementaryPolicies.thy b/UPF/ElementaryPolicies.thy index ad05574..5299f40 100644 --- a/UPF/ElementaryPolicies.thy +++ b/UPF/ElementaryPolicies.thy @@ -139,13 +139,13 @@ definition text{* ... and resulting properties: *} -lemma "A\<^sub>I \ empty = A\<^sub>I" +lemma "A\<^sub>I \ Map.empty = A\<^sub>I" by simp -lemma "A\<^sub>f f \ empty = A\<^sub>f f" +lemma "A\<^sub>f f \ Map.empty = A\<^sub>f f" by simp -lemma "allow_pfun empty = empty" +lemma "allow_pfun Map.empty = Map.empty" apply (rule ext) apply (simp add: allow_pfun_def) done diff --git a/UPF/Monads.thy b/UPF/Monads.thy index 94ca85a..e29db24 100644 --- a/UPF/Monads.thy +++ b/UPF/Monads.thy @@ -221,7 +221,7 @@ where "mbind' [] iostep \ = Some([], \)" | (case iostep a \ of None \ None | Some (out, \') \ (case mbind H iostep \' of - None \ None (* fail-strict *) + None \ None \ \fail-strict\ | Some(outs,\'') \ Some(out#outs,\'')))" text{* diff --git a/UPF/Normalisation.thy b/UPF/Normalisation.thy index 2730764..ecae0e4 100644 --- a/UPF/Normalisation.thy +++ b/UPF/Normalisation.thy @@ -267,7 +267,7 @@ text{* definition prod_2_list :: "[('\ \'\), (('\ \'\) list)] \ (('\ \ '\) \ 'y) \ ('x \ ('\ \ '\)) \ (('x \ 'y) list)" (infixr "\\<^sub>2\<^sub>L" 55) where - "x \\<^sub>2\<^sub>L y = (\ d r. (x \\<^sub>L y) (op \\<^sub>2) d r)" + "x \\<^sub>2\<^sub>L y = (\ d r. (x \\<^sub>L y) (\\<^sub>2) d r)" lemma list2listNMT: "x \ [] \ map sem x \ []" apply (case_tac x) @@ -288,25 +288,25 @@ definition is_distr where definition is_strict where "is_strict p = (\ r d. \ P1. (r o_f (p P1 \ \ d)) = \)" -lemma is_distr_orD: "is_distr (op \\<^sub>\\<^sub>D) d r" +lemma is_distr_orD: "is_distr (\\<^sub>\\<^sub>D) d r" apply (simp add: is_distr_def) apply (rule allI)+ apply (rule distr_orD) apply (simp) done -lemma is_strict_orD: "is_strict (op \\<^sub>\\<^sub>D) d r" +lemma is_strict_orD: "is_strict (\\<^sub>\\<^sub>D) d r" apply (simp add: is_strict_def) apply (simp add: policy_range_comp_def) done -lemma is_distr_2: "is_distr (op \\<^sub>2) d r" +lemma is_distr_2: "is_distr (\\<^sub>2) d r" apply (simp add: is_distr_def) apply (rule allI)+ apply (rule distr_or2) by simp -lemma is_strict_2: "is_strict (op \\<^sub>2) d r" +lemma is_strict_2: "is_strict (\\<^sub>2) d r" apply (simp only: is_strict_def) apply simp apply (simp add: policy_range_comp_def) @@ -323,8 +323,8 @@ lemma notDom: "x \ dom A \ \ A x = None" text{* The following theorems are crucial: they establish the correctness of the distribution. *} -lemma Norm_Distr_1: "((r o_f (((op \\<^sub>1) P1 (list2policy P2)) o d)) x = - ((list2policy ((P1 \\<^sub>L P2) (op \\<^sub>1) r d)) x))" +lemma Norm_Distr_1: "((r o_f (((\\<^sub>1) P1 (list2policy P2)) o d)) x = + ((list2policy ((P1 \\<^sub>L P2) (\\<^sub>1) r d)) x))" proof (induct P2) case Nil show ?case by (simp add: policy_range_comp_def list2policy_def) @@ -341,8 +341,8 @@ next qed qed -lemma Norm_Distr_2: "((r o_f (((op \\<^sub>2) P1 (list2policy P2)) o d)) x = - ((list2policy ((P1 \\<^sub>L P2) (op \\<^sub>2) r d)) x))"proof (induct P2) +lemma Norm_Distr_2: "((r o_f (((\\<^sub>2) P1 (list2policy P2)) o d)) x = + ((list2policy ((P1 \\<^sub>L P2) (\\<^sub>2) r d)) x))"proof (induct P2) case Nil show ?case by (simp add: policy_range_comp_def list2policy_def) next @@ -358,8 +358,8 @@ next qed qed -lemma Norm_Distr_A: "((r o_f (((op \\<^sub>\\<^sub>A) P1 (list2policy P2)) o d)) x = - ((list2policy ((P1 \\<^sub>L P2) (op \\<^sub>\\<^sub>A) r d)) x))" +lemma Norm_Distr_A: "((r o_f (((\\<^sub>\\<^sub>A) P1 (list2policy P2)) o d)) x = + ((list2policy ((P1 \\<^sub>L P2) (\\<^sub>\\<^sub>A) r d)) x))" proof (induct P2) case Nil show ?case by (simp add: policy_range_comp_def list2policy_def) @@ -377,8 +377,8 @@ next qed -lemma Norm_Distr_D: "((r o_f (((op \\<^sub>\\<^sub>D) P1 (list2policy P2)) o d)) x = - ((list2policy ((P1 \\<^sub>L P2) (op \\<^sub>\\<^sub>D) r d)) x))" +lemma Norm_Distr_D: "((r o_f (((\\<^sub>\\<^sub>D) P1 (list2policy P2)) o d)) x = + ((list2policy ((P1 \\<^sub>L P2) (\\<^sub>\\<^sub>D) r d)) x))" proof (induct P2) case Nil show ?case by (simp add: policy_range_comp_def list2policy_def) diff --git a/UPF/ROOT b/UPF/ROOT index c418faa..78db805 100644 --- a/UPF/ROOT +++ b/UPF/ROOT @@ -2,7 +2,7 @@ chapter AFP session "UPF" (AFP) = HOL + description {* The Unified Policy Framework (UPF) *} - options [timeout=300] + options [timeout = 300] theories Monads UPF diff --git a/UPF/Service.thy b/UPF/Service.thy index 4479260..5160693 100644 --- a/UPF/Service.thy +++ b/UPF/Service.thy @@ -423,7 +423,7 @@ fun OpSuccessSigma :: "(Operation \ \) \ \" (case S p of \lrs\ \ (case (lrs lr_id) of \ \ \S(p\(lrs(lr_id\us)))\ | \x\ \ \S\) - | \ \ \S(p\(empty(lr_id\us)))\)" + | \ \ \S(p\(Map.empty(lr_id\us)))\)" |"OpSuccessSigma (removeLR u r p lr_id,S) = (case S p of Some lrs \ \S(p\(lrs(lr_id:=\)))\ | \ \ \S\)" diff --git a/UPF/ServiceExample.thy b/UPF/ServiceExample.thy index 97d0c92..f584640 100644 --- a/UPF/ServiceExample.thy +++ b/UPF/ServiceExample.thy @@ -59,7 +59,7 @@ definition patient1 :: patient where "patient1 = 5" definition patient2 :: patient where "patient2 = 6" definition UC0 :: \ where - "UC0 = empty(alice\Nurse)(bob\ClinicalPractitioner)(charlie\Clerical)" + "UC0 = Map.empty(alice\Nurse)(bob\ClinicalPractitioner)(charlie\Clerical)" definition entry1 :: entry where "entry1 = (Open,alice, dummyContent)" @@ -77,13 +77,13 @@ definition SCR2 :: SCR where "SCR2 = (Map.empty)" definition Spine0 :: DB where - "Spine0 = empty(patient1\SCR1)(patient2\SCR2)" + "Spine0 = Map.empty(patient1\SCR1)(patient2\SCR2)" definition LR1 :: LR where - "LR1 =(empty(1\{alice}))" + "LR1 =(Map.empty(1\{alice}))" definition \0 :: \ where - "\0 = (empty(patient1\LR1))" + "\0 = (Map.empty(patient1\LR1))" subsection {* The Initial System State *} definition \0 :: "DB \ \\\" where diff --git a/UPF/UPFCore.thy b/UPF/UPFCore.thy index 9f4ad41..fba5c4e 100644 --- a/UPF/UPFCore.thy +++ b/UPF/UPFCore.thy @@ -135,10 +135,10 @@ translations "_MapUpd m (_Maplets xy ms)" \ "_MapUpd (_MapUpd m xy) ms" "_MapUpd m (_policylet1 x y)" \ "m(x := CONST Some (CONST allow y))" "_MapUpd m (_policylet2 x y)" \ "m(x := CONST Some (CONST deny y))" - "\" \ "CONST empty" + "\" \ "CONST Map.empty" text{* Here are some lemmas essentially showing syntactic equivalences: *} -lemma test: "empty(x\\<^sub>+a, y\\<^sub>-b) = \(x \\<^sub>+ a, y \\<^sub>- b)" by simp +lemma test: "\(x\\<^sub>+a, y\\<^sub>-b) = \(x \\<^sub>+ a, y \\<^sub>- b)" by simp lemma test2: "p(x\\<^sub>+a,x\\<^sub>-b) = p(x\\<^sub>-b)" by simp