Browse Source

Import of official AFP entry for Isabelle 2018.

tags/afp-UPF-current-Isabelle2018^0
Achim D. Brucker 5 months ago
parent
commit
270d675500
7 changed files with 25 additions and 25 deletions
  1. 3
    3
      UPF/ElementaryPolicies.thy
  2. 1
    1
      UPF/Monads.thy
  3. 13
    13
      UPF/Normalisation.thy
  4. 1
    1
      UPF/ROOT
  5. 1
    1
      UPF/Service.thy
  6. 4
    4
      UPF/ServiceExample.thy
  7. 2
    2
      UPF/UPFCore.thy

+ 3
- 3
UPF/ElementaryPolicies.thy View File

@@ -139,13 +139,13 @@ definition
139 139
 
140 140
 text{* ... and resulting properties: *}
141 141
 
142
-lemma "A\<^sub>I  \<Oplus> empty  = A\<^sub>I"
142
+lemma "A\<^sub>I  \<Oplus> Map.empty  = A\<^sub>I"
143 143
   by simp 
144 144
   
145
-lemma "A\<^sub>f f  \<Oplus> empty  = A\<^sub>f f"
145
+lemma "A\<^sub>f f  \<Oplus> Map.empty  = A\<^sub>f f"
146 146
   by simp 
147 147
   
148
-lemma "allow_pfun empty = empty"
148
+lemma "allow_pfun Map.empty = Map.empty"
149 149
   apply (rule ext)
150 150
   apply (simp add: allow_pfun_def)
151 151
   done

+ 1
- 1
UPF/Monads.thy View File

