author | Christian Urban <urbanc@in.tum.de> |
Fri, 23 Jun 2017 00:27:16 +0100 | |
changeset 178 | da27bece9575 |
parent 142 | 10c16b85a839 |
child 179 | f9e6c4166476 |
permissions | -rw-r--r-- |
93
524bd3caa6b6
The overwriten original .thy files are working now. The ones in last revision aren't.
zhangx
parents:
92
diff
changeset
|
1 |
theory PIPBasics |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2 |
imports PIPDefs RTree |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
begin |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
|
117 | 5 |
text {* (* ddd *) |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
6 |
|
117 | 7 |
Following the HOL convention of {\em definitional extension}, we have |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
8 |
given a concise and miniature model of PIP. To assure ourselves of the |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
9 |
correctness of this model, we are going to derive a series of expected |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
10 |
properties out of it. |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
11 |
|
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
12 |
This file contains the very basic properties, useful for self-assurance, |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
13 |
as well as for deriving more advance properties concerning the correctness |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
14 |
and implementation of PIP. *} |
117 | 15 |
|
16 |
||
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
17 |
section {* Generic auxiliary lemmas *} |
99 | 18 |
|
108 | 19 |
lemma rel_eqI: |
20 |
assumes "\<And> x y. (x,y) \<in> A \<Longrightarrow> (x,y) \<in> B" |
|
21 |
and "\<And> x y. (x,y) \<in> B \<Longrightarrow> (x, y) \<in> A" |
|
22 |
shows "A = B" |
|
23 |
using assms by auto |
|
24 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
25 |
lemma f_image_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
26 |
assumes h: "\<And> a. a \<in> A \<Longrightarrow> f a = g a" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
27 |
shows "f ` A = g ` A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
28 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
29 |
show "f ` A \<subseteq> g ` A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
30 |
by(rule image_subsetI, auto intro:h) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
31 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
32 |
show "g ` A \<subseteq> f ` A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
33 |
by (rule image_subsetI, auto intro:h[symmetric]) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
34 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
35 |
|
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
36 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
37 |
|
99 | 38 |
section {* Lemmas do not depend on trace validity *} |
39 |
||
108 | 40 |
text {* The following lemma serves to proof @{text "preced_tm_lt"} *} |
41 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
42 |
lemma birth_time_lt: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
43 |
assumes "s \<noteq> []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
44 |
shows "last_set th s < length s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
45 |
using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
46 |
proof(induct s) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
47 |
case (Cons a s) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
48 |
show ?case |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
49 |
proof(cases "s \<noteq> []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
50 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
51 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
52 |
by (cases a, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
53 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
54 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
55 |
show ?thesis using Cons(1)[OF True] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
56 |
by (cases a, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
57 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
58 |
qed simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
59 |
|
108 | 60 |
text {* The following lemma also serves to proof @{text "preced_tm_lt"} *} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
61 |
lemma th_in_ne: "th \<in> threads s \<Longrightarrow> s \<noteq> []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
62 |
by (induct s, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
63 |
|
108 | 64 |
text {* The following lemma is used in Correctness.thy *} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
65 |
lemma preced_tm_lt: "th \<in> threads s \<Longrightarrow> preced th s = Prc x y \<Longrightarrow> y < length s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
66 |
by (drule_tac th_in_ne, unfold preced_def, auto intro: birth_time_lt) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
67 |
|
108 | 68 |
text {* |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
69 |
|
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
70 |
The following lemma says that if a resource is waited for, it must be held |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
71 |
by someone else. *} |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
72 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
73 |
lemma waiting_holding: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
74 |
assumes "waiting (s::state) th cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
75 |
obtains th' where "holding s th' cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
76 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
77 |
from assms[unfolded s_waiting_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
78 |
obtain th' where "th' \<in> set (wq s cs)" "th' = hd (wq s cs)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
79 |
by (metis empty_iff hd_in_set list.set(1)) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
80 |
hence "holding s th' cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
81 |
unfolding s_holding_def by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
82 |
from that[OF this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
83 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
84 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
85 |
|
108 | 86 |
text {* |
87 |
The following @{text "children_RAG_alt_def"} relates |
|
88 |
@{term children} in @{term RAG} to the notion of @{term holding}. |
|
89 |
It is a technical lemmas used to prove the two following lemmas. |
|
90 |
*} |
|
101 | 91 |
lemma children_RAG_alt_def: |
92 |
"children (RAG (s::state)) (Th th) = Cs ` {cs. holding s th cs}" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
93 |
by (unfold s_RAG_def, auto simp:children_def s_holding_abv) |
101 | 94 |
|
108 | 95 |
text {* |
96 |
The following two lemmas relate @{term holdents} and @{term cntCS} |
|
97 |
to @{term children} in @{term RAG}, so that proofs about |
|
98 |
@{term holdents} and @{term cntCS} can be carried out under |
|
99 |
the support of the abstract theory of {\em relational graph} |
|
100 |
(and specifically {\em relational tree} and {\em relational forest}). |
|
101 |
*} |
|
101 | 102 |
lemma holdents_alt_def: |
103 |
"holdents s th = the_cs ` (children (RAG (s::state)) (Th th))" |
|
104 |
by (unfold children_RAG_alt_def holdents_def, simp add: image_image) |
|
105 |
||
106 |
lemma cntCS_alt_def: |
|
107 |
"cntCS s th = card (children (RAG s) (Th th))" |
|
108 |
apply (unfold children_RAG_alt_def cntCS_def holdents_def) |
|
109 |
by (rule card_image[symmetric], auto simp:inj_on_def) |
|
110 |
||
108 | 111 |
text {* |
112 |
The following two lemmas show the inclusion relations |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
113 |
among three key sets, namely @{term running}, @{term readys} |
108 | 114 |
and @{term threads}. |
115 |
*} |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
116 |
lemma running_ready: |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
117 |
shows "running s \<subseteq> readys s" |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
118 |
unfolding running_def readys_def |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
119 |
by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
120 |
|
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
121 |
lemma readys_threads: |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
122 |
shows "readys s \<subseteq> threads s" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
123 |
unfolding readys_def |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
124 |
by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
125 |
|
108 | 126 |
text {* |
127 |
The following lemma says that if a thread is running, |
|
128 |
it must be the head of every waiting queue it is in. |
|
129 |
In other words, a running thread must have got every |
|
130 |
resource it has requested. |
|
131 |
*} |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
132 |
lemma running_wqE: |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
133 |
assumes "th \<in> running s" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
134 |
and "th \<in> set (wq s cs)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
135 |
obtains rest where "wq s cs = th#rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
136 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
137 |
from assms(2) obtain th' rest where eq_wq: "wq s cs = th'#rest" |
107
30ed212f268a
updated Correctness, Implementation and PIPBasics so that they work with Isabelle 2014 and 2015
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
106
diff
changeset
|
138 |
by (metis empty_iff list.exhaust list.set(1)) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
139 |
have "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
140 |
proof(rule ccontr) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
141 |
assume "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
142 |
hence "th \<noteq> hd (wq s cs)" using eq_wq by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
143 |
with assms(2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
144 |
have "waiting s th cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
145 |
by (unfold s_waiting_def, fold wq_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
146 |
with assms show False |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
147 |
by (unfold running_def readys_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
148 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
149 |
with eq_wq that show ?thesis by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
150 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
151 |
|
100 | 152 |
text {* |
153 |
Every thread can only be blocked on one critical resource, |
|
154 |
symmetrically, every critical resource can only be held by one thread. |
|
155 |
This fact is much more easier according to our definition. |
|
156 |
*} |
|
157 |
lemma held_unique: |
|
158 |
assumes "holding (s::event list) th1 cs" |
|
159 |
and "holding s th2 cs" |
|
160 |
shows "th1 = th2" |
|
161 |
by (insert assms, unfold s_holding_def, auto) |
|
162 |
||
108 | 163 |
text {* |
164 |
The following three lemmas establishes the uniqueness of |
|
165 |
precedence, a key property about precedence. |
|
166 |
The first two are just technical lemmas to assist the proof |
|
167 |
of the third. |
|
168 |
*} |
|
100 | 169 |
lemma last_set_lt: "th \<in> threads s \<Longrightarrow> last_set th s < length s" |
170 |
apply (induct s, auto) |
|
171 |
by (case_tac a, auto split:if_splits) |
|
172 |
||
173 |
lemma last_set_unique: |
|
174 |
"\<lbrakk>last_set th1 s = last_set th2 s; th1 \<in> threads s; th2 \<in> threads s\<rbrakk> |
|
175 |
\<Longrightarrow> th1 = th2" |
|
176 |
apply (induct s, auto) |
|
177 |
by (case_tac a, auto split:if_splits dest:last_set_lt) |
|
178 |
||
179 |
lemma preced_unique : |
|
180 |
assumes pcd_eq: "preced th1 s = preced th2 s" |
|
181 |
and th_in1: "th1 \<in> threads s" |
|
182 |
and th_in2: " th2 \<in> threads s" |
|
183 |
shows "th1 = th2" |
|
184 |
proof - |
|
185 |
from pcd_eq have "last_set th1 s = last_set th2 s" by (simp add:preced_def) |
|
186 |
from last_set_unique [OF this th_in1 th_in2] |
|
187 |
show ?thesis . |
|
188 |
qed |
|
108 | 189 |
|
190 |
text {* |
|
191 |
The following lemma shows that there exits a linear order |
|
192 |
on precedences, which is crucial for the notion of |
|
193 |
@{term Max} to be applicable. |
|
194 |
*} |
|
100 | 195 |
lemma preced_linorder: |
196 |
assumes neq_12: "th1 \<noteq> th2" |
|
197 |
and th_in1: "th1 \<in> threads s" |
|
198 |
and th_in2: " th2 \<in> threads s" |
|
199 |
shows "preced th1 s < preced th2 s \<or> preced th1 s > preced th2 s" |
|
200 |
proof - |
|
201 |
from preced_unique [OF _ th_in1 th_in2] and neq_12 |
|
202 |
have "preced th1 s \<noteq> preced th2 s" by auto |
|
203 |
thus ?thesis by auto |
|
204 |
qed |
|
205 |
||
108 | 206 |
text {* |
207 |
The following lemma case analysis the situations when |
|
208 |
two nodes are in @{term RAG}. |
|
209 |
*} |
|
100 | 210 |
lemma in_RAG_E: |
211 |
assumes "(n1, n2) \<in> RAG (s::state)" |
|
212 |
obtains (waiting) th cs where "n1 = Th th" "n2 = Cs cs" "waiting s th cs" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
213 |
| (holding) th cs where "n1 = Cs cs" "n2 = Th th" "holding s th cs" |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
214 |
using assms[unfolded s_RAG_def, folded s_waiting_abv s_holding_abv] |
100 | 215 |
by auto |
216 |
||
108 | 217 |
text {* |
218 |
The following lemmas are the simplification rules |
|
219 |
for @{term count}, @{term cntP}, @{term cntV}. |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
220 |
It is part of the scheme to use the counting |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
221 |
of @{term "P"} and @{term "V"} operations to reason about |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
222 |
the number of resources occupied by one thread. |
108 | 223 |
*} |
224 |
||
101 | 225 |
lemma count_rec1 [simp]: |
226 |
assumes "Q e" |
|
227 |
shows "count Q (e#es) = Suc (count Q es)" |
|
228 |
using assms |
|
229 |
by (unfold count_def, auto) |
|
230 |
||
231 |
lemma count_rec2 [simp]: |
|
232 |
assumes "\<not>Q e" |
|
233 |
shows "count Q (e#es) = (count Q es)" |
|
234 |
using assms |
|
235 |
by (unfold count_def, auto) |
|
236 |
||
237 |
lemma count_rec3 [simp]: |
|
238 |
shows "count Q [] = 0" |
|
239 |
by (unfold count_def, auto) |
|
240 |
||
241 |
lemma cntP_simp1[simp]: |
|
242 |
"cntP (P th cs'#s) th = cntP s th + 1" |
|
243 |
by (unfold cntP_def, simp) |
|
244 |
||
245 |
lemma cntP_simp2[simp]: |
|
246 |
assumes "th' \<noteq> th" |
|
247 |
shows "cntP (P th cs'#s) th' = cntP s th'" |
|
248 |
using assms |
|
249 |
by (unfold cntP_def, simp) |
|
250 |
||
251 |
lemma cntP_simp3[simp]: |
|
252 |
assumes "\<not> isP e" |
|
253 |
shows "cntP (e#s) th' = cntP s th'" |
|
254 |
using assms |
|
255 |
by (unfold cntP_def, cases e, simp+) |
|
256 |
||
257 |
lemma cntV_simp1[simp]: |
|
258 |
"cntV (V th cs'#s) th = cntV s th + 1" |
|
259 |
by (unfold cntV_def, simp) |
|
260 |
||
261 |
lemma cntV_simp2[simp]: |
|
262 |
assumes "th' \<noteq> th" |
|
263 |
shows "cntV (V th cs'#s) th' = cntV s th'" |
|
264 |
using assms |
|
265 |
by (unfold cntV_def, simp) |
|
266 |
||
267 |
lemma cntV_simp3[simp]: |
|
268 |
assumes "\<not> isV e" |
|
269 |
shows "cntV (e#s) th' = cntV s th'" |
|
270 |
using assms |
|
271 |
by (unfold cntV_def, cases e, simp+) |
|
272 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
273 |
text {* |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
274 |
The following two lemmas show that only @{term P} |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
275 |
and @{term V} operation can change the value |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
276 |
of @{term cntP} and @{term cntV}, which is true |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
277 |
obviously. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
278 |
*} |
101 | 279 |
lemma cntP_diff_inv: |
280 |
assumes "cntP (e#s) th \<noteq> cntP s th" |
|
116 | 281 |
obtains cs where "e = P th cs" |
101 | 282 |
proof(cases e) |
283 |
case (P th' pty) |
|
116 | 284 |
show ?thesis using that |
101 | 285 |
by (cases "(\<lambda>e. \<exists>cs. e = P th cs) (P th' pty)", |
286 |
insert assms P, auto simp:cntP_def) |
|
287 |
qed (insert assms, auto simp:cntP_def) |
|
288 |
||
289 |
lemma cntV_diff_inv: |
|
290 |
assumes "cntV (e#s) th \<noteq> cntV s th" |
|
116 | 291 |
obtains cs' where "e = V th cs'" |
101 | 292 |
proof(cases e) |
293 |
case (V th' pty) |
|
116 | 294 |
show ?thesis using that |
101 | 295 |
by (cases "(\<lambda>e. \<exists>cs. e = V th cs) (V th' pty)", |
296 |
insert assms V, auto simp:cntV_def) |
|
297 |
qed (insert assms, auto simp:cntV_def) |
|
298 |
||
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
299 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
300 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
301 |
The following three lemmas shows the shape |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
302 |
of nodes in @{term tRAG}. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
303 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
304 |
lemma tRAG_nodeE: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
305 |
assumes "(n1, n2) \<in> tRAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
306 |
obtains th1 th2 where "n1 = Th th1" "n2 = Th th2" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
307 |
using assms |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
308 |
by (auto simp: tRAG_def wRAG_def hRAG_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
309 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
310 |
lemma tRAG_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
311 |
assumes "(n1, n2) \<in> tRAG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
312 |
shows "n1 = Th (the_thread n1)" "n2 = Th (the_thread n2)" "(the_thread n1, the_thread n2) \<in> tG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
313 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
314 |
by (unfold tRAG_def_tG tG_alt_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
315 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
316 |
lemma tG_tRAG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
317 |
assumes "(th1, th2) \<in> tG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
318 |
shows "(Th th1, Th th2) \<in> tRAG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
319 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
320 |
by (unfold tRAG_def_tG, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
321 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
322 |
lemma tRAG_ancestorsE: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
323 |
assumes "x \<in> ancestors (tRAG s) u" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
324 |
obtains th where "x = Th th" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
325 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
326 |
from assms have "(u, x) \<in> (tRAG s)^+" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
327 |
by (unfold ancestors_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
328 |
from tranclE[OF this] obtain c where "(c, x) \<in> tRAG s" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
329 |
then obtain th where "x = Th th" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
330 |
by (unfold tRAG_alt_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
331 |
from that[OF this] show ?thesis . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
332 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
333 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
334 |
lemma map_prod_RE: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
335 |
assumes "(u, v) \<in> (map_prod f f ` R)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
336 |
obtains u' v' where "u = (f u')" "v = (f v')" "(u', v') \<in> R" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
337 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
338 |
by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
339 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
340 |
lemma map_prod_tranclE: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
341 |
assumes "(u, v) \<in> (map_prod f f ` R)^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
342 |
and "inj_on f (Field R)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
343 |
obtains u' v' where "u = (f u')" "v = (f v')" "(u', v') \<in> R^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
344 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
345 |
from assms(1) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
346 |
have "\<exists>u' v'. u = f u' \<and> v = f v' \<and> (u', v') \<in> R\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
347 |
proof(induct rule:trancl_induct) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
348 |
case (base y) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
349 |
thus ?case by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
350 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
351 |
case (step y z) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
352 |
then obtain u' v' where h1: "u = f u'" "y = f v'" "(u', v') \<in> R\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
353 |
from map_prod_RE[OF step(2)] obtain v'' u'' |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
354 |
where h2: "y = f v''" "z = f u''" "(v'', u'') \<in> R" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
355 |
from h1 h2 have "f v' = f v''" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
356 |
hence eq_v': "v' = v''" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
357 |
proof(cases rule:inj_onD[OF assms(2), consumes 1]) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
358 |
case 1 |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
359 |
from h1(3) show ?case using trancl_subset_Field2[of R] by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
360 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
361 |
case 2 |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
362 |
from h2(3) show ?case by (simp add: Domain.DomainI Field_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
363 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
364 |
let ?u = "u'" and ?v = "u''" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
365 |
have "(?u, ?v) \<in> R^+" using h1(3)[unfolded eq_v'] h2(3) by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
366 |
with h1 h2 |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
367 |
show ?case by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
368 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
369 |
thus ?thesis using that by metis |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
370 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
371 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
372 |
lemma map_prod_rtranclE: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
373 |
assumes "(u, v) \<in> (map_prod f f ` R)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
374 |
and "inj_on f (Field R)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
375 |
obtains (root) "u = v" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
376 |
| (trancl) u' v' where "u = (f u')" "v = (f v')" "(u', v') \<in> R^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
377 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
378 |
from rtranclD[OF assms(1)] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
379 |
have "u = v \<or> (\<exists>u' v'. u = f u' \<and> v = f v' \<and> (u', v') \<in> R\<^sup>*)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
380 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
381 |
assume "u = v" thus ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
382 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
383 |
assume "u \<noteq> v \<and> (u, v) \<in> (map_prod f f ` R)\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
384 |
hence "(u, v) \<in> (map_prod f f ` R)\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
385 |
thus ?thesis |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
386 |
by (rule map_prod_tranclE[OF _ assms(2)], auto dest!:trancl_into_rtrancl) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
387 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
388 |
with that show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
389 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
390 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
391 |
lemma Field_tRAGE: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
392 |
assumes "n \<in> (Field (tRAG s))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
393 |
obtains th where "n = Th th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
394 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
395 |
from assms[unfolded tRAG_alt_def Field_def Domain_def Range_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
396 |
show ?thesis using that by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
397 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
398 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
399 |
lemma trancl_tG_tRAG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
400 |
assumes "(th1, th2) \<in> (tG s)^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
401 |
shows "(Th th1, Th th2) \<in> (tRAG s)^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
402 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
403 |
have "inj_on the_thread (Field (tRAG s))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
404 |
by (unfold inj_on_def Field_def tRAG_alt_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
405 |
from map_prod_tranclE[OF assms[unfolded tG_def] this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
406 |
obtain u' v' where h: "th1 = the_thread u'" "th2 = the_thread v'" "(u', v') \<in> (tRAG s)\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
407 |
by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
408 |
hence "u' \<in> Domain ((tRAG s)\<^sup>+)" "v' \<in> Range ((tRAG s)\<^sup>+)" by (auto simp:Domain_def Range_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
409 |
from this[unfolded trancl_domain trancl_range] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
410 |
have "u' \<in> Field (tRAG s)" "v' \<in> Field (tRAG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
411 |
by (unfold Field_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
412 |
then obtain th1' th2' where h': "u' = Th th1'" "v' = Th th2'" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
413 |
by (auto elim!:Field_tRAGE) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
414 |
with h have "th1' = th1" "th2' = th2" by (auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
415 |
from h(3)[unfolded h' this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
416 |
show ?thesis by (auto simp:ancestors_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
417 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
418 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
419 |
lemma rtrancl_tG_tRAG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
420 |
assumes "(th1, th2) \<in> (tG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
421 |
shows "(Th th1, Th th2) \<in> (tRAG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
422 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
423 |
from rtranclD[OF assms] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
424 |
show ?thesis |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
425 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
426 |
assume "th1 = th2" thus "(Th th1, Th th2) \<in> (tRAG s)\<^sup>*" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
427 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
428 |
assume "th1 \<noteq> th2 \<and> (th1, th2) \<in> (tG s)\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
429 |
hence "(th1, th2) \<in> (tG s)\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
430 |
from trancl_into_rtrancl[OF trancl_tG_tRAG[OF this]] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
431 |
show "(Th th1, Th th2) \<in> (tRAG s)\<^sup>*" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
432 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
433 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
434 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
435 |
lemma trancl_tRAG_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
436 |
assumes "(n1, n2) \<in> (tRAG s)^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
437 |
obtains "n1 = Th (the_thread n1)" "n2 = Th (the_thread n2)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
438 |
"(the_thread n1, the_thread n2) \<in> (tG s)^+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
439 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
440 |
have inj: "inj_on Th (Field (tG s))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
441 |
by (unfold inj_on_def Field_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
442 |
show ?thesis |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
443 |
by (rule map_prod_tranclE[OF assms[unfolded tRAG_def_tG] inj], auto intro!:that) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
444 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
445 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
446 |
lemma rtrancl_tRAG_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
447 |
assumes "(n1, n2) \<in> (tRAG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
448 |
obtains "n1 = n2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
449 |
| "n1 = Th (the_thread n1)" "n2 = Th (the_thread n2)" "the_thread n1 \<noteq> the_thread n2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
450 |
"(the_thread n1, the_thread n2) \<in> (tG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
451 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
452 |
from rtranclD[OF assms] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
453 |
have "n1 = n2 \<or> |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
454 |
n1 = Th (the_thread n1) \<and> n2 = Th (the_thread n2) \<and> the_thread n1 \<noteq> the_thread n2 \<and> |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
455 |
(the_thread n1, the_thread n2) \<in> (tG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
456 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
457 |
assume h: "n1 \<noteq> n2 \<and> (n1, n2) \<in> (tRAG s)\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
458 |
hence "(n1, n2) \<in> (tRAG s)\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
459 |
from trancl_tRAG_tG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
460 |
have "n1 = Th (the_thread n1)" "n2 = Th (the_thread n2)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
461 |
"(the_thread n1, the_thread n2) \<in> (tG s)\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
462 |
with h |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
463 |
show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
464 |
qed auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
465 |
with that show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
466 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
467 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
468 |
lemma ancestors_imageE: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
469 |
assumes "u \<in> ancestors ((map_prod f f) ` R) v" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
470 |
and "inj_on f (Field R)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
471 |
obtains u' v' where "u = (f u')" "v = (f v')" "u' \<in> ancestors R v'" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
472 |
using assms unfolding ancestors_def |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
473 |
by (metis map_prod_tranclE mem_Collect_eq) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
474 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
475 |
lemma tRAG_ancestorsE_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
476 |
assumes "x \<in> ancestors (tRAG s) u" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
477 |
obtains "x = Th (the_thread x)" "u = Th (the_thread u)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
478 |
"the_thread x \<in> ancestors (tG s) (the_thread u)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
479 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
480 |
from assms[unfolded ancestors_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
481 |
have "(u, x) \<in> (tRAG s)\<^sup>+" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
482 |
from trancl_tRAG_tG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
483 |
show ?thesis using that by (auto simp:ancestors_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
484 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
485 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
486 |
lemma ancestors_tG_tRAG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
487 |
assumes "th1 \<in> ancestors (tG s) th2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
488 |
shows "Th th1 \<in> ancestors (tRAG s) (Th th2)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
489 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
490 |
from assms[unfolded ancestors_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
491 |
have "(th2, th1) \<in> (tG s)\<^sup>+" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
492 |
from trancl_tG_tRAG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
493 |
show ?thesis by (simp add:ancestors_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
494 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
495 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
496 |
lemma subtree_nodeE: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
497 |
assumes "n \<in> subtree (tRAG s) (Th th)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
498 |
obtains th1 where "n = Th th1" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
499 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
500 |
show ?thesis |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
501 |
proof(rule subtreeE[OF assms]) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
502 |
assume "n = Th th" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
503 |
from that[OF this] show ?thesis . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
504 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
505 |
assume "Th th \<in> ancestors (tRAG s) n" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
506 |
hence "(n, Th th) \<in> (tRAG s)^+" by (auto simp:ancestors_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
507 |
hence "\<exists> th1. n = Th th1" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
508 |
proof(induct) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
509 |
case (base y) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
510 |
from tRAG_nodeE[OF this] show ?case by metis |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
511 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
512 |
case (step y z) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
513 |
thus ?case by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
514 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
515 |
with that show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
516 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
517 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
518 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
519 |
lemma subtree_nodeE_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
520 |
assumes "n \<in> subtree (tRAG s) (Th th)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
521 |
obtains "n = Th (the_thread n)" "the_thread n \<in> subtree (tG s) th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
522 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
523 |
from assms[unfolded subtree_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
524 |
have "(n, Th th) \<in> (tRAG s)\<^sup>*" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
525 |
hence "n = Th (the_thread n) \<and> the_thread n \<in> subtree (tG s) th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
526 |
by (cases rule:rtrancl_tRAG_tG, auto simp:subtree_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
527 |
thus ?thesis using that by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
528 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
529 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
530 |
lemma subtree_tRAG_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
531 |
"subtree (tRAG s) (Th th) = Th ` (subtree (tG s) th)" (is "?L = ?R") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
532 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
533 |
{ fix n |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
534 |
assume "n \<in> ?L" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
535 |
from subtree_nodeE_tG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
536 |
have "n \<in> ?R" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
537 |
} moreover { |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
538 |
fix n |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
539 |
assume "n \<in> ?R" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
540 |
then obtain th' where h: "th' \<in> subtree (tG s) th" "n = Th th'" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
541 |
hence "(th', th) \<in> (tG s)^*" by (auto simp:subtree_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
542 |
from rtrancl_tG_tRAG[OF this] and h |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
543 |
have "n \<in> ?L" by (auto simp:subtree_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
544 |
} ultimately show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
545 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
546 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
547 |
lemma subtree_tG_tRAG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
548 |
"(subtree (tG s) th) = the_thread ` (subtree (tRAG s) (Th th))" (is "?L = ?R") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
549 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
550 |
have "?R = (the_thread \<circ> Th) ` subtree (tG s) th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
551 |
by (unfold subtree_tRAG_tG image_comp, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
552 |
also have "... = id ` ?L" by (rule image_cong, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
553 |
finally show ?thesis by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
554 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
555 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
556 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
557 |
The following lemmas relate @{term tRAG} with |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
558 |
@{term RAG} from different perspectives. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
559 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
560 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
561 |
lemma tRAG_star_RAG: "(tRAG s)^* \<subseteq> (RAG s)^*" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
562 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
563 |
have "(wRAG s O hRAG s)^* \<subseteq> (RAG s O RAG s)^*" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
564 |
by (rule rtrancl_mono, auto simp:RAG_split) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
565 |
also have "... \<subseteq> ((RAG s)^*)^*" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
566 |
by (rule rtrancl_mono, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
567 |
also have "... = (RAG s)^*" by simp |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
568 |
finally show ?thesis by (unfold tRAG_def, simp) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
569 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
570 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
571 |
lemma tRAG_subtree_RAG: "subtree (tRAG s) x \<subseteq> subtree (RAG s) x" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
572 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
573 |
{ fix a |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
574 |
assume "a \<in> subtree (tRAG s) x" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
575 |
hence "(a, x) \<in> (tRAG s)^*" by (auto simp:subtree_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
576 |
with tRAG_star_RAG |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
577 |
have "(a, x) \<in> (RAG s)^*" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
578 |
hence "a \<in> subtree (RAG s) x" by (auto simp:subtree_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
579 |
} thus ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
580 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
581 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
582 |
lemma tRAG_trancl_eq: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
583 |
"{th'. (Th th', Th th) \<in> (tRAG s)^+} = |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
584 |
{th'. (Th th', Th th) \<in> (RAG s)^+}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
585 |
(is "?L = ?R") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
586 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
587 |
{ fix th' |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
588 |
assume "th' \<in> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
589 |
hence "(Th th', Th th) \<in> (tRAG s)^+" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
590 |
from tranclD[OF this] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
591 |
obtain z where h: "(Th th', z) \<in> tRAG s" "(z, Th th) \<in> (tRAG s)\<^sup>*" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
592 |
from tRAG_subtree_RAG and this(2) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
593 |
have "(z, Th th) \<in> (RAG s)^*" by (meson subsetCE tRAG_star_RAG) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
594 |
moreover from h(1) have "(Th th', z) \<in> (RAG s)^+" using tRAG_alt_def by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
595 |
ultimately have "th' \<in> ?R" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
596 |
} moreover |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
597 |
{ fix th' |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
598 |
assume "th' \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
599 |
hence "(Th th', Th th) \<in> (RAG s)^+" by (auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
600 |
from plus_rpath[OF this] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
601 |
obtain xs where rp: "rpath (RAG s) (Th th') xs (Th th)" "xs \<noteq> []" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
602 |
hence "(Th th', Th th) \<in> (tRAG s)^+" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
603 |
proof(induct xs arbitrary:th' th rule:length_induct) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
604 |
case (1 xs th' th) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
605 |
then obtain x1 xs1 where Cons1: "xs = x1#xs1" by (cases xs, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
606 |
show ?case |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
607 |
proof(cases "xs1") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
608 |
case Nil |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
609 |
from 1(2)[unfolded Cons1 Nil] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
610 |
have rp: "rpath (RAG s) (Th th') [x1] (Th th)" . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
611 |
hence "(Th th', x1) \<in> (RAG s)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
612 |
by (cases, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
613 |
then obtain cs where "x1 = Cs cs" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
614 |
by (unfold s_RAG_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
615 |
from rpath_nnl_lastE[OF rp[unfolded this]] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
616 |
show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
617 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
618 |
case (Cons x2 xs2) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
619 |
from 1(2)[unfolded Cons1[unfolded this]] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
620 |
have rp: "rpath (RAG s) (Th th') (x1 # x2 # xs2) (Th th)" . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
621 |
from rpath_edges_on[OF this] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
622 |
have eds: "edges_on (Th th' # x1 # x2 # xs2) \<subseteq> RAG s" . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
623 |
have "(Th th', x1) \<in> edges_on (Th th' # x1 # x2 # xs2)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
624 |
by (simp add: edges_on_unfold) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
625 |
with eds have rg1: "(Th th', x1) \<in> RAG s" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
626 |
then obtain cs1 where eq_x1: "x1 = Cs cs1" by (unfold s_RAG_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
627 |
have "(x1, x2) \<in> edges_on (Th th' # x1 # x2 # xs2)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
628 |
by (simp add: edges_on_unfold) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
629 |
from this eds |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
630 |
have rg2: "(x1, x2) \<in> RAG s" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
631 |
from this[unfolded eq_x1] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
632 |
obtain th1 where eq_x2: "x2 = Th th1" by (unfold s_RAG_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
633 |
from rg1[unfolded eq_x1] rg2[unfolded eq_x1 eq_x2] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
634 |
have rt1: "(Th th', Th th1) \<in> tRAG s" by (unfold tRAG_alt_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
635 |
from rp have "rpath (RAG s) x2 xs2 (Th th)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
636 |
by (elim rpath_ConsE, simp) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
637 |
from this[unfolded eq_x2] have rp': "rpath (RAG s) (Th th1) xs2 (Th th)" . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
638 |
show ?thesis |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
639 |
proof(cases "xs2 = []") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
640 |
case True |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
641 |
from rpath_nilE[OF rp'[unfolded this]] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
642 |
have "th1 = th" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
643 |
from rt1[unfolded this] show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
644 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
645 |
case False |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
646 |
from 1(1)[rule_format, OF _ rp' this, unfolded Cons1 Cons] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
647 |
have "(Th th1, Th th) \<in> (tRAG s)\<^sup>+" by simp |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
648 |
with rt1 show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
649 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
650 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
651 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
652 |
hence "th' \<in> ?L" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
653 |
} ultimately show ?thesis by blast |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
654 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
655 |
|
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
656 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
657 |
lemma tRAG_trancl_eq_Th: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
658 |
"{Th th' | th'. (Th th', Th th) \<in> (tRAG s)^+} = |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
659 |
{Th th' | th'. (Th th', Th th) \<in> (RAG s)^+}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
660 |
using tRAG_trancl_eq by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
661 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
662 |
lemma tRAG_Field: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
663 |
"Field (tRAG s) \<subseteq> Field (RAG s)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
664 |
by (unfold tRAG_alt_def Field_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
665 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
666 |
lemma tRAG_mono: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
667 |
assumes "RAG s' \<subseteq> RAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
668 |
shows "tRAG s' \<subseteq> tRAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
669 |
using assms |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
670 |
by (unfold tRAG_alt_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
671 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
672 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
673 |
lemma tRAG_subtree_eq: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
674 |
"(subtree (tRAG s) (Th th)) = {Th th' | th'. Th th' \<in> (subtree (RAG s) (Th th))}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
675 |
(is "?L = ?R") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
676 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
677 |
{ fix n |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
678 |
assume h: "n \<in> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
679 |
hence "n \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
680 |
by (smt mem_Collect_eq subsetCE subtree_def subtree_nodeE tRAG_subtree_RAG) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
681 |
} moreover { |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
682 |
fix n |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
683 |
assume "n \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
684 |
then obtain th' where h: "n = Th th'" "(Th th', Th th) \<in> (RAG s)^*" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
685 |
by (auto simp:subtree_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
686 |
from rtranclD[OF this(2)] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
687 |
have "n \<in> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
688 |
proof |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
689 |
assume "Th th' \<noteq> Th th \<and> (Th th', Th th) \<in> (RAG s)\<^sup>+" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
690 |
with h have "n \<in> {Th th' | th'. (Th th', Th th) \<in> (RAG s)^+}" by auto |
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
691 |
thus ?thesis using subtree_def tRAG_trancl_eq |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
692 |
by fastforce (* ccc *) |
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
693 |
qed (insert h, auto simp:subtree_def) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
694 |
} ultimately show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
695 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
696 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
697 |
lemma threads_set_eq: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
698 |
"the_thread ` (subtree (tRAG s) (Th th)) = |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
699 |
{th'. Th th' \<in> (subtree (RAG s) (Th th))}" (is "?L = ?R") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
700 |
by (auto intro:rev_image_eqI simp:tRAG_subtree_eq) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
701 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
702 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
703 |
The following lemmas is an alternative definition of @{term cp}, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
704 |
which is based on the notion of subtrees in @{term RAG} and |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
705 |
is handy to use once the abstract theory of {\em relational graph} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
706 |
(and specifically {\em relational tree} and {\em relational forest}) |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
707 |
are in place. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
708 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
709 |
lemma cp_alt_def: |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
710 |
"cp s th = Max ((the_preced s) ` {th'. Th th' \<in> (subtree (RAG s) (Th th))})" |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
711 |
proof - |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
712 |
have "Max (the_preced s ` ({th} \<union> dependants s th)) = |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
713 |
Max (the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)})" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
714 |
(is "Max (_ ` ?L) = Max (_ ` ?R)") |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
715 |
proof - |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
716 |
have "?L = ?R" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
717 |
unfolding subtree_def |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
718 |
apply(auto) |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
719 |
apply (simp add: s_RAG_abv s_dependants_def wq_def) |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
720 |
by (simp add: rtrancl_eq_or_trancl s_RAG_abv s_dependants_def wq_def) |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
721 |
thus ?thesis by simp |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
722 |
qed |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
723 |
thus ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
724 |
by (metis (no_types, lifting) cp_eq cpreced_def2 f_image_eq |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
725 |
s_dependants_abv the_preced_def) |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
726 |
qed |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
727 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
728 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
729 |
The following is another definition of @{term cp}. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
730 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
731 |
lemma cp_alt_def1: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
732 |
"cp s th = Max ((the_preced s o the_thread) ` (subtree (tRAG s) (Th th)))" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
733 |
proof - |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
734 |
have "(the_preced s ` the_thread ` subtree (tRAG s) (Th th)) = |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
735 |
((the_preced s \<circ> the_thread) ` subtree (tRAG s) (Th th))" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
736 |
by auto |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
737 |
thus ?thesis by (unfold cp_alt_def, fold threads_set_eq, auto) |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
738 |
qed |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
739 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
740 |
text {* |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
741 |
The following is another definition of @{term cp} based on @{term tG}: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
742 |
*} |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
743 |
lemma cp_alt_def2: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
744 |
"cp s th = Max (the_preced s ` (subtree (tG s) th))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
745 |
by (unfold cp_alt_def1 subtree_tG_tRAG image_comp, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
746 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
747 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
748 |
lemma RAG_tRAG_transfer: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
749 |
assumes "RAG s' = RAG s \<union> {(Th th, Cs cs)}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
750 |
and "(Cs cs, Th th'') \<in> RAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
751 |
shows "tRAG s' = tRAG s \<union> {(Th th, Th th'')}" (is "?L = ?R") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
752 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
753 |
{ fix n1 n2 |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
754 |
assume "(n1, n2) \<in> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
755 |
from this[unfolded tRAG_alt_def] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
756 |
obtain th1 th2 cs' where |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
757 |
h: "n1 = Th th1" "n2 = Th th2" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
758 |
"(Th th1, Cs cs') \<in> RAG s'" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
759 |
"(Cs cs', Th th2) \<in> RAG s'" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
760 |
from h(4) and assms(1) have cs_in: "(Cs cs', Th th2) \<in> RAG s" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
761 |
from h(3) and assms(1) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
762 |
have "(Th th1, Cs cs') = (Th th, Cs cs) \<or> |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
763 |
(Th th1, Cs cs') \<in> RAG s" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
764 |
hence "(n1, n2) \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
765 |
proof |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
766 |
assume h1: "(Th th1, Cs cs') = (Th th, Cs cs)" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
767 |
with assms(1) have "(Th th1, Cs cs) \<in> RAG s'" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
768 |
moreover have "th2 = th''" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
769 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
770 |
from h1 have "cs' = cs" by simp |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
771 |
from assms(2) cs_in[unfolded this] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
772 |
have "holding s th'' cs" "holding s th2 cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
773 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
774 |
from held_unique[OF this] |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
775 |
show ?thesis by simp |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
776 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
777 |
ultimately show ?thesis using h(1,2) h1 by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
778 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
779 |
assume "(Th th1, Cs cs') \<in> RAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
780 |
with cs_in have "(Th th1, Th th2) \<in> tRAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
781 |
by (unfold tRAG_alt_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
782 |
from this[folded h(1, 2)] show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
783 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
784 |
} moreover { |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
785 |
fix n1 n2 |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
786 |
assume "(n1, n2) \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
787 |
hence "(n1, n2) \<in>tRAG s \<or> (n1, n2) = (Th th, Th th'')" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
788 |
hence "(n1, n2) \<in> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
789 |
proof |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
790 |
assume "(n1, n2) \<in> tRAG s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
791 |
moreover have "... \<subseteq> ?L" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
792 |
proof(rule tRAG_mono) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
793 |
show "RAG s \<subseteq> RAG s'" by (unfold assms(1), auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
794 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
795 |
ultimately show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
796 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
797 |
assume eq_n: "(n1, n2) = (Th th, Th th'')" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
798 |
from assms(1, 2) have "(Cs cs, Th th'') \<in> RAG s'" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
799 |
moreover have "(Th th, Cs cs) \<in> RAG s'" using assms(1) by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
800 |
ultimately show ?thesis |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
801 |
by (unfold eq_n tRAG_alt_def, auto) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
802 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
803 |
} ultimately show ?thesis by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
804 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
805 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
806 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
807 |
The following lemmas gives an alternative definition @{term dependants} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
808 |
in terms of @{term tRAG}. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
809 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
810 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
811 |
lemma dependants_alt_def: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
812 |
"dependants s th = {th'. (Th th', Th th) \<in> (tRAG s)^+}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
813 |
by (metis eq_RAG s_dependants_def tRAG_trancl_eq) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
814 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
815 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
816 |
The following lemmas gives another alternative definition @{term dependants} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
817 |
in terms of @{term RAG}. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
818 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
819 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
820 |
lemma dependants_alt_def1: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
821 |
"dependants (s::state) th = {th'. (Th th', Th th) \<in> (RAG s)^+}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
822 |
using dependants_alt_def tRAG_trancl_eq by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
823 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
824 |
text {* |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
825 |
Another definition of dependants based on @{term tG}: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
826 |
*} |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
827 |
lemma dependants_alt_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
828 |
"dependants s th = {th'. (th', th) \<in> (tG s)^+}" (is "?L = ?R") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
829 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
830 |
have "?L = {th'. (Th th', Th th) \<in> (tRAG s)\<^sup>+}" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
831 |
by (unfold dependants_alt_def, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
832 |
also have "... = ?R" (is "?LL = ?RR") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
833 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
834 |
{ fix th' |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
835 |
assume "th' \<in> ?LL" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
836 |
hence "(Th th', Th th) \<in> (tRAG s)\<^sup>+" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
837 |
from trancl_tRAG_tG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
838 |
have "th' \<in> ?RR" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
839 |
} moreover { |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
840 |
fix th' |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
841 |
assume "th' \<in> ?RR" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
842 |
hence "(th', th) \<in> (tG s)\<^sup>+" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
843 |
from trancl_tG_tRAG[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
844 |
have "th' \<in> ?LL" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
845 |
} ultimately show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
846 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
847 |
finally show ?thesis . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
848 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
849 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
850 |
lemma dependants_alt_def_tG_ancestors: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
851 |
"dependants s th = {th'. th \<in> ancestors (tG s) th'}" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
852 |
by (unfold dependants_alt_tG ancestors_def, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
853 |
|
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
854 |
|
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
855 |
|
99 | 856 |
section {* Locales used to investigate the execution of PIP *} |
857 |
||
858 |
text {* |
|
859 |
The following locale @{text valid_trace} is used to constrain the |
|
860 |
trace to be valid. All properties hold for valid traces are |
|
861 |
derived under this locale. |
|
862 |
*} |
|
63 | 863 |
locale valid_trace = |
864 |
fixes s |
|
865 |
assumes vt : "vt s" |
|
866 |
||
99 | 867 |
text {* |
868 |
The following locale @{text valid_trace_e} describes |
|
869 |
the valid extension of a valid trace. The event @{text "e"} |
|
870 |
represents an event in the system, which corresponds |
|
871 |
to a one step operation of the PIP protocol. |
|
872 |
It is required that @{text "e"} is an event eligible to happen |
|
873 |
under state @{text "s"}, which is already required to be valid |
|
874 |
by the parent locale @{text "valid_trace"}. |
|
875 |
||
876 |
This locale is used to investigate one step execution of PIP, |
|
877 |
properties concerning the effects of @{text "e"}'s execution, |
|
878 |
for example, how the values of observation functions are changed, |
|
879 |
or how desirable properties are kept invariant, are derived |
|
880 |
under this locale. The state before execution is @{text "s"}, while |
|
881 |
the state after execution is @{text "e#s"}. Therefore, the lemmas |
|
882 |
derived usually relate observations on @{text "e#s"} to those |
|
883 |
on @{text "s"}. |
|
884 |
*} |
|
885 |
||
63 | 886 |
locale valid_trace_e = valid_trace + |
887 |
fixes e |
|
888 |
assumes vt_e: "vt (e#s)" |
|
889 |
begin |
|
890 |
||
99 | 891 |
text {* |
892 |
The following lemma shows that @{text "e"} must be a |
|
893 |
eligible event (or a valid step) to be taken under |
|
894 |
the state represented by @{text "s"}. |
|
895 |
*} |
|
63 | 896 |
lemma pip_e: "PIP s e" |
897 |
using vt_e by (cases, simp) |
|
898 |
||
899 |
end |
|
900 |
||
99 | 901 |
text {* |
902 |
Because @{term "e#s"} is also a valid trace, properties |
|
903 |
derived for valid trace @{term s} also hold on @{term "e#s"}. |
|
904 |
*} |
|
120
b3b8735c7c02
updated to Isabelle 2016
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
905 |
sublocale valid_trace_e < vat_es: valid_trace "e#s" |
99 | 906 |
using vt_e |
907 |
by (unfold_locales, simp) |
|
908 |
||
909 |
text {* |
|
910 |
For each specific event (or operation), there is a sublocale |
|
911 |
further constraining that the event @{text e} to be that |
|
912 |
particular event. |
|
913 |
||
914 |
For example, the following |
|
915 |
locale @{text "valid_trace_create"} is the sublocale for |
|
916 |
event @{term "Create"}: |
|
917 |
*} |
|
918 |
locale valid_trace_create = valid_trace_e + |
|
919 |
fixes th prio |
|
920 |
assumes is_create: "e = Create th prio" |
|
921 |
||
922 |
locale valid_trace_exit = valid_trace_e + |
|
923 |
fixes th |
|
924 |
assumes is_exit: "e = Exit th" |
|
925 |
||
926 |
locale valid_trace_p = valid_trace_e + |
|
927 |
fixes th cs |
|
928 |
assumes is_p: "e = P th cs" |
|
929 |
||
930 |
text {* |
|
931 |
locale @{text "valid_trace_p"} is divided further into two |
|
932 |
sublocales, namely, @{text "valid_trace_p_h"} |
|
933 |
and @{text "valid_trace_p_w"}. |
|
934 |
*} |
|
935 |
||
936 |
text {* |
|
937 |
The following two sublocales @{text "valid_trace_p_h"} |
|
938 |
and @{text "valid_trace_p_w"} represent two complementary |
|
939 |
cases under @{text "valid_trace_p"}, where |
|
940 |
@{text "valid_trace_p_h"} further constraints that |
|
941 |
@{text "wq s cs = []"}, which means the waiting queue of |
|
942 |
the requested resource @{text "cs"} is empty, in which |
|
943 |
case, the requesting thread @{text "th"} |
|
944 |
will take hold of @{text "cs"}. |
|
945 |
||
946 |
Opposite to @{text "valid_trace_p_h"}, |
|
947 |
@{text "valid_trace_p_w"} constraints that |
|
948 |
@{text "wq s cs \<noteq> []"}, which means the waiting queue of |
|
949 |
the requested resource @{text "cs"} is nonempty, in which |
|
950 |
case, the requesting thread @{text "th"} will be blocked |
|
951 |
on @{text "cs"}: |
|
952 |
||
953 |
Peculiar properties will be derived under respective |
|
954 |
locales. |
|
955 |
*} |
|
956 |
||
957 |
locale valid_trace_p_h = valid_trace_p + |
|
958 |
assumes we: "wq s cs = []" |
|
959 |
||
960 |
locale valid_trace_p_w = valid_trace_p + |
|
961 |
assumes wne: "wq s cs \<noteq> []" |
|
962 |
begin |
|
963 |
||
964 |
text {* |
|
965 |
The following @{text "holder"} designates |
|
966 |
the holder of @{text "cs"} before the @{text "P"}-operation. |
|
967 |
*} |
|
968 |
definition "holder = hd (wq s cs)" |
|
969 |
||
970 |
text {* |
|
971 |
The following @{text "waiters"} designates |
|
972 |
the list of threads waiting for @{text "cs"} |
|
973 |
before the @{text "P"}-operation. |
|
974 |
*} |
|
975 |
definition "waiters = tl (wq s cs)" |
|
976 |
end |
|
977 |
||
978 |
text {* |
|
979 |
@{text "valid_trace_v"} is set for the @{term V}-operation. |
|
980 |
*} |
|
981 |
locale valid_trace_v = valid_trace_e + |
|
982 |
fixes th cs |
|
983 |
assumes is_v: "e = V th cs" |
|
984 |
begin |
|
985 |
-- {* The following @{text "rest"} is the tail of |
|
986 |
waiting queue of the resource @{text "cs"} |
|
987 |
to be released by this @{text "V"}-operation. |
|
988 |
*} |
|
989 |
definition "rest = tl (wq s cs)" |
|
990 |
||
991 |
text {* |
|
992 |
The following @{text "wq'"} is the waiting |
|
993 |
queue of @{term "cs"} |
|
994 |
after the @{text "V"}-operation, which |
|
995 |
is simply a reordering of @{term "rest"}. |
|
996 |
||
997 |
The effect of this reordering needs to be |
|
998 |
understood by two cases: |
|
999 |
\begin{enumerate} |
|
1000 |
\item When @{text "rest = []"}, |
|
1001 |
the reordering gives rise to an empty list as well, |
|
1002 |
which means there is no thread holding or waiting |
|
1003 |
for resource @{term "cs"}, therefore, it is free. |
|
1004 |
||
1005 |
\item When @{text "rest \<noteq> []"}, the effect of |
|
1006 |
this reordering is to arbitrarily |
|
1007 |
switch one thread in @{term "rest"} to the |
|
1008 |
head, which, by definition take over the hold |
|
1009 |
of @{term "cs"} and is designated by @{text "taker"} |
|
1010 |
in the following sublocale @{text "valid_trace_v_n"}. |
|
1011 |
*} |
|
1012 |
definition "wq' = (SOME q. distinct q \<and> set q = set rest)" |
|
1013 |
||
1014 |
text {* |
|
1015 |
The following @{text "rest'"} is the tail of the |
|
1016 |
waiting queue after the @{text "V"}-operation. |
|
1017 |
It plays only auxiliary role to ease reasoning. |
|
1018 |
*} |
|
1019 |
definition "rest' = tl wq'" |
|
1020 |
||
1021 |
end |
|
1022 |
||
1023 |
text {* |
|
1024 |
In the following, @{text "valid_trace_v"} is also |
|
1025 |
divided into two |
|
1026 |
sublocales: when @{text "rest"} is empty (represented |
|
1027 |
by @{text "valid_trace_v_e"}), which means, there is no thread waiting |
|
1028 |
for @{text "cs"}, therefore, after the @{text "V"}-operation, |
|
1029 |
it will become free; otherwise (represented |
|
1030 |
by @{text "valid_trace_v_n"}), one thread |
|
1031 |
will be picked from those in @{text "rest"} to take |
|
1032 |
over @{text "cs"}. |
|
1033 |
*} |
|
1034 |
||
1035 |
locale valid_trace_v_e = valid_trace_v + |
|
1036 |
assumes rest_nil: "rest = []" |
|
1037 |
||
1038 |
locale valid_trace_v_n = valid_trace_v + |
|
1039 |
assumes rest_nnl: "rest \<noteq> []" |
|
1040 |
begin |
|
1041 |
||
1042 |
text {* |
|
1043 |
The following @{text "taker"} is the thread to |
|
1044 |
take over @{text "cs"}. |
|
1045 |
*} |
|
1046 |
definition "taker = hd wq'" |
|
1047 |
||
1048 |
end |
|
1049 |
||
1050 |
||
1051 |
locale valid_trace_set = valid_trace_e + |
|
1052 |
fixes th prio |
|
1053 |
assumes is_set: "e = Set th prio" |
|
1054 |
||
1055 |
context valid_trace |
|
1056 |
begin |
|
1057 |
||
1058 |
text {* |
|
1059 |
Induction rule introduced to easy the |
|
1060 |
derivation of properties for valid trace @{term "s"}. |
|
1061 |
One more premises, namely @{term "valid_trace_e s e"} |
|
1062 |
is added, so that an interpretation of |
|
1063 |
@{text "valid_trace_e"} can be instantiated |
|
1064 |
so that all properties derived so far becomes |
|
1065 |
available in the proof of induction step. |
|
1066 |
||
1067 |
You will see its use in the proofs that follows. |
|
1068 |
*} |
|
1069 |
lemma ind [consumes 0, case_names Nil Cons, induct type]: |
|
1070 |
assumes "PP []" |
|
1071 |
and "(\<And>s e. valid_trace_e s e \<Longrightarrow> |
|
1072 |
PP s \<Longrightarrow> PIP s e \<Longrightarrow> PP (e # s))" |
|
1073 |
shows "PP s" |
|
1074 |
proof(induct rule:vt.induct[OF vt, case_names Init Step]) |
|
1075 |
case Init |
|
1076 |
from assms(1) show ?case . |
|
1077 |
next |
|
1078 |
case (Step s e) |
|
1079 |
show ?case |
|
1080 |
proof(rule assms(2)) |
|
1081 |
show "valid_trace_e s e" using Step by (unfold_locales, auto) |
|
1082 |
next |
|
1083 |
show "PP s" using Step by simp |
|
1084 |
next |
|
1085 |
show "PIP s e" using Step by simp |
|
1086 |
qed |
|
1087 |
qed |
|
1088 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1089 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1090 |
lemma finite_threads: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1091 |
shows "finite (threads s)" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1092 |
using vt by (induct) (auto elim: step.cases) |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1093 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1094 |
lemma finite_readys: "finite (readys s)" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1095 |
using finite_threads readys_threads rev_finite_subset by blast |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1096 |
|
99 | 1097 |
end |
1098 |
||
100 | 1099 |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1100 |
section {* Waiting queues are distinct *} |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1101 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1102 |
text {* |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1103 |
This section proves that every waiting queue in the system |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1104 |
is distinct, given in lemma @{text wq_distinct}. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1105 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1106 |
The proof is split into the locales for events (or operations), |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1107 |
all contain a lemma named @{text "wq_distinct_kept"} to show that |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1108 |
the distinctiveness is preserved by the respective operation. All lemmas |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1109 |
before are to facilitate the proof of @{text "wq_distinct_kept"}. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1110 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1111 |
The proof also demonstrates the common pattern to prove |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1112 |
invariant properties over valid traces, i.e. to spread the |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1113 |
invariant proof into locales and to assemble the results of all |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1114 |
locales to complete the final proof. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1115 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1116 |
*} |
108 | 1117 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1118 |
context valid_trace_create |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1119 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1120 |
|
99 | 1121 |
lemma wq_kept [simp]: |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1122 |
shows "wq (e#s) cs' = wq s cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1123 |
using assms unfolding is_create wq_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1124 |
by (auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1125 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1126 |
lemma wq_distinct_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1127 |
assumes "distinct (wq s cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1128 |
shows "distinct (wq (e#s) cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1129 |
using assms by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1130 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1131 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1132 |
context valid_trace_exit |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1133 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1134 |
|
99 | 1135 |
lemma wq_kept [simp]: |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1136 |
shows "wq (e#s) cs' = wq s cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1137 |
using assms unfolding is_exit wq_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1138 |
by (auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1139 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1140 |
lemma wq_distinct_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1141 |
assumes "distinct (wq s cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1142 |
shows "distinct (wq (e#s) cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1143 |
using assms by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1144 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1145 |
|
100 | 1146 |
context valid_trace_p |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1147 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1148 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1149 |
lemma wq_neq_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1150 |
assumes "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1151 |
shows "wq (e#s) cs' = wq s cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1152 |
using assms unfolding is_p wq_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1153 |
by (auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1154 |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1155 |
lemma running_th_s: |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1156 |
shows "th \<in> running s" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1157 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1158 |
from pip_e[unfolded is_p] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1159 |
show ?thesis by (cases, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1160 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1161 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1162 |
lemma th_not_in_wq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1163 |
shows "th \<notin> set (wq s cs)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1164 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1165 |
assume otherwise: "th \<in> set (wq s cs)" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1166 |
from running_wqE[OF running_th_s this] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1167 |
obtain rest where eq_wq: "wq s cs = th#rest" by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1168 |
with otherwise |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1169 |
have "holding s th cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1170 |
unfolding s_holding_def by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1171 |
hence cs_th_RAG: "(Cs cs, Th th) \<in> RAG s" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1172 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1173 |
from pip_e[unfolded is_p] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1174 |
show False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1175 |
proof(cases) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1176 |
case (thread_P) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1177 |
with cs_th_RAG show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1178 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1179 |
qed |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1180 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1181 |
lemma wq_es_cs: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1182 |
"wq (e#s) cs = wq s cs @ [th]" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1183 |
by (unfold is_p wq_def, auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1184 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1185 |
lemma wq_distinct_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1186 |
assumes "distinct (wq s cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1187 |
shows "distinct (wq (e#s) cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1188 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1189 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1190 |
show ?thesis using True assms th_not_in_wq |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1191 |
by (unfold True wq_es_cs, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1192 |
qed (insert assms, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1193 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1194 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1195 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1196 |
context valid_trace_v |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1197 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1198 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1199 |
lemma wq_neq_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1200 |
assumes "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1201 |
shows "wq (e#s) cs' = wq s cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1202 |
using assms unfolding is_v wq_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1203 |
by (auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1204 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1205 |
lemma wq_s_cs: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1206 |
"wq s cs = th#rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1207 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1208 |
from pip_e[unfolded is_v] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1209 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1210 |
proof(cases) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1211 |
case (thread_V) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1212 |
from this(2) show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1213 |
unfolding s_holding_def |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1214 |
by (metis empty_iff empty_set hd_Cons_tl rest_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1215 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1216 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1217 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1218 |
lemma wq_es_cs: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1219 |
"wq (e#s) cs = wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1220 |
using wq_s_cs[unfolded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1221 |
by (auto simp:Let_def wq_def rest_def wq'_def is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1222 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1223 |
lemma wq_distinct_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1224 |
assumes "distinct (wq s cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1225 |
shows "distinct (wq (e#s) cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1226 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1227 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1228 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1229 |
proof(unfold True wq_es_cs wq'_def, rule someI2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1230 |
show "distinct rest \<and> set rest = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1231 |
using assms[unfolded True wq_s_cs] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1232 |
qed simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1233 |
qed (insert assms, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1234 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1235 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1236 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1237 |
context valid_trace_set |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1238 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1239 |
|
99 | 1240 |
lemma wq_kept [simp]: |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1241 |
shows "wq (e#s) cs' = wq s cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1242 |
using assms unfolding is_set wq_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1243 |
by (auto simp:Let_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1244 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1245 |
lemma wq_distinct_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1246 |
assumes "distinct (wq s cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1247 |
shows "distinct (wq (e#s) cs')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1248 |
using assms by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1249 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1250 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1251 |
context valid_trace |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1252 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1253 |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1254 |
text {* |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1255 |
The proof of @{text "wq_distinct"} shows how the results |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1256 |
proved in the foregoing locales are assembled in |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1257 |
a overall structure of induction and case analysis |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1258 |
to get the final conclusion. This scheme will be |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1259 |
used repeatedly in the following. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1260 |
*} |
63 | 1261 |
lemma wq_distinct: "distinct (wq s cs)" |
68 | 1262 |
proof(induct rule:ind) |
1263 |
case (Cons s e) |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1264 |
interpret vt_e: valid_trace_e s e using Cons by simp |
68 | 1265 |
show ?case |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1266 |
proof(cases e) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1267 |
case (Create th prio) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1268 |
interpret vt_create: valid_trace_create s e th prio |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1269 |
using Create by (unfold_locales, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1270 |
show ?thesis using Cons by (simp add: vt_create.wq_distinct_kept) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1271 |
next |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1272 |
case (Exit th) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1273 |
interpret vt_exit: valid_trace_exit s e th |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1274 |
using Exit by (unfold_locales, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1275 |
show ?thesis using Cons by (simp add: vt_exit.wq_distinct_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1276 |
next |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1277 |
case (P th cs) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1278 |
interpret vt_p: valid_trace_p s e th cs using P by (unfold_locales, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1279 |
show ?thesis using Cons by (simp add: vt_p.wq_distinct_kept) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1280 |
next |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1281 |
case (V th cs) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1282 |
interpret vt_v: valid_trace_v s e th cs using V by (unfold_locales, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1283 |
show ?thesis using Cons by (simp add: vt_v.wq_distinct_kept) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1284 |
next |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1285 |
case (Set th prio) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1286 |
interpret vt_set: valid_trace_set s e th prio |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1287 |
using Set by (unfold_locales, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1288 |
show ?thesis using Cons by (simp add: vt_set.wq_distinct_kept) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1289 |
qed |
68 | 1290 |
qed (unfold wq_def Let_def, simp) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1291 |
|
63 | 1292 |
end |
1293 |
||
100 | 1294 |
section {* Waiting queues and threads *} |
1295 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1296 |
text {* |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1297 |
This section shows that all threads withing waiting queues are |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1298 |
in the @{term threads}-set. In other words, @{term threads} covers |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1299 |
all the threads in waiting queue. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1300 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1301 |
The proof follows the same pattern as @{thm valid_trace.wq_distinct}. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1302 |
The desired property is shown to be kept by all operations (or events) |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1303 |
in their respective locales, and finally the main lemmas is |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1304 |
derived by assembling the invariant keeping results of the locales. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1305 |
*} |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1306 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1307 |
context valid_trace_create |
63 | 1308 |
begin |
1309 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1310 |
lemma |
100 | 1311 |
th_not_in_threads: "th \<notin> threads s" |
1312 |
proof - |
|
1313 |
from pip_e[unfolded is_create] |
|
1314 |
show ?thesis by (cases, simp) |
|
1315 |
qed |
|
1316 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1317 |
lemma |
100 | 1318 |
threads_es [simp]: "threads (e#s) = threads s \<union> {th}" |
1319 |
by (unfold is_create, simp) |
|
1320 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1321 |
lemma wq_threads_kept: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1322 |
assumes "\<And> th' cs'. th' \<in> set (wq s cs') \<Longrightarrow> th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1323 |
and "th' \<in> set (wq (e#s) cs')" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1324 |
shows "th' \<in> threads (e#s)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1325 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1326 |
have "th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1327 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1328 |
from assms(2)[unfolded wq_kept] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1329 |
have "th' \<in> set (wq s cs')" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1330 |
from assms(1)[OF this] show ?thesis . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1331 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1332 |
with threads_es show ?thesis by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1333 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1334 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1335 |
end |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1336 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1337 |
context valid_trace_exit |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1338 |
begin |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1339 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1340 |
lemma threads_es [simp]: "threads (e#s) = threads s - {th}" |
100 | 1341 |
by (unfold is_exit, simp) |
1342 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1343 |
lemma |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1344 |
th_not_in_wq: "th \<notin> set (wq s cs)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1345 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1346 |
from pip_e[unfolded is_exit] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1347 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1348 |
apply(cases) |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1349 |
unfolding holdents_def s_holding_def |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1350 |
by (metis (mono_tags, lifting) empty_iff list.sel(1) mem_Collect_eq running_wqE) |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1351 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1352 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1353 |
lemma wq_threads_kept: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1354 |
assumes "\<And> th' cs'. th' \<in> set (wq s cs') \<Longrightarrow> th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1355 |
and "th' \<in> set (wq (e#s) cs')" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1356 |
shows "th' \<in> threads (e#s)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1357 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1358 |
have "th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1359 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1360 |
from assms(2)[unfolded wq_kept] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1361 |
have "th' \<in> set (wq s cs')" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1362 |
from assms(1)[OF this] show ?thesis . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1363 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1364 |
moreover have "th' \<noteq> th" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1365 |
proof |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1366 |
assume otherwise: "th' = th" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1367 |
from assms(2)[unfolded wq_kept] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1368 |
have "th' \<in> set (wq s cs')" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1369 |
with th_not_in_wq[folded otherwise] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1370 |
show False by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1371 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1372 |
ultimately show ?thesis |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1373 |
by (unfold threads_es, simp) |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1374 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1375 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1376 |
end |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1377 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1378 |
context valid_trace_v |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1379 |
begin |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1380 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1381 |
lemma |
100 | 1382 |
threads_es [simp]: "threads (e#s) = threads s" |
1383 |
by (unfold is_v, simp) |
|
1384 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1385 |
lemma |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1386 |
th_not_in_rest: "th \<notin> set rest" |
100 | 1387 |
proof |
1388 |
assume otherwise: "th \<in> set rest" |
|
1389 |
have "distinct (wq s cs)" by (simp add: wq_distinct) |
|
1390 |
from this[unfolded wq_s_cs] and otherwise |
|
1391 |
show False by auto |
|
1392 |
qed |
|
1393 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1394 |
lemma distinct_rest: "distinct rest" |
100 | 1395 |
by (simp add: distinct_tl rest_def wq_distinct) |
1396 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1397 |
lemma |
100 | 1398 |
set_wq_es_cs [simp]: "set (wq (e#s) cs) = set (wq s cs) - {th}" |
1399 |
proof(unfold wq_es_cs wq'_def, rule someI2) |
|
1400 |
show "distinct rest \<and> set rest = set rest" |
|
1401 |
by (simp add: distinct_rest) |
|
1402 |
next |
|
1403 |
fix x |
|
1404 |
assume "distinct x \<and> set x = set rest" |
|
1405 |
thus "set x = set (wq s cs) - {th}" |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1406 |
by (unfold wq_s_cs, simp add:th_not_in_rest) |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1407 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1408 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1409 |
lemma wq_threads_kept: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1410 |
assumes "\<And> th' cs'. th' \<in> set (wq s cs') \<Longrightarrow> th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1411 |
and "th' \<in> set (wq (e#s) cs')" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1412 |
shows "th' \<in> threads (e#s)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1413 |
proof(cases "cs' = cs") |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1414 |
case True |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1415 |
have " th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1416 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1417 |
from assms(2)[unfolded True set_wq_es_cs] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1418 |
have "th' \<in> set (wq s cs) - {th}" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1419 |
hence "th' \<in> set (wq s cs)" by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1420 |
from assms(1)[OF this] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1421 |
show ?thesis . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1422 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1423 |
with threads_es show ?thesis by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1424 |
next |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1425 |
case False |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1426 |
have "th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1427 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1428 |
from wq_neq_simp[OF False] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1429 |
have "wq (e # s) cs' = wq s cs'" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1430 |
from assms(2)[unfolded this] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1431 |
have "th' \<in> set (wq s cs')" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1432 |
from assms(1)[OF this] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1433 |
show ?thesis . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1434 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1435 |
with threads_es show ?thesis by simp |
100 | 1436 |
qed |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1437 |
end |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1438 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1439 |
context valid_trace_p |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1440 |
begin |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1441 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1442 |
lemma threads_es [simp]: "threads (e#s) = threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1443 |
by (unfold is_p, simp) |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1444 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1445 |
lemma ready_th_s: "th \<in> readys s" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1446 |
using running_th_s |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1447 |
by (unfold running_def, auto) |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1448 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1449 |
lemma live_th_s: "th \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1450 |
using readys_threads ready_th_s by auto |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1451 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1452 |
lemma wq_threads_kept: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1453 |
assumes "\<And> th' cs'. th' \<in> set (wq s cs') \<Longrightarrow> th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1454 |
and "th' \<in> set (wq (e#s) cs')" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1455 |
shows "th' \<in> threads (e#s)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1456 |
proof(cases "cs' = cs") |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1457 |
case True |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1458 |
from assms(2)[unfolded True wq_es_cs] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1459 |
have "th' \<in> set (wq s cs) \<or> th' = th" by auto |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1460 |
thus ?thesis |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1461 |
proof |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1462 |
assume "th' \<in> set (wq s cs)" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1463 |
from assms(1)[OF this] have "th' \<in> threads s" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1464 |
with threads_es |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1465 |
show ?thesis by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1466 |
next |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1467 |
assume "th' = th" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1468 |
with live_th_s have "th' \<in> threads s" by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1469 |
with threads_es show ?thesis by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1470 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1471 |
next |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1472 |
case False |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1473 |
have "th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1474 |
proof - |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1475 |
from wq_neq_simp[OF False] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1476 |
have "wq (e # s) cs' = wq s cs'" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1477 |
from assms(2)[unfolded this] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1478 |
have "th' \<in> set (wq s cs')" . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1479 |
from assms(1)[OF this] |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1480 |
show ?thesis . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1481 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1482 |
with threads_es show ?thesis by simp |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1483 |
qed |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1484 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1485 |
end |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1486 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1487 |
context valid_trace_set |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1488 |
begin |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1489 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1490 |
lemma threads_kept[simp]: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1491 |
"threads (e#s) = threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1492 |
by (unfold is_set, simp) |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1493 |
|
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1494 |
lemma wq_threads_kept: |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1495 |
assumes "\<And> th' cs'. th' \<in> set (wq s cs') \<Longrightarrow> th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1496 |
and "th' \<in> set (wq (e#s) cs')" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1497 |
shows "th' \<in> threads (e#s)" |
100 | 1498 |
proof - |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1499 |
have "th' \<in> threads s" |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1500 |
using assms(1)[OF assms(2)[unfolded wq_kept]] . |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1501 |
with threads_kept show ?thesis by simp |
100 | 1502 |
qed |
1503 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1504 |
end |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1505 |
|
129
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
1506 |
context valid_trace |
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
1507 |
begin |
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
1508 |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1509 |
text {* |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1510 |
The is the main lemma of this section, which is derived |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1511 |
by induction, case analysis on event @{text e} and |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1512 |
assembling the @{text "wq_threads_kept"}-results of |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1513 |
all possible cases of @{text "e"}. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1514 |
*} |
129
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
1515 |
lemma wq_threads: |
100 | 1516 |
assumes "th \<in> set (wq s cs)" |
1517 |
shows "th \<in> threads s" |
|
1518 |
using assms |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1519 |
proof(induct arbitrary:th cs rule:ind) |
100 | 1520 |
case (Nil) |
1521 |
thus ?case by (auto simp:wq_def) |
|
1522 |
next |
|
1523 |
case (Cons s e) |
|
1524 |
interpret vt_e: valid_trace_e s e using Cons by simp |
|
1525 |
show ?case |
|
1526 |
proof(cases e) |
|
1527 |
case (Create th' prio') |
|
1528 |
interpret vt: valid_trace_create s e th' prio' |
|
1529 |
using Create by (unfold_locales, simp) |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1530 |
show ?thesis using vt.wq_threads_kept Cons by auto |
100 | 1531 |
next |
1532 |
case (Exit th') |
|
1533 |
interpret vt: valid_trace_exit s e th' |
|
1534 |
using Exit by (unfold_locales, simp) |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1535 |
show ?thesis using vt.wq_threads_kept Cons by auto |
100 | 1536 |
next |
1537 |
case (P th' cs') |
|
1538 |
interpret vt: valid_trace_p s e th' cs' |
|
1539 |
using P by (unfold_locales, simp) |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1540 |
show ?thesis using vt.wq_threads_kept Cons by auto |
100 | 1541 |
next |
1542 |
case (V th' cs') |
|
1543 |
interpret vt: valid_trace_v s e th' cs' |
|
1544 |
using V by (unfold_locales, simp) |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1545 |
show ?thesis using vt.wq_threads_kept Cons by auto |
100 | 1546 |
next |
1547 |
case (Set th' prio) |
|
1548 |
interpret vt: valid_trace_set s e th' prio |
|
1549 |
using Set by (unfold_locales, simp) |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1550 |
show ?thesis using vt.wq_threads_kept Cons by auto |
100 | 1551 |
qed |
1552 |
qed |
|
1553 |
||
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1554 |
subsection {* RAG and threads *} |
68 | 1555 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1556 |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1557 |
text {* |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1558 |
As corollaries of @{thm wq_threads}, it is shown in this subsection |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1559 |
that the fields (including both domain |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1560 |
and range) of @{term RAG} are covered by @{term threads}. |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1561 |
*} |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
1562 |
|
100 | 1563 |
lemma dm_RAG_threads: |
1564 |
assumes in_dom: "(Th th) \<in> Domain (RAG s)" |
|
1565 |
shows "th \<in> threads s" |
|
104 | 1566 |
proof - |
100 | 1567 |
from in_dom obtain n where "(Th th, n) \<in> RAG s" by auto |
108 | 1568 |
moreover then obtain cs where "n = Cs cs" by (unfold s_RAG_def, auto) |
100 | 1569 |
ultimately have "(Th th, Cs cs) \<in> RAG s" by simp |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1570 |
then have "th \<in> set (wq s cs)" |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1571 |
using in_RAG_E s_waiting_def wq_def by auto |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1572 |
then show ?thesis using wq_threads by simp |
104 | 1573 |
qed |
1574 |
||
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1575 |
lemma dm_tG_threads: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1576 |
assumes "th \<in> Domain (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1577 |
shows "th \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1578 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1579 |
from assms[unfolded tG_alt_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1580 |
have "(Th th) \<in> Domain (RAG s)" by (unfold Domain_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1581 |
from dm_RAG_threads[OF this] show ?thesis . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1582 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1583 |
|
100 | 1584 |
lemma rg_RAG_threads: |
1585 |
assumes "(Th th) \<in> Range (RAG s)" |
|
1586 |
shows "th \<in> threads s" |
|
1587 |
using assms |
|
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1588 |
apply(erule_tac RangeE) |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1589 |
apply(erule_tac in_RAG_E) |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1590 |
apply(auto) |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1591 |
using s_holding_def wq_def wq_threads by auto |
100 | 1592 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1593 |
lemma rg_tG_threads: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1594 |
assumes "th \<in> Range (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1595 |
shows "th \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1596 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1597 |
from assms[unfolded tG_alt_def] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1598 |
have "(Th th) \<in> Range (RAG s)" by (unfold Range_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1599 |
from rg_RAG_threads[OF this] show ?thesis . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1600 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1601 |
|
100 | 1602 |
lemma RAG_threads: |
1603 |
assumes "(Th th) \<in> Field (RAG s)" |
|
1604 |
shows "th \<in> threads s" |
|
1605 |
using assms |
|
1606 |
by (metis Field_def UnE dm_RAG_threads rg_RAG_threads) |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1607 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1608 |
lemma tG_threads: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1609 |
assumes "th \<in> Field (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1610 |
shows "th \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1611 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1612 |
by (metis Field_def UnE dm_tG_threads rg_tG_threads) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1613 |
|
116 | 1614 |
lemma not_in_thread_isolated: |
1615 |
assumes "th \<notin> threads s" |
|
1616 |
shows "(Th th) \<notin> Field (RAG s)" |
|
1617 |
using RAG_threads assms by auto |
|
1618 |
||
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1619 |
lemma not_in_thread_isolated_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1620 |
assumes "th \<notin> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1621 |
shows "th \<notin> Field (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1622 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1623 |
using tG_threads by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1624 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1625 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1626 |
As a corollary, this lemma shows that @{term tRAG} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1627 |
is also covered by the @{term threads}-set. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1628 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1629 |
lemma subtree_tRAG_thread: |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1630 |
assumes "th \<in> threads s" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1631 |
shows "subtree (tRAG s) (Th th) \<subseteq> Th ` threads s" (is "?L \<subseteq> ?R") |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1632 |
proof - |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1633 |
have "?L = {Th th' |th'. Th th' \<in> subtree (RAG s) (Th th)}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1634 |
by (unfold tRAG_subtree_eq, simp) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1635 |
also have "... \<subseteq> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1636 |
proof |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1637 |
fix x |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1638 |
assume "x \<in> {Th th' |th'. Th th' \<in> subtree (RAG s) (Th th)}" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1639 |
then obtain th' where h: "x = Th th'" "Th th' \<in> subtree (RAG s) (Th th)" by auto |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1640 |
from this(2) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1641 |
show "x \<in> ?R" |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1642 |
proof(cases rule:subtreeE) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1643 |
case 1 |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1644 |
thus ?thesis by (simp add: assms h(1)) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1645 |
next |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1646 |
case 2 |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1647 |
thus ?thesis by (metis ancestors_Field dm_RAG_threads h(1) image_eqI) |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1648 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1649 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1650 |
finally show ?thesis . |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1651 |
qed |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
1652 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1653 |
lemma subtree_tG_thread: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1654 |
assumes "th \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1655 |
shows "subtree (tG s) th \<subseteq> threads s" (is "?L \<subseteq> ?R") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1656 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1657 |
from subtree_tRAG_thread[OF assms] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1658 |
have "subtree (tRAG s) (Th th) \<subseteq> Th ` threads s" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1659 |
from this[unfolded subtree_tRAG_tG] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1660 |
have " Th ` subtree (tG s) th \<subseteq> Th ` threads s" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1661 |
thus ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1662 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
1663 |
|
63 | 1664 |
end |
1665 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1666 |
section {* The formation of @{term RAG} *} |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1667 |
|
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1668 |
text {* |
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1669 |
The whole of PIP resides on the understanding of the formation |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1670 |
of @{term RAG}. We are going to show that @{term RAG} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1671 |
forms a finite branching forest. The formalization is divided |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1672 |
into a series of subsections. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1673 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1674 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1675 |
subsection {* The change of @{term RAG} with each step of execution *} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1676 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1677 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1678 |
The very essence to prove that @{term RAG} has a certain property is to |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1679 |
show that this property is preserved as an invariant by the execution |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1680 |
of the system, and the basis for such kind of invariant proofs is to |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1681 |
show how @{term RAG} is changed with the execution of every execution step |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1682 |
(or event, or system operation). In this subsection, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1683 |
the effect of every event on @{text RAG} is derived in its respective |
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1684 |
locale named @{text "RAG_es"} with all lemmas before auxiliary. |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1685 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1686 |
These derived @{text "RAG_es"}s constitute the foundation |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
1687 |
to show the various well-formed properties of @{term RAG}, |
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1688 |
for example, @{term RAG} is finite, acyclic, and single-valued, etc. |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1689 |
*} |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1690 |
|
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1691 |
text {* |
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1692 |
The following three lemmas show that @{text "RAG"} does not change |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1693 |
by the happening of @{text "Set"}, @{text "Create"} and @{text "Exit"} |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1694 |
events, respectively. |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1695 |
*} |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
1696 |
|
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1697 |
lemma (in valid_trace_set) RAG_es [simp]: "(RAG (e # s)) = RAG s" |
100 | 1698 |
by (unfold is_set s_RAG_def s_waiting_def wq_def, simp add:Let_def) |
1699 |
||
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1700 |
lemma (in valid_trace_create) RAG_es [simp]: "(RAG (e # s)) = RAG s" |
100 | 1701 |
by (unfold is_create s_RAG_def s_waiting_def wq_def, simp add:Let_def) |
1702 |
||
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
1703 |
lemma (in valid_trace_exit) RAG_es[simp]: "(RAG (e # s)) = RAG s" |
100 | 1704 |
by (unfold is_exit s_RAG_def s_waiting_def wq_def, simp add:Let_def) |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1705 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1706 |
context valid_trace_v |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1707 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1708 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1709 |
lemma holding_cs_eq_th: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1710 |
assumes "holding s t cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1711 |
shows "t = th" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1712 |
proof - |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1713 |
from pip_e[unfolded is_v] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1714 |
show ?thesis |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1715 |
proof(cases) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1716 |
case (thread_V) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1717 |
from held_unique[OF this(2) assms] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1718 |
show ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1719 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1720 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1721 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1722 |
lemma distinct_wq': "distinct wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1723 |
by (metis (mono_tags, lifting) distinct_rest some_eq_ex wq'_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1724 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1725 |
lemma set_wq': "set wq' = set rest" |
100 | 1726 |
by (metis (mono_tags, lifting) distinct_rest some_eq_ex wq'_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1727 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1728 |
lemma th'_in_inv: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1729 |
assumes "th' \<in> set wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1730 |
shows "th' \<in> set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1731 |
using assms set_wq' by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1732 |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1733 |
lemma running_th_s: |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1734 |
shows "th \<in> running s" |
100 | 1735 |
proof - |
1736 |
from pip_e[unfolded is_v] |
|
1737 |
show ?thesis by (cases, simp) |
|
1738 |
qed |
|
1739 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1740 |
lemma neq_t_th: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1741 |
assumes "waiting (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1742 |
shows "t \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1743 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1744 |
assume otherwise: "t = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1745 |
show False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1746 |
proof(cases "c = cs") |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1747 |
case True |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1748 |
have "t \<in> set wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1749 |
using assms[unfolded True s_waiting_def, folded wq_def, unfolded wq_es_cs] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1750 |
by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1751 |
from th'_in_inv[OF this] have "t \<in> set rest" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1752 |
with wq_s_cs[folded otherwise] wq_distinct[of cs] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1753 |
show ?thesis by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1754 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1755 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1756 |
have "wq (e#s) c = wq s c" using False |
108 | 1757 |
by simp |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1758 |
hence "waiting s t c" using assms |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1759 |
by (simp add: s_waiting_def wq_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1760 |
hence "t \<notin> readys s" by (unfold readys_def, auto) |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1761 |
hence "t \<notin> running s" using running_ready by auto |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
1762 |
with running_th_s[folded otherwise] show ?thesis by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1763 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1764 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1765 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1766 |
lemma waiting_esI1: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1767 |
assumes "waiting s t c" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1768 |
and "c \<noteq> cs" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1769 |
shows "waiting (e#s) t c" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1770 |
proof - |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1771 |
have "wq (e#s) c = wq s c" |
108 | 1772 |
using assms(2) by auto |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1773 |
with assms(1) show ?thesis |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1774 |
by (simp add: s_waiting_def wq_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1775 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1776 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1777 |
lemma holding_esI2: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1778 |
assumes "c \<noteq> cs" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1779 |
and "holding s t c" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1780 |
shows "holding (e#s) t c" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1781 |
proof - |
108 | 1782 |
from assms(1) have "wq (e#s) c = wq s c" by auto |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1783 |
from assms(2)[unfolded s_holding_def, folded wq_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1784 |
folded this, folded s_holding_def] |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1785 |
show ?thesis . |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1786 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1787 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1788 |
lemma holding_esI1: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1789 |
assumes "holding s t c" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1790 |
and "t \<noteq> th" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1791 |
shows "holding (e#s) t c" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1792 |
proof - |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1793 |
have "c \<noteq> cs" using assms using holding_cs_eq_th by blast |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1794 |
from holding_esI2[OF this assms(1)] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1795 |
show ?thesis . |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1796 |
qed |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
1797 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1798 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1799 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1800 |
context valid_trace_v_n |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1801 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1802 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1803 |
lemma neq_wq': "wq' \<noteq> []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1804 |
proof (unfold wq'_def, rule someI2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1805 |
show "distinct rest \<and> set rest = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1806 |
by (simp add: distinct_rest) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1807 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1808 |
fix x |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1809 |
assume " distinct x \<and> set x = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1810 |
thus "x \<noteq> []" using rest_nnl by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1811 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1812 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1813 |
lemma eq_wq': "wq' = taker # rest'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1814 |
by (simp add: neq_wq' rest'_def taker_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1815 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1816 |
lemma next_th_taker: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1817 |
shows "next_th s th cs taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1818 |
using rest_nnl taker_def wq'_def wq_s_cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1819 |
by (auto simp:next_th_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1820 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1821 |
lemma taker_unique: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1822 |
assumes "next_th s th cs taker'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1823 |
shows "taker' = taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1824 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1825 |
from assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1826 |
obtain rest' where |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1827 |
h: "wq s cs = th # rest'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1828 |
"taker' = hd (SOME q. distinct q \<and> set q = set rest')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1829 |
by (unfold next_th_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1830 |
with wq_s_cs have "rest' = rest" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1831 |
thus ?thesis using h(2) taker_def wq'_def by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1832 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1833 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1834 |
lemma waiting_set_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1835 |
"{(Th th', Cs cs) |th'. next_th s th cs th'} = {(Th taker, Cs cs)}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1836 |
by (smt all_not_in_conv bot.extremum insertI1 insert_subset |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1837 |
mem_Collect_eq next_th_taker subsetI subset_antisym taker_def taker_unique) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1838 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1839 |
lemma holding_set_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1840 |
"{(Cs cs, Th th') |th'. next_th s th cs th'} = {(Cs cs, Th taker)}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1841 |
using next_th_taker taker_def waiting_set_eq |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1842 |
by fastforce |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1843 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1844 |
lemma holding_taker: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1845 |
shows "holding (e#s) taker cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1846 |
by (unfold s_holding_def, unfold wq_es_cs, |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1847 |
auto simp:neq_wq' taker_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1848 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1849 |
lemma waiting_esI2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1850 |
assumes "waiting s t cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1851 |
and "t \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1852 |
shows "waiting (e#s) t cs" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1853 |
proof - |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1854 |
have "t \<in> set wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1855 |
proof(unfold wq'_def, rule someI2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1856 |
show "distinct rest \<and> set rest = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1857 |
by (simp add: distinct_rest) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1858 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1859 |
fix x |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1860 |
assume "distinct x \<and> set x = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1861 |
moreover have "t \<in> set rest" |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1862 |
using assms(1) s_waiting_def set_ConsD wq_def wq_s_cs by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1863 |
ultimately show "t \<in> set x" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1864 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1865 |
moreover have "t \<noteq> hd wq'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1866 |
using assms(2) taker_def by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1867 |
ultimately show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1868 |
by (unfold s_waiting_def, fold wq_def, unfold wq_es_cs, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1869 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1870 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1871 |
lemma waiting_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1872 |
assumes "waiting (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1873 |
obtains "c \<noteq> cs" "waiting s t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1874 |
| "c = cs" "t \<noteq> taker" "waiting s t cs" "t \<in> set rest'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1875 |
proof(cases "c = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1876 |
case False |
108 | 1877 |
hence "wq (e#s) c = wq s c" by auto |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1878 |
with assms have "waiting s t c" |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1879 |
by (simp add: s_waiting_def wq_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1880 |
from that(1)[OF False this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1881 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1882 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1883 |
from assms[unfolded s_waiting_def True, folded wq_def, unfolded wq_es_cs] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1884 |
have "t \<noteq> hd wq'" "t \<in> set wq'" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1885 |
hence "t \<noteq> taker" by (simp add: taker_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1886 |
moreover hence "t \<noteq> th" using assms neq_t_th by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1887 |
moreover have "t \<in> set rest" by (simp add: `t \<in> set wq'` th'_in_inv) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1888 |
ultimately have "waiting s t cs" |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1889 |
by (metis list.sel(1) list.set_sel(2) list.simps(3) rest_def s_waiting_def wq_def wq_s_cs) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1890 |
show ?thesis using that(2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1891 |
using True `t \<in> set wq'` `t \<noteq> taker` `waiting s t cs` eq_wq' by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1892 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1893 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1894 |
lemma holding_esI1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1895 |
assumes "c = cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1896 |
and "t = taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1897 |
shows "holding (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1898 |
by (unfold assms, simp add: holding_taker) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1899 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1900 |
lemma holding_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1901 |
assumes "holding (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1902 |
obtains "c = cs" "t = taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1903 |
| "c \<noteq> cs" "holding s t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1904 |
proof(cases "c = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1905 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1906 |
from assms[unfolded True, unfolded s_holding_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1907 |
folded wq_def, unfolded wq_es_cs] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1908 |
have "t = taker" by (simp add: taker_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1909 |
from that(1)[OF True this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1910 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1911 |
case False |
108 | 1912 |
hence "wq (e#s) c = wq s c" by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1913 |
from assms[unfolded s_holding_def, folded wq_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
1914 |
unfolded this, folded s_holding_def] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1915 |
have "holding s t c" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1916 |
from that(2)[OF False this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1917 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1918 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1919 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1920 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1921 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1922 |
context valid_trace_v_e |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1923 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1924 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1925 |
lemma nil_wq': "wq' = []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1926 |
proof (unfold wq'_def, rule someI2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1927 |
show "distinct rest \<and> set rest = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1928 |
by (simp add: distinct_rest) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1929 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1930 |
fix x |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1931 |
assume " distinct x \<and> set x = set rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1932 |
thus "x = []" using rest_nil by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1933 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1934 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1935 |
lemma no_taker: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1936 |
assumes "next_th s th cs taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1937 |
shows "False" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1938 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1939 |
from assms[unfolded next_th_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1940 |
obtain rest' where "wq s cs = th # rest'" "rest' \<noteq> []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1941 |
by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1942 |
thus ?thesis using rest_def rest_nil by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1943 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1944 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1945 |
lemma waiting_set_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1946 |
"{(Th th', Cs cs) |th'. next_th s th cs th'} = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1947 |
using no_taker by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1948 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1949 |
lemma holding_set_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1950 |
"{(Cs cs, Th th') |th'. next_th s th cs th'} = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1951 |
using no_taker by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1952 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1953 |
lemma no_holding: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1954 |
assumes "holding (e#s) taker cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1955 |
shows False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1956 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1957 |
from wq_es_cs[unfolded nil_wq'] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1958 |
have " wq (e # s) cs = []" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1959 |
from assms[unfolded s_holding_def, folded wq_def, unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1960 |
show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1961 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1962 |
|
108 | 1963 |
lemma no_waiter_before: "\<not> waiting s t cs" |
1964 |
proof |
|
1965 |
assume otherwise: "waiting s t cs" |
|
1966 |
from this[unfolded s_waiting_def, folded wq_def, |
|
1967 |
unfolded wq_s_cs rest_nil] |
|
1968 |
show False by simp |
|
1969 |
qed |
|
1970 |
||
1971 |
lemma no_waiter_after: |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1972 |
assumes "waiting (e#s) t cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1973 |
shows False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1974 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1975 |
from wq_es_cs[unfolded nil_wq'] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1976 |
have " wq (e # s) cs = []" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1977 |
from assms[unfolded s_waiting_def, folded wq_def, unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1978 |
show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1979 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1980 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1981 |
lemma waiting_esI2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1982 |
assumes "waiting s t c" |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1983 |
shows "waiting (e # s) t c" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1984 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1985 |
have "c \<noteq> cs" using assms |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1986 |
using no_waiter_before by blast |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1987 |
from waiting_esI1[OF assms this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1988 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1989 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1990 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1991 |
lemma waiting_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1992 |
assumes "waiting (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1993 |
obtains "c \<noteq> cs" "waiting s t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1994 |
proof(cases "c = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1995 |
case False |
108 | 1996 |
hence "wq (e#s) c = wq s c" by auto |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1997 |
with assms have "waiting s t c" |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
1998 |
by (simp add: s_waiting_def wq_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1999 |
from that(1)[OF False this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2000 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2001 |
case True |
108 | 2002 |
from no_waiter_after[OF assms[unfolded True]] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2003 |
show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2004 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2005 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2006 |
lemma holding_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2007 |
assumes "holding (e#s) t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2008 |
obtains "c \<noteq> cs" "holding s t c" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2009 |
proof(cases "c = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2010 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2011 |
from no_holding[OF assms[unfolded True]] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2012 |
show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2013 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2014 |
case False |
108 | 2015 |
hence "wq (e#s) c = wq s c" by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2016 |
from assms[unfolded s_holding_def, folded wq_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2017 |
unfolded this, folded s_holding_def] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2018 |
have "holding s t c" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2019 |
from that[OF False this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2020 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2021 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2022 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2023 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2024 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2025 |
context valid_trace_v |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2026 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2027 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2028 |
lemma RAG_es: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2029 |
"RAG (e # s) = |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2030 |
RAG s - {(Cs cs, Th th)} - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2031 |
{(Th th', Cs cs) |th'. next_th s th cs th'} \<union> |
129
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
2032 |
{(Cs cs, Th th') |th'. next_th s th cs th'}" (is "?L = ?R") |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2033 |
proof(rule rel_eqI) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2034 |
fix n1 n2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2035 |
assume "(n1, n2) \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2036 |
thus "(n1, n2) \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2037 |
proof(cases rule:in_RAG_E) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2038 |
case (waiting th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2039 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2040 |
proof(cases "rest = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2041 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2042 |
interpret h_n: valid_trace_v_n s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2043 |
by (unfold_locales, insert False, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2044 |
from waiting(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2045 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2046 |
proof(cases rule:h_n.waiting_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2047 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2048 |
with waiting(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2049 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2050 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2051 |
fold s_waiting_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2052 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2053 |
case 2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2054 |
with waiting(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2055 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2056 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2057 |
fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2058 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2059 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2060 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2061 |
interpret h_e: valid_trace_v_e s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2062 |
by (unfold_locales, insert True, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2063 |
from waiting(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2064 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2065 |
proof(cases rule:h_e.waiting_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2066 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2067 |
with waiting(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2068 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2069 |
by (unfold h_e.waiting_set_eq h_e.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2070 |
fold s_waiting_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2071 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2072 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2073 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2074 |
case (holding th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2075 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2076 |
proof(cases "rest = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2077 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2078 |
interpret h_n: valid_trace_v_n s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2079 |
by (unfold_locales, insert False, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2080 |
from holding(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2081 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2082 |
proof(cases rule:h_n.holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2083 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2084 |
with holding(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2085 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2086 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2087 |
fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2088 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2089 |
case 2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2090 |
with holding(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2091 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2092 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2093 |
fold s_holding_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2094 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2095 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2096 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2097 |
interpret h_e: valid_trace_v_e s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2098 |
by (unfold_locales, insert True, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2099 |
from holding(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2100 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2101 |
proof(cases rule:h_e.holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2102 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2103 |
with holding(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2104 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2105 |
by (unfold h_e.waiting_set_eq h_e.holding_set_eq s_RAG_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2106 |
fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2107 |
qed |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2108 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2109 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2110 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2111 |
fix n1 n2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2112 |
assume h: "(n1, n2) \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2113 |
show "(n1, n2) \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2114 |
proof(cases "rest = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2115 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2116 |
interpret h_n: valid_trace_v_n s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2117 |
by (unfold_locales, insert False, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2118 |
from h[unfolded h_n.waiting_set_eq h_n.holding_set_eq] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2119 |
have "((n1, n2) \<in> RAG s \<and> (n1 \<noteq> Cs cs \<or> n2 \<noteq> Th th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2120 |
\<and> (n1 \<noteq> Th h_n.taker \<or> n2 \<noteq> Cs cs)) \<or> |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2121 |
(n2 = Th h_n.taker \<and> n1 = Cs cs)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2122 |
by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2123 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2124 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2125 |
assume "n2 = Th h_n.taker \<and> n1 = Cs cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2126 |
with h_n.holding_taker |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2127 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2128 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2129 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2130 |
assume h: "(n1, n2) \<in> RAG s \<and> |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2131 |
(n1 \<noteq> Cs cs \<or> n2 \<noteq> Th th) \<and> (n1 \<noteq> Th h_n.taker \<or> n2 \<noteq> Cs cs)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2132 |
hence "(n1, n2) \<in> RAG s" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2133 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2134 |
proof(cases rule:in_RAG_E) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2135 |
case (waiting th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2136 |
from h and this(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2137 |
have "th' \<noteq> h_n.taker \<or> cs' \<noteq> cs" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2138 |
hence "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2139 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2140 |
assume "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2141 |
from waiting_esI1[OF waiting(3) this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2142 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2143 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2144 |
assume neq_th': "th' \<noteq> h_n.taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2145 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2146 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2147 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2148 |
from waiting_esI1[OF waiting(3) this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2149 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2150 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2151 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2152 |
from h_n.waiting_esI2[OF waiting(3)[unfolded True] neq_th', folded True] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2153 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2154 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2155 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2156 |
thus ?thesis using waiting(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2157 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2158 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2159 |
case (holding th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2160 |
from h this(1,2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2161 |
have "cs' \<noteq> cs \<or> th' \<noteq> th" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2162 |
hence "holding (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2163 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2164 |
assume "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2165 |
from holding_esI2[OF this holding(3)] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2166 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2167 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2168 |
assume "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2169 |
from holding_esI1[OF holding(3) this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2170 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2171 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2172 |
thus ?thesis using holding(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2173 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2174 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2175 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2176 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2177 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2178 |
interpret h_e: valid_trace_v_e s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2179 |
by (unfold_locales, insert True, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2180 |
from h[unfolded h_e.waiting_set_eq h_e.holding_set_eq] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2181 |
have h_s: "(n1, n2) \<in> RAG s" "(n1, n2) \<noteq> (Cs cs, Th th)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2182 |
by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2183 |
from h_s(1) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2184 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2185 |
proof(cases rule:in_RAG_E) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2186 |
case (waiting th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2187 |
from h_e.waiting_esI2[OF this(3)] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2188 |
show ?thesis using waiting(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2189 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2190 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2191 |
case (holding th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2192 |
with h_s(2) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2193 |
have "cs' \<noteq> cs \<or> th' \<noteq> th" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2194 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2195 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2196 |
assume neq_cs: "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2197 |
from holding_esI2[OF this holding(3)] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2198 |
show ?thesis using holding(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2199 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2200 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2201 |
assume "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2202 |
from holding_esI1[OF holding(3) this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2203 |
show ?thesis using holding(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2204 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2205 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2206 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2207 |
qed |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2208 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2209 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2210 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2211 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2212 |
context valid_trace_p |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2213 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2214 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2215 |
lemma waiting_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2216 |
assumes "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2217 |
shows "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2218 |
using assms |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
2219 |
by (metis butlast_snoc distinct.simps(2) distinct_singleton hd_append2 |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
2220 |
in_set_butlastD s_waiting_def wq_def wq_es_cs wq_neq_simp) |
100 | 2221 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2222 |
lemma holding_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2223 |
assumes "holding s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2224 |
shows "holding (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2225 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2226 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2227 |
hence "wq (e#s) cs' = wq s cs'" by simp |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2228 |
with assms show ?thesis unfolding holding_raw_def s_holding_abv by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2229 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2230 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2231 |
from assms[unfolded s_holding_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2232 |
obtain rest where eq_wq: "wq s cs' = th'#rest" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2233 |
by (metis empty_iff list.collapse list.set(1)) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2234 |
hence "wq (e#s) cs' = th'#(rest@[th])" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2235 |
by (simp add: True wq_es_cs) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2236 |
thus ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2237 |
by (simp add: holding_raw_def s_holding_abv) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2238 |
qed |
100 | 2239 |
end |
2240 |
||
2241 |
lemma (in valid_trace_p) th_not_waiting: "\<not> waiting s th c" |
|
2242 |
proof - |
|
2243 |
have "th \<in> readys s" |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
2244 |
using running_ready running_th_s by blast |
100 | 2245 |
thus ?thesis |
2246 |
by (unfold readys_def, auto) |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2247 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2248 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2249 |
context valid_trace_p_h |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2250 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2251 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2252 |
lemma wq_es_cs': "wq (e#s) cs = [th]" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2253 |
using wq_es_cs[unfolded we] by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2254 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2255 |
lemma holding_es_th_cs: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2256 |
shows "holding (e#s) th cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2257 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2258 |
from wq_es_cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2259 |
have "th \<in> set (wq (e#s) cs)" "th = hd (wq (e#s) cs)" by auto |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2260 |
thus ?thesis unfolding holding_raw_def s_holding_abv by blast |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2261 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2262 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2263 |
lemma RAG_edge: "(Cs cs, Th th) \<in> RAG (e#s)" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2264 |
by (unfold s_RAG_def, fold s_holding_abv, insert holding_es_th_cs, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2265 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2266 |
lemma waiting_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2267 |
assumes "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2268 |
obtains "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2269 |
using assms |
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
2270 |
by (metis empty_iff list.sel(1) list.set(1) s_waiting_def |
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
2271 |
set_ConsD wq_def wq_es_cs' wq_neq_simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2272 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2273 |
lemma holding_esE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2274 |
assumes "holding (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2275 |
obtains "cs' \<noteq> cs" "holding s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2276 |
| "cs' = cs" "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2277 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2278 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2279 |
from held_unique[OF holding_es_th_cs assms[unfolded True]] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2280 |
have "th' = th" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2281 |
from that(2)[OF True this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2282 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2283 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2284 |
have "holding s th' cs'" using assms |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2285 |
using False unfolding holding_raw_def s_holding_abv by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2286 |
from that(1)[OF False this] show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2287 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2288 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2289 |
lemma RAG_es: "RAG (e # s) = RAG s \<union> {(Cs cs, Th th)}" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2290 |
proof(rule rel_eqI) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2291 |
fix n1 n2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2292 |
assume "(n1, n2) \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2293 |
thus "(n1, n2) \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2294 |
proof(cases rule:in_RAG_E) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2295 |
case (waiting th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2296 |
from this(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2297 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2298 |
proof(cases rule:waiting_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2299 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2300 |
thus ?thesis using waiting(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2301 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2302 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2303 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2304 |
case (holding th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2305 |
from this(3) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2306 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2307 |
proof(cases rule:holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2308 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2309 |
with holding(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2310 |
show ?thesis by (unfold s_RAG_def, fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2311 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2312 |
case 2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2313 |
with holding(1,2) show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2314 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2315 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2316 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2317 |
fix n1 n2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2318 |
assume "(n1, n2) \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2319 |
hence "(n1, n2) \<in> RAG s \<or> (n1 = Cs cs \<and> n2 = Th th)" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2320 |
thus "(n1, n2) \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2321 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2322 |
assume "(n1, n2) \<in> RAG s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2323 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2324 |
proof(cases rule:in_RAG_E) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2325 |
case (waiting th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2326 |
from waiting_kept[OF this(3)] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2327 |
show ?thesis using waiting(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2328 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2329 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2330 |
case (holding th' cs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2331 |
from holding_kept[OF this(3)] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2332 |
show ?thesis using holding(1,2) |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2333 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2334 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2335 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2336 |
assume "n1 = Cs cs \<and> n2 = Th th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2337 |
with holding_es_th_cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2338 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2339 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2340 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2341 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2342 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2343 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2344 |
|
100 | 2345 |
context valid_trace_p_w |
2346 |
begin |
|
2347 |
||
2348 |
lemma wq_s_cs: "wq s cs = holder#waiters" |
|
2349 |
by (simp add: holder_def waiters_def wne) |
|
2350 |
||
2351 |
lemma wq_es_cs': "wq (e#s) cs = holder#waiters@[th]" |
|
2352 |
by (simp add: wq_es_cs wq_s_cs) |
|
2353 |
||
2354 |
lemma waiting_es_th_cs: "waiting (e#s) th cs" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2355 |
using th_not_in_wq s_waiting_abv wq_es_cs' wq_s_cs |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2356 |
using Un_iff list.sel(1) list.set_intros(1) s_waiting_def |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2357 |
set_append wq_def wq_es_cs by auto |
100 | 2358 |
|
2359 |
lemma RAG_edge: "(Th th, Cs cs) \<in> RAG (e#s)" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2360 |
by (unfold s_RAG_def, fold s_waiting_abv, insert waiting_es_th_cs, auto) |
100 | 2361 |
|
2362 |
lemma holding_esE: |
|
2363 |
assumes "holding (e#s) th' cs'" |
|
2364 |
obtains "holding s th' cs'" |
|
2365 |
using assms |
|
2366 |
proof(cases "cs' = cs") |
|
2367 |
case False |
|
2368 |
hence "wq (e#s) cs' = wq s cs'" by simp |
|
120
b3b8735c7c02
updated to Isabelle 2016
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
2369 |
with assms show ?thesis using that |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
2370 |
using s_holding_def wq_def by auto |
100 | 2371 |
next |
2372 |
case True |
|
2373 |
with assms show ?thesis |
|
109
4e59c0ce1511
wq_in_inv and wq_out_inv are removed, a number of loop holes need to be filled.
zhangx
parents:
108
diff
changeset
|
2374 |
using s_holding_def that wq_def wq_es_cs' wq_s_cs by auto |
100 | 2375 |
qed |
2376 |
||
2377 |
lemma waiting_esE: |
|
2378 |
assumes "waiting (e#s) th' cs'" |
|
2379 |
obtains "th' \<noteq> th" "waiting s th' cs'" |
|
2380 |
| "th' = th" "cs' = cs" |
|
2381 |
proof(cases "waiting s th' cs'") |
|
2382 |
case True |
|
2383 |
have "th' \<noteq> th" |
|
2384 |
proof |
|
2385 |
assume otherwise: "th' = th" |
|
2386 |
from True[unfolded this] |
|
2387 |
show False by (simp add: th_not_waiting) |
|
2388 |
qed |
|
2389 |
from that(1)[OF this True] show ?thesis . |
|
2390 |
next |
|
2391 |
case False |
|
2392 |
hence "th' = th \<and> cs' = cs" |
|
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
2393 |
by (metis assms hd_append2 insert_iff list.simps(15) rotate1.simps(2) |
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
2394 |
s_waiting_def set_rotate1 wne wq_def wq_es_cs wq_neq_simp) |
100 | 2395 |
with that(2) show ?thesis by metis |
2396 |
qed |
|
2397 |
||
2398 |
lemma RAG_es: "RAG (e # s) = RAG s \<union> {(Th th, Cs cs)}" (is "?L = ?R") |
|
2399 |
proof(rule rel_eqI) |
|
2400 |
fix n1 n2 |
|
2401 |
assume "(n1, n2) \<in> ?L" |
|
2402 |
thus "(n1, n2) \<in> ?R" |
|
2403 |
proof(cases rule:in_RAG_E) |
|
2404 |
case (waiting th' cs') |
|
2405 |
from this(3) |
|
2406 |
show ?thesis |
|
2407 |
proof(cases rule:waiting_esE) |
|
2408 |
case 1 |
|
2409 |
thus ?thesis using waiting(1,2) |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2410 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
100 | 2411 |
next |
2412 |
case 2 |
|
2413 |
thus ?thesis using waiting(1,2) by auto |
|
2414 |
qed |
|
2415 |
next |
|
2416 |
case (holding th' cs') |
|
2417 |
from this(3) |
|
2418 |
show ?thesis |
|
2419 |
proof(cases rule:holding_esE) |
|
2420 |
case 1 |
|
2421 |
with holding(1,2) |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2422 |
show ?thesis by (unfold s_RAG_def, fold s_holding_abv, auto) |
100 | 2423 |
qed |
2424 |
qed |
|
2425 |
next |
|
2426 |
fix n1 n2 |
|
2427 |
assume "(n1, n2) \<in> ?R" |
|
2428 |
hence "(n1, n2) \<in> RAG s \<or> (n1 = Th th \<and> n2 = Cs cs)" by auto |
|
2429 |
thus "(n1, n2) \<in> ?L" |
|
2430 |
proof |
|
2431 |
assume "(n1, n2) \<in> RAG s" |
|
2432 |
thus ?thesis |
|
2433 |
proof(cases rule:in_RAG_E) |
|
2434 |
case (waiting th' cs') |
|
2435 |
from waiting_kept[OF this(3)] |
|
2436 |
show ?thesis using waiting(1,2) |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2437 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
100 | 2438 |
next |
2439 |
case (holding th' cs') |
|
2440 |
from holding_kept[OF this(3)] |
|
2441 |
show ?thesis using holding(1,2) |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2442 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
100 | 2443 |
qed |
2444 |
next |
|
2445 |
assume "n1 = Th th \<and> n2 = Cs cs" |
|
2446 |
thus ?thesis using RAG_edge by auto |
|
2447 |
qed |
|
2448 |
qed |
|
2449 |
||
2450 |
end |
|
2451 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2452 |
context valid_trace_p |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2453 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2454 |
|
100 | 2455 |
lemma RAG_es: "RAG (e # s) = (if (wq s cs = []) then RAG s \<union> {(Cs cs, Th th)} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2456 |
else RAG s \<union> {(Th th, Cs cs)})" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2457 |
proof(cases "wq s cs = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2458 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2459 |
interpret vt_p: valid_trace_p_h using True |
63 | 2460 |
by (unfold_locales, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2461 |
show ?thesis by (simp add: vt_p.RAG_es vt_p.we) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2462 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2463 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2464 |
interpret vt_p: valid_trace_p_w using False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2465 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2466 |
show ?thesis by (simp add: vt_p.RAG_es vt_p.wne) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2467 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2468 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2469 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2470 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
2471 |
subsection {* RAG is finite *} |
100 | 2472 |
|
110
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2473 |
context valid_trace_v |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2474 |
begin |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2475 |
|
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2476 |
lemma |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2477 |
finite_RAG_kept: |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2478 |
assumes "finite (RAG s)" |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2479 |
shows "finite (RAG (e#s))" |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2480 |
proof(cases "rest = []") |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2481 |
case True |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2482 |
interpret vt: valid_trace_v_e using True |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2483 |
by (unfold_locales, simp) |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2484 |
show ?thesis using assms |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2485 |
by (unfold RAG_es vt.waiting_set_eq vt.holding_set_eq, simp) |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2486 |
next |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2487 |
case False |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2488 |
interpret vt: valid_trace_v_n using False |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2489 |
by (unfold_locales, simp) |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2490 |
show ?thesis using assms |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2491 |
by (unfold RAG_es vt.waiting_set_eq vt.holding_set_eq, simp) |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2492 |
qed |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2493 |
|
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2494 |
end |
4782d82c3ae9
About to change the proof of waiting_unique_pre and waiting_unqie.
zhangx
parents:
109
diff
changeset
|
2495 |
|
100 | 2496 |
context valid_trace |
2497 |
begin |
|
2498 |
||
2499 |
lemma finite_RAG: |
|
2500 |
shows "finite (RAG s)" |
|
2501 |
proof(induct rule:ind) |
|
2502 |
case Nil |
|
2503 |
show ?case |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
2504 |
by (auto simp: s_RAG_def waiting_raw_def |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
2505 |
holding_raw_def wq_def acyclic_def) |
100 | 2506 |
next |
2507 |
case (Cons s e) |
|
2508 |
interpret vt_e: valid_trace_e s e using Cons by simp |
|
2509 |
show ?case |
|
2510 |
proof(cases e) |
|
2511 |
case (Create th prio) |
|
2512 |
interpret vt: valid_trace_create s e th prio using Create |
|
2513 |
by (unfold_locales, simp) |
|
2514 |
show ?thesis using Cons by simp |
|
2515 |
next |
|
2516 |
case (Exit th) |
|
2517 |
interpret vt: valid_trace_exit s e th using Exit |
|
2518 |
by (unfold_locales, simp) |
|
2519 |
show ?thesis using Cons by simp |
|
2520 |
next |
|
2521 |
case (P th cs) |
|
2522 |
interpret vt: valid_trace_p s e th cs using P |
|
2523 |
by (unfold_locales, simp) |
|
2524 |
show ?thesis using Cons using vt.RAG_es by auto |
|
2525 |
next |
|
2526 |
case (V th cs) |
|
2527 |
interpret vt: valid_trace_v s e th cs using V |
|
2528 |
by (unfold_locales, simp) |
|
2529 |
show ?thesis using Cons by (simp add: vt.finite_RAG_kept) |
|
2530 |
next |
|
2531 |
case (Set th prio) |
|
2532 |
interpret vt: valid_trace_set s e th prio using Set |
|
2533 |
by (unfold_locales, simp) |
|
2534 |
show ?thesis using Cons by simp |
|
2535 |
qed |
|
2536 |
qed |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2537 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2538 |
lemma finite_tRAG: "finite (tRAG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2539 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2540 |
from finite_RAG[unfolded RAG_split] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2541 |
have "finite (wRAG s)" "finite (hRAG s)" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2542 |
from finite_relcomp[OF this] tRAG_def |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2543 |
show ?thesis by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2544 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2545 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2546 |
lemma finite_tG: "finite (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2547 |
by (unfold tG_def, insert finite_tRAG, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
2548 |
|
100 | 2549 |
end |
2550 |
||
111 | 2551 |
subsection {* Uniqueness of waiting *} |
2552 |
||
2553 |
text {* |
|
112 | 2554 |
{\em Uniqueness of waiting} means that |
2555 |
a thread can only be blocked on one resource. |
|
2556 |
This property is needed in order to prove that @{term RAG} |
|
2557 |
is acyclic. Therefore, we need to prove it first in the following |
|
2558 |
lemma @{text "waiting_unqiue"}, all lemmas before it are auxiliary. |
|
2559 |
||
2560 |
The property is expressed by the following predicate over system |
|
2561 |
state (or event trace), which is also named @{text "waiting_unqiue"}. |
|
111 | 2562 |
*} |
2563 |
||
2564 |
definition |
|
2565 |
"waiting_unique (ss::state) = |
|
2566 |
(\<forall> th cs1 cs2. waiting ss th cs1 \<longrightarrow> |
|
2567 |
waiting ss th cs2 \<longrightarrow> cs1 = cs2)" |
|
2568 |
||
2569 |
text {* |
|
2570 |
We are going to show (in the |
|
2571 |
lemma named @{text waiting_unique}) that |
|
2572 |
this property holds on any valid trace (or system state). |
|
2573 |
*} |
|
2574 |
||
2575 |
text {* |
|
112 | 2576 |
As a first step to prove lemma @{text "waiting_unqiue"}, |
2577 |
we need to understand how |
|
111 | 2578 |
a thread is get blocked. |
2579 |
We show in the following lemmas |
|
2580 |
(all named @{text "waiting_inv"}) that |
|
2581 |
@{term P}-operation is the only cause. |
|
100 | 2582 |
*} |
2583 |
||
111 | 2584 |
context valid_trace_create |
2585 |
begin |
|
2586 |
lemma waiting_inv: |
|
2587 |
assumes "\<not> waiting s th' cs'" |
|
2588 |
and "waiting (e#s) th' cs'" |
|
2589 |
shows "e = P th' cs'" |
|
2590 |
using assms |
|
2591 |
by (unfold s_waiting_def, fold wq_def, simp) |
|
2592 |
end |
|
2593 |
||
2594 |
context valid_trace_set |
|
2595 |
begin |
|
2596 |
lemma waiting_inv: |
|
2597 |
assumes "\<not> waiting s th' cs'" |
|
2598 |
and "waiting (e#s) th' cs'" |
|
2599 |
shows "e = P th' cs'" |
|
2600 |
using assms |
|
2601 |
by (unfold s_waiting_def, fold wq_def, simp) |
|
2602 |
end |
|
2603 |
||
2604 |
context valid_trace_exit |
|
2605 |
begin |
|
2606 |
lemma waiting_inv: |
|
2607 |
assumes "\<not> waiting s th' cs'" |
|
2608 |
and "waiting (e#s) th' cs'" |
|
2609 |
shows "e = P th' cs'" |
|
2610 |
using assms |
|
2611 |
by (unfold s_waiting_def, fold wq_def, simp) |
|
2612 |
end |
|
2613 |
||
2614 |
context valid_trace_p |
|
2615 |
begin |
|
2616 |
||
2617 |
lemma waiting_inv: |
|
2618 |
assumes "\<not> waiting s th' cs'" |
|
2619 |
and "waiting (e#s) th' cs'" |
|
2620 |
shows "e = P th' cs'" |
|
2621 |
proof(cases "cs' = cs") |
|
2622 |
case True |
|
2623 |
moreover have "th' = th" |
|
2624 |
proof(rule ccontr) |
|
2625 |
assume otherwise: "th' \<noteq> th" |
|
2626 |
have "waiting s th' cs'" |
|
2627 |
proof - |
|
2628 |
from assms(2)[unfolded True s_waiting_def, |
|
2629 |
folded wq_def, unfolded wq_es_cs] |
|
2630 |
have h: "th' \<in> set (wq s cs @ [th])" |
|
2631 |
"th' \<noteq> hd (wq s cs @ [th])" by auto |
|
2632 |
from h(1) and otherwise |
|
2633 |
have "th' \<in> set (wq s cs)" by auto |
|
2634 |
hence "wq s cs \<noteq> []" by auto |
|
2635 |
hence "hd (wq s cs @ [th]) = hd (wq s cs)" by auto |
|
2636 |
with h otherwise |
|
2637 |
have "waiting s th' cs" |
|
2638 |
by (unfold s_waiting_def, fold wq_def, auto) |
|
2639 |
from this[folded True] show ?thesis . |
|
2640 |
qed |
|
2641 |
with assms(1) show False by simp |
|
2642 |
qed |
|
2643 |
ultimately show ?thesis using is_p by simp |
|
2644 |
next |
|
2645 |
case False |
|
2646 |
hence "wq (e#s) cs' = wq s cs'" by simp |
|
2647 |
from assms[unfolded s_waiting_def, folded wq_def, |
|
2648 |
unfolded this] |
|
2649 |
show ?thesis by simp |
|
2650 |
qed |
|
2651 |
||
2652 |
end |
|
2653 |
||
2654 |
context valid_trace_v_n |
|
2655 |
begin |
|
2656 |
||
2657 |
lemma waiting_inv: |
|
2658 |
assumes "\<not> waiting s th' cs'" |
|
2659 |
and "waiting (e#s) th' cs'" |
|
2660 |
shows "e = P th' cs'" |
|
2661 |
proof - |
|
2662 |
from assms(2) |
|
2663 |
show ?thesis |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
2664 |
by (cases rule:waiting_esE, insert assms, auto) |
111 | 2665 |
qed |
2666 |
||
2667 |
end |
|
2668 |
||
2669 |
context valid_trace_v_e |
|
2670 |
begin |
|
2671 |
||
2672 |
lemma waiting_inv: |
|
2673 |
assumes "\<not> waiting s th' cs'" |
|
2674 |
and "waiting (e#s) th' cs'" |
|
2675 |
shows "e = P th' cs'" |
|
2676 |
proof - |
|
2677 |
from assms(2) |
|
2678 |
show ?thesis |
|
2679 |
by (cases rule:waiting_esE, insert assms, auto) |
|
2680 |
qed |
|
2681 |
||
2682 |
end |
|
2683 |
||
2684 |
context valid_trace_e |
|
2685 |
begin |
|
2686 |
||
2687 |
lemma waiting_inv: |
|
2688 |
assumes "\<not> waiting s th cs" |
|
2689 |
and "waiting (e#s) th cs" |
|
2690 |
shows "e = P th cs" |
|
2691 |
proof(cases e) |
|
2692 |
case (Create th' prio') |
|
2693 |
then interpret vt: valid_trace_create s e th' prio' |
|
2694 |
by (unfold_locales, simp) |
|
2695 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2696 |
next |
|
2697 |
case (Exit th') |
|
2698 |
then interpret vt: valid_trace_exit s e th' |
|
2699 |
by (unfold_locales, simp) |
|
2700 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2701 |
next |
|
2702 |
case (Set th' prio') |
|
2703 |
then interpret vt: valid_trace_set s e th' prio' |
|
2704 |
by (unfold_locales, simp) |
|
2705 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2706 |
next |
|
2707 |
case (P th' cs') |
|
2708 |
then interpret vt: valid_trace_p s e th' cs' |
|
2709 |
by (unfold_locales, simp) |
|
2710 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2711 |
next |
|
2712 |
case (V th' cs') |
|
2713 |
then interpret vt_e: valid_trace_v s e th' cs' |
|
2714 |
by (unfold_locales, simp) |
|
2715 |
show ?thesis |
|
2716 |
proof(cases "vt_e.rest = []") |
|
2717 |
case True |
|
2718 |
then interpret vt: valid_trace_v_e s e th' cs' |
|
2719 |
by (unfold_locales, simp) |
|
2720 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2721 |
next |
|
2722 |
case False |
|
2723 |
then interpret vt: valid_trace_v_n s e th' cs' |
|
2724 |
by (unfold_locales, simp) |
|
2725 |
show ?thesis using vt.waiting_inv[OF assms] by simp |
|
2726 |
qed |
|
2727 |
qed |
|
2728 |
||
112 | 2729 |
text {* |
2730 |
Now, with @{thm waiting_inv} in place, the following lemma |
|
2731 |
shows the uniqueness of waiting is kept by every operation |
|
2732 |
in the PIP protocol. This lemma constitutes the main part |
|
2733 |
in the proof of lemma @{text "waiting_unique"}. |
|
2734 |
*} |
|
2735 |
||
111 | 2736 |
lemma waiting_unique_kept: |
2737 |
assumes "waiting_unique s" |
|
2738 |
shows "waiting_unique (e#s)" |
|
2739 |
proof - |
|
2740 |
note h = assms[unfolded waiting_unique_def, rule_format] |
|
2741 |
{ fix th cs1 cs2 |
|
2742 |
assume w1: "waiting (e#s) th cs1" |
|
2743 |
and w2: "waiting (e#s) th cs2" |
|
2744 |
have "cs1 = cs2" |
|
2745 |
proof(rule ccontr) |
|
2746 |
assume otherwise: "cs1 \<noteq> cs2" |
|
2747 |
show False |
|
2748 |
proof(cases "waiting s th cs1") |
|
2749 |
case True |
|
2750 |
from h[OF this] and otherwise |
|
2751 |
have "\<not> waiting s th cs2" by auto |
|
2752 |
from waiting_inv[OF this w2] |
|
2753 |
have "e = P th cs2" . |
|
2754 |
then interpret vt: valid_trace_p s e th cs2 |
|
2755 |
by (unfold_locales, simp) |
|
2756 |
from vt.th_not_waiting and True |
|
2757 |
show ?thesis by simp |
|
2758 |
next |
|
2759 |
case False |
|
2760 |
from waiting_inv[OF this w1] |
|
2761 |
have "e = P th cs1" . |
|
2762 |
then interpret vt: valid_trace_p s e th cs1 |
|
2763 |
by (unfold_locales, simp) |
|
2764 |
have "wq (e # s) cs2 = wq s cs2" |
|
2765 |
using otherwise by simp |
|
2766 |
from w2[unfolded s_waiting_def, folded wq_def, |
|
2767 |
unfolded this] |
|
2768 |
have "waiting s th cs2" |
|
2769 |
by (unfold s_waiting_def, fold wq_def, simp) |
|
2770 |
thus ?thesis by (simp add: vt.th_not_waiting) |
|
2771 |
qed |
|
2772 |
qed |
|
2773 |
} thus ?thesis by (unfold waiting_unique_def, auto) |
|
2774 |
qed |
|
2775 |
||
2776 |
end |
|
100 | 2777 |
|
2778 |
context valid_trace |
|
2779 |
begin |
|
2780 |
||
112 | 2781 |
text {* |
2782 |
With @{thm valid_trace_e.waiting_unique_kept} in place, |
|
2783 |
the proof of the following lemma @{text "waiting_unique"} |
|
2784 |
needs only a very simple induction. |
|
2785 |
*} |
|
2786 |
||
111 | 2787 |
lemma waiting_unique |
2788 |
[unfolded waiting_unique_def, rule_format]: |
|
2789 |
shows "waiting_unique s" |
|
2790 |
proof(induct rule:ind) |
|
2791 |
case Nil |
|
2792 |
show ?case |
|
2793 |
by (unfold waiting_unique_def s_waiting_def, simp) |
|
2794 |
next |
|
2795 |
case (Cons s e) |
|
2796 |
then interpret vt: valid_trace_e s e by simp |
|
2797 |
show ?case using Cons(2) vt.waiting_unique_kept |
|
2798 |
by simp |
|
100 | 2799 |
qed |
2800 |
||
2801 |
end |
|
2802 |
||
112 | 2803 |
|
111 | 2804 |
subsection {* Acyclic keeping *} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2805 |
|
112 | 2806 |
text {* |
2807 |
To prove that @{term RAG} is acyclic, we need to show the acyclic property |
|
2808 |
is preserved by all system operations. There are only two non-trivial cases, |
|
2809 |
the @{term P} and @{term V} operation, where are treated in the following |
|
2810 |
locales, under the name @{text "acylic_RAG_kept"}: |
|
2811 |
*} |
|
2812 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2813 |
context valid_trace_v_e |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2814 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2815 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2816 |
lemma |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2817 |
acylic_RAG_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2818 |
assumes "acyclic (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2819 |
shows "acyclic (RAG (e#s))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2820 |
proof(rule acyclic_subset[OF assms]) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2821 |
show "RAG (e # s) \<subseteq> RAG s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2822 |
by (unfold RAG_es waiting_set_eq holding_set_eq, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2823 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2824 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2825 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2826 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2827 |
context valid_trace_v_n |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2828 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2829 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2830 |
lemma waiting_taker: "waiting s taker cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2831 |
apply (unfold s_waiting_def, fold wq_def, unfold wq_s_cs taker_def) |
111 | 2832 |
using eq_wq' set_wq' th_not_in_rest by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2833 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2834 |
lemma |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2835 |
acylic_RAG_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2836 |
assumes "acyclic (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2837 |
shows "acyclic (RAG (e#s))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2838 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2839 |
have "acyclic ((RAG s - {(Cs cs, Th th)} - {(Th taker, Cs cs)}) \<union> |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2840 |
{(Cs cs, Th taker)})" (is "acyclic (?A \<union> _)") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2841 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2842 |
from assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2843 |
have "acyclic ?A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2844 |
by (rule acyclic_subset, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2845 |
moreover have "(Th taker, Cs cs) \<notin> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2846 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2847 |
assume otherwise: "(Th taker, Cs cs) \<in> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2848 |
hence "(Th taker, Cs cs) \<in> ?A^+" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2849 |
by (unfold rtrancl_eq_or_trancl, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2850 |
from tranclD[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2851 |
obtain cs' where h: "(Th taker, Cs cs') \<in> ?A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2852 |
"(Th taker, Cs cs') \<in> RAG s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2853 |
by (unfold s_RAG_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2854 |
from this(2) have "waiting s taker cs'" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2855 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
100 | 2856 |
from waiting_unique[OF this waiting_taker] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2857 |
have "cs' = cs" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2858 |
from h(1)[unfolded this] show False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2859 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2860 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2861 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2862 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2863 |
by (unfold RAG_es waiting_set_eq holding_set_eq, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2864 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2865 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2866 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2867 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2868 |
context valid_trace_p_h |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2869 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2870 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2871 |
lemma |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2872 |
acylic_RAG_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2873 |
assumes "acyclic (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2874 |
shows "acyclic (RAG (e#s))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2875 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2876 |
have "acyclic (RAG s \<union> {(Cs cs, Th th)})" (is "acyclic (?A \<union> _)") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2877 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2878 |
from assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2879 |
have "acyclic ?A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2880 |
by (rule acyclic_subset, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2881 |
moreover have "(Th th, Cs cs) \<notin> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2882 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2883 |
assume otherwise: "(Th th, Cs cs) \<in> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2884 |
hence "(Th th, Cs cs) \<in> ?A^+" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2885 |
by (unfold rtrancl_eq_or_trancl, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2886 |
from tranclD[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2887 |
obtain cs' where h: "(Th th, Cs cs') \<in> RAG s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2888 |
by (unfold s_RAG_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2889 |
hence "waiting s th cs'" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
2890 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
101 | 2891 |
with th_not_waiting show False by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2892 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2893 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2894 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2895 |
thus ?thesis by (unfold RAG_es, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2896 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2897 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2898 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2899 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2900 |
context valid_trace_p_w |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2901 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2902 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2903 |
lemma |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2904 |
acylic_RAG_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2905 |
assumes "acyclic (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2906 |
shows "acyclic (RAG (e#s))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2907 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2908 |
have "acyclic (RAG s \<union> {(Th th, Cs cs)})" (is "acyclic (?A \<union> _)") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2909 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2910 |
from assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2911 |
have "acyclic ?A" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2912 |
by (rule acyclic_subset, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2913 |
moreover have "(Cs cs, Th th) \<notin> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2914 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2915 |
assume otherwise: "(Cs cs, Th th) \<in> ?A^*" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2916 |
from pip_e[unfolded is_p] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2917 |
show False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2918 |
proof(cases) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2919 |
case (thread_P) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2920 |
moreover from otherwise have "(Cs cs, Th th) \<in> ?A^+" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2921 |
by (unfold rtrancl_eq_or_trancl, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2922 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2923 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2924 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2925 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2926 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2927 |
thus ?thesis by (unfold RAG_es, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2928 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2929 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2930 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2931 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
2932 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
2933 |
subsection {* RAG is acyclic *} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
2934 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2935 |
context valid_trace |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2936 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2937 |
|
112 | 2938 |
text {* |
2939 |
With these @{text "acylic_RAG_kept"}-lemmas proved, |
|
2940 |
the proof of the following @{text "acyclic_RAG"} is |
|
2941 |
straight forward. |
|
2942 |
*} |
|
2943 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2944 |
lemma acyclic_RAG: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2945 |
shows "acyclic (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2946 |
proof(induct rule:ind) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2947 |
case Nil |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2948 |
show ?case |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
2949 |
by (auto simp: s_RAG_def waiting_raw_def |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
2950 |
holding_raw_def wq_def acyclic_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2951 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2952 |
case (Cons s e) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2953 |
interpret vt_e: valid_trace_e s e using Cons by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2954 |
show ?case |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2955 |
proof(cases e) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2956 |
case (Create th prio) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2957 |
interpret vt: valid_trace_create s e th prio using Create |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2958 |
by (unfold_locales, simp) |
100 | 2959 |
show ?thesis using Cons by simp |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2960 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2961 |
case (Exit th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2962 |
interpret vt: valid_trace_exit s e th using Exit |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2963 |
by (unfold_locales, simp) |
100 | 2964 |
show ?thesis using Cons by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2965 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2966 |
case (P th cs) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2967 |
interpret vt: valid_trace_p s e th cs using P |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2968 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2969 |
show ?thesis |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2970 |
proof(cases "wq s cs = []") |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2971 |
case True |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2972 |
then interpret vt_h: valid_trace_p_h s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2973 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2974 |
show ?thesis using Cons by (simp add: vt_h.acylic_RAG_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2975 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2976 |
case False |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2977 |
then interpret vt_w: valid_trace_p_w s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2978 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2979 |
show ?thesis using Cons by (simp add: vt_w.acylic_RAG_kept) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2980 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2981 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2982 |
case (V th cs) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2983 |
interpret vt: valid_trace_v s e th cs using V |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2984 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2985 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2986 |
proof(cases "vt.rest = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2987 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2988 |
then interpret vt_e: valid_trace_v_e s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2989 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2990 |
show ?thesis by (simp add: Cons.hyps(2) vt_e.acylic_RAG_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2991 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2992 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2993 |
then interpret vt_n: valid_trace_v_n s e th cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2994 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2995 |
show ?thesis by (simp add: Cons.hyps(2) vt_n.acylic_RAG_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2996 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2997 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2998 |
case (Set th prio) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2999 |
interpret vt: valid_trace_set s e th prio using Set |
63 | 3000 |
by (unfold_locales, simp) |
100 | 3001 |
show ?thesis using Cons by simp |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3002 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3003 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3004 |
|
100 | 3005 |
end |
3006 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3007 |
subsection {* RAG is single-valued *} |
100 | 3008 |
|
112 | 3009 |
text {* |
3010 |
The proof that @{term RAG} is single-valued makes use of |
|
3011 |
@{text "unique_waiting"} and @{thm held_unique} and the |
|
3012 |
proof itself is very simple: |
|
3013 |
*} |
|
3014 |
||
100 | 3015 |
context valid_trace |
3016 |
begin |
|
3017 |
||
3018 |
lemma unique_RAG: "\<lbrakk>(n, n1) \<in> RAG s; (n, n2) \<in> RAG s\<rbrakk> \<Longrightarrow> n1 = n2" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3019 |
apply(unfold s_RAG_def, auto, fold s_waiting_abv s_holding_abv) |
100 | 3020 |
by(auto elim:waiting_unique held_unique) |
3021 |
||
3022 |
lemma sgv_RAG: "single_valued (RAG s)" |
|
3023 |
using unique_RAG by (auto simp:single_valued_def) |
|
3024 |
||
3025 |
end |
|
3026 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3027 |
subsection {* RAG is well-founded *} |
100 | 3028 |
|
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3029 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3030 |
In this section, it is proved that both @{term RAG} and |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3031 |
its converse @{term "(RAG s)^-1"} are well-founded. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3032 |
The proof is very simple with the help of |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3033 |
already proved fact that @{term RAG} is finite. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3034 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3035 |
|
100 | 3036 |
context valid_trace |
3037 |
begin |
|
3038 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3039 |
lemma wf_RAG: "wf (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3040 |
proof(rule finite_acyclic_wf) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3041 |
from finite_RAG show "finite (RAG s)" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3042 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3043 |
from acyclic_RAG show "acyclic (RAG s)" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3044 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3045 |
|
100 | 3046 |
lemma wf_RAG_converse: |
3047 |
shows "wf ((RAG s)^-1)" |
|
3048 |
proof(rule finite_acyclic_wf_converse) |
|
3049 |
from finite_RAG |
|
3050 |
show "finite (RAG s)" . |
|
3051 |
next |
|
3052 |
from acyclic_RAG |
|
3053 |
show "acyclic (RAG s)" . |
|
3054 |
qed |
|
3055 |
||
3056 |
end |
|
3057 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3058 |
subsection {* RAG forms a finite-branching forest (or tree) *} |
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3059 |
|
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3060 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3061 |
With all the well-formedness proofs about @{term RAG} in place, |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3062 |
it is easy to show. |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3063 |
*} |
100 | 3064 |
|
3065 |
context valid_trace |
|
3066 |
begin |
|
3067 |
||
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3068 |
lemma forest_RAG: "forest (RAG s)" |
100 | 3069 |
using sgv_RAG acyclic_RAG |
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3070 |
by (unfold forest_def, auto) |
100 | 3071 |
|
3072 |
end |
|
3073 |
||
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3074 |
sublocale valid_trace < forest_RAG?: forest "RAG s" |
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3075 |
using forest_RAG . |
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3076 |
|
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3077 |
sublocale valid_trace < fsbtRAGs?: fforest "RAG s" |
132
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3078 |
proof |
133
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3079 |
show "\<And>x. finite (children (RAG s) x)" |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3080 |
by (smt Collect_empty_eq Range.intros children_def finite.emptyI finite_RAG finite_fbranchI) |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3081 |
(*by (rule finite_fbranchI[OF finite_RAG])*) |
132
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3082 |
next |
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3083 |
show "wf (RAG s)" using wf_RAG . |
100 | 3084 |
qed |
3085 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3086 |
subsection {* Derived properties for sub-graphs of RAG *} |
100 | 3087 |
|
3088 |
context valid_trace |
|
3089 |
begin |
|
3090 |
||
3091 |
lemma acyclic_tRAG: "acyclic (tRAG s)" |
|
3092 |
proof(unfold tRAG_def, rule acyclic_compose) |
|
3093 |
show "acyclic (RAG s)" using acyclic_RAG . |
|
3094 |
next |
|
3095 |
show "wRAG s \<subseteq> RAG s" unfolding RAG_split by auto |
|
3096 |
next |
|
3097 |
show "hRAG s \<subseteq> RAG s" unfolding RAG_split by auto |
|
3098 |
qed |
|
3099 |
||
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3100 |
lemma rel_map_alt_def: "rel_map f R = map_prod f f ` R" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3101 |
by (unfold rel_map_def pairself_def map_prod_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3102 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3103 |
lemma acyclic_tG: "acyclic (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3104 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3105 |
have "acyclic (rel_map the_thread (tRAG s))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3106 |
proof(rule rel_map_acyclic [OF acyclic_tRAG]) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3107 |
show "inj_on the_thread (Domain (tRAG s) \<union> Range (tRAG s))" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3108 |
by (unfold tRAG_alt_def Domain_def Range_def inj_on_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3109 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3110 |
thus ?thesis |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3111 |
by (unfold tG_def, fold rel_map_alt_def, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3112 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3113 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3114 |
lemma sgv_wRAG: "single_valued (wRAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3115 |
using waiting_unique |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3116 |
by (unfold single_valued_def wRAG_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3117 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3118 |
lemma sgv_hRAG: "single_valued (hRAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3119 |
using held_unique |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3120 |
by (unfold single_valued_def hRAG_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3121 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3122 |
lemma sgv_tRAG: "single_valued (tRAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3123 |
by (unfold tRAG_def, rule single_valued_relcomp, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3124 |
insert sgv_wRAG sgv_hRAG, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3125 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3126 |
lemma sgv_tG: "single_valued (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3127 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3128 |
{ fix x y z |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3129 |
assume h: "(x, y) \<in> tG s" "(x, z) \<in> tG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3130 |
from tG_tRAG[OF h(1)] tG_tRAG[OF h(2)] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3131 |
have "(Th x, Th y) \<in> tRAG s" "(Th x, Th z) \<in> tRAG s" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3132 |
from sgv_tRAG[unfolded single_valued_def, rule_format, OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3133 |
have "y = z" by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3134 |
} thus ?thesis by (unfold single_valued_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3135 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3136 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3137 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3138 |
|
178 | 3139 |
|
3140 |
||
113
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3141 |
text {* |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3142 |
It can be shown that @{term tRAG} is also a |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3143 |
finite-branch relational tree (or forest): |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3144 |
*} |
ce85c3c4e5bf
More improvements in PIPBasics.thy and Implemenation.thy.
zhangx
parents:
112
diff
changeset
|
3145 |
|
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3146 |
sublocale valid_trace < forest_s?: forest "tRAG s" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3147 |
proof(unfold_locales) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3148 |
from sgv_tRAG show "single_valued (tRAG s)" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3149 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3150 |
from acyclic_tRAG show "acyclic (tRAG s)" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3151 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3152 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3153 |
sublocale valid_trace < forest_s_tG?: forest "tG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3154 |
proof(unfold_locales) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3155 |
from sgv_tG show "single_valued (tG s)" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3156 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3157 |
from acyclic_tG show "acyclic (tG s)" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3158 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3159 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3160 |
context valid_trace |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3161 |
begin |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3162 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3163 |
lemma wf_tRAG: "wf (tRAG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3164 |
proof(rule wf_subset) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3165 |
show "wf (RAG s O RAG s)" using wf_RAG |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3166 |
by (fold wf_comp_self, simp) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3167 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3168 |
show "tRAG s \<subseteq> (RAG s O RAG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3169 |
by (unfold tRAG_alt_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3170 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3171 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3172 |
lemma wf_tG: "wf (tG s)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3173 |
proof(rule finite_acyclic_wf) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3174 |
from finite_tG show "finite (tG s)" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3175 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3176 |
from acyclic_tG show "acyclic (tG s)" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3177 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3178 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3179 |
lemma finite_children_tRAG: "finite (children (tRAG s) x)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3180 |
proof(unfold tRAG_def, rule fbranch_compose1[rule_format]) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3181 |
fix x show "finite (children (wRAG s) x)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3182 |
proof(rule finite_fbranchI1[rule_format]) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3183 |
show "finite (wRAG s)" using finite_RAG[unfolded RAG_split] by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3184 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3185 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3186 |
fix x |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3187 |
show "finite (children (hRAG s) x)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3188 |
proof(rule finite_fbranchI1[rule_format]) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3189 |
show "finite (hRAG s)" using finite_RAG[unfolded RAG_split] by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3190 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3191 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3192 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3193 |
lemma children_map_prod: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3194 |
assumes "inj f" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3195 |
shows " children (map_prod f f ` r) (f x) = f ` (children r x)" (is "?L = ?R") |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3196 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3197 |
{ fix e |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3198 |
assume "e \<in> ?L" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3199 |
then obtain e' x' where h: "e = f e'" "f x' = f x" "(e', x') \<in> r" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3200 |
by (auto simp:children_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3201 |
with assms[unfolded inj_on_def, rule_format] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3202 |
have eq_x': "x' = x" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3203 |
with h |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3204 |
have "e \<in> ?R" by (unfold children_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3205 |
} moreover { |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3206 |
fix e |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3207 |
assume "e \<in> ?R" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3208 |
hence "e \<in> ?L" by (auto simp:children_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3209 |
} ultimately show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3210 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3211 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3212 |
lemma finite_children_tG: "finite (children (tG s) x)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3213 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3214 |
have "(children (tRAG s) (Th x)) = Th ` children (tG s) x" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3215 |
by (unfold tRAG_def_tG, subst children_map_prod, auto simp:inj_on_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3216 |
from finite_children_tRAG[of "Th x", unfolded this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3217 |
have "finite (Th ` children (tG s) x)" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3218 |
from finite_imageD[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3219 |
show ?thesis by (auto simp:inj_on_def) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3220 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3221 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3222 |
end |
133
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3223 |
|
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3224 |
sublocale valid_trace < fsbttRAGs?: fforest "tRAG s" |
132
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3225 |
proof |
133
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3226 |
fix x |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3227 |
show "finite (children (tRAG s) x)" |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3228 |
proof(unfold tRAG_def, rule fbranch_compose1[rule_format]) |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3229 |
fix x show "finite (children (wRAG s) x)" |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3230 |
proof(rule finite_fbranchI1[rule_format]) |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3231 |
show "finite (wRAG s)" using finite_RAG[unfolded RAG_split] by auto |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3232 |
qed |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3233 |
next |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3234 |
fix x |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3235 |
show "finite (children (hRAG s) x)" |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3236 |
proof(rule finite_fbranchI1[rule_format]) |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3237 |
show "finite (hRAG s)" using finite_RAG[unfolded RAG_split] by auto |
4b717aa162fa
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
132
diff
changeset
|
3238 |
qed |
132
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3239 |
qed |
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3240 |
next |
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3241 |
show "wf (tRAG s)" |
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3242 |
proof(rule wf_subset) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3243 |
show "wf (RAG s O RAG s)" using wf_RAG |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3244 |
by (fold wf_comp_self, simp) |
132
d9974794436a
added version with fgraphs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
131
diff
changeset
|
3245 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3246 |
show "tRAG s \<subseteq> (RAG s O RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3247 |
by (unfold tRAG_alt_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3248 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3249 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3250 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3251 |
sublocale valid_trace < fsbttGs?: fforest "tG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3252 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3253 |
fix x |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3254 |
show "finite (children (tG s) x)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3255 |
by (simp add:finite_children_tG) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3256 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3257 |
show "wf (tG s)" by (simp add:wf_tG) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3258 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3259 |
|
101 | 3260 |
section {* Chain to readys *} |
100 | 3261 |
|
114 | 3262 |
text {* |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3263 |
In this section, based on the just derived |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3264 |
properties about the shape of @{term RAG}, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3265 |
a more complete view of the relationship |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3266 |
between threads is established. |
114 | 3267 |
*} |
3268 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3269 |
context valid_trace |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3270 |
begin |
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
3271 |
|
138
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3272 |
text {* The first lemma is technical, which says out of any node in the |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3273 |
domain of @{term RAG} (no matter whether it is thread node or resource |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3274 |
node), there is a path leading to a ready thread. |
114 | 3275 |
*} |
3276 |
||
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3277 |
lemma chain_building: |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3278 |
assumes "node \<in> Domain (RAG s)" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3279 |
obtains th' where "th' \<in> readys s" "(node, Th th') \<in> (RAG s)^+" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3280 |
proof - |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3281 |
from assms have "node \<in> Range ((RAG s)^-1)" by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3282 |
from wf_base[OF wf_RAG_converse this] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3283 |
obtain b where h_b: "(b, node) \<in> ((RAG s)\<inverse>)\<^sup>+" "\<forall>c. (c, b) \<notin> (RAG s)\<inverse>" by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3284 |
obtain th' where eq_b: "b = Th th'" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3285 |
proof(cases b) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3286 |
case (Cs cs) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3287 |
from h_b(1)[unfolded trancl_converse] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3288 |
have "(node, b) \<in> ((RAG s)\<^sup>+)" by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3289 |
from tranclE[OF this] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3290 |
obtain n where "(n, b) \<in> RAG s" by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3291 |
from this[unfolded Cs] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3292 |
obtain th1 where "waiting s th1 cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3293 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3294 |
from waiting_holding[OF this] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3295 |
obtain th2 where "holding s th2 cs" . |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3296 |
hence "(Cs cs, Th th2) \<in> RAG s" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3297 |
by (unfold s_RAG_def, fold s_holding_abv, auto) |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3298 |
with h_b(2)[unfolded Cs, rule_format] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3299 |
have False by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3300 |
thus ?thesis by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3301 |
qed auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3302 |
have "th' \<in> readys s" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3303 |
proof - |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3304 |
from h_b(2)[unfolded eq_b] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3305 |
have "\<forall>cs. \<not> waiting s th' cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3306 |
by (unfold s_RAG_def, fold s_waiting_abv, auto) |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3307 |
moreover have "th' \<in> threads s" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3308 |
proof(rule rg_RAG_threads) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3309 |
from tranclD[OF h_b(1), unfolded eq_b] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3310 |
obtain z where "(z, Th th') \<in> (RAG s)" by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3311 |
thus "Th th' \<in> Range (RAG s)" by auto |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3312 |
qed |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3313 |
ultimately show ?thesis by (auto simp:readys_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3314 |
qed |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3315 |
moreover have "(node, Th th') \<in> (RAG s)^+" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3316 |
using h_b(1)[unfolded trancl_converse] eq_b by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3317 |
ultimately show ?thesis using that by metis |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3318 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3319 |
|
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
3320 |
text {* \noindent |
114 | 3321 |
The following lemma says for any living thread, |
3322 |
either it is ready or there is a path in @{term RAG} |
|
3323 |
leading from it to a ready thread. The lemma is proved easily |
|
3324 |
by instantiating @{thm "chain_building"}. |
|
100 | 3325 |
*} |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3326 |
lemma th_chain_to_ready: |
63 | 3327 |
assumes th_in: "th \<in> threads s" |
35
92f61f6a0fe7
added a bit more text to the paper and separated a theory about Max
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
32
diff
changeset
|
3328 |
shows "th \<in> readys s \<or> (\<exists> th'. th' \<in> readys s \<and> (Th th, Th th') \<in> (RAG s)^+)" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3329 |
proof(cases "th \<in> readys s") |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3330 |
case True |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3331 |
thus ?thesis by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3332 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3333 |
case False |
35
92f61f6a0fe7
added a bit more text to the paper and separated a theory about Max
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
32
diff
changeset
|
3334 |
from False and th_in have "Th th \<in> Domain (RAG s)" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3335 |
by (auto simp: readys_def s_waiting_def s_RAG_def wq_def waiting_raw_def |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3336 |
Domain_def) |
63 | 3337 |
from chain_building [rule_format, OF this] |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3338 |
show ?thesis by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3339 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3340 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3341 |
lemma th_chain_to_ready_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3342 |
assumes th_in: "th \<in> threads s" |
138
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3343 |
shows "\<exists>th'\<in> nancestors (tG s) th. th' \<in> readys s" |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3344 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3345 |
from th_chain_to_ready[OF assms] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3346 |
show ?thesis |
138
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3347 |
using dependants_alt_def1 dependants_alt_tG |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3348 |
unfolding nancestors_def ancestors_def |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3349 |
by blast |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3350 |
qed |
20c1d3a14143
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
137
diff
changeset
|
3351 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3352 |
|
114 | 3353 |
text {* |
3354 |
The following lemma is a technical one to show |
|
3355 |
that the set of threads in the subtree of any thread |
|
3356 |
is finite. |
|
3357 |
*} |
|
101 | 3358 |
lemma finite_subtree_threads: |
3359 |
"finite {th'. Th th' \<in> subtree (RAG s) (Th th)}" (is "finite ?A") |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3360 |
proof - |
101 | 3361 |
have "?A = the_thread ` {Th th' | th' . Th th' \<in> subtree (RAG s) (Th th)}" |
3362 |
by (auto, insert image_iff, fastforce) |
|
3363 |
moreover have "finite {Th th' | th' . Th th' \<in> subtree (RAG s) (Th th)}" |
|
3364 |
(is "finite ?B") |
|
3365 |
proof - |
|
3366 |
have "?B = (subtree (RAG s) (Th th)) \<inter> {Th th' | th'. True}" |
|
3367 |
by auto |
|
3368 |
moreover have "... \<subseteq> (subtree (RAG s) (Th th))" by auto |
|
3369 |
moreover have "finite ..." by (simp add: fsbtRAGs.finite_subtree) |
|
3370 |
ultimately show ?thesis by auto |
|
3371 |
qed |
|
3372 |
ultimately show ?thesis by auto |
|
104 | 3373 |
qed |
3374 |
||
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3375 |
(* ccc *) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3376 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3377 |
lemma readys_no_tRAG_chain: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3378 |
assumes "th1 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3379 |
and "th2 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3380 |
and "th1 \<noteq> th2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3381 |
shows "(Th th1, Th th2) \<notin> (tRAG s)^*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3382 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3383 |
assume "(Th th1, Th th2) \<in> (tRAG s)\<^sup>*" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3384 |
from rtranclD[OF this] |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3385 |
show False |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3386 |
proof |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3387 |
assume "Th th1 = Th th2" with assms show ?thesis by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3388 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3389 |
assume "Th th1 \<noteq> Th th2 \<and> (Th th1, Th th2) \<in> (tRAG s)\<^sup>+" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3390 |
hence "(Th th1, Th th2) \<in> (tRAG s)\<^sup>+" by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3391 |
from tranclD[OF this] obtain cs where "(Th th1, Cs cs) \<in> RAG s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3392 |
by (unfold tRAG_alt_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3393 |
from in_RAG_E[OF this] have "th1 \<notin> readys s" by (unfold readys_def, auto) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3394 |
with assms show ?thesis by simp |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3395 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3396 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3397 |
|
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3398 |
lemma root_readys: |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3399 |
assumes "th \<in> readys s" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3400 |
shows "root (tRAG s) (Th th)" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3401 |
proof - |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3402 |
{ assume "\<not> root (tRAG s) (Th th)" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3403 |
then obtain n' where "(Th th, n') \<in> (tRAG s)^+" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3404 |
unfolding root_def ancestors_def by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3405 |
then obtain cs where "(Th th, Cs cs) \<in> RAG s" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3406 |
unfolding tRAG_alt_def using tranclD by fastforce |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3407 |
then have "th \<notin> readys s" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3408 |
unfolding readys_def using in_RAG_E by blast |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3409 |
with assms have False by simp |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3410 |
} then show "root (tRAG s) (Th th)" by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3411 |
qed |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3412 |
|
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3413 |
lemma root_readys_tG: |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3414 |
assumes "th \<in> readys s" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3415 |
shows "root (tG s) th" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3416 |
proof - |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3417 |
{ assume "\<not> root (tG s) th" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3418 |
then obtain th' where "(th, th') \<in> (tG s)^+" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3419 |
unfolding root_def ancestors_def by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3420 |
then have "(Th th, Th th') \<in> (tRAG s)^+" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3421 |
using trancl_tG_tRAG by simp |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3422 |
with root_readys assms |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3423 |
have False |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3424 |
unfolding root_def ancestors_def by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3425 |
} then show "root (tG s) th" by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3426 |
qed |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3427 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3428 |
lemma readys_indep: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3429 |
assumes "th1 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3430 |
and "th2 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3431 |
and "th1 \<noteq> th2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3432 |
shows "indep (tRAG s) (Th th1) (Th th2)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3433 |
using assms readys_no_tRAG_chain |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3434 |
unfolding indep_def by blast |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3435 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3436 |
lemma readys_indep_tG: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3437 |
assumes "th1 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3438 |
and "th2 \<in> readys s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3439 |
and "th1 \<noteq> th2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3440 |
shows "indep (tG s) th1 th2" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3441 |
using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3442 |
unfolding indep_def |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3443 |
using readys_no_tRAG_chain rtrancl_tG_tRAG by blast |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3444 |
|
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3445 |
text {* |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3446 |
The following lemma @{text "thread_chain"} holds on any living thread, |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3447 |
not necessarily a running one. |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3448 |
*} |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3449 |
lemma thread_chain: |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3450 |
assumes "th \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3451 |
obtains th' where "th' \<in> subtree (tG s) th" "th' \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3452 |
"the_preced s th' = Max (the_preced s ` subtree (tG s) th)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3453 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3454 |
have "Max (the_preced s ` subtree (tG s) th) \<in> the_preced s ` subtree (tG s) th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3455 |
proof(rule Max_in) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3456 |
show "finite (the_preced s ` subtree (tG s) th)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3457 |
by (simp add: fsbttGs.finite_subtree) |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3458 |
next |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3459 |
show "the_preced s ` subtree (tG s) th \<noteq> {}" using subtree_def by fastforce |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3460 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3461 |
then obtain th' where |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3462 |
h: "th' \<in> subtree (tG s) th" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3463 |
"the_preced s th' = Max (the_preced s ` subtree (tG s) th)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3464 |
by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3465 |
moreover have "th' \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3466 |
proof - |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3467 |
from assms have "th \<in> threads s" . |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3468 |
from subtree_tG_thread[OF this] and h |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3469 |
show ?thesis by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3470 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3471 |
ultimately show ?thesis using that by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3472 |
qed |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3473 |
|
114 | 3474 |
text {* |
3475 |
The following two lemmas shows there is at most one running thread |
|
3476 |
in the system. |
|
3477 |
*} |
|
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3478 |
|
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3479 |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3480 |
lemma running_unique: |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3481 |
assumes running_1: "th1 \<in> running s" |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3482 |
and running_2: "th2 \<in> running s" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3483 |
shows "th1 = th2" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3484 |
proof - |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3485 |
-- {* |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3486 |
|
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3487 |
According to lemma @{thm thread_chain}, each live thread is chained to a |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3488 |
thread in its subtree, who holds the highest precedence of the subtree. |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3489 |
|
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3490 |
The chains for @{term th1} and @{term th2} are established first in the |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3491 |
following in @{text "chain1"} and @{text "chain2"}. These chains start |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3492 |
with the threads @{text "th1'"} and @{text "th2'"} respectively. *} |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3493 |
|
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3494 |
have "th1 \<in> threads s" using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3495 |
by (unfold running_def readys_def, auto) |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3496 |
with thread_chain |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3497 |
obtain th1' where |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3498 |
chain1: "th1' \<in> subtree (tG s) th1" |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3499 |
"the_preced s th1' = Max (the_preced s ` subtree (tG s) th1)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3500 |
"th1' \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3501 |
by auto |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3502 |
have "th2 \<in> threads s" using assms |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3503 |
by (unfold running_def readys_def, auto) |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3504 |
with thread_chain |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3505 |
obtain th2' where |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3506 |
chain2: "th2' \<in> subtree (tG s) th2" |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3507 |
"the_preced s th2' = Max (the_preced s ` subtree (tG s) th2)" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3508 |
"th2' \<in> threads s" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3509 |
by auto |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3510 |
-- {* From these two chains we can be prove that the threads |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3511 |
@{term th1} and @{term th2} must be equal. For this we first |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3512 |
show that the starting points of the chains are equal. |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3513 |
*} |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3514 |
have eq_th': "th1' = th2'" |
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
3515 |
proof - |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3516 |
-- {* from @{text th1} and @{text th2} running, we know their |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3517 |
cp-value is the same *} |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3518 |
from running_1 and running_2 have "cp s th1 = cp s th2" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3519 |
unfolding running_def by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3520 |
-- {* that means the preced of @{text th1'} and @{text th2'} |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3521 |
must be the same *} |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3522 |
then |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3523 |
have eq_max: "Max (the_preced s ` subtree (tG s) th1) = |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3524 |
Max (the_preced s ` subtree (tG s) th2)" |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3525 |
unfolding cp_alt_def2 . |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3526 |
with chain1(2) chain2(2) |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3527 |
have "the_preced s th1' = the_preced s th2'" by simp |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3528 |
-- {* since the precedences are the same, we can conclude |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3529 |
that @{text th1'} and @{text th2'} are the same *} |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3530 |
with preced_unique chain1(3) chain2(3) |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3531 |
show "th1' = th2'" unfolding the_preced_def by auto |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3532 |
qed |
137
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3533 |
moreover |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3534 |
have "root (tG s) th1" "root (tG s) th2" using assms |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3535 |
using assms root_readys_tG |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3536 |
unfolding running_def by auto |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3537 |
ultimately show "th1 = th2" using root_unique chain1(1) chain2(1) |
785c0f6b8184
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
136
diff
changeset
|
3538 |
by fastforce |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3539 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3540 |
|
129
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
3541 |
lemma card_running: |
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
3542 |
shows "card (running s) \<le> 1" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3543 |
proof(cases "running s = {}") |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3544 |
case True |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3545 |
thus ?thesis by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3546 |
next |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3547 |
case False |
129
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
3548 |
then obtain th where "th \<in> running s" by auto |
e3cf792db636
removed some files to attic
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
128
diff
changeset
|
3549 |
with running_unique |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
3550 |
have "running s = {th}" by auto |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3551 |
thus ?thesis by auto |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
3552 |
qed |
63 | 3553 |
|
114 | 3554 |
text {* |
3555 |
The following two lemmas show that the set of living threads |
|
3556 |
in the system can be partitioned into subtrees of those |
|
3557 |
threads in the @{term readys} set. The first lemma |
|
3558 |
@{text threads_alt_def} shows the union of |
|
3559 |
these subtrees equals to the set of living threads |
|
3560 |
and the second lemma @{text "readys_subtree_disjoint"} shows |
|
3561 |
subtrees of different threads in @{term readys}-set |
|
3562 |
are disjoint. |
|
3563 |
*} |
|
3564 |
||
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3565 |
lemma subtree_RAG_tG: |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3566 |
shows "subtree (tG s) th = {th'. Th th' \<in> subtree (RAG s) (Th th)}" |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3567 |
using subtree_tG_tRAG threads_set_eq by auto |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3568 |
|
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3569 |
|
114 | 3570 |
lemma threads_alt_def: |
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3571 |
"threads s = (\<Union> th \<in> readys s. {th'. Th th' \<in> subtree (RAG s) (Th th)})" |
114 | 3572 |
(is "?L = ?R") |
3573 |
proof - |
|
3574 |
{ fix th1 |
|
3575 |
assume "th1 \<in> ?L" |
|
3576 |
from th_chain_to_ready[OF this] |
|
3577 |
have "th1 \<in> readys s \<or> (\<exists>th'. th' \<in> readys s \<and> (Th th1, Th th') \<in> (RAG s)\<^sup>+)" . |
|
3578 |
hence "th1 \<in> ?R" by (auto simp:subtree_def) |
|
3579 |
} moreover |
|
3580 |
{ fix th' |
|
3581 |
assume "th' \<in> ?R" |
|
3582 |
then obtain th where h: "th \<in> readys s" " Th th' \<in> subtree (RAG s) (Th th)" |
|
3583 |
by auto |
|
3584 |
from this(2) |
|
3585 |
have "th' \<in> ?L" |
|
3586 |
proof(cases rule:subtreeE) |
|
3587 |
case 1 |
|
3588 |
with h(1) show ?thesis by (auto simp:readys_def) |
|
3589 |
next |
|
3590 |
case 2 |
|
3591 |
from tranclD[OF this(2)[unfolded ancestors_def, simplified]] |
|
3592 |
have "Th th' \<in> Domain (RAG s)" by auto |
|
3593 |
from dm_RAG_threads[OF this] |
|
3594 |
show ?thesis . |
|
3595 |
qed |
|
3596 |
} ultimately show ?thesis by auto |
|
3597 |
qed |
|
3598 |
||
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3599 |
lemma threads_alt_def1: |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3600 |
shows "(threads s) = (\<Union> th \<in> readys s. subtree (tG s) th)" |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3601 |
unfolding threads_alt_def subtree_RAG_tG .. |
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3602 |
|
114 | 3603 |
lemma readys_subtree_disjoint: |
3604 |
assumes "th1 \<in> readys s" |
|
3605 |
and "th2 \<in> readys s" |
|
3606 |
and "th1 \<noteq> th2" |
|
3607 |
shows "subtree (RAG s) (Th th1) \<inter> subtree (RAG s) (Th th2) = {}" |
|
3608 |
proof - |
|
3609 |
{ fix n |
|
3610 |
assume "n \<in> subtree (RAG s) (Th th1) \<inter> subtree (RAG s) (Th th2)" |
|
3611 |
hence "(n, Th th1) \<in> (RAG s)^*" "(n, Th th2) \<in> (RAG s)^*" |
|
3612 |
by (auto simp:subtree_def) |
|
3613 |
from star_rpath[OF this(1)] star_rpath[OF this(2)] |
|
3614 |
obtain xs1 xs2 where "rpath (RAG s) n xs1 (Th th1)" |
|
3615 |
"rpath (RAG s) n xs2 (Th th2)" by metis |
|
3616 |
hence False |
|
134
8a13b37b4d95
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
133
diff
changeset
|
3617 |
proof(cases rule:forest_RAG.rpath_overlap') |
114 | 3618 |
case (less_1 xs3) |
3619 |
from rpath_star[OF this(3)] |
|
3620 |
have "Th th1 \<in> subtree (RAG s) (Th th2)" |
|
3621 |
by (auto simp:subtree_def) |
|
3622 |
thus ?thesis |
|
3623 |
proof(cases rule:subtreeE) |
|
3624 |
case 1 |
|
3625 |
with assms(3) show ?thesis by auto |
|
3626 |
next |
|
3627 |
case 2 |
|
3628 |
hence "(Th th1, Th th2) \<in> (RAG s)^+" by (auto simp:ancestors_def) |
|
3629 |
from tranclD[OF this] |
|
3630 |
obtain z where "(Th th1, z) \<in> RAG s" by auto |
|
3631 |
from this[unfolded s_RAG_def, folded wq_def] |
|
3632 |
obtain cs' where "waiting s th1 cs'" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3633 |
by (auto simp:s_waiting_abv) |
114 | 3634 |
with assms(1) show False by (auto simp:readys_def) |
3635 |
qed |
|
3636 |
next |
|
3637 |
case (less_2 xs3) |
|
3638 |
from rpath_star[OF this(3)] |
|
3639 |
have "Th th2 \<in> subtree (RAG s) (Th th1)" |
|
3640 |
by (auto simp:subtree_def) |
|
3641 |
thus ?thesis |
|
3642 |
proof(cases rule:subtreeE) |
|
3643 |
case 1 |
|
3644 |
with assms(3) show ?thesis by auto |
|
3645 |
next |
|
3646 |
case 2 |
|
3647 |
hence "(Th th2, Th th1) \<in> (RAG s)^+" by (auto simp:ancestors_def) |
|
3648 |
from tranclD[OF this] |
|
3649 |
obtain z where "(Th th2, z) \<in> RAG s" by auto |
|
3650 |
from this[unfolded s_RAG_def, folded wq_def] |
|
3651 |
obtain cs' where "waiting s th2 cs'" |
|
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3652 |
by (auto simp:s_waiting_abv) |
114 | 3653 |
with assms(2) show False by (auto simp:readys_def) |
3654 |
qed |
|
3655 |
qed |
|
3656 |
} thus ?thesis by auto |
|
3657 |
qed |
|
3658 |
||
63 | 3659 |
end |
3660 |
||
101 | 3661 |
section {* Relating @{term cp} and @{term the_preced} and @{term preced} *} |
3662 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3663 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3664 |
@{term cp} of a thread is defined to be the maximum of |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3665 |
the @{term preced}-values (precedences) of all threads in |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3666 |
its subtree given by @{term RAG}. Therefore, there exits |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3667 |
a relationship between @{term cp} and @{term preced} (and |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3668 |
also its variation @{term "the_preced"}) to be explored, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3669 |
and this is the target of this section. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3670 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3671 |
|
101 | 3672 |
context valid_trace |
3673 |
begin |
|
3674 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3675 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3676 |
Since @{term cp} is the maximum of all @{term preced}s in its subtree, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3677 |
which includes itself, it is not difficult to show |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3678 |
that the one thread's precedence is less or equal to its |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3679 |
@{text cp}-value: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3680 |
*} |
114 | 3681 |
|
101 | 3682 |
lemma le_cp: |
3683 |
shows "preced th s \<le> cp s th" |
|
3684 |
proof(unfold cp_alt_def, rule Max_ge) |
|
3685 |
show "finite (the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)})" |
|
3686 |
by (simp add: finite_subtree_threads) |
|
3687 |
next |
|
3688 |
show "preced th s \<in> the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)}" |
|
3689 |
by (simp add: subtree_def the_preced_def) |
|
3690 |
qed |
|
3691 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3692 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3693 |
Since @{term cp} is the maximum precedence of its subtree, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3694 |
and the subtree is only a subset of the set of all threads, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3695 |
it can be shown that @{text cp} is less or equal to the maximum of |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3696 |
all threads: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3697 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3698 |
|
101 | 3699 |
lemma cp_le: |
3700 |
assumes th_in: "th \<in> threads s" |
|
3701 |
shows "cp s th \<le> Max (the_preced s ` threads s)" |
|
3702 |
proof(unfold cp_alt_def, rule Max_f_mono) |
|
3703 |
show "finite (threads s)" by (simp add: finite_threads) |
|
3704 |
next |
|
3705 |
show " {th'. Th th' \<in> subtree (RAG s) (Th th)} \<noteq> {}" |
|
3706 |
using subtree_def by fastforce |
|
3707 |
next |
|
3708 |
show "{th'. Th th' \<in> subtree (RAG s) (Th th)} \<subseteq> threads s" |
|
3709 |
using assms |
|
3710 |
by (smt Domain.DomainI dm_RAG_threads mem_Collect_eq |
|
3711 |
node.inject(1) rtranclD subsetI subtree_def trancl_domain) |
|
3712 |
qed |
|
3713 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3714 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3715 |
Since the @{term cp}-value of each individual thread is less or equal to the |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3716 |
maximum precedence value of all threads (shown in lemma @{thm cp_le}), |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3717 |
it is easy to derive further that maximum @{term "cp"}-value of |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3718 |
all threads is also less or equal to the latter. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3719 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3720 |
On the other hand, since the precedence value of each individual |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3721 |
thread is less of equal to its own @{term cp}-value (shown in lemma @{thm le_cp}), |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3722 |
it is easy to show that the maximum of the former is less or equal to the |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3723 |
maximum of the latter. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3724 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3725 |
By combining these two perspectives, we get the following equality |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3726 |
between the two maximums: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3727 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3728 |
|
101 | 3729 |
lemma max_cp_eq: |
3730 |
shows "Max ((cp s) ` threads s) = Max (the_preced s ` threads s)" |
|
3731 |
(is "?L = ?R") |
|
3732 |
proof - |
|
3733 |
have "?L \<le> ?R" |
|
3734 |
proof(cases "threads s = {}") |
|
3735 |
case False |
|
3736 |
show ?thesis |
|
3737 |
by (rule Max.boundedI, |
|
3738 |
insert cp_le, |
|
3739 |
auto simp:finite_threads False) |
|
3740 |
qed auto |
|
3741 |
moreover have "?R \<le> ?L" |
|
3742 |
by (rule Max_fg_mono, |
|
3743 |
simp add: finite_threads, |
|
3744 |
simp add: le_cp the_preced_def) |
|
3745 |
ultimately show ?thesis by auto |
|
3746 |
qed |
|
3747 |
||
114 | 3748 |
text {* (* ddd *) \noindent |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3749 |
According to @{thm threads_alt_def} and @{thm readys_subtree_disjoint} , |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3750 |
the set of @{term threads} can be partitioned into subtrees of the |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3751 |
threads in @{term readys}, and also because @{term cp}-value of a thread is |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3752 |
the maximum precedence of its own subtree, by applying |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3753 |
the absorbing property of @{term Max} (lemma @{thm Max_UNION}) |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3754 |
over the union of subtrees, the following equation can be derived: |
103
d5e9653fbf19
PIPBasics.thy reorganized into sections. The structure is now stable. Next step is to put in more comments.
zhangx
parents:
102
diff
changeset
|
3755 |
*} |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3756 |
|
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3757 |
|
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3758 |
lemma cp_alt_def3: |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3759 |
shows "cp s th = Max (preceds (subtree (tG s) th) s)" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3760 |
unfolding cp_alt_def2 |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3761 |
unfolding image_def |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3762 |
unfolding the_preced_def |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3763 |
by meson |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3764 |
|
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3765 |
lemma KK: |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3766 |
shows "(\<Union>x\<in>C. B x) = (\<Union> {B x |x. x \<in> C})" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3767 |
(* and "\<Union>" *) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3768 |
by (simp_all add: Setcompr_eq_image) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3769 |
|
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3770 |
lemma Max_Segments: |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3771 |
assumes "finite C" "\<forall>x\<in> C. finite (B x)" "\<forall>x\<in> C. B x \<noteq> {}" "{B x |x. x \<in> C} \<noteq> {}" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3772 |
shows "Max (\<Union>x \<in> C. B x) = Max {Max (B x) | x. x \<in> C}" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3773 |
using assms |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3774 |
apply(subst KK(1)) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3775 |
apply(subst Max_Union) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3776 |
apply(auto)[3] |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3777 |
apply(simp add: Setcompr_eq_image) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3778 |
apply(simp add: image_eq_UN) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3779 |
done |
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3780 |
|
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3781 |
lemma max_cp_readys_max_preced_tG: |
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3782 |
shows "Max (cp s ` readys s) = Max (preceds (threads s) s)" (is "?L = ?R") |
103
d5e9653fbf19
PIPBasics.thy reorganized into sections. The structure is now stable. Next step is to put in more comments.
zhangx
parents:
102
diff
changeset
|
3783 |
proof(cases "readys s = {}") |
d5e9653fbf19
PIPBasics.thy reorganized into sections. The structure is now stable. Next step is to put in more comments.
zhangx
parents:
102
diff
changeset
|
3784 |
case False |
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3785 |
have "Max (preceds (threads s) s) = Max (preceds (\<Union>th\<in>readys s. subtree (tG s) th) s)" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3786 |
unfolding threads_alt_def1 by simp |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3787 |
also have "... = Max {Max (preceds (subtree (tG s) th) s) | th. th \<in> readys s}" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3788 |
apply(subst Max_Segments[symmetric]) |
142
10c16b85a839
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
141
diff
changeset
|
3789 |
apply (simp add: finite_readys) |
10c16b85a839
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
141
diff
changeset
|
3790 |
apply (simp add: fsbttGs.finite_subtree) |
10c16b85a839
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
141
diff
changeset
|
3791 |
apply blast |
10c16b85a839
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
141
diff
changeset
|
3792 |
using False apply blast |
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3793 |
apply(rule arg_cong) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3794 |
back |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3795 |
apply(blast) |
142
10c16b85a839
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
141
diff
changeset
|
3796 |
done |
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3797 |
also have "... = Max {cp s th | th. th \<in> readys s}" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3798 |
unfolding cp_alt_def3 .. |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3799 |
finally show "Max (cp s ` readys s) = Max (preceds (threads s) s)" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3800 |
by (simp add: Setcompr_eq_image image_def) |
103
d5e9653fbf19
PIPBasics.thy reorganized into sections. The structure is now stable. Next step is to put in more comments.
zhangx
parents:
102
diff
changeset
|
3801 |
qed (auto simp:threads_alt_def) |
d5e9653fbf19
PIPBasics.thy reorganized into sections. The structure is now stable. Next step is to put in more comments.
zhangx
parents:
102
diff
changeset
|
3802 |
|
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3803 |
|
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3804 |
lemma LL: |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3805 |
shows "the_preced s ` threads s = preceds (threads s) s" |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3806 |
using the_preced_def by auto |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3807 |
|
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3808 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3809 |
text {* |
140
389ef8b1959c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
138
diff
changeset
|
3810 |
The following lemma is simply a corollary of @{thm max_cp_readys_max_preced_tG} |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3811 |
and @{thm max_cp_eq}: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3812 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3813 |
lemma max_cp_readys_threads: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3814 |
shows "Max (cp s ` readys s) = Max (cp s ` threads s)" |
141
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3815 |
apply(simp add: max_cp_readys_max_preced_tG) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3816 |
apply(simp add: max_cp_eq) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3817 |
apply(simp add: LL) |
f70344294e99
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
140
diff
changeset
|
3818 |
done |
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3819 |
|
101 | 3820 |
end |
3821 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3822 |
|
101 | 3823 |
section {* Relating @{term cntP}, @{term cntV}, @{term cntCS} and @{term pvD} *} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3824 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3825 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3826 |
As explained in the section where @{term "cntP"}, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3827 |
@{term "cntV"} and @{term "cntCS"} are defined, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3828 |
we need to establish a equation (in lemma @{text "cnp_cnv_cncs"}) |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3829 |
so that the last can be calculated out of the first two. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3830 |
|
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3831 |
While the calculation of @{term "cntV"} and @{term "cntCS"} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3832 |
are relatively simple, the calculation of @{term "cntCS"} and |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3833 |
@{term "pvD"} are complicated, because their definitions |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3834 |
involve a number of other functions such as @{term holdents}, @{term readys}, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3835 |
and @{term threads}. To prove @{text "cnp_cnv_cncs"}, |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3836 |
we need to investigate how the values of these functions |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3837 |
are changed with the execution of each kind of system operation. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3838 |
Following conventions, such investigation are divided into |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3839 |
locales corresponding to system operations. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3840 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
3841 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3842 |
context valid_trace_p_w |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3843 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3844 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3845 |
lemma holding_s_holder: "holding s holder cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3846 |
by (unfold s_holding_def, unfold wq_s_cs, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3847 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3848 |
lemma holding_es_holder: "holding (e#s) holder cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3849 |
by (unfold s_holding_def, unfold wq_es_cs wq_s_cs, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3850 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3851 |
lemma holdents_es: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3852 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3853 |
proof - |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3854 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3855 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3856 |
hence h: "holding (e#s) th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3857 |
have "holding s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3858 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3859 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3860 |
from held_unique[OF h[unfolded True] holding_es_holder] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3861 |
have "th' = holder" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3862 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3863 |
by (unfold True holdents_def, insert holding_s_holder, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3864 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3865 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3866 |
hence "wq (e#s) cs' = wq s cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3867 |
from h[unfolded s_holding_def, folded wq_def, unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3868 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3869 |
by (unfold s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3870 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3871 |
hence "cs' \<in> ?R" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3872 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3873 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3874 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3875 |
hence h: "holding s th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3876 |
have "holding (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3877 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3878 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3879 |
from held_unique[OF h[unfolded True] holding_s_holder] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3880 |
have "th' = holder" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3881 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3882 |
by (unfold True holdents_def, insert holding_es_holder, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3883 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3884 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3885 |
hence "wq s cs' = wq (e#s) cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3886 |
from h[unfolded s_holding_def, folded wq_def, unfolded this] |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3887 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
3888 |
by (unfold s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3889 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3890 |
hence "cs' \<in> ?L" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3891 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3892 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3893 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3894 |
lemma cntCS_es_th[simp]: "cntCS (e#s) th' = cntCS s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3895 |
by (unfold cntCS_def holdents_es, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3896 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3897 |
lemma th_not_ready_es: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3898 |
shows "th \<notin> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3899 |
using waiting_es_th_cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3900 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3901 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3902 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3903 |
|
100 | 3904 |
lemma (in valid_trace) finite_holdents: "finite (holdents s th)" |
3905 |
by (unfold holdents_alt_def, insert fsbtRAGs.finite_children, auto) |
|
3906 |
||
101 | 3907 |
context valid_trace_p |
3908 |
begin |
|
3909 |
||
3910 |
lemma live_th_es: "th \<in> threads (e#s)" |
|
3911 |
using live_th_s |
|
3912 |
by (unfold is_p, simp) |
|
3913 |
||
3914 |
lemma waiting_neq_th: |
|
3915 |
assumes "waiting s t c" |
|
3916 |
shows "t \<noteq> th" |
|
3917 |
using assms using th_not_waiting by blast |
|
3918 |
||
3919 |
end |
|
3920 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3921 |
context valid_trace_p_h |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3922 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3923 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3924 |
lemma th_not_waiting': |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3925 |
"\<not> waiting (e#s) th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3926 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3927 |
case True |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3928 |
show ?thesis |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3929 |
by (unfold True s_waiting_def, fold wq_def, unfold wq_es_cs', auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3930 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3931 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3932 |
from th_not_waiting[of cs', unfolded s_waiting_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3933 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3934 |
by (unfold s_waiting_def, fold wq_def, insert False, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3935 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3936 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3937 |
lemma ready_th_es: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3938 |
shows "th \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3939 |
using th_not_waiting' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3940 |
by (unfold readys_def, insert live_th_es, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3941 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3942 |
lemma holdents_es_th: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3943 |
"holdents (e#s) th = (holdents s th) \<union> {cs}" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3944 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3945 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3946 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3947 |
hence "holding (e#s) th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3948 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3949 |
hence "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3950 |
by (cases rule:holding_esE, auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3951 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3952 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3953 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3954 |
hence "holding s th cs' \<or> cs' = cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3955 |
by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3956 |
hence "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3957 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3958 |
assume "holding s th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3959 |
from holding_kept[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3960 |
show ?thesis by (auto simp:holdents_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3961 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3962 |
assume "cs' = cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3963 |
thus ?thesis using holding_es_th_cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3964 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3965 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3966 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3967 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3968 |
|
111 | 3969 |
lemma not_holding_s_th_cs: "\<not> holding s th cs" |
3970 |
proof |
|
3971 |
assume otherwise: "holding s th cs" |
|
3972 |
from pip_e[unfolded is_p] |
|
3973 |
show False |
|
3974 |
proof(cases) |
|
3975 |
case (thread_P) |
|
3976 |
moreover have "(Cs cs, Th th) \<in> RAG s" |
|
120
b3b8735c7c02
updated to Isabelle 2016
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
3977 |
using otherwise th_not_in_wq |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
3978 |
using s_holding_def wq_def by auto |
111 | 3979 |
ultimately show ?thesis by auto |
3980 |
qed |
|
3981 |
qed |
|
3982 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3983 |
lemma cntCS_es_th: "cntCS (e#s) th = cntCS s th + 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3984 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3985 |
have "card (holdents s th \<union> {cs}) = card (holdents s th) + 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3986 |
proof(subst card_Un_disjoint) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3987 |
show "holdents s th \<inter> {cs} = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3988 |
using not_holding_s_th_cs by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3989 |
qed (auto simp:finite_holdents) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3990 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3991 |
by (unfold cntCS_def holdents_es_th, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3992 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3993 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3994 |
lemma no_holder: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3995 |
"\<not> holding s th' cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3996 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3997 |
assume otherwise: "holding s th' cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3998 |
from this[unfolded s_holding_def, folded wq_def, unfolded we] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3999 |
show False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4000 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4001 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4002 |
lemma holdents_es_th': |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4003 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4004 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4005 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4006 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4007 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4008 |
hence h_e: "holding (e#s) th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4009 |
have "cs' \<noteq> cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4010 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4011 |
assume "cs' = cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4012 |
from held_unique[OF h_e[unfolded this] holding_es_th_cs] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4013 |
have "th' = th" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4014 |
with assms show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4015 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4016 |
from h_e[unfolded s_holding_def, folded wq_def, unfolded wq_neq_simp[OF this]] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4017 |
have "th' \<in> set (wq s cs') \<and> th' = hd (wq s cs')" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4018 |
hence "cs' \<in> ?R" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4019 |
by (unfold holdents_def s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4020 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4021 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4022 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4023 |
hence "holding s th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4024 |
from holding_kept[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4025 |
have "holding (e # s) th' cs'" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4026 |
hence "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4027 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4028 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4029 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4030 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4031 |
lemma cntCS_es_th'[simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4032 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4033 |
shows "cntCS (e#s) th' = cntCS s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4034 |
by (unfold cntCS_def holdents_es_th'[OF assms], simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4035 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4036 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4037 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4038 |
context valid_trace_p |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4039 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4040 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4041 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4042 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4043 |
and "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4044 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4045 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4046 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4047 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4048 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4049 |
using assms(2)[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4050 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4051 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4052 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4053 |
with n_wait wait |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4054 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4055 |
by (unfold s_waiting_def, fold wq_def, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4056 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4057 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4058 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4059 |
proof(cases "wq s cs = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4060 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4061 |
then interpret vt: valid_trace_p_h |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4062 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4063 |
show ?thesis using n_wait wait waiting_kept by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4064 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4065 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4066 |
then interpret vt: valid_trace_p_w by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4067 |
show ?thesis using n_wait wait waiting_kept by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4068 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4069 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4070 |
} with assms(2) show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4071 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4072 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4073 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4074 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4075 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4076 |
and "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4077 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4078 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4079 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4080 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4081 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4082 |
using assms(2)[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4083 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4084 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4085 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4086 |
with n_wait wait |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4087 |
show ?thesis |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4088 |
by (unfold s_waiting_def, fold wq_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4089 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4090 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4091 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4092 |
proof(cases "wq s cs = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4093 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4094 |
then interpret vt: valid_trace_p_h |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4095 |
by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4096 |
show ?thesis using n_wait vt.waiting_esE wait by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4097 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4098 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4099 |
then interpret vt: valid_trace_p_w by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4100 |
show ?thesis using assms(1) n_wait vt.waiting_esE wait by auto |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4101 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4102 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4103 |
} with assms(2) show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4104 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4105 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4106 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4107 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4108 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4109 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4110 |
using readys_kept1[OF assms] readys_kept2[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4111 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4112 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4113 |
lemma cnp_cnv_cncs_kept: (* ddd *) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4114 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4115 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4116 |
proof(cases "th' = th") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4117 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4118 |
note eq_th' = this |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4119 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4120 |
proof(cases "wq s cs = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4121 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4122 |
then interpret vt: valid_trace_p_h by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4123 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4124 |
using assms eq_th' is_p ready_th_s vt.cntCS_es_th vt.ready_th_es pvD_def by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4125 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4126 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4127 |
then interpret vt: valid_trace_p_w by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4128 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4129 |
using add.commute add.left_commute assms eq_th' is_p live_th_s |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4130 |
ready_th_s vt.th_not_ready_es pvD_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4131 |
apply (auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4132 |
by (fold is_p, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4133 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4134 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4135 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4136 |
note h_False = False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4137 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4138 |
proof(cases "wq s cs = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4139 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4140 |
then interpret vt: valid_trace_p_h by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4141 |
show ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4142 |
by (insert True h_False pvD_def, auto split:if_splits,unfold is_p, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4143 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4144 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4145 |
then interpret vt: valid_trace_p_w by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4146 |
show ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4147 |
by (insert False h_False pvD_def, auto split:if_splits,unfold is_p, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4148 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4149 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4150 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4151 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4152 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4153 |
|
100 | 4154 |
context valid_trace_v |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4155 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4156 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4157 |
lemma holding_th_cs_s: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4158 |
"holding s th cs" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4159 |
by (unfold s_holding_def, unfold wq_s_cs, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4160 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4161 |
lemma th_ready_s [simp]: "th \<in> readys s" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4162 |
using running_th_s |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4163 |
by (unfold running_def readys_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4164 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4165 |
lemma th_live_s [simp]: "th \<in> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4166 |
using th_ready_s by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4167 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4168 |
lemma th_ready_es [simp]: "th \<in> readys (e#s)" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4169 |
using running_th_s neq_t_th |
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4170 |
by (unfold is_v running_def readys_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4171 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4172 |
lemma th_live_es [simp]: "th \<in> threads (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4173 |
using th_ready_es by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4174 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4175 |
lemma pvD_th_s[simp]: "pvD s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4176 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4177 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4178 |
lemma pvD_th_es[simp]: "pvD (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4179 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4180 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4181 |
lemma cntCS_s_th [simp]: "cntCS s th > 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4182 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4183 |
have "cs \<in> holdents s th" using holding_th_cs_s |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4184 |
by (unfold holdents_def, simp) |
101 | 4185 |
moreover have "finite (holdents s th)" using finite_holdents |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4186 |
by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4187 |
ultimately show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4188 |
by (unfold cntCS_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4189 |
auto intro!:card_gt_0_iff[symmetric, THEN iffD1]) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4190 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4191 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4192 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4193 |
|
101 | 4194 |
context valid_trace_v |
4195 |
begin |
|
4196 |
||
4197 |
lemma th_not_waiting: |
|
4198 |
"\<not> waiting s th c" |
|
4199 |
proof - |
|
4200 |
have "th \<in> readys s" |
|
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4201 |
using running_ready running_th_s by blast |
101 | 4202 |
thus ?thesis |
4203 |
by (unfold readys_def, auto) |
|
4204 |
qed |
|
4205 |
||
4206 |
lemma waiting_neq_th: |
|
4207 |
assumes "waiting s t c" |
|
4208 |
shows "t \<noteq> th" |
|
4209 |
using assms using th_not_waiting by blast |
|
4210 |
||
4211 |
end |
|
4212 |
||
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4213 |
context valid_trace_v_n |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4214 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4215 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4216 |
lemma not_ready_taker_s[simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4217 |
"taker \<notin> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4218 |
using waiting_taker |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4219 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4220 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4221 |
lemma taker_live_s [simp]: "taker \<in> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4222 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4223 |
have "taker \<in> set wq'" by (simp add: eq_wq') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4224 |
from th'_in_inv[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4225 |
have "taker \<in> set rest" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4226 |
hence "taker \<in> set (wq s cs)" by (simp add: wq_s_cs) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4227 |
thus ?thesis using wq_threads by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4228 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4229 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4230 |
lemma taker_live_es [simp]: "taker \<in> threads (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4231 |
using taker_live_s threads_es by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4232 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4233 |
lemma taker_ready_es [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4234 |
shows "taker \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4235 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4236 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4237 |
assume "waiting (e#s) taker cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4238 |
hence False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4239 |
proof(cases rule:waiting_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4240 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4241 |
thus ?thesis using waiting_taker waiting_unique by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4242 |
qed simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4243 |
} thus ?thesis by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4244 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4245 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4246 |
lemma neq_taker_th: "taker \<noteq> th" |
101 | 4247 |
using th_not_waiting waiting_taker by blast |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4248 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4249 |
lemma not_holding_taker_s_cs: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4250 |
shows "\<not> holding s taker cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4251 |
using holding_cs_eq_th neq_taker_th by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4252 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4253 |
lemma holdents_es_taker: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4254 |
"holdents (e#s) taker = holdents s taker \<union> {cs}" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4255 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4256 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4257 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4258 |
hence "holding (e#s) taker cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4259 |
hence "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4260 |
proof(cases rule:holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4261 |
case 2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4262 |
thus ?thesis by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4263 |
qed auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4264 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4265 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4266 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4267 |
hence "holding s taker cs' \<or> cs' = cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4268 |
hence "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4269 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4270 |
assume "holding s taker cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4271 |
hence "holding (e#s) taker cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4272 |
using holding_esI2 holding_taker by fastforce |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4273 |
thus ?thesis by (auto simp:holdents_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4274 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4275 |
assume "cs' = cs" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4276 |
with holding_taker |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4277 |
show ?thesis by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4278 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4279 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4280 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4281 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4282 |
lemma cntCS_es_taker [simp]: "cntCS (e#s) taker = cntCS s taker + 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4283 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4284 |
have "card (holdents s taker \<union> {cs}) = card (holdents s taker) + 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4285 |
proof(subst card_Un_disjoint) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4286 |
show "holdents s taker \<inter> {cs} = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4287 |
using not_holding_taker_s_cs by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4288 |
qed (auto simp:finite_holdents) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4289 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4290 |
by (unfold cntCS_def, insert holdents_es_taker, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4291 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4292 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4293 |
lemma pvD_taker_s[simp]: "pvD s taker = 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4294 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4295 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4296 |
lemma pvD_taker_es[simp]: "pvD (e#s) taker = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4297 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4298 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4299 |
lemma pvD_th_s[simp]: "pvD s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4300 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4301 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4302 |
lemma pvD_th_es[simp]: "pvD (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4303 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4304 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4305 |
lemma holdents_es_th: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4306 |
"holdents (e#s) th = holdents s th - {cs}" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4307 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4308 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4309 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4310 |
hence "holding (e#s) th cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4311 |
hence "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4312 |
proof(cases rule:holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4313 |
case 2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4314 |
thus ?thesis by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4315 |
qed (insert neq_taker_th, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4316 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4317 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4318 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4319 |
hence "cs' \<noteq> cs" "holding s th cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4320 |
from holding_esI2[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4321 |
have "cs' \<in> ?L" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4322 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4323 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4324 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4325 |
lemma cntCS_es_th [simp]: "cntCS (e#s) th = cntCS s th - 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4326 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4327 |
have "card (holdents s th - {cs}) = card (holdents s th) - 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4328 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4329 |
have "cs \<in> holdents s th" using holding_th_cs_s |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4330 |
by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4331 |
moreover have "finite (holdents s th)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4332 |
by (simp add: finite_holdents) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4333 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4334 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4335 |
thus ?thesis by (unfold cntCS_def holdents_es_th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4336 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4337 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4338 |
lemma holdents_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4339 |
assumes "th' \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4340 |
and "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4341 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4342 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4343 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4344 |
assume h: "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4345 |
have "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4346 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4347 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4348 |
hence eq_wq: "wq (e#s) cs' = wq s cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4349 |
from h have "holding (e#s) th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4350 |
from this[unfolded s_holding_def, folded wq_def, unfolded eq_wq] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4351 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4352 |
by (unfold holdents_def s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4353 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4354 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4355 |
from h[unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4356 |
have "holding (e#s) th' cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4357 |
from held_unique[OF this holding_taker] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4358 |
have "th' = taker" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4359 |
with assms show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4360 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4361 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4362 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4363 |
assume h: "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4364 |
have "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4365 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4366 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4367 |
hence eq_wq: "wq (e#s) cs' = wq s cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4368 |
from h have "holding s th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4369 |
from this[unfolded s_holding_def, folded wq_def, unfolded eq_wq] |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4370 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4371 |
by (unfold holdents_def s_holding_def, insert eq_wq, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4372 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4373 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4374 |
from h[unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4375 |
have "holding s th' cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4376 |
from held_unique[OF this holding_th_cs_s] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4377 |
have "th' = th" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4378 |
with assms show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4379 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4380 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4381 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4382 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4383 |
lemma cntCS_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4384 |
assumes "th' \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4385 |
and "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4386 |
shows "cntCS (e#s) th' = cntCS s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4387 |
by (unfold cntCS_def holdents_kept[OF assms], simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4388 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4389 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4390 |
assumes "th' \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4391 |
and "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4392 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4393 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4394 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4395 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4396 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4397 |
using assms(2)[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4398 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4399 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4400 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4401 |
with n_wait wait |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4402 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4403 |
by (unfold s_waiting_def, fold wq_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4404 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4405 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4406 |
have "th' \<in> set (th # rest) \<and> th' \<noteq> hd (th # rest)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4407 |
using wait[unfolded True s_waiting_def, folded wq_def, unfolded wq_s_cs] . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4408 |
moreover have "\<not> (th' \<in> set rest \<and> th' \<noteq> hd (taker # rest'))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4409 |
using n_wait[unfolded True s_waiting_def, folded wq_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4410 |
unfolded wq_es_cs set_wq', unfolded eq_wq'] . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4411 |
ultimately have "th' = taker" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4412 |
with assms(1) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4413 |
show ?thesis by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4414 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4415 |
} with assms(2) show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4416 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4417 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4418 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4419 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4420 |
assumes "th' \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4421 |
and "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4422 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4423 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4424 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4425 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4426 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4427 |
using assms(2)[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4428 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4429 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4430 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4431 |
with n_wait wait |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4432 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4433 |
by (unfold s_waiting_def, fold wq_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4434 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4435 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4436 |
have "th' \<in> set rest \<and> th' \<noteq> hd (taker # rest')" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4437 |
using wait [unfolded True s_waiting_def, folded wq_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4438 |
unfolded wq_es_cs set_wq', unfolded eq_wq'] . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4439 |
moreover have "\<not> (th' \<in> set (th # rest) \<and> th' \<noteq> hd (th # rest))" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4440 |
using n_wait[unfolded True s_waiting_def, folded wq_def, unfolded wq_s_cs] . |
111 | 4441 |
ultimately have "th' = taker" using th_not_in_rest by simp |
4442 |
thm taker_def wq'_def |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4443 |
with assms(1) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4444 |
show ?thesis by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4445 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4446 |
} with assms(2) show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4447 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4448 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4449 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4450 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4451 |
assumes "th' \<noteq> taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4452 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4453 |
using readys_kept1[OF assms] readys_kept2[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4454 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4455 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4456 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4457 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4458 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4459 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4460 |
{ assume eq_th': "th' = taker" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4461 |
have ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4462 |
apply (unfold eq_th' pvD_taker_es cntCS_es_taker) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4463 |
by (insert neq_taker_th assms[unfolded eq_th'], unfold is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4464 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4465 |
assume eq_th': "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4466 |
have ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4467 |
apply (unfold eq_th' pvD_th_es cntCS_es_th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4468 |
by (insert assms[unfolded eq_th'], unfold is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4469 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4470 |
assume h: "th' \<noteq> taker" "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4471 |
have ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4472 |
apply (unfold cntCS_kept[OF h], insert h, unfold is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4473 |
by (fold is_v, unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4474 |
} ultimately show ?thesis by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4475 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4476 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4477 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4478 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4479 |
context valid_trace_v_e |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4480 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4481 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4482 |
lemma holdents_es_th: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4483 |
"holdents (e#s) th = holdents s th - {cs}" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4484 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4485 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4486 |
assume "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4487 |
hence "holding (e#s) th cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4488 |
hence "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4489 |
proof(cases rule:holding_esE) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4490 |
case 1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4491 |
thus ?thesis by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4492 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4493 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4494 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4495 |
assume "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4496 |
hence "cs' \<noteq> cs" "holding s th cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4497 |
from holding_esI2[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4498 |
have "cs' \<in> ?L" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4499 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4500 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4501 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4502 |
lemma cntCS_es_th [simp]: "cntCS (e#s) th = cntCS s th - 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4503 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4504 |
have "card (holdents s th - {cs}) = card (holdents s th) - 1" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4505 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4506 |
have "cs \<in> holdents s th" using holding_th_cs_s |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4507 |
by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4508 |
moreover have "finite (holdents s th)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4509 |
by (simp add: finite_holdents) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4510 |
ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4511 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4512 |
thus ?thesis by (unfold cntCS_def holdents_es_th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4513 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4514 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4515 |
lemma holdents_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4516 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4517 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4518 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4519 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4520 |
assume h: "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4521 |
have "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4522 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4523 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4524 |
hence eq_wq: "wq (e#s) cs' = wq s cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4525 |
from h have "holding (e#s) th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4526 |
from this[unfolded s_holding_def, folded wq_def, unfolded eq_wq] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4527 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4528 |
by (unfold holdents_def s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4529 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4530 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4531 |
from h[unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4532 |
have "holding (e#s) th' cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4533 |
from this[unfolded s_holding_def, folded wq_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4534 |
unfolded wq_es_cs nil_wq'] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4535 |
show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4536 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4537 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4538 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4539 |
assume h: "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4540 |
have "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4541 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4542 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4543 |
hence eq_wq: "wq (e#s) cs' = wq s cs'" by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4544 |
from h have "holding s th' cs'" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4545 |
from this[unfolded s_holding_def, folded wq_def, unfolded eq_wq] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4546 |
show ?thesis |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4547 |
by (unfold holdents_def s_holding_def, insert eq_wq, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4548 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4549 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4550 |
from h[unfolded this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4551 |
have "holding s th' cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4552 |
from held_unique[OF this holding_th_cs_s] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4553 |
have "th' = th" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4554 |
with assms show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4555 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4556 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4557 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4558 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4559 |
lemma cntCS_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4560 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4561 |
shows "cntCS (e#s) th' = cntCS s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4562 |
by (unfold cntCS_def holdents_kept[OF assms], simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4563 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4564 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4565 |
assumes "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4566 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4567 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4568 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4569 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4570 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4571 |
using assms(1)[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4572 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4573 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4574 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4575 |
with n_wait wait |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4576 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4577 |
by (unfold s_waiting_def, fold wq_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4578 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4579 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4580 |
have "th' \<in> set (th # rest) \<and> th' \<noteq> hd (th # rest)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4581 |
using wait[unfolded True s_waiting_def, folded wq_def, unfolded wq_s_cs] . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4582 |
hence "th' \<in> set rest" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4583 |
with set_wq' have "th' \<in> set wq'" by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4584 |
with nil_wq' show ?thesis by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4585 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4586 |
} thus ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4587 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4588 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4589 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4590 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4591 |
assumes "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4592 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4593 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4594 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4595 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4596 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4597 |
using assms[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4598 |
have False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4599 |
proof(cases "cs' = cs") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4600 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4601 |
with n_wait wait |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4602 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4603 |
by (unfold s_waiting_def, fold wq_def, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4604 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4605 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4606 |
have "th' \<in> set [] \<and> th' \<noteq> hd []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4607 |
using wait[unfolded True s_waiting_def, folded wq_def, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4608 |
unfolded wq_es_cs nil_wq'] . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4609 |
thus ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4610 |
qed |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4611 |
} with assms show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4612 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4613 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4614 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4615 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4616 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4617 |
using readys_kept1[OF assms] readys_kept2[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4618 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4619 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4620 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4621 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4622 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4623 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4624 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4625 |
assume eq_th': "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4626 |
have ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4627 |
apply (unfold eq_th' pvD_th_es cntCS_es_th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4628 |
by (insert assms[unfolded eq_th'], unfold is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4629 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4630 |
assume h: "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4631 |
have ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4632 |
apply (unfold cntCS_kept[OF h], insert h, unfold is_v, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4633 |
by (fold is_v, unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4634 |
} ultimately show ?thesis by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4635 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4636 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4637 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4638 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4639 |
context valid_trace_v |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4640 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4641 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4642 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4643 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4644 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4645 |
proof(cases "rest = []") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4646 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4647 |
then interpret vt: valid_trace_v_e by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4648 |
show ?thesis using assms using vt.cnp_cnv_cncs_kept by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4649 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4650 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4651 |
then interpret vt: valid_trace_v_n by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4652 |
show ?thesis using assms using vt.cnp_cnv_cncs_kept by blast |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4653 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4654 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4655 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4656 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4657 |
context valid_trace_create |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4658 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4659 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4660 |
lemma th_not_live_s [simp]: "th \<notin> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4661 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4662 |
from pip_e[unfolded is_create] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4663 |
show ?thesis by (cases, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4664 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4665 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4666 |
lemma th_not_ready_s [simp]: "th \<notin> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4667 |
using th_not_live_s by (unfold readys_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4668 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4669 |
lemma th_live_es [simp]: "th \<in> threads (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4670 |
by (unfold is_create, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4671 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4672 |
lemma not_waiting_th_s [simp]: "\<not> waiting s th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4673 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4674 |
assume "waiting s th cs'" |
99 | 4675 |
from this[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4676 |
have "th \<in> set (wq s cs')" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4677 |
from wq_threads[OF this] have "th \<in> threads s" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4678 |
with th_not_live_s show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4679 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4680 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4681 |
lemma not_holding_th_s [simp]: "\<not> holding s th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4682 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4683 |
assume "holding s th cs'" |
99 | 4684 |
from this[unfolded s_holding_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4685 |
have "th \<in> set (wq s cs')" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4686 |
from wq_threads[OF this] have "th \<in> threads s" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4687 |
with th_not_live_s show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4688 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4689 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4690 |
lemma not_waiting_th_es [simp]: "\<not> waiting (e#s) th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4691 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4692 |
assume "waiting (e # s) th cs'" |
99 | 4693 |
from this[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4694 |
have "th \<in> set (wq s cs')" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4695 |
from wq_threads[OF this] have "th \<in> threads s" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4696 |
with th_not_live_s show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4697 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4698 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4699 |
lemma not_holding_th_es [simp]: "\<not> holding (e#s) th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4700 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4701 |
assume "holding (e # s) th cs'" |
99 | 4702 |
from this[unfolded s_holding_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4703 |
have "th \<in> set (wq s cs')" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4704 |
from wq_threads[OF this] have "th \<in> threads s" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4705 |
with th_not_live_s show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4706 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4707 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4708 |
lemma ready_th_es [simp]: "th \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4709 |
by (simp add:readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4710 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4711 |
lemma holdents_th_s: "holdents s th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4712 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4713 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4714 |
lemma holdents_th_es: "holdents (e#s) th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4715 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4716 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4717 |
lemma cntCS_th_s [simp]: "cntCS s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4718 |
by (unfold cntCS_def, simp add:holdents_th_s) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4719 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4720 |
lemma cntCS_th_es [simp]: "cntCS (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4721 |
by (unfold cntCS_def, simp add:holdents_th_es) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4722 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4723 |
lemma pvD_th_s [simp]: "pvD s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4724 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4725 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4726 |
lemma pvD_th_es [simp]: "pvD (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4727 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4728 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4729 |
lemma holdents_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4730 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4731 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4732 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4733 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4734 |
assume h: "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4735 |
hence "cs' \<in> ?R" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4736 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4737 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4738 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4739 |
assume h: "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4740 |
hence "cs' \<in> ?L" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4741 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4742 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4743 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4744 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4745 |
lemma cntCS_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4746 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4747 |
shows "cntCS (e#s) th' = cntCS s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4748 |
using holdents_kept[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4749 |
by (unfold cntCS_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4750 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4751 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4752 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4753 |
and "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4754 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4755 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4756 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4757 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4758 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4759 |
using assms by (auto simp:readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4760 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 4761 |
n_wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4762 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4763 |
} thus ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4764 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4765 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4766 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4767 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4768 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4769 |
and "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4770 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4771 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4772 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4773 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4774 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4775 |
using assms(2) by (auto simp:readys_def) |
99 | 4776 |
from wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4777 |
n_wait[unfolded s_waiting_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4778 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4779 |
} with assms show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4780 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4781 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4782 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4783 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4784 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4785 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4786 |
using readys_kept1[OF assms] readys_kept2[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4787 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4788 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4789 |
lemma pvD_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4790 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4791 |
shows "pvD (e#s) th' = pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4792 |
using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4793 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4794 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4795 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4796 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4797 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4798 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4799 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4800 |
assume eq_th': "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4801 |
have ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4802 |
by (unfold eq_th', simp, unfold is_create, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4803 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4804 |
assume h: "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4805 |
hence ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4806 |
by (simp, simp add:is_create) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4807 |
} ultimately show ?thesis by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4808 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4809 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4810 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4811 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4812 |
context valid_trace_exit |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4813 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4814 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4815 |
lemma th_live_s [simp]: "th \<in> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4816 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4817 |
from pip_e[unfolded is_exit] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4818 |
show ?thesis |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4819 |
by (cases, unfold running_def readys_def, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4820 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4821 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4822 |
lemma th_ready_s [simp]: "th \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4823 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4824 |
from pip_e[unfolded is_exit] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4825 |
show ?thesis |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4826 |
by (cases, unfold running_def, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4827 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4828 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4829 |
lemma th_not_live_es [simp]: "th \<notin> threads (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4830 |
by (unfold is_exit, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4831 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4832 |
lemma not_holding_th_s [simp]: "\<not> holding s th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4833 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4834 |
from pip_e[unfolded is_exit] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4835 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4836 |
by (cases, unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4837 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4838 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4839 |
lemma cntCS_th_s [simp]: "cntCS s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4840 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4841 |
from pip_e[unfolded is_exit] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4842 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4843 |
by (cases, unfold cntCS_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4844 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4845 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4846 |
lemma not_holding_th_es [simp]: "\<not> holding (e#s) th cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4847 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4848 |
assume "holding (e # s) th cs'" |
99 | 4849 |
from this[unfolded s_holding_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4850 |
have "holding s th cs'" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4851 |
by (unfold s_holding_def, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4852 |
with not_holding_th_s |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4853 |
show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4854 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4855 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4856 |
lemma ready_th_es [simp]: "th \<notin> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4857 |
by (simp add:readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4858 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4859 |
lemma holdents_th_s: "holdents s th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4860 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4861 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4862 |
lemma holdents_th_es: "holdents (e#s) th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4863 |
by (unfold holdents_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4864 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4865 |
lemma cntCS_th_es [simp]: "cntCS (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4866 |
by (unfold cntCS_def, simp add:holdents_th_es) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4867 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4868 |
lemma pvD_th_s [simp]: "pvD s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4869 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4870 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4871 |
lemma pvD_th_es [simp]: "pvD (e#s) th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4872 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4873 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4874 |
lemma holdents_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4875 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4876 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4877 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4878 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4879 |
assume h: "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4880 |
hence "cs' \<in> ?R" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4881 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4882 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4883 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4884 |
assume h: "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4885 |
hence "cs' \<in> ?L" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4886 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4887 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4888 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4889 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4890 |
lemma cntCS_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4891 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4892 |
shows "cntCS (e#s) th' = cntCS s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4893 |
using holdents_kept[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4894 |
by (unfold cntCS_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4895 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4896 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4897 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4898 |
and "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4899 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4900 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4901 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4902 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4903 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4904 |
using assms by (auto simp:readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4905 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 4906 |
n_wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4907 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4908 |
} thus ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4909 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4910 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4911 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4912 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4913 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4914 |
and "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4915 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4916 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4917 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4918 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4919 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4920 |
using assms(2) by (auto simp:readys_def) |
99 | 4921 |
from wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4922 |
n_wait[unfolded s_waiting_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4923 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4924 |
} with assms show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4925 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4926 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4927 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4928 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4929 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4930 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4931 |
using readys_kept1[OF assms] readys_kept2[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4932 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4933 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4934 |
lemma pvD_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4935 |
assumes "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4936 |
shows "pvD (e#s) th' = pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4937 |
using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4938 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4939 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4940 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4941 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4942 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4943 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4944 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4945 |
assume eq_th': "th' = th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4946 |
have ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4947 |
by (unfold eq_th', simp, unfold is_exit, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4948 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4949 |
assume h: "th' \<noteq> th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4950 |
hence ?thesis using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4951 |
by (simp, simp add:is_exit) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4952 |
} ultimately show ?thesis by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4953 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4954 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4955 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4956 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4957 |
context valid_trace_set |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4958 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4959 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4960 |
lemma th_live_s [simp]: "th \<in> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4961 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4962 |
from pip_e[unfolded is_set] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4963 |
show ?thesis |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4964 |
by (cases, unfold running_def readys_def, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4965 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4966 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4967 |
lemma th_ready_s [simp]: "th \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4968 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4969 |
from pip_e[unfolded is_set] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4970 |
show ?thesis |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
4971 |
by (cases, unfold running_def, simp) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4972 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4973 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4974 |
lemma th_not_live_es [simp]: "th \<in> threads (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4975 |
by (unfold is_set, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4976 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4977 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4978 |
lemma holdents_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4979 |
shows "holdents (e#s) th' = holdents s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4980 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4981 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4982 |
assume h: "cs' \<in> ?L" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4983 |
hence "cs' \<in> ?R" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4984 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4985 |
} moreover { |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4986 |
fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4987 |
assume h: "cs' \<in> ?R" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4988 |
hence "cs' \<in> ?L" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
4989 |
by (unfold holdents_def s_holding_def, unfold wq_kept, auto) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4990 |
} ultimately show ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4991 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4992 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4993 |
lemma cntCS_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4994 |
shows "cntCS (e#s) th' = cntCS s th'" (is "?L = ?R") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4995 |
using holdents_kept |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4996 |
by (unfold cntCS_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4997 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4998 |
lemma readys_kept1: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4999 |
assumes "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5000 |
shows "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5001 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5002 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5003 |
assume wait: "waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5004 |
have n_wait: "\<not> waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5005 |
using assms by (auto simp:readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5006 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 5007 |
n_wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5008 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5009 |
} moreover have "th' \<in> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5010 |
using assms[unfolded readys_def] by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5011 |
ultimately show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5012 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5013 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5014 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5015 |
lemma readys_kept2: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5016 |
assumes "th' \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5017 |
shows "th' \<in> readys (e#s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5018 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5019 |
{ fix cs' |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5020 |
assume wait: "waiting (e#s) th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5021 |
have n_wait: "\<not> waiting s th' cs'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5022 |
using assms by (auto simp:readys_def) |
99 | 5023 |
from wait[unfolded s_waiting_def, folded wq_def, unfolded wq_kept] |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5024 |
n_wait[unfolded s_waiting_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5025 |
have False by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5026 |
} with assms show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5027 |
by (unfold readys_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5028 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5029 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5030 |
lemma readys_simp [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5031 |
shows "(th' \<in> readys (e#s)) = (th' \<in> readys s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5032 |
using readys_kept1 readys_kept2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5033 |
by metis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5034 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5035 |
lemma pvD_kept [simp]: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5036 |
shows "pvD (e#s) th' = pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5037 |
by (unfold pvD_def, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5038 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5039 |
lemma cnp_cnv_cncs_kept: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5040 |
assumes "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5041 |
shows "cntP (e#s) th' = cntV (e#s) th' + cntCS (e#s) th' + pvD (e#s) th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5042 |
using assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5043 |
by (unfold is_set, simp, fold is_set, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5044 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5045 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5046 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5047 |
context valid_trace |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5048 |
begin |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5049 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5050 |
lemma cnp_cnv_cncs: "cntP s th' = cntV s th' + cntCS s th' + pvD s th'" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5051 |
proof(induct rule:ind) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5052 |
case Nil |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5053 |
thus ?case |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
5054 |
unfolding cntP_def cntV_def pvD_def cntCS_def holdents_def s_holding_def |
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
5055 |
by(simp add: wq_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5056 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5057 |
case (Cons s e) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5058 |
interpret vt_e: valid_trace_e s e using Cons by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5059 |
show ?case |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5060 |
proof(cases e) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5061 |
case (Create th prio) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5062 |
interpret vt_create: valid_trace_create s e th prio |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5063 |
using Create by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5064 |
show ?thesis using Cons by (simp add: vt_create.cnp_cnv_cncs_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5065 |
next |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5066 |
case (Exit th) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5067 |
interpret vt_exit: valid_trace_exit s e th |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5068 |
using Exit by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5069 |
show ?thesis using Cons by (simp add: vt_exit.cnp_cnv_cncs_kept) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5070 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5071 |
case (P th cs) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5072 |
interpret vt_p: valid_trace_p s e th cs using P by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5073 |
show ?thesis using Cons by (simp add: vt_p.cnp_cnv_cncs_kept) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5074 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5075 |
case (V th cs) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5076 |
interpret vt_v: valid_trace_v s e th cs using V by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5077 |
show ?thesis using Cons by (simp add: vt_v.cnp_cnv_cncs_kept) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5078 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5079 |
case (Set th prio) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5080 |
interpret vt_set: valid_trace_set s e th prio |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5081 |
using Set by (unfold_locales, simp) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5082 |
show ?thesis using Cons by (simp add: vt_set.cnp_cnv_cncs_kept) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5083 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5084 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5085 |
|
101 | 5086 |
end |
5087 |
||
5088 |
section {* Corollaries of @{thm valid_trace.cnp_cnv_cncs} *} |
|
5089 |
||
5090 |
context valid_trace |
|
5091 |
begin |
|
5092 |
||
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5093 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5094 |
The following two lemmas are purely technical, which says |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5095 |
a non-living thread can not hold any resource. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5096 |
*} |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5097 |
lemma not_thread_holdents: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5098 |
assumes not_in: "th \<notin> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5099 |
shows "holdents s th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5100 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5101 |
{ fix cs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5102 |
assume "cs \<in> holdents s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5103 |
hence "holding s th cs" by (auto simp:holdents_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5104 |
from this[unfolded s_holding_def, folded wq_def] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5105 |
have "th \<in> set (wq s cs)" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5106 |
with wq_threads have "th \<in> threads s" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5107 |
with assms |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5108 |
have False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5109 |
} thus ?thesis by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5110 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5111 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5112 |
lemma not_thread_cncs: |
63 | 5113 |
assumes not_in: "th \<notin> threads s" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5114 |
shows "cntCS s th = 0" |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5115 |
using not_thread_holdents[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5116 |
by (simp add:cntCS_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5117 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5118 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5119 |
Starting from the following @{text cnp_cnv_eq}, all |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5120 |
lemmas in this section concern the meaning of |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5121 |
condition @{prop "cntP s th = cntV s th"}, i.e. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5122 |
when the numbers of resource requesting and resource releasing |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5123 |
are equal. |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5124 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5125 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5126 |
lemma cnp_cnv_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5127 |
assumes "th \<notin> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5128 |
shows "cntP s th = cntV s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5129 |
using assms cnp_cnv_cncs not_thread_cncs pvD_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5130 |
by (auto) |
63 | 5131 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5132 |
lemma eq_pv_children: |
63 | 5133 |
assumes eq_pv: "cntP s th = cntV s th" |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5134 |
shows "children (RAG s) (Th th) = {}" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5135 |
proof - |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5136 |
from cnp_cnv_cncs and eq_pv |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5137 |
have "cntCS s th = 0" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5138 |
by (auto split:if_splits) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5139 |
from this[unfolded cntCS_def holdents_alt_def] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5140 |
have card_0: "card (the_cs ` children (RAG s) (Th th)) = 0" . |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5141 |
have "finite (the_cs ` children (RAG s) (Th th))" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5142 |
by (simp add: fsbtRAGs.finite_children) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5143 |
from card_0[unfolded card_0_eq[OF this]] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5144 |
show ?thesis by auto |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5145 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5146 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5147 |
lemma eq_pv_holdents: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5148 |
assumes eq_pv: "cntP s th = cntV s th" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5149 |
shows "holdents s th = {}" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5150 |
by (unfold holdents_alt_def eq_pv_children[OF assms], simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5151 |
|
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5152 |
lemma eq_pv_subtree: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5153 |
assumes eq_pv: "cntP s th = cntV s th" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5154 |
shows "subtree (RAG s) (Th th) = {Th th}" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5155 |
using eq_pv_children[OF assms] |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5156 |
by (unfold subtree_children, simp) |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5157 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5158 |
lemma count_eq_RAG_plus: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5159 |
assumes "cntP s th = cntV s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5160 |
shows "{th'. (Th th', Th th) \<in> (RAG s)^+} = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5161 |
proof(rule ccontr) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5162 |
assume otherwise: "{th'. (Th th', Th th) \<in> (RAG s)\<^sup>+} \<noteq> {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5163 |
then obtain th' where "(Th th', Th th) \<in> (RAG s)^+" by auto |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5164 |
from tranclD2[OF this] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5165 |
obtain z where "z \<in> children (RAG s) (Th th)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5166 |
by (auto simp:children_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5167 |
with eq_pv_children[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5168 |
show False by simp |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5169 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5170 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5171 |
lemma count_eq_RAG_plus_Th: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5172 |
assumes "cntP s th = cntV s th" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5173 |
shows "{Th th' | th'. (Th th', Th th) \<in> (RAG s)^+} = {}" |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5174 |
using count_eq_RAG_plus[OF assms] by auto |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5175 |
|
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5176 |
lemma eq_pv_dependants: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5177 |
assumes eq_pv: "cntP s th = cntV s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5178 |
shows "dependants s th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5179 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5180 |
from count_eq_RAG_plus[OF assms, folded dependants_alt_def1] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5181 |
show ?thesis . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5182 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5183 |
|
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5184 |
lemma count_eq_tRAG_plus: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5185 |
assumes "cntP s th = cntV s th" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5186 |
shows "{th'. (Th th', Th th) \<in> (tRAG s)^+} = {}" |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
5187 |
using assms count_eq_RAG_plus dependants_alt_def s_dependants_def by blast |
106
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5188 |
|
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5189 |
lemma count_eq_tRAG_plus_Th: |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5190 |
assumes "cntP s th = cntV s th" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5191 |
shows "{Th th' | th'. (Th th', Th th) \<in> (tRAG s)^+} = {}" |
5454387e42ce
updated files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
104
diff
changeset
|
5192 |
using count_eq_tRAG_plus[OF assms] by auto |
63 | 5193 |
|
5194 |
end |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5195 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5196 |
subsection {* A notion @{text detached} and its relation with @{term cntP} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5197 |
and @{term cntV} *} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5198 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5199 |
definition detached :: "state \<Rightarrow> thread \<Rightarrow> bool" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5200 |
where "detached s th \<equiv> (\<not>(\<exists> cs. holding s th cs)) \<and> (\<not>(\<exists>cs. waiting s th cs))" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5201 |
|
115
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5202 |
text {* |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5203 |
The following lemma shows that a thread is detached means |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5204 |
it is isolated from @{term RAG}: |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5205 |
*} |
74fc1eae4605
Commenting of PIPBasics.thy almost completed. The last section needs to be distributed to Correctness.thy and Implementation.thy
zhangx
parents:
114
diff
changeset
|
5206 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5207 |
lemma detached_test: |
35
92f61f6a0fe7
added a bit more text to the paper and separated a theory about Max
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
32
diff
changeset
|
5208 |
shows "detached s th = (Th th \<notin> Field (RAG s))" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5209 |
apply(simp add: detached_def Field_def) |
35
92f61f6a0fe7
added a bit more text to the paper and separated a theory about Max
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
32
diff
changeset
|
5210 |
apply(simp add: s_RAG_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5211 |
apply(simp add: s_holding_abv s_waiting_abv) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5212 |
apply(simp add: Domain_iff Range_iff) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5213 |
apply(simp add: wq_def) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5214 |
apply(auto) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5215 |
done |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5216 |
|
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5217 |
lemma detached_cp_the_preced: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5218 |
assumes "detached s th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5219 |
shows "cp s th = the_preced s th" (is "?L = ?R") |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5220 |
proof - |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5221 |
have "?L = Max (the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)})" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5222 |
by (unfold cp_alt_def, simp) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5223 |
moreover have "{th'. Th th' \<in> subtree (RAG s) (Th th)} = {th}" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5224 |
proof - |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5225 |
{ fix n |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5226 |
assume "n \<in> subtree (RAG s) (Th th)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5227 |
hence "n = Th th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5228 |
proof(cases rule:subtreeE) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5229 |
case 2 |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5230 |
from 2(2) have "Th th \<in> Range (RAG s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5231 |
by (elim ancestors_Field, simp) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5232 |
moreover from assms[unfolded detached_test] have "Th th \<notin> Field (RAG s)" . |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5233 |
ultimately have False by (auto simp:Field_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5234 |
thus ?thesis by simp |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5235 |
qed simp |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5236 |
} thus ?thesis by auto |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5237 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5238 |
ultimately show ?thesis by auto |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5239 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5240 |
|
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5241 |
lemma detached_cp_preced: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5242 |
assumes "detached s th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5243 |
shows "cp s th = preced th s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5244 |
using detached_cp_the_preced[OF assms] |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5245 |
by (simp add:the_preced_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5246 |
|
63 | 5247 |
context valid_trace |
5248 |
begin |
|
5249 |
||
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5250 |
lemma detached_intro: |
63 | 5251 |
assumes eq_pv: "cntP s th = cntV s th" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5252 |
shows "detached s th" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5253 |
proof - |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5254 |
from eq_pv cnp_cnv_cncs |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5255 |
have "th \<in> readys s \<or> th \<notin> threads s" by (auto simp:pvD_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5256 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5257 |
proof |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5258 |
assume "th \<notin> threads s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5259 |
with rg_RAG_threads dm_RAG_threads |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5260 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5261 |
by (auto simp add: detached_def s_RAG_def s_waiting_abv |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5262 |
s_holding_abv wq_def Domain_iff Range_iff) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5263 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5264 |
assume "th \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5265 |
moreover have "Th th \<notin> Range (RAG s)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5266 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5267 |
from eq_pv_children[OF assms] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5268 |
have "children (RAG s) (Th th) = {}" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5269 |
thus ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5270 |
by (unfold children_def, auto) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5271 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5272 |
ultimately show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5273 |
by (auto simp add: detached_def s_RAG_def s_waiting_abv |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5274 |
s_holding_abv wq_def readys_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5275 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5276 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5277 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5278 |
lemma detached_elim: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5279 |
assumes dtc: "detached s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5280 |
shows "cntP s th = cntV s th" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5281 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5282 |
have cncs_z: "cntCS s th = 0" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5283 |
proof - |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5284 |
from dtc have "holdents s th = {}" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5285 |
unfolding detached_def holdents_test s_RAG_def |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5286 |
by (simp add: s_waiting_abv wq_def s_holding_abv Domain_iff Range_iff) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5287 |
thus ?thesis by (auto simp:cntCS_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5288 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5289 |
show ?thesis |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5290 |
proof(cases "th \<in> threads s") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5291 |
case True |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5292 |
with dtc |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5293 |
have "th \<in> readys s" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5294 |
by (unfold readys_def detached_def Field_def Domain_def Range_def, |
130
0f124691c191
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
129
diff
changeset
|
5295 |
auto simp:s_waiting_abv s_RAG_def) |
92
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5296 |
with cncs_z show ?thesis using cnp_cnv_cncs by (simp add:pvD_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5297 |
next |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5298 |
case False |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5299 |
with cncs_z and cnp_cnv_cncs show ?thesis by (simp add:pvD_def) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5300 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5301 |
qed |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5302 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5303 |
lemma detached_eq: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5304 |
shows "(detached s th) = (cntP s th = cntV s th)" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5305 |
by (insert vt, auto intro:detached_intro detached_elim) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5306 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5307 |
end |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
5308 |
|
116 | 5309 |
section {* Recursive calculation of @{term "cp"} *} |
5310 |
||
5311 |
text {* |
|
5312 |
According to the normal definitions, such as @{thm cp_def}, @{thm cp_alt_def} |
|
5313 |
and @{thm cp_alt_def1}, the @{term cp}-value of a thread depends |
|
5314 |
on the @{term preced}-values of all threads in its subtree. To calculate |
|
5315 |
a @{term cp}-value, one needs to traverse a whole subtree. |
|
5316 |
||
5317 |
However, in this section, we are going to show that @{term cp}-value |
|
5318 |
can be calculate locally (given by the lemma @{text "cp_rec"} in the following). |
|
5319 |
According to this lemma, the @{term cp}-value of a thread can be calculated only from |
|
5320 |
the @{term cp}-values of its children in @{term RAG}. |
|
5321 |
Therefore, if the @{term cp}-values of one thread's children are not |
|
5322 |
changed by an execution step, there is no need to recalculate. This |
|
5323 |
is particularly useful to in Implementation.thy to speed up the |
|
5324 |
recalculation of @{term cp}-values. |
|
5325 |
*} |
|
5326 |
||
5327 |
text {* |
|
5328 |
The following function @{text "cp_gen"} is a generalization |
|
5329 |
of @{term cp}. Unlike @{term cp} which returns a precedence |
|
5330 |
for a thread, @{text "cp_gen"} returns precedence for a node |
|
5331 |
in @{term RAG}. When the node represent a thread, @{text cp_gen} is |
|
5332 |
coincident with @{term cp} (to be shown in lemma @{text "cp_gen_def_cond"}), |
|
5333 |
and this is the only meaningful use of @{text cp_gen}. |
|
5334 |
||
5335 |
The introduction of @{text cp_gen} is purely technical to easy some |
|
5336 |
of the proofs leading to the finally lemma @{text cp_rec}. |
|
5337 |
*} |
|
5338 |
||
5339 |
definition "cp_gen s x = |
|
5340 |
Max ((the_preced s \<circ> the_thread) ` subtree (tRAG s) x)" |
|
5341 |
||
5342 |
lemma cp_gen_alt_def: |
|
5343 |
"cp_gen s = (Max \<circ> (\<lambda>x. (the_preced s \<circ> the_thread) ` subtree (tRAG s) x))" |
|
5344 |
by (auto simp:cp_gen_def) |
|
5345 |
||
5346 |
lemma cp_gen_def_cond: |
|
5347 |
assumes "x = Th th" |
|
5348 |
shows "cp s th = cp_gen s (Th th)" |
|
5349 |
by (unfold cp_alt_def1 cp_gen_def, simp) |
|
5350 |
||
5351 |
lemma cp_gen_over_set: |
|
5352 |
assumes "\<forall> x \<in> A. \<exists> th. x = Th th" |
|
5353 |
shows "cp_gen s ` A = (cp s \<circ> the_thread) ` A" |
|
5354 |
proof(rule f_image_eq) |
|
5355 |
fix a |
|
5356 |
assume "a \<in> A" |
|
5357 |
from assms[rule_format, OF this] |
|
5358 |
obtain th where eq_a: "a = Th th" by auto |
|
5359 |
show "cp_gen s a = (cp s \<circ> the_thread) a" |
|
5360 |
by (unfold eq_a, simp, unfold cp_gen_def_cond[OF refl[of "Th th"]], simp) |
|
5361 |
qed |
|
5362 |
||
80
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
5363 |
|
102
3a801bbd2687
Reorganizing PIPBasics.thy and making small changes to Implementation.thy and Correctness.thy.
zhangx
parents:
101
diff
changeset
|
5364 |
context valid_trace |
3a801bbd2687
Reorganizing PIPBasics.thy and making small changes to Implementation.thy and Correctness.thy.
zhangx
parents:
101
diff
changeset
|
5365 |
begin |
116 | 5366 |
(* ddd *) |
5367 |
lemma cp_gen_rec: |
|
5368 |
assumes "x = Th th" |
|
5369 |
shows "cp_gen s x = Max ({the_preced s th} \<union> (cp_gen s) ` children (tRAG s) x)" |
|
5370 |
proof(cases "children (tRAG s) x = {}") |
|
5371 |
case True |
|
5372 |
show ?thesis |
|
5373 |
by (unfold True cp_gen_def subtree_children, simp add:assms) |
|
5374 |
next |
|
5375 |
case False |
|
5376 |
hence [simp]: "children (tRAG s) x \<noteq> {}" by auto |
|
5377 |
note fsbttRAGs.finite_subtree[simp] |
|
5378 |
have [simp]: "finite (children (tRAG s) x)" |
|
5379 |
by (intro rev_finite_subset[OF fsbttRAGs.finite_subtree], |
|
5380 |
rule children_subtree) |
|
5381 |
{ fix r x |
|
5382 |
have "subtree r x \<noteq> {}" by (auto simp:subtree_def) |
|
5383 |
} note this[simp] |
|
5384 |
have [simp]: "\<exists>x\<in>children (tRAG s) x. subtree (tRAG s) x \<noteq> {}" |
|
5385 |
proof - |
|
5386 |
from False obtain q where "q \<in> children (tRAG s) x" by blast |
|
5387 |
moreover have "subtree (tRAG s) q \<noteq> {}" by simp |
|
5388 |
ultimately show ?thesis by blast |
|
5389 |
qed |
|
5390 |
have h: "Max ((the_preced s \<circ> the_thread) ` |
|
5391 |
({x} \<union> \<Union>(subtree (tRAG s) ` children (tRAG s) x))) = |
|
5392 |
Max ({the_preced s th} \<union> cp_gen s ` children (tRAG s) x)" |
|
5393 |
(is "?L = ?R") |
|
5394 |
proof - |
|
5395 |
let "Max (?f ` (?A \<union> \<Union> (?g ` ?B)))" = ?L |
|
5396 |
let "Max (_ \<union> (?h ` ?B))" = ?R |
|
5397 |
let ?L1 = "?f ` \<Union>(?g ` ?B)" |
|
5398 |
have eq_Max_L1: "Max ?L1 = Max (?h ` ?B)" |
|
5399 |
proof - |
|
5400 |
have "?L1 = ?f ` (\<Union> x \<in> ?B.(?g x))" by simp |
|
5401 |
also have "... = (\<Union> x \<in> ?B. ?f ` (?g x))" by auto |
|
5402 |
finally have "Max ?L1 = Max ..." by simp |
|
5403 |
also have "... = Max (Max ` (\<lambda>x. ?f ` subtree (tRAG s) x) ` ?B)" |
|
5404 |
by (subst Max_UNION, simp+) |
|
5405 |
also have "... = Max (cp_gen s ` children (tRAG s) x)" |
|
5406 |
by (unfold image_comp cp_gen_alt_def, simp) |
|
5407 |
finally show ?thesis . |
|
5408 |
qed |
|
5409 |
show ?thesis |
|
5410 |
proof - |
|
5411 |
have "?L = Max (?f ` ?A \<union> ?L1)" by simp |
|
5412 |
also have "... = max (the_preced s (the_thread x)) (Max ?L1)" |
|
5413 |
by (subst Max_Un, simp+) |
|
5414 |
also have "... = max (?f x) (Max (?h ` ?B))" |
|
5415 |
by (unfold eq_Max_L1, simp) |
|
5416 |
also have "... =?R" |
|
5417 |
by (rule max_Max_eq, (simp)+, unfold assms, simp) |
|
5418 |
finally show ?thesis . |
|
5419 |
qed |
|
5420 |
qed thus ?thesis |
|
5421 |
by (fold h subtree_children, unfold cp_gen_def, simp) |
|
102
3a801bbd2687
Reorganizing PIPBasics.thy and making small changes to Implementation.thy and Correctness.thy.
zhangx
parents:
101
diff
changeset
|
5422 |
qed |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5423 |
|
116 | 5424 |
lemma cp_rec: |
5425 |
"cp s th = Max ({the_preced s th} \<union> |
|
5426 |
(cp s o the_thread) ` children (tRAG s) (Th th))" |
|
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5427 |
proof - |
116 | 5428 |
have "Th th = Th th" by simp |
5429 |
note h = cp_gen_def_cond[OF this] cp_gen_rec[OF this] |
|
5430 |
show ?thesis |
|
5431 |
proof - |
|
5432 |
have "cp_gen s ` children (tRAG s) (Th th) = |
|
5433 |
(cp s \<circ> the_thread) ` children (tRAG s) (Th th)" |
|
5434 |
proof(rule cp_gen_over_set) |
|
5435 |
show " \<forall>x\<in>children (tRAG s) (Th th). \<exists>th. x = Th th" |
|
5436 |
by (unfold tRAG_alt_def, auto simp:children_def) |
|
5437 |
qed |
|
5438 |
thus ?thesis by (subst (1) h(1), unfold h(2), simp) |
|
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5439 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5440 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5441 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5442 |
end |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
5443 |
|
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5444 |
lemma PIP_actorE: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5445 |
assumes "PIP s e" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5446 |
and "actor e = th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5447 |
and "\<not> isCreate e" |
127
38c6acf03f68
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
125
diff
changeset
|
5448 |
shows "th \<in> running s" |
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5449 |
using assms |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5450 |
by (cases, auto) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5451 |
|
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5452 |
|
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5453 |
lemma holdents_RAG: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5454 |
assumes "holdents s th = {}" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5455 |
shows "Th th \<notin> Range (RAG s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5456 |
proof |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5457 |
assume "Th th \<in> Range (RAG s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5458 |
thus False |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5459 |
proof(rule RangeE) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5460 |
fix a |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5461 |
assume "(a, Th th) \<in> RAG s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5462 |
with assms[unfolded holdents_test] |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5463 |
show False |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
5464 |
using assms children_def holdents_alt_def by fastforce |
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5465 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5466 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5467 |
|
178 | 5468 |
|
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5469 |
lemma readys_RAG: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5470 |
assumes "th \<in> readys s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5471 |
shows "Th th \<notin> Domain (RAG s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5472 |
proof |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5473 |
assume "Th th \<in> Domain (RAG s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5474 |
thus False |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5475 |
proof(rule DomainE) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5476 |
fix b |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5477 |
assume "(Th th, b) \<in> RAG s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5478 |
with assms[unfolded readys_def s_waiting_def] |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5479 |
show False |
128
5d8ec128518b
removed most instances of raw
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
127
diff
changeset
|
5480 |
using Collect_disj_eq s_RAG_def s_waiting_abv s_waiting_def wq_def by fastforce |
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5481 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5482 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5483 |
|
178 | 5484 |
|
5485 |
text {* |
|
5486 |
The following two lemmas are general about any valid system state, |
|
5487 |
but are used in the derivation in more specific system operations. |
|
5488 |
*} |
|
5489 |
||
5490 |
lemma readys_root: |
|
5491 |
assumes "th \<in> readys s" |
|
5492 |
shows "root (RAG s) (Th th)" |
|
5493 |
unfolding root_def ancestors_def |
|
5494 |
using readys_RAG assms |
|
5495 |
by (metis Collect_empty_eq Domain.DomainI trancl_domain) |
|
5496 |
||
5497 |
lemma readys_in_no_subtree: |
|
5498 |
assumes "th \<in> readys s" |
|
5499 |
and "th' \<noteq> th" |
|
5500 |
shows "Th th \<notin> subtree (RAG s) (Th th')" |
|
5501 |
proof |
|
5502 |
assume "Th th \<in> subtree (RAG s) (Th th')" |
|
5503 |
thus False |
|
5504 |
proof(cases rule:subtreeE) |
|
5505 |
case 1 |
|
5506 |
with assms show ?thesis by auto |
|
5507 |
next |
|
5508 |
case 2 |
|
5509 |
with readys_root[OF assms(1)] |
|
5510 |
show ?thesis by (auto simp:root_def) |
|
5511 |
qed |
|
5512 |
qed |
|
5513 |
||
125
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5514 |
lemma readys_holdents_detached: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5515 |
assumes "th \<in> readys s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5516 |
and "holdents s th = {}" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5517 |
shows "detached s th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5518 |
proof - |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5519 |
from readys_RAG[OF assms(1)] holdents_RAG[OF assms(2)] |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5520 |
show ?thesis |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5521 |
by (unfold detached_test Field_def, auto) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5522 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5523 |
|
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5524 |
lemma len_actions_of_sigma: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5525 |
assumes "finite A" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5526 |
shows "length (actions_of A t) = (\<Sum> th' \<in> A. length (actions_of {th'} t))" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5527 |
proof(induct t) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5528 |
case h: (Cons e t) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5529 |
thus ?case (is "?L = ?R" is "_ = ?T (e#t)") |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5530 |
proof(cases "actor e \<in> A") |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5531 |
case True |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5532 |
have "?L = 1 + ?T t" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5533 |
by (fold h, insert True, simp add:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5534 |
moreover have "?R = 1 + ?T t" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5535 |
proof - |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5536 |
have "?R = length (actions_of {actor e} (e # t)) + |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5537 |
(\<Sum>th'\<in>A - {actor e}. length (actions_of {th'} (e # t)))" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5538 |
(is "_ = ?F (e#t) + ?G (e#t)") |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5539 |
by (subst comm_monoid_add_class.setsum.remove[where x = "actor e", |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5540 |
OF assms True], simp) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5541 |
moreover have "?F (e#t) = 1 + ?F t" using True |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5542 |
by (simp add:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5543 |
moreover have "?G (e#t) = ?G t" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5544 |
by (rule setsum.cong, auto simp:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5545 |
moreover have "?F t + ?G t = ?T t" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5546 |
by (subst comm_monoid_add_class.setsum.remove[where x = "actor e", |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5547 |
OF assms True], simp) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5548 |
ultimately show ?thesis by simp |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5549 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5550 |
ultimately show ?thesis by simp |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5551 |
next |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5552 |
case False |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5553 |
hence "?L = length (actions_of A t)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5554 |
by (simp add:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5555 |
also have "... = (\<Sum>th'\<in>A. length (actions_of {th'} t))" by (simp add: h) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5556 |
also have "... = ?R" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5557 |
by (rule setsum.cong; insert False, auto simp:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5558 |
finally show ?thesis . |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5559 |
qed |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5560 |
qed (auto simp:actions_of_def) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5561 |
|
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5562 |
lemma threads_Exit: |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5563 |
assumes "th \<in> threads s" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5564 |
and "th \<notin> threads (e#s)" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5565 |
shows "e = Exit th" |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5566 |
using assms |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5567 |
by (cases e, auto) |
95e7933968f8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
5568 |
|
108 | 5569 |
end |
136
fb3f52fe99d1
updated tG definition
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
134
diff
changeset
|
5570 |