@@ -221,7 +221,7 @@ where "mbind' [] iostep \<sigma> = Some([], \<sigma>)" |
221 221
                 (case iostep a \<sigma> of 
222 222
                      None   \<Rightarrow> None
223 223
                   |  Some (out, \<sigma>') \<Rightarrow> (case mbind H iostep \<sigma>' of 
224
-                                          None    \<Rightarrow> None   (*  fail-strict *) 
224
+                                          None    \<Rightarrow> None   \<comment> \<open>fail-strict\<close>
225 225
                                         | Some(outs,\<sigma>'') \<Rightarrow> Some(out#outs,\<sigma>'')))"
226 226
 
227 227
 text{* 

+ 13
- 13
UPF/Normalisation.thy View File

@@ -267,7 +267,7 @@ text{*
267 267
 definition prod_2_list :: "[('\<alpha> \<mapsto>'\<beta>), (('\<gamma> \<mapsto>'\<delta>) list)] \<Rightarrow> 
268 268
                   (('\<beta> \<times> '\<delta>) \<Rightarrow> 'y) \<Rightarrow> ('x \<Rightarrow> ('\<alpha> \<times> '\<gamma>)) \<Rightarrow> 
269 269
                   (('x \<mapsto> 'y) list)" (infixr "\<Otimes>\<^sub>2\<^sub>L" 55) where 
270
-  "x \<Otimes>\<^sub>2\<^sub>L y =  (\<lambda> d r. (x \<Otimes>\<^sub>L y) (op \<Otimes>\<^sub>2) d r)"  
270
+  "x \<Otimes>\<^sub>2\<^sub>L y =  (\<lambda> d r. (x \<Otimes>\<^sub>L y) (\<Otimes>\<^sub>2) d r)"  
271 271
   
272 272
 lemma list2listNMT:  "x \<noteq> [] \<Longrightarrow> map sem x \<noteq> []"
273 273
   apply (case_tac x)
@@ -288,25 +288,25 @@ definition is_distr where
288 288
 definition is_strict where
289 289
  "is_strict p = (\<lambda> r d. \<forall> P1. (r o_f (p P1 \<emptyset> \<circ> d)) = \<emptyset>)"
290 290
 
291
-lemma is_distr_orD: "is_distr (op \<Otimes>\<^sub>\<or>\<^sub>D) d r"
291
+lemma is_distr_orD: "is_distr (\<Otimes>\<^sub>\<or>\<^sub>D) d r"
292 292
   apply (simp add: is_distr_def)
293 293
   apply (rule allI)+
294 294
   apply (rule distr_orD)
295 295
   apply (simp)
296 296
   done
297 297
     
298
-lemma is_strict_orD: "is_strict (op \<Otimes>\<^sub>\<or>\<^sub>D) d r"
298
+lemma is_strict_orD: "is_strict (\<Otimes>\<^sub>\<or>\<^sub>D) d r"
299 299
   apply (simp add: is_strict_def)
300 300
   apply (simp add: policy_range_comp_def)
301 301
   done
302 302
     
303
-lemma is_distr_2: "is_distr (op \<Otimes>\<^sub>2) d r"
303
+lemma is_distr_2: "is_distr (\<Otimes>\<^sub>2) d r"
304 304
   apply (simp add: is_distr_def)
305 305
   apply (rule allI)+
306 306
   apply (rule distr_or2)
307 307
   by simp
308 308
     
309
-lemma is_strict_2: "is_strict (op \<Otimes>\<^sub>2) d r"
309
+lemma is_strict_2: "is_strict (\<Otimes>\<^sub>2) d r"
310 310
   apply (simp only: is_strict_def)
311 311
   apply simp
312 312
   apply (simp add: policy_range_comp_def)
@@ -323,8 +323,8 @@ lemma notDom: "x \<in> dom A \<Longrightarrow> \<not> A x = None"
323 323
 text{* 
324 324
   The following theorems are crucial: they establish the correctness of the distribution.
325 325
 *}
326
-lemma Norm_Distr_1:  "((r o_f (((op \<Otimes>\<^sub>1) P1 (list2policy P2)) o d)) x = 
327
-                                                   ((list2policy ((P1 \<Otimes>\<^sub>L P2) (op \<Otimes>\<^sub>1) r d)) x))"
326
+lemma Norm_Distr_1:  "((r o_f (((\<Otimes>\<^sub>1) P1 (list2policy P2)) o d)) x = 
327
+                                                   ((list2policy ((P1 \<Otimes>\<^sub>L P2) (\<Otimes>\<^sub>1) r d)) x))"
328 328
 proof (induct P2) 
329 329
   case Nil show ?case
330 330
     by (simp add: policy_range_comp_def  list2policy_def) 
@@ -341,8 +341,8 @@ next
341 341
   qed
342 342
 qed
343 343
   
344
-lemma Norm_Distr_2: "((r o_f (((op \<Otimes>\<^sub>2) P1 (list2policy P2)) o d)) x = 
345
-                               ((list2policy ((P1 \<Otimes>\<^sub>L P2) (op \<Otimes>\<^sub>2) r d)) x))"proof (induct P2) 
344
+lemma Norm_Distr_2: "((r o_f (((\<Otimes>\<^sub>2) P1 (list2policy P2)) o d)) x = 
345
+                               ((list2policy ((P1 \<Otimes>\<^sub>L P2) (\<Otimes>\<^sub>2) r d)) x))"proof (induct P2) 
346 346
   case Nil show ?case
347 347
     by (simp add: policy_range_comp_def  list2policy_def) 
348 348
 next
@@ -358,8 +358,8 @@ next
358 358
   qed
359 359
 qed
360 360
   
361
-lemma Norm_Distr_A: "((r o_f (((op \<Otimes>\<^sub>\<or>\<^sub>A) P1 (list2policy P2)) o d)) x = 
362
-                                                 ((list2policy ((P1 \<Otimes>\<^sub>L P2) (op \<Otimes>\<^sub>\<or>\<^sub>A) r d)) x))"
361
+lemma Norm_Distr_A: "((r o_f (((\<Otimes>\<^sub>\<or>\<^sub>A) P1 (list2policy P2)) o d)) x = 
362
+                                                 ((list2policy ((P1 \<Otimes>\<^sub>L P2) (\<Otimes>\<^sub>\<or>\<^sub>A) r d)) x))"
363 363
 proof (induct P2) 
364 364
   case Nil show ?case
365 365
     by (simp add: policy_range_comp_def  list2policy_def) 
@@ -377,8 +377,8 @@ next
377 377
 qed
378 378
 
379 379
   
380
-lemma Norm_Distr_D: "((r o_f (((op \<Otimes>\<^sub>\<or>\<^sub>D) P1 (list2policy P2)) o d)) x = 
381
-                                                  ((list2policy ((P1 \<Otimes>\<^sub>L P2) (op \<Otimes>\<^sub>\<or>\<^sub>D) r d)) x))"
380
+lemma Norm_Distr_D: "((r o_f (((\<Otimes>\<^sub>\<or>\<^sub>D) P1 (list2policy P2)) o d)) x = 
381
+                                                  ((list2policy ((P1 \<Otimes>\<^sub>L P2) (\<Otimes>\<^sub>\<or>\<^sub>D) r d)) x))"
382 382
 proof (induct P2) 
383 383
   case Nil show ?case
384 384
     by (simp add: policy_range_comp_def  list2policy_def) 

+ 1
- 1
UPF/ROOT View File

@@ -2,7 +2,7 @@ chapter AFP
2 2
 
3 3
 session "UPF" (AFP) = HOL +
4 4
   description {* The Unified Policy Framework (UPF) *}
5
-  options [timeout=300]
5
+  options [timeout = 300]
6 6
   theories
7 7
     Monads
8 8
     UPF

+ 1
- 1
UPF/Service.thy View File

@@ -423,7 +423,7 @@ fun OpSuccessSigma :: "(Operation \<times> \<Sigma>) \<rightharpoonup> \<Sigma>"
423 423
                    (case S p of \<lfloor>lrs\<rfloor>  \<Rightarrow> (case (lrs lr_id) of 
424 424
                                                \<bottom>  \<Rightarrow> \<lfloor>S(p\<mapsto>(lrs(lr_id\<mapsto>us)))\<rfloor>                        
425 425
                                              | \<lfloor>x\<rfloor> \<Rightarrow> \<lfloor>S\<rfloor>)
426
-                              | \<bottom> \<Rightarrow> \<lfloor>S(p\<mapsto>(empty(lr_id\<mapsto>us)))\<rfloor>)"
426
+                              | \<bottom> \<Rightarrow> \<lfloor>S(p\<mapsto>(Map.empty(lr_id\<mapsto>us)))\<rfloor>)"
427 427
   |"OpSuccessSigma (removeLR u r p lr_id,S) = 
428 428
                    (case S p of Some lrs \<Rightarrow> \<lfloor>S(p\<mapsto>(lrs(lr_id:=\<bottom>)))\<rfloor>
429 429
                               | \<bottom> \<Rightarrow> \<lfloor>S\<rfloor>)"

+ 4
- 4
UPF/ServiceExample.thy View File

@@ -59,7 +59,7 @@ definition patient1 :: patient where "patient1 = 5"
59 59
 definition patient2 :: patient where "patient2 = 6"
60 60
 
61 61
 definition UC0 :: \<upsilon> where
62
- "UC0 = empty(alice\<mapsto>Nurse)(bob\<mapsto>ClinicalPractitioner)(charlie\<mapsto>Clerical)"
62
+ "UC0 = Map.empty(alice\<mapsto>Nurse)(bob\<mapsto>ClinicalPractitioner)(charlie\<mapsto>Clerical)"
63 63
 
64 64
 definition entry1  :: entry where
65 65
  "entry1 = (Open,alice, dummyContent)"
@@ -77,13 +77,13 @@ definition SCR2 :: SCR where
77 77
  "SCR2 =  (Map.empty)"
78 78
 
79 79
 definition Spine0 :: DB where
80
- "Spine0 = empty(patient1\<mapsto>SCR1)(patient2\<mapsto>SCR2)"
80
+ "Spine0 = Map.empty(patient1\<mapsto>SCR1)(patient2\<mapsto>SCR2)"
81 81
 
82 82
 definition LR1 :: LR where
83
- "LR1 =(empty(1\<mapsto>{alice}))"
83
+ "LR1 =(Map.empty(1\<mapsto>{alice}))"
84 84
 
85 85
 definition \<Sigma>0 :: \<Sigma> where
86
- "\<Sigma>0 = (empty(patient1\<mapsto>LR1))"
86
+ "\<Sigma>0 = (Map.empty(patient1\<mapsto>LR1))"
87 87
 
88 88
 subsection {* The Initial System State *}
89 89
 definition \<sigma>0 :: "DB \<times> \<Sigma>\<times>\<upsilon>" where

+ 2
- 2
UPF/UPFCore.thy View File

@@ -135,10 +135,10 @@ translations
135 135
   "_MapUpd m (_Maplets xy ms)"   \<rightleftharpoons> "_MapUpd (_MapUpd m xy) ms"
136 136
   "_MapUpd m (_policylet1 x y)"  \<rightleftharpoons> "m(x := CONST Some (CONST allow y))"
137 137
   "_MapUpd m (_policylet2 x y)"  \<rightleftharpoons> "m(x := CONST Some (CONST deny y))"
138
-  "\<emptyset>"                            \<rightleftharpoons> "CONST empty" 
138
+  "\<emptyset>"                            \<rightleftharpoons> "CONST Map.empty" 
139 139
 
140 140
 text{* Here are some lemmas essentially showing syntactic equivalences: *}
141
-lemma test: "empty(x\<mapsto>\<^sub>+a, y\<mapsto>\<^sub>-b) = \<emptyset>(x \<mapsto>\<^sub>+ a, y \<mapsto>\<^sub>- b)"   by simp
141
+lemma test: "\<emptyset>(x\<mapsto>\<^sub>+a, y\<mapsto>\<^sub>-b) = \<emptyset>(x \<mapsto>\<^sub>+ a, y \<mapsto>\<^sub>- b)"   by simp
142 142
 
143 143
 lemma test2: "p(x\<mapsto>\<^sub>+a,x\<mapsto>\<^sub>-b) = p(x\<mapsto>\<^sub>-b)"   by simp
144 144
 

Loading…
Cancel
Save