author | zhangx |
Mon, 01 Feb 2016 20:56:39 +0800 | |
changeset 100 | 3d2b59f15f26 |
parent 99 | f7b33c633b96 |
child 101 | c7db2ccba18a |
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 |
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
|
2 |
imports PIPDefs |
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 |
|
99 | 5 |
section {* Generic aulxiliary lemmas *} |
6 |
||
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
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
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
|
13 |
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
|
14 |
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
|
15 |
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
|
16 |
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
|
17 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
18 |
lemma Max_fg_mono: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
19 |
assumes "finite 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
|
20 |
and "\<forall> a \<in> A. f a \<le> 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
|
21 |
shows "Max (f ` A) \<le> Max (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
|
22 |
proof(cases "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
|
23 |
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
|
24 |
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
|
25 |
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
|
26 |
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
|
27 |
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
|
28 |
proof(rule Max.boundedI) |
4763aa246dbd
Original files overwrite by 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 |
from assms show "finite (f ` A)" 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
|
30 |
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
|
31 |
from False show "f ` A \<noteq> {}" 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
|
32 |
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
|
33 |
fix fa |
4763aa246dbd
Original files overwrite by 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 |
assume "fa \<in> 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
|
35 |
then obtain a where h_fa: "a \<in> A" "fa = f a" 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
|
36 |
show "fa \<le> Max (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
|
37 |
proof(rule Max_ge_iff[THEN iffD2]) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
38 |
from assms show "finite (g ` A)" 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
|
39 |
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
|
40 |
from False show "g ` A \<noteq> {}" 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
|
41 |
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
|
42 |
from h_fa have "g a \<in> g ` A" 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
|
43 |
moreover have "fa \<le> g a" using h_fa assms(2) 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
|
44 |
ultimately show "\<exists>a\<in>g ` A. fa \<le> a" 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
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma Max_f_mono: |
4763aa246dbd
Original files overwrite by 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 |
assumes seq: "A \<subseteq> B" |
4763aa246dbd
Original files overwrite by 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 |
and np: "A \<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
|
52 |
and fnt: "finite B" |
4763aa246dbd
Original files overwrite by 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 |
shows "Max (f ` A) \<le> Max (f ` B)" |
4763aa246dbd
Original files overwrite by 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 |
proof(rule Max_mono) |
4763aa246dbd
Original files overwrite by 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 |
from seq show "f ` A \<subseteq> f ` B" 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
|
56 |
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
|
57 |
from np show "f ` A \<noteq> {}" 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
|
58 |
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
|
59 |
from fnt and seq show "finite (f ` B)" 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
|
60 |
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
|
61 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma Max_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
|
63 |
assumes "finite 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
|
64 |
and "A \<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
|
65 |
and "\<forall> M \<in> f ` A. finite M" |
4763aa246dbd
Original files overwrite by 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 |
and "\<forall> M \<in> f ` A. M \<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
|
67 |
shows "Max (\<Union>x\<in> A. f x) = Max (Max ` f ` A)" (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
|
68 |
using 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
|
69 |
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
|
70 |
have "?L = Max (\<Union>(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
|
71 |
by (fold Union_image_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
|
72 |
also have "... = ?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
|
73 |
by (subst Max_Union, 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
|
74 |
finally 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
|
75 |
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
|
76 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma max_Max_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
|
78 |
assumes "finite 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
|
79 |
and "A \<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
|
80 |
and "x = y" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
81 |
shows "max x (Max A) = Max ({y} \<union> A)" (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
|
82 |
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
|
83 |
have "?R = Max (insert y A)" 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
|
84 |
also from assms have "... = ?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
|
85 |
by (subst Max.insert, 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
|
86 |
finally 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
|
87 |
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
|
88 |
|
100 | 89 |
lemma rel_eqI: |
90 |
assumes "\<And> x y. (x,y) \<in> A \<Longrightarrow> (x,y) \<in> B" |
|
91 |
and "\<And> x y. (x,y) \<in> B \<Longrightarrow> (x, y) \<in> A" |
|
92 |
shows "A = B" |
|
93 |
using assms by auto |
|
94 |
||
99 | 95 |
section {* Lemmas do not depend on trace validity *} |
96 |
||
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
|
97 |
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
|
98 |
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
|
99 |
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
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
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
|
105 |
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
|
106 |
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
|
107 |
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
|
108 |
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
|
109 |
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
|
110 |
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
|
111 |
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
|
112 |
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
|
113 |
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
|
114 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
115 |
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
|
116 |
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
|
117 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
118 |
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
|
119 |
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
|
120 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
121 |
lemma eq_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
|
122 |
"RAG (wq s) = 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
|
123 |
by (unfold cs_RAG_def 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
|
124 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
125 |
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
|
126 |
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
|
127 |
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
|
128 |
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
|
129 |
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
|
130 |
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
|
131 |
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
|
132 |
hence "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
|
133 |
by (unfold s_holding_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
|
134 |
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
|
135 |
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
|
136 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma cp_eq_cpreced: "cp s th = cpreced (wq s) 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
|
138 |
unfolding cp_def 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
|
139 |
apply(induct s rule: schs.induct) |
4763aa246dbd
Original files overwrite by 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 |
apply(simp add: Let_def cpreced_initial) |
4763aa246dbd
Original files overwrite by 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 |
apply(simp add: 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
|
142 |
apply(simp add: 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
|
143 |
apply(simp add: 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
|
144 |
apply(subst (2) schs.simps) |
4763aa246dbd
Original files overwrite by 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 |
apply(simp add: 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
|
146 |
apply(subst (2) schs.simps) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
147 |
apply(simp add: 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
|
148 |
done |
4763aa246dbd
Original files overwrite by 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 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma cp_alt_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
|
151 |
"cp 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
|
152 |
Max ((the_preced s) ` {th'. Th th' \<in> (subtree (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
|
153 |
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
|
154 |
have "Max (the_preced s ` ({th} \<union> dependants (wq 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
|
155 |
Max (the_preced s ` {th'. Th th' \<in> subtree (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
|
156 |
(is "Max (_ ` ?L) = Max (_ ` ?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
|
157 |
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
|
158 |
have "?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
|
159 |
by (auto dest:rtranclD simp:cs_dependants_def cs_RAG_def s_RAG_def subtree_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
|
160 |
thus ?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
|
161 |
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
|
162 |
thus ?thesis by (unfold cp_eq_cpreced cpreced_def, fold the_preced_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
|
163 |
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
|
164 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
165 |
lemma RAG_target_th: "(Th th, x) \<in> RAG (s::state) \<Longrightarrow> \<exists> cs. x = 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
|
166 |
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
|
167 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
168 |
lemma waiting_eq: "waiting s th cs = waiting (wq 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
|
169 |
by (unfold s_waiting_def cs_waiting_def 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
|
170 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
171 |
lemma holding_eq: "holding (s::state) th cs = holding (wq 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
|
172 |
by (unfold s_holding_def wq_def cs_holding_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
|
173 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
174 |
lemma runing_ready: |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
175 |
shows "runing s \<subseteq> readys s" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
176 |
unfolding runing_def readys_def |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
177 |
by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
178 |
|
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
179 |
lemma readys_threads: |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
180 |
shows "readys s \<subseteq> threads s" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
181 |
unfolding readys_def |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
182 |
by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
183 |
|
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
|
184 |
lemma wq_v_neq [simp]: |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
185 |
"cs \<noteq> cs' \<Longrightarrow> wq (V thread cs#s) cs' = wq s cs'" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
186 |
by (auto simp:wq_def Let_def cp_def split:list.splits) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
187 |
|
68 | 188 |
lemma runing_head: |
189 |
assumes "th \<in> runing s" |
|
190 |
and "th \<in> set (wq_fun (schs s) cs)" |
|
191 |
shows "th = hd (wq_fun (schs s) cs)" |
|
192 |
using assms |
|
193 |
by (simp add:runing_def readys_def s_waiting_def wq_def) |
|
194 |
||
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
|
195 |
lemma runing_wqE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
196 |
assumes "th \<in> runing 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
|
197 |
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
|
198 |
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
|
199 |
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
|
200 |
from assms(2) obtain th' 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
|
201 |
by (meson list.set_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
|
202 |
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
|
203 |
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
|
204 |
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
|
205 |
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
|
206 |
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
|
207 |
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
|
208 |
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
|
209 |
with assms 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
|
210 |
by (unfold runing_def 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
|
211 |
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
|
212 |
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
|
213 |
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
|
214 |
|
100 | 215 |
lemma isP_E: |
216 |
assumes "isP e" |
|
217 |
obtains cs where "e = P (actor e) cs" |
|
218 |
using assms by (cases e, auto) |
|
219 |
||
220 |
lemma isV_E: |
|
221 |
assumes "isV e" |
|
222 |
obtains cs where "e = V (actor e) cs" |
|
223 |
using assms by (cases e, auto) |
|
224 |
||
225 |
||
226 |
text {* |
|
227 |
Every thread can only be blocked on one critical resource, |
|
228 |
symmetrically, every critical resource can only be held by one thread. |
|
229 |
This fact is much more easier according to our definition. |
|
230 |
*} |
|
231 |
lemma held_unique: |
|
232 |
assumes "holding (s::event list) th1 cs" |
|
233 |
and "holding s th2 cs" |
|
234 |
shows "th1 = th2" |
|
235 |
by (insert assms, unfold s_holding_def, auto) |
|
236 |
||
237 |
lemma last_set_lt: "th \<in> threads s \<Longrightarrow> last_set th s < length s" |
|
238 |
apply (induct s, auto) |
|
239 |
by (case_tac a, auto split:if_splits) |
|
240 |
||
241 |
lemma last_set_unique: |
|
242 |
"\<lbrakk>last_set th1 s = last_set th2 s; th1 \<in> threads s; th2 \<in> threads s\<rbrakk> |
|
243 |
\<Longrightarrow> th1 = th2" |
|
244 |
apply (induct s, auto) |
|
245 |
by (case_tac a, auto split:if_splits dest:last_set_lt) |
|
246 |
||
247 |
lemma preced_unique : |
|
248 |
assumes pcd_eq: "preced th1 s = preced th2 s" |
|
249 |
and th_in1: "th1 \<in> threads s" |
|
250 |
and th_in2: " th2 \<in> threads s" |
|
251 |
shows "th1 = th2" |
|
252 |
proof - |
|
253 |
from pcd_eq have "last_set th1 s = last_set th2 s" by (simp add:preced_def) |
|
254 |
from last_set_unique [OF this th_in1 th_in2] |
|
255 |
show ?thesis . |
|
256 |
qed |
|
257 |
||
258 |
lemma preced_linorder: |
|
259 |
assumes neq_12: "th1 \<noteq> th2" |
|
260 |
and th_in1: "th1 \<in> threads s" |
|
261 |
and th_in2: " th2 \<in> threads s" |
|
262 |
shows "preced th1 s < preced th2 s \<or> preced th1 s > preced th2 s" |
|
263 |
proof - |
|
264 |
from preced_unique [OF _ th_in1 th_in2] and neq_12 |
|
265 |
have "preced th1 s \<noteq> preced th2 s" by auto |
|
266 |
thus ?thesis by auto |
|
267 |
qed |
|
268 |
||
269 |
lemma in_RAG_E: |
|
270 |
assumes "(n1, n2) \<in> RAG (s::state)" |
|
271 |
obtains (waiting) th cs where "n1 = Th th" "n2 = Cs cs" "waiting s th cs" |
|
272 |
| (holding) th cs where "n1 = Cs cs" "n2 = Th th" "holding s th cs" |
|
273 |
using assms[unfolded s_RAG_def, folded waiting_eq holding_eq] |
|
274 |
by auto |
|
275 |
||
99 | 276 |
(* ccc *) |
277 |
||
278 |
section {* Locales used to investigate the execution of PIP *} |
|
279 |
||
280 |
text {* |
|
281 |
The following locale @{text valid_trace} is used to constrain the |
|
282 |
trace to be valid. All properties hold for valid traces are |
|
283 |
derived under this locale. |
|
284 |
*} |
|
285 |
locale valid_trace = |
|
286 |
fixes s |
|
287 |
assumes vt : "vt s" |
|
288 |
||
289 |
text {* |
|
290 |
The following locale @{text valid_trace_e} describes |
|
291 |
the valid extension of a valid trace. The event @{text "e"} |
|
292 |
represents an event in the system, which corresponds |
|
293 |
to a one step operation of the PIP protocol. |
|
294 |
It is required that @{text "e"} is an event eligible to happen |
|
295 |
under state @{text "s"}, which is already required to be valid |
|
296 |
by the parent locale @{text "valid_trace"}. |
|
297 |
||
298 |
This locale is used to investigate one step execution of PIP, |
|
299 |
properties concerning the effects of @{text "e"}'s execution, |
|
300 |
for example, how the values of observation functions are changed, |
|
301 |
or how desirable properties are kept invariant, are derived |
|
302 |
under this locale. The state before execution is @{text "s"}, while |
|
303 |
the state after execution is @{text "e#s"}. Therefore, the lemmas |
|
304 |
derived usually relate observations on @{text "e#s"} to those |
|
305 |
on @{text "s"}. |
|
306 |
*} |
|
307 |
||
308 |
locale valid_trace_e = valid_trace + |
|
309 |
fixes e |
|
310 |
assumes vt_e: "vt (e#s)" |
|
311 |
begin |
|
312 |
||
313 |
text {* |
|
314 |
The following lemma shows that @{text "e"} must be a |
|
315 |
eligible event (or a valid step) to be taken under |
|
316 |
the state represented by @{text "s"}. |
|
317 |
*} |
|
318 |
lemma pip_e: "PIP s e" |
|
319 |
using vt_e by (cases, simp) |
|
320 |
||
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
|
321 |
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
|
322 |
|
99 | 323 |
text {* |
324 |
Because @{term "e#s"} is also a valid trace, properties |
|
325 |
derived for valid trace @{term s} also hold on @{term "e#s"}. |
|
326 |
*} |
|
327 |
sublocale valid_trace_e < vat_es!: valid_trace "e#s" |
|
328 |
using vt_e |
|
329 |
by (unfold_locales, simp) |
|
330 |
||
331 |
text {* |
|
332 |
For each specific event (or operation), there is a sublocale |
|
333 |
further constraining that the event @{text e} to be that |
|
334 |
particular event. |
|
335 |
||
336 |
For example, the following |
|
337 |
locale @{text "valid_trace_create"} is the sublocale for |
|
338 |
event @{term "Create"}: |
|
339 |
*} |
|
340 |
locale valid_trace_create = valid_trace_e + |
|
341 |
fixes th prio |
|
342 |
assumes is_create: "e = Create th prio" |
|
343 |
||
344 |
locale valid_trace_exit = valid_trace_e + |
|
345 |
fixes th |
|
346 |
assumes is_exit: "e = Exit th" |
|
347 |
||
348 |
locale valid_trace_p = valid_trace_e + |
|
349 |
fixes th cs |
|
350 |
assumes is_p: "e = P th cs" |
|
351 |
||
352 |
text {* |
|
353 |
locale @{text "valid_trace_p"} is divided further into two |
|
354 |
sublocales, namely, @{text "valid_trace_p_h"} |
|
355 |
and @{text "valid_trace_p_w"}. |
|
356 |
*} |
|
357 |
||
358 |
text {* |
|
359 |
The following two sublocales @{text "valid_trace_p_h"} |
|
360 |
and @{text "valid_trace_p_w"} represent two complementary |
|
361 |
cases under @{text "valid_trace_p"}, where |
|
362 |
@{text "valid_trace_p_h"} further constraints that |
|
363 |
@{text "wq s cs = []"}, which means the waiting queue of |
|
364 |
the requested resource @{text "cs"} is empty, in which |
|
365 |
case, the requesting thread @{text "th"} |
|
366 |
will take hold of @{text "cs"}. |
|
367 |
||
368 |
Opposite to @{text "valid_trace_p_h"}, |
|
369 |
@{text "valid_trace_p_w"} constraints that |
|
370 |
@{text "wq s cs \<noteq> []"}, which means the waiting queue of |
|
371 |
the requested resource @{text "cs"} is nonempty, in which |
|
372 |
case, the requesting thread @{text "th"} will be blocked |
|
373 |
on @{text "cs"}: |
|
374 |
||
375 |
Peculiar properties will be derived under respective |
|
376 |
locales. |
|
377 |
*} |
|
378 |
||
379 |
locale valid_trace_p_h = valid_trace_p + |
|
380 |
assumes we: "wq s cs = []" |
|
381 |
||
382 |
locale valid_trace_p_w = valid_trace_p + |
|
383 |
assumes wne: "wq s cs \<noteq> []" |
|
384 |
begin |
|
385 |
||
386 |
text {* |
|
387 |
The following @{text "holder"} designates |
|
388 |
the holder of @{text "cs"} before the @{text "P"}-operation. |
|
389 |
*} |
|
390 |
definition "holder = hd (wq s cs)" |
|
391 |
||
392 |
text {* |
|
393 |
The following @{text "waiters"} designates |
|
394 |
the list of threads waiting for @{text "cs"} |
|
395 |
before the @{text "P"}-operation. |
|
396 |
*} |
|
397 |
definition "waiters = tl (wq s cs)" |
|
398 |
end |
|
399 |
||
400 |
text {* |
|
401 |
@{text "valid_trace_v"} is set for the @{term V}-operation. |
|
402 |
*} |
|
403 |
locale valid_trace_v = valid_trace_e + |
|
404 |
fixes th cs |
|
405 |
assumes is_v: "e = V th cs" |
|
406 |
begin |
|
407 |
-- {* The following @{text "rest"} is the tail of |
|
408 |
waiting queue of the resource @{text "cs"} |
|
409 |
to be released by this @{text "V"}-operation. |
|
410 |
*} |
|
411 |
definition "rest = tl (wq s cs)" |
|
412 |
||
413 |
text {* |
|
414 |
The following @{text "wq'"} is the waiting |
|
415 |
queue of @{term "cs"} |
|
416 |
after the @{text "V"}-operation, which |
|
417 |
is simply a reordering of @{term "rest"}. |
|
418 |
||
419 |
The effect of this reordering needs to be |
|
420 |
understood by two cases: |
|
421 |
\begin{enumerate} |
|
422 |
\item When @{text "rest = []"}, |
|
423 |
the reordering gives rise to an empty list as well, |
|
424 |
which means there is no thread holding or waiting |
|
425 |
for resource @{term "cs"}, therefore, it is free. |
|
426 |
||
427 |
\item When @{text "rest \<noteq> []"}, the effect of |
|
428 |
this reordering is to arbitrarily |
|
429 |
switch one thread in @{term "rest"} to the |
|
430 |
head, which, by definition take over the hold |
|
431 |
of @{term "cs"} and is designated by @{text "taker"} |
|
432 |
in the following sublocale @{text "valid_trace_v_n"}. |
|
433 |
*} |
|
434 |
definition "wq' = (SOME q. distinct q \<and> set q = set rest)" |
|
435 |
||
436 |
text {* |
|
437 |
The following @{text "rest'"} is the tail of the |
|
438 |
waiting queue after the @{text "V"}-operation. |
|
439 |
It plays only auxiliary role to ease reasoning. |
|
440 |
*} |
|
441 |
definition "rest' = tl wq'" |
|
442 |
||
443 |
end |
|
444 |
||
445 |
text {* |
|
446 |
In the following, @{text "valid_trace_v"} is also |
|
447 |
divided into two |
|
448 |
sublocales: when @{text "rest"} is empty (represented |
|
449 |
by @{text "valid_trace_v_e"}), which means, there is no thread waiting |
|
450 |
for @{text "cs"}, therefore, after the @{text "V"}-operation, |
|
451 |
it will become free; otherwise (represented |
|
452 |
by @{text "valid_trace_v_n"}), one thread |
|
453 |
will be picked from those in @{text "rest"} to take |
|
454 |
over @{text "cs"}. |
|
455 |
*} |
|
456 |
||
457 |
locale valid_trace_v_e = valid_trace_v + |
|
458 |
assumes rest_nil: "rest = []" |
|
459 |
||
460 |
locale valid_trace_v_n = valid_trace_v + |
|
461 |
assumes rest_nnl: "rest \<noteq> []" |
|
462 |
begin |
|
463 |
||
464 |
text {* |
|
465 |
The following @{text "taker"} is the thread to |
|
466 |
take over @{text "cs"}. |
|
467 |
*} |
|
468 |
definition "taker = hd wq'" |
|
469 |
||
470 |
end |
|
471 |
||
472 |
||
473 |
locale valid_trace_set = valid_trace_e + |
|
474 |
fixes th prio |
|
475 |
assumes is_set: "e = Set th prio" |
|
476 |
||
477 |
context valid_trace |
|
478 |
begin |
|
479 |
||
480 |
text {* |
|
481 |
Induction rule introduced to easy the |
|
482 |
derivation of properties for valid trace @{term "s"}. |
|
483 |
One more premises, namely @{term "valid_trace_e s e"} |
|
484 |
is added, so that an interpretation of |
|
485 |
@{text "valid_trace_e"} can be instantiated |
|
486 |
so that all properties derived so far becomes |
|
487 |
available in the proof of induction step. |
|
488 |
||
489 |
You will see its use in the proofs that follows. |
|
490 |
*} |
|
491 |
lemma ind [consumes 0, case_names Nil Cons, induct type]: |
|
492 |
assumes "PP []" |
|
493 |
and "(\<And>s e. valid_trace_e s e \<Longrightarrow> |
|
494 |
PP s \<Longrightarrow> PIP s e \<Longrightarrow> PP (e # s))" |
|
495 |
shows "PP s" |
|
496 |
proof(induct rule:vt.induct[OF vt, case_names Init Step]) |
|
497 |
case Init |
|
498 |
from assms(1) show ?case . |
|
499 |
next |
|
500 |
case (Step s e) |
|
501 |
show ?case |
|
502 |
proof(rule assms(2)) |
|
503 |
show "valid_trace_e s e" using Step by (unfold_locales, auto) |
|
504 |
next |
|
505 |
show "PP s" using Step by simp |
|
506 |
next |
|
507 |
show "PIP s e" using Step by simp |
|
508 |
qed |
|
509 |
qed |
|
510 |
||
511 |
text {* |
|
512 |
The following lemma says that if @{text "s"} is a valid state, so |
|
513 |
is its any postfix. Where @{term "monent t s"} is the postfix of |
|
514 |
@{term "s"} with length @{term "t"}. |
|
515 |
*} |
|
516 |
lemma vt_moment: "\<And> t. vt (moment t s)" |
|
517 |
proof(induct rule:ind) |
|
518 |
case Nil |
|
519 |
thus ?case by (simp add:vt_nil) |
|
520 |
next |
|
521 |
case (Cons s e t) |
|
522 |
show ?case |
|
523 |
proof(cases "t \<ge> length (e#s)") |
|
524 |
case True |
|
525 |
from True have "moment t (e#s) = e#s" by simp |
|
526 |
thus ?thesis using Cons |
|
527 |
by (simp add:valid_trace_def valid_trace_e_def, auto) |
|
528 |
next |
|
529 |
case False |
|
530 |
from Cons have "vt (moment t s)" by simp |
|
531 |
moreover have "moment t (e#s) = moment t s" |
|
532 |
proof - |
|
533 |
from False have "t \<le> length s" by simp |
|
534 |
from moment_app [OF this, of "[e]"] |
|
535 |
show ?thesis by simp |
|
536 |
qed |
|
537 |
ultimately show ?thesis by simp |
|
538 |
qed |
|
539 |
qed |
|
540 |
end |
|
541 |
||
542 |
text {* |
|
543 |
The following locale @{text "valid_moment"} is to inherit the properties |
|
544 |
derived on any valid state to the prefix of it, with length @{text "i"}. |
|
545 |
*} |
|
546 |
locale valid_moment = valid_trace + |
|
547 |
fixes i :: nat |
|
548 |
||
100 | 549 |
sublocale valid_moment < vat_moment!: valid_trace "(moment i s)" |
99 | 550 |
by (unfold_locales, insert vt_moment, auto) |
551 |
||
100 | 552 |
locale valid_moment_e = valid_moment + |
553 |
assumes less_i: "i < length s" |
|
554 |
begin |
|
555 |
definition "next_e = hd (moment (Suc i) s)" |
|
556 |
||
557 |
lemma trace_e: |
|
558 |
"moment (Suc i) s = next_e#moment i s" |
|
559 |
proof - |
|
560 |
from less_i have "Suc i \<le> length s" by auto |
|
561 |
from moment_plus[OF this, folded next_e_def] |
|
562 |
show ?thesis . |
|
563 |
qed |
|
564 |
||
565 |
end |
|
566 |
||
567 |
sublocale valid_moment_e < vat_moment_e!: valid_trace_e "moment i s" "next_e" |
|
568 |
using vt_moment[of "Suc i", unfolded trace_e] |
|
569 |
by (unfold_locales, simp) |
|
570 |
||
571 |
section {* Distinctiveness of waiting queues *} |
|
99 | 572 |
|
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
|
573 |
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
|
574 |
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
|
575 |
|
99 | 576 |
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
|
577 |
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
|
578 |
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
|
579 |
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
|
580 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
581 |
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
|
582 |
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
|
583 |
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
|
584 |
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
|
585 |
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
|
586 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
587 |
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
|
588 |
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
|
589 |
|
99 | 590 |
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
|
591 |
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
|
592 |
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
|
593 |
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
|
594 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
595 |
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
|
596 |
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
|
597 |
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
|
598 |
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
|
599 |
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
|
600 |
|
100 | 601 |
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
|
602 |
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
|
603 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
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
|
608 |
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
|
609 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
610 |
lemma runing_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
|
611 |
shows "th \<in> runing 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
|
612 |
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
|
613 |
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
|
614 |
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
|
615 |
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
|
616 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
617 |
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
|
618 |
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
|
619 |
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
|
620 |
assume otherwise: "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
|
621 |
from runing_wqE[OF runing_th_s 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
|
622 |
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
|
623 |
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
|
624 |
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
|
625 |
by (unfold s_holding_def, fold wq_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
|
626 |
hence cs_th_RAG: "(Cs cs, 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
|
627 |
by (unfold s_RAG_def, fold holding_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
|
628 |
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
|
629 |
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
|
630 |
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
|
631 |
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
|
632 |
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
|
633 |
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
|
634 |
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
|
635 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
636 |
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
|
637 |
"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
|
638 |
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
|
639 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
640 |
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
|
641 |
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
|
642 |
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
|
643 |
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
|
644 |
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
|
645 |
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
|
646 |
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
|
647 |
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
|
648 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
649 |
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
|
650 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
651 |
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
|
652 |
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
|
653 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
654 |
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
|
655 |
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
|
656 |
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
|
657 |
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
|
658 |
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
|
659 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
660 |
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
|
661 |
"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
|
662 |
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
|
663 |
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
|
664 |
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
|
665 |
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
|
666 |
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
|
667 |
from this(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
|
668 |
by (unfold rest_def s_holding_def, fold 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
|
669 |
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
|
670 |
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
|
671 |
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
|
672 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
673 |
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
|
674 |
"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
|
675 |
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
|
676 |
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
|
677 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
678 |
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
|
679 |
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
|
680 |
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
|
681 |
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
|
682 |
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
|
683 |
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
|
684 |
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
|
685 |
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
|
686 |
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
|
687 |
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
|
688 |
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
|
689 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
690 |
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
|
691 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
692 |
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
|
693 |
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
|
694 |
|
99 | 695 |
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
|
696 |
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
|
697 |
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
|
698 |
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
|
699 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
700 |
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
|
701 |
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
|
702 |
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
|
703 |
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
|
704 |
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
|
705 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
706 |
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
|
707 |
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
|
708 |
|
63 | 709 |
lemma wq_distinct: "distinct (wq s cs)" |
68 | 710 |
proof(induct rule:ind) |
711 |
case (Cons s e) |
|
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
|
712 |
interpret vt_e: valid_trace_e s e using Cons by simp |
68 | 713 |
show ?case |
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
|
714 |
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
|
715 |
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
|
716 |
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
|
717 |
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
|
718 |
show ?thesis using Cons by (simp add: vt_create.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
|
719 |
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
|
720 |
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
|
721 |
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
|
722 |
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
|
723 |
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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
show ?thesis using Cons by (simp add: vt_p.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
|
728 |
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
|
729 |
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
|
730 |
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
|
731 |
show ?thesis using Cons by (simp add: vt_v.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
|
732 |
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
|
733 |
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
|
734 |
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
|
735 |
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
|
736 |
show ?thesis using Cons by (simp add: vt_set.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
|
737 |
qed |
68 | 738 |
qed (unfold wq_def Let_def, simp) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
739 |
|
63 | 740 |
end |
741 |
||
100 | 742 |
section {* Waiting queues and threads *} |
743 |
||
63 | 744 |
context valid_trace_e |
745 |
begin |
|
746 |
||
100 | 747 |
lemma wq_out_inv: |
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
|
748 |
assumes s_in: "thread \<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
|
749 |
and s_hd: "thread = 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
|
750 |
and s_i: "thread \<noteq> hd (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
|
751 |
shows "e = V thread 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
|
752 |
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
|
753 |
-- {* There are only two non-trivial 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
|
754 |
case (V th cs1) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
755 |
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
|
756 |
proof(cases "cs1 = 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
|
757 |
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
|
758 |
have "PIP s (V th cs)" using pip_e[unfolded V[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
|
759 |
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
|
760 |
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
|
761 |
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
|
762 |
moreover have "th = thread" using thread_V(2) s_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
|
763 |
by (unfold s_holding_def wq_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
|
764 |
ultimately show ?thesis using V True by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
765 |
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
|
766 |
qed (insert assms V, auto simp:wq_def Let_def split:if_splits) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
767 |
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
|
768 |
case (P th cs1) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
769 |
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
|
770 |
proof(cases "cs1 = 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
|
771 |
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
|
772 |
with P have "wq (e#s) cs = wq_fun (schs 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
|
773 |
by (auto simp:wq_def Let_def split:if_splits) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
774 |
with s_i s_hd s_in 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
|
775 |
by (metis empty_iff hd_append2 list.set(1) 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
|
776 |
thus ?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
|
777 |
qed (insert assms P, auto simp:wq_def Let_def split:if_splits) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
778 |
qed (insert assms, auto simp:wq_def Let_def split:if_splits) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
779 |
|
100 | 780 |
lemma wq_in_inv: |
781 |
assumes s_ni: "thread \<notin> set (wq s cs)" |
|
782 |
and s_i: "thread \<in> set (wq (e#s) cs)" |
|
783 |
shows "e = P thread cs" |
|
784 |
proof(cases e) |
|
785 |
-- {* This is the only non-trivial case: *} |
|
786 |
case (V th cs1) |
|
787 |
have False |
|
788 |
proof(cases "cs1 = cs") |
|
789 |
case True |
|
790 |
show ?thesis |
|
791 |
proof(cases "(wq s cs1)") |
|
792 |
case (Cons w_hd w_tl) |
|
793 |
have "set (wq (e#s) cs) \<subseteq> set (wq s cs)" |
|
794 |
proof - |
|
795 |
have "(wq (e#s) cs) = (SOME q. distinct q \<and> set q = set w_tl)" |
|
796 |
using Cons V by (auto simp:wq_def Let_def True split:if_splits) |
|
797 |
moreover have "set ... \<subseteq> set (wq s cs)" |
|
798 |
proof(rule someI2) |
|
799 |
show "distinct w_tl \<and> set w_tl = set w_tl" |
|
800 |
by (metis distinct.simps(2) local.Cons wq_distinct) |
|
801 |
qed (insert Cons True, auto) |
|
802 |
ultimately show ?thesis by simp |
|
803 |
qed |
|
804 |
with assms show ?thesis by auto |
|
805 |
qed (insert assms V True, auto simp:wq_def Let_def split:if_splits) |
|
806 |
qed (insert assms V, auto simp:wq_def Let_def split:if_splits) |
|
807 |
thus ?thesis by auto |
|
808 |
qed (insert assms, auto simp:wq_def Let_def split:if_splits) |
|
809 |
||
63 | 810 |
end |
811 |
||
100 | 812 |
lemma (in valid_trace_create) |
813 |
th_not_in_threads: "th \<notin> threads s" |
|
814 |
proof - |
|
815 |
from pip_e[unfolded is_create] |
|
816 |
show ?thesis by (cases, simp) |
|
817 |
qed |
|
818 |
||
819 |
lemma (in valid_trace_create) |
|
820 |
threads_es [simp]: "threads (e#s) = threads s \<union> {th}" |
|
821 |
by (unfold is_create, simp) |
|
822 |
||
823 |
lemma (in valid_trace_exit) |
|
824 |
threads_es [simp]: "threads (e#s) = threads s - {th}" |
|
825 |
by (unfold is_exit, simp) |
|
826 |
||
827 |
lemma (in valid_trace_p) |
|
828 |
threads_es [simp]: "threads (e#s) = threads s" |
|
829 |
by (unfold is_p, simp) |
|
830 |
||
831 |
lemma (in valid_trace_v) |
|
832 |
threads_es [simp]: "threads (e#s) = threads s" |
|
833 |
by (unfold is_v, simp) |
|
834 |
||
835 |
lemma (in valid_trace_v) |
|
836 |
th_not_in_rest[simp]: "th \<notin> set rest" |
|
837 |
proof |
|
838 |
assume otherwise: "th \<in> set rest" |
|
839 |
have "distinct (wq s cs)" by (simp add: wq_distinct) |
|
840 |
from this[unfolded wq_s_cs] and otherwise |
|
841 |
show False by auto |
|
842 |
qed |
|
843 |
||
844 |
lemma (in valid_trace_v) distinct_rest: "distinct rest" |
|
845 |
by (simp add: distinct_tl rest_def wq_distinct) |
|
846 |
||
847 |
lemma (in valid_trace_v) |
|
848 |
set_wq_es_cs [simp]: "set (wq (e#s) cs) = set (wq s cs) - {th}" |
|
849 |
proof(unfold wq_es_cs wq'_def, rule someI2) |
|
850 |
show "distinct rest \<and> set rest = set rest" |
|
851 |
by (simp add: distinct_rest) |
|
852 |
next |
|
853 |
fix x |
|
854 |
assume "distinct x \<and> set x = set rest" |
|
855 |
thus "set x = set (wq s cs) - {th}" |
|
856 |
by (unfold wq_s_cs, simp) |
|
857 |
qed |
|
858 |
||
859 |
lemma (in valid_trace_exit) |
|
860 |
th_not_in_wq: "th \<notin> set (wq s cs)" |
|
861 |
proof - |
|
862 |
from pip_e[unfolded is_exit] |
|
863 |
show ?thesis |
|
864 |
by (cases, unfold holdents_def s_holding_def, fold wq_def, |
|
865 |
auto elim!:runing_wqE) |
|
866 |
qed |
|
867 |
||
868 |
lemma (in valid_trace) wq_threads: |
|
869 |
assumes "th \<in> set (wq s cs)" |
|
870 |
shows "th \<in> threads s" |
|
871 |
using assms |
|
872 |
proof(induct rule:ind) |
|
873 |
case (Nil) |
|
874 |
thus ?case by (auto simp:wq_def) |
|
875 |
next |
|
876 |
case (Cons s e) |
|
877 |
interpret vt_e: valid_trace_e s e using Cons by simp |
|
878 |
show ?case |
|
879 |
proof(cases e) |
|
880 |
case (Create th' prio') |
|
881 |
interpret vt: valid_trace_create s e th' prio' |
|
882 |
using Create by (unfold_locales, simp) |
|
883 |
show ?thesis |
|
884 |
using Cons.hyps(2) Cons.prems by auto |
|
885 |
next |
|
886 |
case (Exit th') |
|
887 |
interpret vt: valid_trace_exit s e th' |
|
888 |
using Exit by (unfold_locales, simp) |
|
889 |
show ?thesis |
|
890 |
using Cons.hyps(2) Cons.prems vt.th_not_in_wq by auto |
|
891 |
next |
|
892 |
case (P th' cs') |
|
893 |
interpret vt: valid_trace_p s e th' cs' |
|
894 |
using P by (unfold_locales, simp) |
|
895 |
show ?thesis |
|
896 |
using Cons.hyps(2) Cons.prems readys_threads |
|
897 |
runing_ready vt.is_p vt.runing_th_s vt_e.wq_in_inv |
|
898 |
by fastforce |
|
899 |
next |
|
900 |
case (V th' cs') |
|
901 |
interpret vt: valid_trace_v s e th' cs' |
|
902 |
using V by (unfold_locales, simp) |
|
903 |
show ?thesis using Cons |
|
904 |
using vt.is_v vt.threads_es vt_e.wq_in_inv by blast |
|
905 |
next |
|
906 |
case (Set th' prio) |
|
907 |
interpret vt: valid_trace_set s e th' prio |
|
908 |
using Set by (unfold_locales, simp) |
|
909 |
show ?thesis using Cons.hyps(2) Cons.prems vt.is_set |
|
910 |
by (auto simp:wq_def Let_def) |
|
911 |
qed |
|
912 |
qed |
|
913 |
||
914 |
section {* RAG and threads *} |
|
68 | 915 |
|
63 | 916 |
context valid_trace |
917 |
begin |
|
68 | 918 |
|
100 | 919 |
lemma dm_RAG_threads: |
920 |
assumes in_dom: "(Th th) \<in> Domain (RAG s)" |
|
921 |
shows "th \<in> threads s" |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
922 |
proof - |
100 | 923 |
from in_dom obtain n where "(Th th, n) \<in> RAG s" by auto |
924 |
moreover from RAG_target_th[OF this] obtain cs where "n = Cs cs" by auto |
|
925 |
ultimately have "(Th th, Cs cs) \<in> RAG s" by simp |
|
926 |
hence "th \<in> set (wq s cs)" |
|
927 |
by (unfold s_RAG_def, auto simp:cs_waiting_def) |
|
928 |
from wq_threads [OF this] show ?thesis . |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
929 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
930 |
|
100 | 931 |
lemma rg_RAG_threads: |
932 |
assumes "(Th th) \<in> Range (RAG s)" |
|
933 |
shows "th \<in> threads s" |
|
934 |
using assms |
|
935 |
by (unfold s_RAG_def cs_waiting_def cs_holding_def, |
|
936 |
auto intro:wq_threads) |
|
937 |
||
938 |
lemma RAG_threads: |
|
939 |
assumes "(Th th) \<in> Field (RAG s)" |
|
940 |
shows "th \<in> threads s" |
|
941 |
using assms |
|
942 |
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
|
943 |
|
63 | 944 |
end |
945 |
||
100 | 946 |
section {* The change of @{term RAG} *} |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
947 |
|
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
948 |
text {* |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
949 |
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
|
950 |
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
|
951 |
events, respectively. |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
952 |
*} |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
953 |
|
100 | 954 |
lemma (in valid_trace_set) RAG_unchanged [simp]: "(RAG (e # s)) = RAG s" |
955 |
by (unfold is_set s_RAG_def s_waiting_def wq_def, simp add:Let_def) |
|
956 |
||
957 |
lemma (in valid_trace_create) RAG_unchanged [simp]: "(RAG (e # s)) = RAG s" |
|
958 |
by (unfold is_create s_RAG_def s_waiting_def wq_def, simp add:Let_def) |
|
959 |
||
960 |
lemma (in valid_trace_exit) RAG_unchanged[simp]: "(RAG (e # s)) = RAG s" |
|
961 |
by (unfold is_exit s_RAG_def s_waiting_def wq_def, simp add:Let_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
|
962 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
963 |
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
|
964 |
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
|
965 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
966 |
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
|
967 |
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
|
968 |
shows "t = th" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
969 |
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
|
970 |
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
|
971 |
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
|
972 |
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
|
973 |
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
|
974 |
from held_unique[OF this(2) 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
|
975 |
show ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
976 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
977 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
978 |
|
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
|
979 |
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
|
980 |
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
|
981 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
982 |
lemma set_wq': "set wq' = set rest" |
100 | 983 |
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
|
984 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
985 |
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
|
986 |
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
|
987 |
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
|
988 |
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
|
989 |
|
100 | 990 |
lemma runing_th_s: |
991 |
shows "th \<in> runing s" |
|
992 |
proof - |
|
993 |
from pip_e[unfolded is_v] |
|
994 |
show ?thesis by (cases, simp) |
|
995 |
qed |
|
996 |
||
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
|
997 |
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
|
998 |
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
|
999 |
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
|
1000 |
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
|
1001 |
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
|
1002 |
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
|
1003 |
proof(cases "c = cs") |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1004 |
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
|
1005 |
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
|
1006 |
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
|
1007 |
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
|
1008 |
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
|
1009 |
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
|
1010 |
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
|
1011 |
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
|
1012 |
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
|
1013 |
have "wq (e#s) c = wq s c" 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
|
1014 |
by (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
|
1015 |
hence "waiting s t c" 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
|
1016 |
by (simp add: cs_waiting_def waiting_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
|
1017 |
hence "t \<notin> readys 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
|
1018 |
hence "t \<notin> runing s" using runing_ready by auto |
100 | 1019 |
with runing_th_s[folded otherwise] show ?thesis by auto |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1020 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1021 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1022 |
|
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
|
1023 |
lemma waiting_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
|
1024 |
assumes "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
|
1025 |
and "c \<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
|
1026 |
shows "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
|
1027 |
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
|
1028 |
have "wq (e#s) c = wq s 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
|
1029 |
using assms(2) is_v 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
|
1030 |
with assms(1) 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
|
1031 |
using cs_waiting_def waiting_eq 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
|
1032 |
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
|
1033 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1034 |
lemma holding_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
|
1035 |
assumes "c \<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
|
1036 |
and "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
|
1037 |
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
|
1038 |
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
|
1039 |
from assms(1) have "wq (e#s) c = wq s c" using is_v 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
|
1040 |
from assms(2)[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
|
1041 |
folded this, unfolded wq_def, folded 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
|
1042 |
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
|
1043 |
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
|
1044 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1045 |
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
|
1046 |
assumes "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
|
1047 |
and "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
|
1048 |
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
|
1049 |
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
|
1050 |
have "c \<noteq> cs" using assms using holding_cs_eq_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
|
1051 |
from holding_esI2[OF this 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
|
1052 |
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
|
1053 |
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
|
1054 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1055 |
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
|
1056 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1057 |
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
|
1058 |
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
|
1059 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1060 |
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
|
1061 |
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
|
1062 |
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
|
1063 |
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
|
1064 |
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
|
1065 |
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
|
1066 |
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
|
1067 |
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
|
1068 |
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
|
1069 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1070 |
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
|
1071 |
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
|
1072 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1073 |
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
|
1074 |
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
|
1075 |
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
|
1076 |
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
|
1077 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1078 |
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
|
1079 |
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
|
1080 |
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
|
1081 |
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
|
1082 |
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
|
1083 |
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
|
1084 |
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
|
1085 |
"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
|
1086 |
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
|
1087 |
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
|
1088 |
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
|
1089 |
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
|
1090 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1091 |
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
|
1092 |
"{(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
|
1093 |
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
|
1094 |
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
|
1095 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1096 |
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
|
1097 |
"{(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
|
1098 |
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
|
1099 |
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
|
1100 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1101 |
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
|
1102 |
shows "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
|
1103 |
by (unfold s_holding_def, fold wq_def, unfold 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
|
1104 |
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
|
1105 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1106 |
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
|
1107 |
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
|
1108 |
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
|
1109 |
shows "waiting (e#s) t cs" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1110 |
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
|
1111 |
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
|
1112 |
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
|
1113 |
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
|
1114 |
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
|
1115 |
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
|
1116 |
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
|
1117 |
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
|
1118 |
moreover 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
|
1119 |
using assms(1) cs_waiting_def waiting_eq 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
|
1120 |
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
|
1121 |
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
|
1122 |
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
|
1123 |
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
|
1124 |
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
|
1125 |
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
|
1126 |
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
|
1127 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1129 |
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
|
1130 |
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
|
1131 |
| "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
|
1132 |
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
|
1133 |
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
|
1134 |
hence "wq (e#s) c = wq s c" using is_v 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
|
1135 |
with assms have "waiting s t c" using cs_waiting_def waiting_eq 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
|
1136 |
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
|
1137 |
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
|
1138 |
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
|
1139 |
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
|
1140 |
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
|
1141 |
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
|
1142 |
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
|
1143 |
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
|
1144 |
ultimately have "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
|
1145 |
by (metis cs_waiting_def list.distinct(2) list.sel(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
|
1146 |
list.set_sel(2) rest_def waiting_eq 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
|
1147 |
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
|
1148 |
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
|
1149 |
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
|
1150 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1152 |
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
|
1153 |
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
|
1154 |
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
|
1155 |
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
|
1156 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1158 |
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
|
1159 |
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
|
1160 |
| "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
|
1161 |
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
|
1162 |
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
|
1163 |
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
|
1164 |
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
|
1165 |
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
|
1166 |
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
|
1167 |
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
|
1168 |
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
|
1169 |
hence "wq (e#s) c = wq s c" using is_v 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
|
1170 |
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
|
1171 |
unfolded this, unfolded wq_def, folded 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
|
1172 |
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
|
1173 |
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
|
1174 |
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
|
1175 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1177 |
|
4763aa246dbd
Original files overwrite by 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 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1180 |
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
|
1181 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1183 |
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
|
1184 |
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
|
1185 |
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
|
1186 |
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
|
1187 |
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
|
1188 |
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
|
1189 |
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
|
1190 |
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
|
1191 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1193 |
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
|
1194 |
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
|
1195 |
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
|
1196 |
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
|
1197 |
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
|
1198 |
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
|
1199 |
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
|
1200 |
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
|
1201 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1203 |
"{(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
|
1204 |
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
|
1205 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1207 |
"{(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
|
1208 |
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
|
1209 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1211 |
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
|
1212 |
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
|
1213 |
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
|
1214 |
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
|
1215 |
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
|
1216 |
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
|
1217 |
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
|
1218 |
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
|
1219 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma no_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
|
1221 |
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
|
1222 |
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
|
1223 |
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
|
1224 |
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
|
1225 |
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
|
1226 |
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
|
1227 |
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
|
1228 |
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
|
1229 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
1231 |
assumes "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
|
1232 |
shows "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
|
1233 |
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
|
1234 |
have "c \<noteq> cs" 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
|
1235 |
using cs_waiting_def rest_nil waiting_eq 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
|
1236 |
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
|
1237 |
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
|
1238 |
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
|
1239 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1240 |
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
|
1241 |
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
|
1242 |
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
|
1243 |
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
|
1244 |
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
|
1245 |
hence "wq (e#s) c = wq s c" using is_v 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
|
1246 |
with assms have "waiting s t c" using cs_waiting_def waiting_eq 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
|
1247 |
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
|
1248 |
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
|
1249 |
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
|
1250 |
from no_waiting[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
|
1251 |
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
|
1252 |
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
|
1253 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1254 |
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
|
1255 |
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
|
1256 |
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
|
1257 |
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
|
1258 |
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
|
1259 |
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
|
1260 |
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
|
1261 |
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
|
1262 |
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
|
1263 |
hence "wq (e#s) c = wq s c" using is_v 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
|
1264 |
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
|
1265 |
unfolded this, unfolded wq_def, folded 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
|
1266 |
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
|
1267 |
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
|
1268 |
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
|
1269 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1270 |
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
|
1271 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1272 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1273 |
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
|
1274 |
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
|
1275 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1276 |
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
|
1277 |
"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
|
1278 |
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
|
1279 |
{(Th th', Cs cs) |th'. next_th s th cs th'} \<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
|
1280 |
{(Cs cs, Th th') |th'. next_th s th cs 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
|
1281 |
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
|
1282 |
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
|
1283 |
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
|
1284 |
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
|
1285 |
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
|
1286 |
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
|
1287 |
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
|
1288 |
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
|
1289 |
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
|
1290 |
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
|
1291 |
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
|
1292 |
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
|
1293 |
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
|
1294 |
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
|
1295 |
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
|
1296 |
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
|
1297 |
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
|
1298 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq 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
|
1299 |
fold waiting_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1300 |
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
|
1301 |
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
|
1302 |
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
|
1303 |
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
|
1304 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq 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
|
1305 |
fold waiting_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
|
1306 |
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
|
1307 |
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
|
1308 |
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
|
1309 |
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
|
1310 |
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
|
1311 |
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
|
1312 |
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
|
1313 |
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
|
1314 |
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
|
1315 |
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
|
1316 |
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
|
1317 |
by (unfold h_e.waiting_set_eq h_e.holding_set_eq 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
|
1318 |
fold waiting_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1319 |
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
|
1320 |
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
|
1321 |
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
|
1322 |
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
|
1323 |
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
|
1324 |
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
|
1325 |
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
|
1326 |
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
|
1327 |
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
|
1328 |
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
|
1329 |
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
|
1330 |
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
|
1331 |
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
|
1332 |
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
|
1333 |
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
|
1334 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq 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
|
1335 |
fold waiting_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
|
1336 |
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
|
1337 |
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
|
1338 |
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
|
1339 |
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
|
1340 |
by (unfold h_n.waiting_set_eq h_n.holding_set_eq 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
|
1341 |
fold holding_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1342 |
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
|
1343 |
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
|
1344 |
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
|
1345 |
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
|
1346 |
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
|
1347 |
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
|
1348 |
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
|
1349 |
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
|
1350 |
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
|
1351 |
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
|
1352 |
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
|
1353 |
by (unfold h_e.waiting_set_eq h_e.holding_set_eq 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
|
1354 |
fold holding_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
|
1355 |
qed |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1356 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1357 |
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
|
1358 |
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
|
1359 |
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
|
1360 |
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
|
1361 |
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
|
1362 |
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
|
1363 |
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
|
1364 |
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
|
1365 |
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
|
1366 |
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
|
1367 |
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
|
1368 |
\<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
|
1369 |
(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
|
1370 |
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
|
1371 |
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
|
1372 |
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
|
1373 |
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
|
1374 |
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
|
1375 |
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
|
1376 |
by (unfold s_RAG_def, fold holding_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
|
1377 |
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
|
1378 |
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
|
1379 |
(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
|
1380 |
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
|
1381 |
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
|
1382 |
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
|
1383 |
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
|
1384 |
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
|
1385 |
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
|
1386 |
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
|
1387 |
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
|
1388 |
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
|
1389 |
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
|
1390 |
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
|
1391 |
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
|
1392 |
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
|
1393 |
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
|
1394 |
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
|
1395 |
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
|
1396 |
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
|
1397 |
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
|
1398 |
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
|
1399 |
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
|
1400 |
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
|
1401 |
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
|
1402 |
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
|
1403 |
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
|
1404 |
thus ?thesis using 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
|
1405 |
by (unfold s_RAG_def, fold waiting_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
|
1406 |
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
|
1407 |
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
|
1408 |
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
|
1409 |
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
|
1410 |
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
|
1411 |
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
|
1412 |
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
|
1413 |
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
|
1414 |
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
|
1415 |
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
|
1416 |
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
|
1417 |
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
|
1418 |
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
|
1419 |
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
|
1420 |
thus ?thesis using 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
|
1421 |
by (unfold s_RAG_def, fold holding_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1422 |
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
|
1423 |
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
|
1424 |
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
|
1425 |
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
|
1426 |
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
|
1427 |
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
|
1428 |
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
|
1429 |
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
|
1430 |
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
|
1431 |
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
|
1432 |
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
|
1433 |
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
|
1434 |
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
|
1435 |
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
|
1436 |
show ?thesis using 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
|
1437 |
by (unfold s_RAG_def, fold waiting_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
|
1438 |
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
|
1439 |
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
|
1440 |
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
|
1441 |
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
|
1442 |
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
|
1443 |
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
|
1444 |
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
|
1445 |
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
|
1446 |
show ?thesis using 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
|
1447 |
by (unfold s_RAG_def, fold holding_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1448 |
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
|
1449 |
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
|
1450 |
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
|
1451 |
show ?thesis using 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
|
1452 |
by (unfold s_RAG_def, fold holding_eq, auto) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1453 |
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
|
1454 |
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
|
1455 |
qed |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1456 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1457 |
|
100 | 1458 |
lemma |
1459 |
finite_RAG_kept: |
|
1460 |
assumes "finite (RAG s)" |
|
1461 |
shows "finite (RAG (e#s))" |
|
1462 |
proof(cases "rest = []") |
|
1463 |
case True |
|
1464 |
interpret vt: valid_trace_v_e using True |
|
1465 |
by (unfold_locales, simp) |
|
1466 |
show ?thesis using assms |
|
1467 |
by (unfold RAG_es vt.waiting_set_eq vt.holding_set_eq, 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
|
1468 |
next |
100 | 1469 |
case False |
1470 |
interpret vt: valid_trace_v_n using False |
|
1471 |
by (unfold_locales, simp) |
|
1472 |
show ?thesis using assms |
|
1473 |
by (unfold RAG_es vt.waiting_set_eq vt.holding_set_eq, 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
|
1474 |
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
|
1475 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1476 |
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
|
1477 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1478 |
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
|
1479 |
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
|
1480 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1481 |
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
|
1482 |
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
|
1483 |
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
|
1484 |
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
|
1485 |
by (metis cs_waiting_def hd_append2 list.sel(1) list.set_intros(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
|
1486 |
rotate1.simps(2) self_append_conv2 set_rotate1 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1487 |
th_not_in_wq waiting_eq wq_es_cs wq_neq_simp) |
100 | 1488 |
|
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
|
1489 |
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
|
1490 |
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
|
1491 |
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
|
1492 |
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
|
1493 |
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
|
1494 |
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
|
1495 |
with assms show ?thesis using cs_holding_def holding_eq 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
|
1496 |
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
|
1497 |
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
|
1498 |
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
|
1499 |
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
|
1500 |
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
|
1501 |
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
|
1502 |
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
|
1503 |
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
|
1504 |
by (simp add: cs_holding_def holding_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
|
1505 |
qed |
100 | 1506 |
end |
1507 |
||
1508 |
lemma (in valid_trace_p) th_not_waiting: "\<not> waiting s th c" |
|
1509 |
proof - |
|
1510 |
have "th \<in> readys s" |
|
1511 |
using runing_ready runing_th_s by blast |
|
1512 |
thus ?thesis |
|
1513 |
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
|
1514 |
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
|
1515 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1516 |
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
|
1517 |
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
|
1518 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1519 |
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
|
1520 |
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
|
1521 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1522 |
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
|
1523 |
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
|
1524 |
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
|
1525 |
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
|
1526 |
have "th \<in> set (wq (e#s) cs)" "th = hd (wq (e#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
|
1527 |
thus ?thesis using cs_holding_def holding_eq 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
|
1528 |
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
|
1529 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1530 |
lemma RAG_edge: "(Cs cs, Th th) \<in> 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
|
1531 |
by (unfold s_RAG_def, fold holding_eq, insert holding_es_th_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
|
1532 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1533 |
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
|
1534 |
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
|
1535 |
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
|
1536 |
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
|
1537 |
by (metis cs_waiting_def event.distinct(15) is_p list.sel(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
|
1538 |
set_ConsD waiting_eq we wq_es_cs' wq_neq_simp wq_out_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
|
1539 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1540 |
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
|
1541 |
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
|
1542 |
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
|
1543 |
| "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
|
1544 |
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
|
1545 |
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
|
1546 |
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
|
1547 |
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
|
1548 |
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
|
1549 |
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
|
1550 |
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
|
1551 |
have "holding s th' cs'" 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
|
1552 |
using False cs_holding_def holding_eq 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
|
1553 |
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
|
1554 |
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
|
1555 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1556 |
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
|
1557 |
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
|
1558 |
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
|
1559 |
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
|
1560 |
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
|
1561 |
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
|
1562 |
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
|
1563 |
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
|
1564 |
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
|
1565 |
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
|
1566 |
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
|
1567 |
thus ?thesis using 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
|
1568 |
by (unfold s_RAG_def, fold waiting_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
|
1569 |
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
|
1570 |
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
|
1571 |
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
|
1572 |
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
|
1573 |
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
|
1574 |
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
|
1575 |
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
|
1576 |
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
|
1577 |
show ?thesis by (unfold s_RAG_def, fold holding_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
|
1578 |
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
|
1579 |
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
|
1580 |
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
|
1581 |
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
|
1582 |
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
|
1583 |
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
|
1584 |
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
|
1585 |
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
|
1586 |
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
|
1587 |
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
|
1588 |
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
|
1589 |
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
|
1590 |
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
|
1591 |
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
|
1592 |
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
|
1593 |
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
|
1594 |
show ?thesis using 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
|
1595 |
by (unfold s_RAG_def, fold waiting_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
|
1596 |
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
|
1597 |
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
|
1598 |
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
|
1599 |
show ?thesis using 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
|
1600 |
by (unfold s_RAG_def, fold holding_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
|
1601 |
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
|
1602 |
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
|
1603 |
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
|
1604 |
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
|
1605 |
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
|
1606 |
by (unfold s_RAG_def, fold holding_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
|
1607 |
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
|
1608 |
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
|
1609 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1610 |
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
|
1611 |
|
100 | 1612 |
context valid_trace_p_w |
1613 |
begin |
|
1614 |
||
1615 |
lemma wq_s_cs: "wq s cs = holder#waiters" |
|
1616 |
by (simp add: holder_def waiters_def wne) |
|
1617 |
||
1618 |
lemma wq_es_cs': "wq (e#s) cs = holder#waiters@[th]" |
|
1619 |
by (simp add: wq_es_cs wq_s_cs) |
|
1620 |
||
1621 |
lemma waiting_es_th_cs: "waiting (e#s) th cs" |
|
1622 |
using cs_waiting_def th_not_in_wq waiting_eq wq_es_cs' wq_s_cs by auto |
|
1623 |
||
1624 |
lemma RAG_edge: "(Th th, Cs cs) \<in> RAG (e#s)" |
|
1625 |
by (unfold s_RAG_def, fold waiting_eq, insert waiting_es_th_cs, auto) |
|
1626 |
||
1627 |
lemma holding_esE: |
|
1628 |
assumes "holding (e#s) th' cs'" |
|
1629 |
obtains "holding s th' cs'" |
|
1630 |
using assms |
|
1631 |
proof(cases "cs' = cs") |
|
1632 |
case False |
|
1633 |
hence "wq (e#s) cs' = wq s cs'" by simp |
|
1634 |
with assms show ?thesis |
|
1635 |
using cs_holding_def holding_eq that by auto |
|
1636 |
next |
|
1637 |
case True |
|
1638 |
with assms show ?thesis |
|
1639 |
by (metis cs_holding_def holding_eq list.sel(1) list.set_intros(1) that |
|
1640 |
wq_es_cs' wq_s_cs) |
|
1641 |
qed |
|
1642 |
||
1643 |
lemma waiting_esE: |
|
1644 |
assumes "waiting (e#s) th' cs'" |
|
1645 |
obtains "th' \<noteq> th" "waiting s th' cs'" |
|
1646 |
| "th' = th" "cs' = cs" |
|
1647 |
proof(cases "waiting s th' cs'") |
|
1648 |
case True |
|
1649 |
have "th' \<noteq> th" |
|
1650 |
proof |
|
1651 |
assume otherwise: "th' = th" |
|
1652 |
from True[unfolded this] |
|
1653 |
show False by (simp add: th_not_waiting) |
|
1654 |
qed |
|
1655 |
from that(1)[OF this True] show ?thesis . |
|
1656 |
next |
|
1657 |
case False |
|
1658 |
hence "th' = th \<and> cs' = cs" |
|
1659 |
by (metis assms cs_waiting_def holder_def list.sel(1) rotate1.simps(2) |
|
1660 |
set_ConsD set_rotate1 waiting_eq wq_es_cs wq_es_cs' wq_neq_simp) |
|
1661 |
with that(2) show ?thesis by metis |
|
1662 |
qed |
|
1663 |
||
1664 |
lemma RAG_es: "RAG (e # s) = RAG s \<union> {(Th th, Cs cs)}" (is "?L = ?R") |
|
1665 |
proof(rule rel_eqI) |
|
1666 |
fix n1 n2 |
|
1667 |
assume "(n1, n2) \<in> ?L" |
|
1668 |
thus "(n1, n2) \<in> ?R" |
|
1669 |
proof(cases rule:in_RAG_E) |
|
1670 |
case (waiting th' cs') |
|
1671 |
from this(3) |
|
1672 |
show ?thesis |
|
1673 |
proof(cases rule:waiting_esE) |
|
1674 |
case 1 |
|
1675 |
thus ?thesis using waiting(1,2) |
|
1676 |
by (unfold s_RAG_def, fold waiting_eq, auto) |
|
1677 |
next |
|
1678 |
case 2 |
|
1679 |
thus ?thesis using waiting(1,2) by auto |
|
1680 |
qed |
|
1681 |
next |
|
1682 |
case (holding th' cs') |
|
1683 |
from this(3) |
|
1684 |
show ?thesis |
|
1685 |
proof(cases rule:holding_esE) |
|
1686 |
case 1 |
|
1687 |
with holding(1,2) |
|
1688 |
show ?thesis by (unfold s_RAG_def, fold holding_eq, auto) |
|
1689 |
qed |
|
1690 |
qed |
|
1691 |
next |
|
1692 |
fix n1 n2 |
|
1693 |
assume "(n1, n2) \<in> ?R" |
|
1694 |
hence "(n1, n2) \<in> RAG s \<or> (n1 = Th th \<and> n2 = Cs cs)" by auto |
|
1695 |
thus "(n1, n2) \<in> ?L" |
|
1696 |
proof |
|
1697 |
assume "(n1, n2) \<in> RAG s" |
|
1698 |
thus ?thesis |
|
1699 |
proof(cases rule:in_RAG_E) |
|
1700 |
case (waiting th' cs') |
|
1701 |
from waiting_kept[OF this(3)] |
|
1702 |
show ?thesis using waiting(1,2) |
|
1703 |
by (unfold s_RAG_def, fold waiting_eq, auto) |
|
1704 |
next |
|
1705 |
case (holding th' cs') |
|
1706 |
from holding_kept[OF this(3)] |
|
1707 |
show ?thesis using holding(1,2) |
|
1708 |
by (unfold s_RAG_def, fold holding_eq, auto) |
|
1709 |
qed |
|
1710 |
next |
|
1711 |
assume "n1 = Th th \<and> n2 = Cs cs" |
|
1712 |
thus ?thesis using RAG_edge by auto |
|
1713 |
qed |
|
1714 |
qed |
|
1715 |
||
1716 |
end |
|
1717 |
||
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
|
1718 |
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
|
1719 |
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
|
1720 |
|
100 | 1721 |
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
|
1722 |
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
|
1723 |
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
|
1724 |
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
|
1725 |
interpret vt_p: valid_trace_p_h using True |
63 | 1726 |
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
|
1727 |
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
|
1728 |
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
|
1729 |
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
|
1730 |
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
|
1731 |
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
|
1732 |
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
|
1733 |
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
|
1734 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
1735 |
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
|
1736 |
|
100 | 1737 |
section {* Finiteness of RAG *} |
1738 |
||
1739 |
context valid_trace |
|
1740 |
begin |
|
1741 |
||
1742 |
lemma finite_RAG: |
|
1743 |
shows "finite (RAG s)" |
|
1744 |
proof(induct rule:ind) |
|
1745 |
case Nil |
|
1746 |
show ?case |
|
1747 |
by (auto simp: s_RAG_def cs_waiting_def |
|
1748 |
cs_holding_def wq_def acyclic_def) |
|
1749 |
next |
|
1750 |
case (Cons s e) |
|
1751 |
interpret vt_e: valid_trace_e s e using Cons by simp |
|
1752 |
show ?case |
|
1753 |
proof(cases e) |
|
1754 |
case (Create th prio) |
|
1755 |
interpret vt: valid_trace_create s e th prio using Create |
|
1756 |
by (unfold_locales, simp) |
|
1757 |
show ?thesis using Cons by simp |
|
1758 |
next |
|
1759 |
case (Exit th) |
|
1760 |
interpret vt: valid_trace_exit s e th using Exit |
|
1761 |
by (unfold_locales, simp) |
|
1762 |
show ?thesis using Cons by simp |
|
1763 |
next |
|
1764 |
case (P th cs) |
|
1765 |
interpret vt: valid_trace_p s e th cs using P |
|
1766 |
by (unfold_locales, simp) |
|
1767 |
show ?thesis using Cons using vt.RAG_es by auto |
|
1768 |
next |
|
1769 |
case (V th cs) |
|
1770 |
interpret vt: valid_trace_v s e th cs using V |
|
1771 |
by (unfold_locales, simp) |
|
1772 |
show ?thesis using Cons by (simp add: vt.finite_RAG_kept) |
|
1773 |
next |
|
1774 |
case (Set th prio) |
|
1775 |
interpret vt: valid_trace_set s e th prio using Set |
|
1776 |
by (unfold_locales, simp) |
|
1777 |
show ?thesis using Cons by simp |
|
1778 |
qed |
|
1779 |
qed |
|
1780 |
end |
|
1781 |
||
1782 |
section {* RAG is acyclic *} |
|
1783 |
||
1784 |
text {* (* ddd *) |
|
1785 |
The nature of the work is like this: since it starts from a very simple and basic |
|
1786 |
model, even intuitively very `basic` and `obvious` properties need to derived from scratch. |
|
1787 |
For instance, the fact |
|
1788 |
that one thread can not be blocked by two critical resources at the same time |
|
1789 |
is obvious, because only running threads can make new requests, if one is waiting for |
|
1790 |
a critical resource and get blocked, it can not make another resource request and get |
|
1791 |
blocked the second time (because it is not running). |
|
1792 |
||
1793 |
To derive this fact, one needs to prove by contraction and |
|
1794 |
reason about time (or @{text "moement"}). The reasoning is based on a generic theorem |
|
1795 |
named @{text "p_split"}, which is about status changing along the time axis. It says if |
|
1796 |
a condition @{text "Q"} is @{text "True"} at a state @{text "s"}, |
|
1797 |
but it was @{text "False"} at the very beginning, then there must exits a moment @{text "t"} |
|
1798 |
in the history of @{text "s"} (notice that @{text "s"} itself is essentially the history |
|
1799 |
of events leading to it), such that @{text "Q"} switched |
|
1800 |
from being @{text "False"} to @{text "True"} and kept being @{text "True"} |
|
1801 |
till the last moment of @{text "s"}. |
|
1802 |
||
1803 |
Suppose a thread @{text "th"} is blocked |
|
1804 |
on @{text "cs1"} and @{text "cs2"} in some state @{text "s"}, |
|
1805 |
since no thread is blocked at the very beginning, by applying |
|
1806 |
@{text "p_split"} to these two blocking facts, there exist |
|
1807 |
two moments @{text "t1"} and @{text "t2"} in @{text "s"}, such that |
|
1808 |
@{text "th"} got blocked on @{text "cs1"} and @{text "cs2"} |
|
1809 |
and kept on blocked on them respectively ever since. |
|
1810 |
||
1811 |
Without lost of generality, we assume @{text "t1"} is earlier than @{text "t2"}. |
|
1812 |
However, since @{text "th"} was blocked ever since memonent @{text "t1"}, so it was still |
|
1813 |
in blocked state at moment @{text "t2"} and could not |
|
1814 |
make any request and get blocked the second time: Contradiction. |
|
1815 |
*} |
|
1816 |
||
1817 |
||
1818 |
context valid_trace |
|
1819 |
begin |
|
1820 |
||
1821 |
lemma waiting_unique_pre: (* ddd *) |
|
1822 |
assumes h11: "thread \<in> set (wq s cs1)" |
|
1823 |
and h12: "thread \<noteq> hd (wq s cs1)" |
|
1824 |
assumes h21: "thread \<in> set (wq s cs2)" |
|
1825 |
and h22: "thread \<noteq> hd (wq s cs2)" |
|
1826 |
and neq12: "cs1 \<noteq> cs2" |
|
1827 |
shows "False" |
|
1828 |
proof - |
|
1829 |
let "?Q" = "\<lambda> cs s. thread \<in> set (wq s cs) \<and> thread \<noteq> hd (wq s cs)" |
|
1830 |
from h11 and h12 have q1: "?Q cs1 s" by simp |
|
1831 |
from h21 and h22 have q2: "?Q cs2 s" by simp |
|
1832 |
have nq1: "\<not> ?Q cs1 []" by (simp add:wq_def) |
|
1833 |
have nq2: "\<not> ?Q cs2 []" by (simp add:wq_def) |
|
1834 |
from p_split [of "?Q cs1", OF q1 nq1] |
|
1835 |
obtain t1 where lt1: "t1 < length s" |
|
1836 |
and np1: "\<not> ?Q cs1 (moment t1 s)" |
|
1837 |
and nn1: "(\<forall>i'>t1. ?Q cs1 (moment i' s))" by auto |
|
1838 |
from p_split [of "?Q cs2", OF q2 nq2] |
|
1839 |
obtain t2 where lt2: "t2 < length s" |
|
1840 |
and np2: "\<not> ?Q cs2 (moment t2 s)" |
|
1841 |
and nn2: "(\<forall>i'>t2. ?Q cs2 (moment i' s))" by auto |
|
1842 |
{ fix s cs |
|
1843 |
assume q: "?Q cs s" |
|
1844 |
have "thread \<notin> runing s" |
|
1845 |
proof |
|
1846 |
assume "thread \<in> runing s" |
|
1847 |
hence " \<forall>cs. \<not> (thread \<in> set (wq_fun (schs s) cs) \<and> |
|
1848 |
thread \<noteq> hd (wq_fun (schs s) cs))" |
|
1849 |
by (unfold runing_def s_waiting_def readys_def, auto) |
|
1850 |
from this[rule_format, of cs] q |
|
1851 |
show False by (simp add: wq_def) |
|
1852 |
qed |
|
1853 |
} note q_not_runing = this |
|
1854 |
{ fix t1 t2 cs1 cs2 |
|
1855 |
assume lt1: "t1 < length s" |
|
1856 |
and np1: "\<not> ?Q cs1 (moment t1 s)" |
|
1857 |
and nn1: "(\<forall>i'>t1. ?Q cs1 (moment i' s))" |
|
1858 |
and lt2: "t2 < length s" |
|
1859 |
and np2: "\<not> ?Q cs2 (moment t2 s)" |
|
1860 |
and nn2: "(\<forall>i'>t2. ?Q cs2 (moment i' s))" |
|
1861 |
and lt12: "t1 < t2" |
|
1862 |
let ?t3 = "Suc t2" |
|
1863 |
interpret ve2: valid_moment_e _ t2 using lt2 |
|
1864 |
by (unfold_locales, simp) |
|
1865 |
let ?e = ve2.next_e |
|
1866 |
have "t2 < ?t3" by simp |
|
1867 |
from nn2 [rule_format, OF this] and ve2.trace_e |
|
1868 |
have h1: "thread \<in> set (wq (?e#moment t2 s) cs2)" and |
|
1869 |
h2: "thread \<noteq> hd (wq (?e#moment t2 s) cs2)" by auto |
|
1870 |
have ?thesis |
|
1871 |
proof - |
|
1872 |
have "thread \<in> runing (moment t2 s)" |
|
1873 |
proof(cases "thread \<in> set (wq (moment t2 s) cs2)") |
|
1874 |
case True |
|
1875 |
have "?e = V thread cs2" |
|
1876 |
proof - |
|
1877 |
have eq_th: "thread = hd (wq (moment t2 s) cs2)" |
|
1878 |
using True and np2 by auto |
|
1879 |
thus ?thesis |
|
1880 |
using True h2 ve2.vat_moment_e.wq_out_inv by blast |
|
1881 |
qed |
|
1882 |
thus ?thesis |
|
1883 |
using step.cases ve2.vat_moment_e.pip_e by auto |
|
1884 |
next |
|
1885 |
case False |
|
1886 |
hence "?e = P thread cs2" |
|
1887 |
using h1 ve2.vat_moment_e.wq_in_inv by blast |
|
1888 |
thus ?thesis |
|
1889 |
using step.cases ve2.vat_moment_e.pip_e by auto |
|
1890 |
qed |
|
1891 |
moreover have "thread \<notin> runing (moment t2 s)" |
|
1892 |
by (rule q_not_runing[OF nn1[rule_format, OF lt12]]) |
|
1893 |
ultimately show ?thesis by simp |
|
1894 |
qed |
|
1895 |
} note lt_case = this |
|
1896 |
show ?thesis |
|
1897 |
proof - |
|
1898 |
{ assume "t1 < t2" |
|
1899 |
from lt_case[OF lt1 np1 nn1 lt2 np2 nn2 this] |
|
1900 |
have ?thesis . |
|
1901 |
} moreover { |
|
1902 |
assume "t2 < t1" |
|
1903 |
from lt_case[OF lt2 np2 nn2 lt1 np1 nn1 this] |
|
1904 |
have ?thesis . |
|
1905 |
} moreover { |
|
1906 |
assume eq_12: "t1 = t2" |
|
1907 |
let ?t3 = "Suc t2" |
|
1908 |
interpret ve2: valid_moment_e _ t2 using lt2 |
|
1909 |
by (unfold_locales, simp) |
|
1910 |
let ?e = ve2.next_e |
|
1911 |
have "t2 < ?t3" by simp |
|
1912 |
from nn2 [rule_format, OF this] and ve2.trace_e |
|
1913 |
have h1: "thread \<in> set (wq (?e#moment t2 s) cs2)" by auto |
|
1914 |
have lt_2: "t2 < ?t3" by simp |
|
1915 |
from nn2 [rule_format, OF this] and ve2.trace_e |
|
1916 |
have h1: "thread \<in> set (wq (?e#moment t2 s) cs2)" and |
|
1917 |
h2: "thread \<noteq> hd (wq (?e#moment t2 s) cs2)" by auto |
|
1918 |
from nn1[rule_format, OF lt_2[folded eq_12], unfolded ve2.trace_e[folded eq_12]] |
|
1919 |
eq_12[symmetric] |
|
1920 |
have g1: "thread \<in> set (wq (?e#moment t1 s) cs1)" and |
|
1921 |
g2: "thread \<noteq> hd (wq (?e#moment t1 s) cs1)" by auto |
|
1922 |
have "?e = V thread cs2 \<or> ?e = P thread cs2" |
|
1923 |
using h1 h2 np2 ve2.vat_moment_e.wq_in_inv |
|
1924 |
ve2.vat_moment_e.wq_out_inv by blast |
|
1925 |
moreover have "?e = V thread cs1 \<or> ?e = P thread cs1" |
|
1926 |
using eq_12 g1 g2 np1 ve2.vat_moment_e.wq_in_inv |
|
1927 |
ve2.vat_moment_e.wq_out_inv by blast |
|
1928 |
ultimately have ?thesis using neq12 by auto |
|
1929 |
} ultimately show ?thesis using nat_neq_iff by blast |
|
1930 |
qed |
|
1931 |
qed |
|
1932 |
||
1933 |
text {* |
|
1934 |
This lemma is a simple corrolary of @{text "waiting_unique_pre"}. |
|
1935 |
*} |
|
1936 |
||
1937 |
lemma waiting_unique: |
|
1938 |
assumes "waiting s th cs1" |
|
1939 |
and "waiting s th cs2" |
|
1940 |
shows "cs1 = cs2" |
|
1941 |
using waiting_unique_pre assms |
|
1942 |
unfolding wq_def s_waiting_def |
|
1943 |
by auto |
|
1944 |
||
1945 |
end |
|
1946 |
||
1947 |
lemma (in valid_trace_v) |
|
1948 |
preced_es [simp]: "preced th (e#s) = preced th s" |
|
1949 |
by (unfold is_v preced_def, simp) |
|
1950 |
||
1951 |
lemma the_preced_v[simp]: "the_preced (V th cs#s) = the_preced s" |
|
1952 |
proof |
|
1953 |
fix th' |
|
1954 |
show "the_preced (V th cs # s) th' = the_preced s th'" |
|
1955 |
by (unfold the_preced_def preced_def, simp) |
|
1956 |
qed |
|
1957 |
||
1958 |
||
1959 |
lemma (in valid_trace_v) |
|
1960 |
the_preced_es: "the_preced (e#s) = the_preced s" |
|
1961 |
by (unfold is_v preced_def, simp) |
|
1962 |
||
1963 |
context valid_trace_p |
|
1964 |
begin |
|
1965 |
||
1966 |
lemma not_holding_s_th_cs: "\<not> holding s th cs" |
|
1967 |
proof |
|
1968 |
assume otherwise: "holding s th cs" |
|
1969 |
from pip_e[unfolded is_p] |
|
1970 |
show False |
|
1971 |
proof(cases) |
|
1972 |
case (thread_P) |
|
1973 |
moreover have "(Cs cs, Th th) \<in> RAG s" |
|
1974 |
using otherwise cs_holding_def |
|
1975 |
holding_eq th_not_in_wq by auto |
|
1976 |
ultimately show ?thesis by auto |
|
1977 |
qed |
|
1978 |
qed |
|
1979 |
||
1980 |
end |
|
1981 |
||
1982 |
||
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
|
1983 |
lemma (in valid_trace_v_n) finite_waiting_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
|
1984 |
"finite {(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
|
1985 |
by (simp add: 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
|
1986 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma (in valid_trace_v_n) finite_holding_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
|
1988 |
"finite {(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
|
1989 |
by (simp add: 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
|
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 (in valid_trace_v_e) finite_waiting_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
|
1992 |
"finite {(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
|
1993 |
by (simp add: 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
|
1994 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma (in valid_trace_v_e) finite_holding_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
|
1996 |
"finite {(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
|
1997 |
by (simp add: 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
|
1998 |
|
4763aa246dbd
Original files overwrite by 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 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2001 |
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
|
2002 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2004 |
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
|
2005 |
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
|
2006 |
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
|
2007 |
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
|
2008 |
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
|
2009 |
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
|
2010 |
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
|
2011 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2013 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2015 |
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
|
2016 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2017 |
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
|
2018 |
apply (unfold s_waiting_def, fold wq_def, unfold wq_s_cs 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
|
2019 |
using eq_wq' th'_in_inv wq'_def 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
|
2020 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2022 |
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
|
2023 |
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
|
2024 |
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
|
2025 |
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
|
2026 |
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
|
2027 |
{(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
|
2028 |
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
|
2029 |
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
|
2030 |
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
|
2031 |
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
|
2032 |
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
|
2033 |
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
|
2034 |
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
|
2035 |
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
|
2036 |
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
|
2037 |
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
|
2038 |
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
|
2039 |
"(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
|
2040 |
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
|
2041 |
from this(2) have "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
|
2042 |
by (unfold s_RAG_def, fold waiting_eq, auto) |
100 | 2043 |
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
|
2044 |
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
|
2045 |
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
|
2046 |
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
|
2047 |
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
|
2048 |
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
|
2049 |
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
|
2050 |
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
|
2051 |
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
|
2052 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2054 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2056 |
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
|
2057 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2059 |
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
|
2060 |
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
|
2061 |
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
|
2062 |
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
|
2063 |
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
|
2064 |
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
|
2065 |
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
|
2066 |
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
|
2067 |
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
|
2068 |
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
|
2069 |
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
|
2070 |
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
|
2071 |
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
|
2072 |
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
|
2073 |
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
|
2074 |
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
|
2075 |
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
|
2076 |
hence "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
|
2077 |
by (unfold s_RAG_def, fold waiting_eq, auto) |
100 | 2078 |
with th_not_waiting show False by auto (* ccc *) |
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
|
2079 |
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
|
2080 |
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
|
2081 |
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
|
2082 |
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
|
2083 |
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
|
2084 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2086 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2087 |
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
|
2088 |
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
|
2089 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2091 |
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
|
2092 |
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
|
2093 |
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
|
2094 |
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
|
2095 |
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
|
2096 |
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
|
2097 |
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
|
2098 |
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
|
2099 |
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
|
2100 |
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
|
2101 |
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
|
2102 |
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
|
2103 |
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
|
2104 |
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
|
2105 |
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
|
2106 |
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
|
2107 |
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
|
2108 |
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
|
2109 |
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
|
2110 |
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
|
2111 |
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
|
2112 |
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
|
2113 |
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
|
2114 |
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
|
2115 |
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
|
2116 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2118 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2120 |
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
|
2121 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2123 |
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
|
2124 |
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
|
2125 |
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
|
2126 |
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
|
2127 |
by (auto simp: s_RAG_def cs_waiting_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
|
2128 |
cs_holding_def wq_def acyclic_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
|
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 |
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
|
2131 |
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
|
2132 |
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
|
2133 |
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
|
2134 |
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
|
2135 |
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
|
2136 |
by (unfold_locales, simp) |
100 | 2137 |
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
|
2138 |
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
|
2139 |
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
|
2140 |
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
|
2141 |
by (unfold_locales, simp) |
100 | 2142 |
show ?thesis using Cons by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2143 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2144 |
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
|
2145 |
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
|
2146 |
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
|
2147 |
show ?thesis |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2148 |
proof(cases "wq s cs = []") |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2149 |
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
|
2150 |
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
|
2151 |
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
|
2152 |
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
|
2153 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2154 |
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
|
2155 |
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
|
2156 |
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
|
2157 |
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
|
2158 |
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
|
2159 |
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
|
2160 |
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
|
2161 |
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
|
2162 |
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
|
2163 |
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
|
2164 |
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
|
2165 |
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
|
2166 |
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
|
2167 |
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
|
2168 |
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
|
2169 |
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
|
2170 |
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
|
2171 |
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
|
2172 |
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
|
2173 |
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
|
2174 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2175 |
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
|
2176 |
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
|
2177 |
interpret vt: valid_trace_set s e th prio using Set |
63 | 2178 |
by (unfold_locales, simp) |
100 | 2179 |
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
|
2180 |
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
|
2181 |
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
|
2182 |
|
100 | 2183 |
end |
2184 |
||
2185 |
section {* RAG is single-valued *} |
|
2186 |
||
2187 |
context valid_trace |
|
2188 |
begin |
|
2189 |
||
2190 |
lemma unique_RAG: "\<lbrakk>(n, n1) \<in> RAG s; (n, n2) \<in> RAG s\<rbrakk> \<Longrightarrow> n1 = n2" |
|
2191 |
apply(unfold s_RAG_def, auto, fold waiting_eq holding_eq) |
|
2192 |
by(auto elim:waiting_unique held_unique) |
|
2193 |
||
2194 |
lemma sgv_RAG: "single_valued (RAG s)" |
|
2195 |
using unique_RAG by (auto simp:single_valued_def) |
|
2196 |
||
2197 |
end |
|
2198 |
||
2199 |
section {* RAG is well-founded *} |
|
2200 |
||
2201 |
context valid_trace |
|
2202 |
begin |
|
2203 |
||
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
|
2204 |
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
|
2205 |
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
|
2206 |
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
|
2207 |
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
|
2208 |
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
|
2209 |
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
|
2210 |
|
100 | 2211 |
lemma wf_RAG_converse: |
2212 |
shows "wf ((RAG s)^-1)" |
|
2213 |
proof(rule finite_acyclic_wf_converse) |
|
2214 |
from finite_RAG |
|
2215 |
show "finite (RAG s)" . |
|
2216 |
next |
|
2217 |
from acyclic_RAG |
|
2218 |
show "acyclic (RAG s)" . |
|
2219 |
qed |
|
2220 |
||
2221 |
end |
|
2222 |
||
2223 |
section {* RAG forms a forest (or tree) *} |
|
2224 |
||
2225 |
context valid_trace |
|
2226 |
begin |
|
2227 |
||
2228 |
lemma rtree_RAG: "rtree (RAG s)" |
|
2229 |
using sgv_RAG acyclic_RAG |
|
2230 |
by (unfold rtree_def rtree_axioms_def sgv_def, auto) |
|
2231 |
||
2232 |
end |
|
2233 |
||
2234 |
sublocale valid_trace < rtree_RAG: rtree "RAG s" |
|
2235 |
using rtree_RAG . |
|
2236 |
||
2237 |
sublocale valid_trace < fsbtRAGs : fsubtree "RAG s" |
|
2238 |
proof - |
|
2239 |
show "fsubtree (RAG s)" |
|
2240 |
proof(intro_locales) |
|
2241 |
show "fbranch (RAG s)" using finite_fbranchI[OF finite_RAG] . |
|
2242 |
next |
|
2243 |
show "fsubtree_axioms (RAG s)" |
|
2244 |
proof(unfold fsubtree_axioms_def) |
|
2245 |
from wf_RAG show "wf (RAG s)" . |
|
2246 |
qed |
|
2247 |
qed |
|
2248 |
qed |
|
2249 |
||
2250 |
section {* Derived properties for parts of RAG *} |
|
2251 |
||
2252 |
context valid_trace |
|
2253 |
begin |
|
2254 |
||
2255 |
lemma acyclic_tRAG: "acyclic (tRAG s)" |
|
2256 |
proof(unfold tRAG_def, rule acyclic_compose) |
|
2257 |
show "acyclic (RAG s)" using acyclic_RAG . |
|
2258 |
next |
|
2259 |
show "wRAG s \<subseteq> RAG s" unfolding RAG_split by auto |
|
2260 |
next |
|
2261 |
show "hRAG s \<subseteq> RAG s" unfolding RAG_split by auto |
|
2262 |
qed |
|
2263 |
||
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
|
2264 |
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
|
2265 |
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
|
2266 |
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
|
2267 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2269 |
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
|
2270 |
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
|
2271 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2273 |
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
|
2274 |
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
|
2275 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2277 |
|
4763aa246dbd
Original files overwrite by 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 |
sublocale valid_trace < rtree_s: rtree "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
|
2279 |
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
|
2280 |
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
|
2281 |
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
|
2282 |
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
|
2283 |
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
|
2284 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2285 |
sublocale valid_trace < fsbttRAGs: fsubtree "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
|
2286 |
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
|
2287 |
have "fsubtree (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
|
2288 |
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
|
2289 |
have "fbranch (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
|
2290 |
proof(unfold tRAG_def, rule fbranch_compose) |
4763aa246dbd
Original files overwrite by 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 |
show "fbranch (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
|
2292 |
proof(rule finite_fbranchI) |
4763aa246dbd
Original files overwrite by 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 |
from finite_RAG show "finite (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
|
2294 |
by (unfold RAG_split, 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
|
2295 |
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
|
2296 |
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
|
2297 |
show "fbranch (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
|
2298 |
proof(rule finite_fbranchI) |
4763aa246dbd
Original files overwrite by 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 |
from finite_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
|
2300 |
show "finite (hRAG s)" by (unfold RAG_split, 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
|
2301 |
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
|
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 |
moreover have "wf (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
|
2304 |
proof(rule wf_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
|
2305 |
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
|
2306 |
by (fold wf_comp_self, 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
|
2307 |
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
|
2308 |
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
|
2309 |
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
|
2310 |
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
|
2311 |
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
|
2312 |
by (unfold fsubtree_def fsubtree_axioms_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
|
2313 |
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
|
2314 |
from this[folded tRAG_def] show "fsubtree (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
|
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 |
|
4763aa246dbd
Original files overwrite by 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 |
|
100 | 2318 |
(* ccc *) |
2319 |
||
2320 |
context valid_trace_p |
|
2321 |
begin |
|
2322 |
||
2323 |
lemma ready_th_s: "th \<in> readys s" |
|
2324 |
using runing_th_s |
|
2325 |
by (unfold runing_def, auto) |
|
2326 |
||
2327 |
lemma live_th_s: "th \<in> threads s" |
|
2328 |
using readys_threads ready_th_s by auto |
|
2329 |
||
2330 |
lemma live_th_es: "th \<in> threads (e#s)" |
|
2331 |
using live_th_s |
|
2332 |
by (unfold is_p, simp) |
|
2333 |
||
2334 |
||
2335 |
lemma waiting_neq_th: |
|
2336 |
assumes "waiting s t c" |
|
2337 |
shows "t \<noteq> th" |
|
2338 |
using assms using th_not_waiting by blast |
|
2339 |
||
2340 |
end |
|
2341 |
||
2342 |
context valid_trace_v |
|
2343 |
begin |
|
2344 |
||
2345 |
lemma th_not_waiting: |
|
2346 |
"\<not> waiting s th c" |
|
2347 |
proof - |
|
2348 |
have "th \<in> readys s" |
|
2349 |
using runing_ready runing_th_s by blast |
|
2350 |
thus ?thesis |
|
2351 |
by (unfold readys_def, auto) |
|
2352 |
qed |
|
2353 |
||
2354 |
lemma waiting_neq_th: |
|
2355 |
assumes "waiting s t c" |
|
2356 |
shows "t \<noteq> th" |
|
2357 |
using assms using th_not_waiting by blast |
|
2358 |
||
2359 |
end |
|
2360 |
||
2361 |
||
2362 |
context valid_trace_e |
|
2363 |
begin |
|
2364 |
||
2365 |
lemma actor_inv: |
|
2366 |
assumes "\<not> isCreate e" |
|
2367 |
shows "actor e \<in> runing s" |
|
2368 |
using pip_e assms |
|
2369 |
by (induct, auto) |
|
2370 |
||
2371 |
end |
|
2372 |
||
2373 |
||
2374 |
(* ccc *) |
|
2375 |
||
2376 |
(* drag more from before to here *) |
|
2377 |
||
2378 |
||
2379 |
section {* ccc *} |
|
2380 |
||
2381 |
||
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
|
2382 |
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
|
2383 |
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
|
2384 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2385 |
lemma finite_subtree_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
|
2386 |
"finite {th'. Th th' \<in> subtree (RAG s) (Th th)}" (is "finite ?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
|
2387 |
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
|
2388 |
have "?A = the_thread ` {Th th' | th' . Th th' \<in> subtree (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
|
2389 |
by (auto, insert image_iff, 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
|
2390 |
moreover have "finite {Th th' | th' . Th th' \<in> subtree (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
|
2391 |
(is "finite ?B") |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2392 |
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
|
2393 |
have "?B = (subtree (RAG s) (Th th)) \<inter> {Th th' | th'. 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
|
2394 |
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
|
2395 |
moreover have "... \<subseteq> (subtree (RAG s) (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
|
2396 |
moreover have "finite ..." by (simp add: fsbtRAGs.finite_subtree) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2397 |
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
|
2398 |
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
|
2399 |
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
|
2400 |
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
|
2401 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2402 |
lemma le_cp: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2403 |
shows "preced th s \<le> cp 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
|
2404 |
proof(unfold cp_alt_def, rule Max_ge) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2405 |
show "finite (the_preced s ` {th'. Th th' \<in> subtree (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
|
2406 |
by (simp add: finite_subtree_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
|
2407 |
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
|
2408 |
show "preced th s \<in> the_preced s ` {th'. Th th' \<in> subtree (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
|
2409 |
by (simp add: subtree_def the_preced_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
|
2410 |
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
|
2411 |
|
100 | 2412 |
lemma finite_threads: |
99 | 2413 |
shows "finite (threads s)" |
100 | 2414 |
using vt by (induct) (auto elim: step.cases) |
99 | 2415 |
|
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
|
2416 |
lemma cp_le: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2417 |
assumes th_in: "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
|
2418 |
shows "cp s th \<le> Max (the_preced s ` 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
|
2419 |
proof(unfold cp_alt_def, rule Max_f_mono) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2420 |
show "finite (threads s)" by (simp add: finite_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
|
2421 |
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
|
2422 |
show " {th'. Th th' \<in> subtree (RAG s) (Th th)} \<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
|
2423 |
using subtree_def 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
|
2424 |
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
|
2425 |
show "{th'. Th th' \<in> subtree (RAG s) (Th th)} \<subseteq> 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
|
2426 |
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
|
2427 |
by (smt Domain.DomainI dm_RAG_threads mem_Collect_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
|
2428 |
node.inject(1) rtranclD subsetI subtree_def trancl_domain) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2429 |
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
|
2430 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2431 |
lemma max_cp_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
|
2432 |
shows "Max ((cp s) ` threads s) = Max (the_preced s ` 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
|
2433 |
(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
|
2434 |
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
|
2435 |
have "?L \<le> ?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
|
2436 |
proof(cases "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
|
2437 |
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
|
2438 |
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
|
2439 |
by (rule Max.boundedI, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2440 |
insert cp_le, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2441 |
auto simp:finite_threads 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
|
2442 |
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
|
2443 |
moreover have "?R \<le> ?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
|
2444 |
by (rule Max_fg_mono, |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2445 |
simp add: finite_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
|
2446 |
simp add: le_cp the_preced_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
|
2447 |
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
|
2448 |
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
|
2449 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2450 |
lemma chain_building: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2451 |
assumes "node \<in> Domain (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
|
2452 |
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
|
2453 |
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
|
2454 |
from assms have "node \<in> Range ((RAG s)^-1)" 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
|
2455 |
from wf_base[OF wf_RAG_converse 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
|
2456 |
obtain b where h_b: "(b, node) \<in> ((RAG s)\<inverse>)\<^sup>+" "\<forall>c. (c, b) \<notin> (RAG s)\<inverse>" 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
|
2457 |
obtain th' where eq_b: "b = 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
|
2458 |
proof(cases b) |
4763aa246dbd
Original files overwrite by 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 |
case (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
|
2460 |
from h_b(1)[unfolded trancl_converse] |
4763aa246dbd
Original files overwrite by 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 |
have "(node, b) \<in> ((RAG s)\<^sup>+)" 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
|
2462 |
from tranclE[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
|
2463 |
obtain n where "(n, b) \<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
|
2464 |
from this[unfolded 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
|
2465 |
obtain th1 where "waiting s th1 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
|
2466 |
by (unfold s_RAG_def, fold waiting_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
|
2467 |
from waiting_holding[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
|
2468 |
obtain th2 where "holding s th2 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
|
2469 |
hence "(Cs cs, Th th2) \<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
|
2470 |
by (unfold s_RAG_def, fold holding_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
|
2471 |
with h_b(2)[unfolded Cs, rule_format] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2472 |
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
|
2473 |
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
|
2474 |
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
|
2475 |
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
|
2476 |
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
|
2477 |
from h_b(2)[unfolded eq_b] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2478 |
have "\<forall>cs. \<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
|
2479 |
by (unfold s_RAG_def, fold waiting_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
|
2480 |
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
|
2481 |
proof(rule rg_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
|
2482 |
from tranclD[OF h_b(1), unfolded eq_b] |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2483 |
obtain z where "(z, 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
|
2484 |
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
|
2485 |
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
|
2486 |
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
|
2487 |
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
|
2488 |
moreover have "(node, 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
|
2489 |
using h_b(1)[unfolded trancl_converse] eq_b 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
|
2490 |
ultimately show ?thesis using that by metis |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2491 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2492 |
|
53
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
2493 |
text {* \noindent |
8142e80f5d58
Finished comments on PrioGDef.thy
xingyuan zhang <xingyuanzhang@126.com>
parents:
44
diff
changeset
|
2494 |
The following is just an instance of @{text "chain_building"}. |
100 | 2495 |
*} |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2496 |
lemma th_chain_to_ready: |
63 | 2497 |
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
|
2498 |
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
|
2499 |
proof(cases "th \<in> readys s") |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2500 |
case True |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2501 |
thus ?thesis by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2502 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2503 |
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
|
2504 |
from False and th_in have "Th th \<in> Domain (RAG s)" |
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
|
2505 |
by (auto simp:readys_def s_waiting_def s_RAG_def wq_def cs_waiting_def Domain_def) |
63 | 2506 |
from chain_building [rule_format, OF this] |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2507 |
show ?thesis by auto |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2508 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2509 |
|
63 | 2510 |
end |
2511 |
||
67 | 2512 |
lemma count_rec1 [simp]: |
2513 |
assumes "Q e" |
|
2514 |
shows "count Q (e#es) = Suc (count Q es)" |
|
2515 |
using assms |
|
2516 |
by (unfold count_def, auto) |
|
2517 |
||
2518 |
lemma count_rec2 [simp]: |
|
2519 |
assumes "\<not>Q e" |
|
2520 |
shows "count Q (e#es) = (count Q es)" |
|
2521 |
using assms |
|
2522 |
by (unfold count_def, auto) |
|
2523 |
||
2524 |
lemma count_rec3 [simp]: |
|
2525 |
shows "count Q [] = 0" |
|
2526 |
by (unfold count_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
|
2527 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2528 |
lemma cntP_simp1[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
|
2529 |
"cntP (P th cs'#s) th = cntP 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
|
2530 |
by (unfold cntP_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
|
2531 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2532 |
lemma cntP_simp2[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
|
2533 |
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
|
2534 |
shows "cntP (P th cs'#s) th' = cntP 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
|
2535 |
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
|
2536 |
by (unfold cntP_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
|
2537 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2538 |
lemma cntP_simp3[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
|
2539 |
assumes "\<not> isP 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
|
2540 |
shows "cntP (e#s) th' = cntP 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
|
2541 |
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
|
2542 |
by (unfold cntP_def, cases e, 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
|
2543 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2544 |
lemma cntV_simp1[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
|
2545 |
"cntV (V th cs'#s) th = cntV 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
|
2546 |
by (unfold cntV_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
|
2547 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2548 |
lemma cntV_simp2[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
|
2549 |
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
|
2550 |
shows "cntV (V th cs'#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
|
2551 |
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
|
2552 |
by (unfold cntV_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
|
2553 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2554 |
lemma cntV_simp3[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
|
2555 |
assumes "\<not> isV 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
|
2556 |
shows "cntV (e#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
|
2557 |
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
|
2558 |
by (unfold cntV_def, cases e, 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
|
2559 |
|
67 | 2560 |
lemma cntP_diff_inv: |
2561 |
assumes "cntP (e#s) th \<noteq> cntP s th" |
|
2562 |
shows "isP e \<and> actor e = th" |
|
2563 |
proof(cases e) |
|
2564 |
case (P th' pty) |
|
2565 |
show ?thesis |
|
2566 |
by (cases "(\<lambda>e. \<exists>cs. e = P th cs) (P th' pty)", |
|
2567 |
insert assms P, auto simp:cntP_def) |
|
2568 |
qed (insert assms, auto simp:cntP_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
|
2569 |
|
67 | 2570 |
lemma cntV_diff_inv: |
2571 |
assumes "cntV (e#s) th \<noteq> cntV s th" |
|
2572 |
shows "isV e \<and> actor e = th" |
|
2573 |
proof(cases e) |
|
2574 |
case (V th' pty) |
|
2575 |
show ?thesis |
|
2576 |
by (cases "(\<lambda>e. \<exists>cs. e = V th cs) (V th' pty)", |
|
2577 |
insert assms V, auto simp:cntV_def) |
|
2578 |
qed (insert assms, auto simp:cntV_def) |
|
2579 |
||
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
|
2580 |
lemma children_RAG_alt_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
|
2581 |
"children (RAG (s::state)) (Th th) = Cs ` {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
|
2582 |
by (unfold s_RAG_def, auto simp:children_def holding_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
|
2583 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2584 |
lemma holdents_alt_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
|
2585 |
"holdents s th = the_cs ` (children (RAG (s::state)) (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
|
2586 |
by (unfold children_RAG_alt_def holdents_def, simp add: image_image) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2587 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2588 |
lemma cntCS_alt_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
|
2589 |
"cntCS s th = card (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
|
2590 |
apply (unfold children_RAG_alt_def cntCS_def 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
|
2591 |
by (rule card_image[symmetric], auto simp:inj_on_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
|
2592 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2593 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2594 |
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
|
2595 |
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
|
2596 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2597 |
lemma holding_s_holder: "holding s holder 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
|
2598 |
by (unfold s_holding_def, fold wq_def, unfold wq_s_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
|
2599 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2600 |
lemma holding_es_holder: "holding (e#s) holder 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
|
2601 |
by (unfold s_holding_def, fold wq_def, unfold wq_es_cs wq_s_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
|
2602 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2603 |
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
|
2604 |
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
|
2605 |
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
|
2606 |
{ 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
|
2607 |
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
|
2608 |
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
|
2609 |
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
|
2610 |
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
|
2611 |
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
|
2612 |
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
|
2613 |
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
|
2614 |
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
|
2615 |
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
|
2616 |
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
|
2617 |
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
|
2618 |
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
|
2619 |
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
|
2620 |
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
|
2621 |
by (unfold s_holding_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
|
2622 |
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
|
2623 |
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
|
2624 |
} 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
|
2625 |
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
|
2626 |
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
|
2627 |
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
|
2628 |
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
|
2629 |
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
|
2630 |
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
|
2631 |
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
|
2632 |
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
|
2633 |
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
|
2634 |
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
|
2635 |
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
|
2636 |
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
|
2637 |
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
|
2638 |
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
|
2639 |
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
|
2640 |
by (unfold s_holding_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
|
2641 |
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
|
2642 |
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
|
2643 |
} 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
|
2644 |
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
|
2645 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2646 |
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
|
2647 |
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
|
2648 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2649 |
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
|
2650 |
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
|
2651 |
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
|
2652 |
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
|
2653 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2654 |
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
|
2655 |
|
100 | 2656 |
lemma (in valid_trace) finite_holdents: "finite (holdents s th)" |
2657 |
by (unfold holdents_alt_def, insert fsbtRAGs.finite_children, auto) |
|
2658 |
||
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
|
2659 |
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
|
2660 |
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
|
2661 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2662 |
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
|
2663 |
"\<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
|
2664 |
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
|
2665 |
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
|
2666 |
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
|
2667 |
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
|
2668 |
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
|
2669 |
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
|
2670 |
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
|
2671 |
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
|
2672 |
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
|
2673 |
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
|
2674 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2675 |
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
|
2676 |
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
|
2677 |
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
|
2678 |
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
|
2679 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2680 |
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
|
2681 |
"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
|
2682 |
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
|
2683 |
{ 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
|
2684 |
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
|
2685 |
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
|
2686 |
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
|
2687 |
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
|
2688 |
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
|
2689 |
} 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
|
2690 |
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
|
2691 |
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
|
2692 |
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
|
2693 |
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
|
2694 |
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
|
2695 |
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
|
2696 |
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
|
2697 |
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
|
2698 |
show ?thesis by (auto simp:holdents_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2699 |
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
|
2700 |
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
|
2701 |
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
|
2702 |
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
|
2703 |
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
|
2704 |
} 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
|
2705 |
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
|
2706 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2707 |
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
|
2708 |
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
|
2709 |
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
|
2710 |
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
|
2711 |
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
|
2712 |
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
|
2713 |
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
|
2714 |
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
|
2715 |
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
|
2716 |
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
|
2717 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2718 |
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
|
2719 |
"\<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
|
2720 |
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
|
2721 |
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
|
2722 |
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
|
2723 |
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
|
2724 |
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
|
2725 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2726 |
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
|
2727 |
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
|
2728 |
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
|
2729 |
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
|
2730 |
{ 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
|
2731 |
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
|
2732 |
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
|
2733 |
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
|
2734 |
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
|
2735 |
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
|
2736 |
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
|
2737 |
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
|
2738 |
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
|
2739 |
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
|
2740 |
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
|
2741 |
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
|
2742 |
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
|
2743 |
by (unfold holdents_def s_holding_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
|
2744 |
} 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
|
2745 |
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
|
2746 |
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
|
2747 |
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
|
2748 |
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
|
2749 |
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
|
2750 |
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
|
2751 |
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
|
2752 |
} 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
|
2753 |
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
|
2754 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2755 |
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
|
2756 |
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
|
2757 |
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
|
2758 |
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
|
2759 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2760 |
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
|
2761 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2762 |
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
|
2763 |
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
|
2764 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2765 |
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
|
2766 |
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
|
2767 |
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
|
2768 |
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
|
2769 |
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
|
2770 |
{ 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
|
2771 |
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
|
2772 |
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
|
2773 |
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
|
2774 |
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
|
2775 |
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
|
2776 |
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
|
2777 |
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
|
2778 |
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
|
2779 |
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
|
2780 |
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
|
2781 |
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
|
2782 |
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
|
2783 |
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
|
2784 |
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
|
2785 |
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
|
2786 |
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
|
2787 |
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
|
2788 |
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
|
2789 |
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
|
2790 |
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
|
2791 |
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
|
2792 |
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
|
2793 |
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
|
2794 |
} 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
|
2795 |
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
|
2796 |
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
|
2797 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2798 |
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
|
2799 |
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
|
2800 |
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
|
2801 |
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
|
2802 |
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
|
2803 |
{ 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
|
2804 |
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
|
2805 |
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
|
2806 |
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
|
2807 |
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
|
2808 |
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
|
2809 |
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
|
2810 |
with n_wait wait |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2811 |
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
|
2812 |
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
|
2813 |
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
|
2814 |
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
|
2815 |
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
|
2816 |
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
|
2817 |
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
|
2818 |
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
|
2819 |
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
|
2820 |
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
|
2821 |
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
|
2822 |
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
|
2823 |
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
|
2824 |
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
|
2825 |
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
|
2826 |
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
|
2827 |
} 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
|
2828 |
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
|
2829 |
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
|
2830 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2832 |
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
|
2833 |
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
|
2834 |
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
|
2835 |
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
|
2836 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2838 |
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
|
2839 |
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
|
2840 |
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
|
2841 |
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
|
2842 |
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
|
2843 |
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
|
2844 |
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
|
2845 |
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
|
2846 |
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
|
2847 |
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
|
2848 |
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
|
2849 |
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
|
2850 |
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
|
2851 |
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
|
2852 |
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
|
2853 |
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
|
2854 |
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
|
2855 |
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
|
2856 |
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
|
2857 |
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
|
2858 |
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
|
2859 |
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
|
2860 |
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
|
2861 |
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
|
2862 |
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
|
2863 |
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
|
2864 |
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
|
2865 |
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
|
2866 |
by (insert True 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
|
2867 |
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
|
2868 |
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
|
2869 |
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
|
2870 |
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
|
2871 |
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
|
2872 |
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
|
2873 |
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
|
2874 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2876 |
|
4763aa246dbd
Original files overwrite by 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 |
|
100 | 2878 |
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
|
2879 |
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
|
2880 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2882 |
"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
|
2883 |
by (unfold s_holding_def, fold wq_def, unfold wq_s_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
|
2884 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2886 |
using runing_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
|
2887 |
by (unfold runing_def 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
|
2888 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2890 |
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
|
2891 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma th_ready_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
|
2893 |
using runing_th_s 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
|
2894 |
by (unfold is_v runing_def 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
|
2895 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2897 |
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
|
2898 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2900 |
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
|
2901 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2903 |
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
|
2904 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2906 |
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
|
2907 |
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
|
2908 |
by (unfold holdents_def, simp) |
100 | 2909 |
moreover have "finite (holdents s th)" using finite_holdents (* ccc *) |
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
|
2910 |
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
|
2911 |
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
|
2912 |
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
|
2913 |
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
|
2914 |
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
|
2915 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2917 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2919 |
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
|
2920 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2922 |
"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
|
2923 |
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
|
2924 |
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
|
2925 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2927 |
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
|
2928 |
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
|
2929 |
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
|
2930 |
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
|
2931 |
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
|
2932 |
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
|
2933 |
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
|
2934 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2936 |
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
|
2937 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
2938 |
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
|
2939 |
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
|
2940 |
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
|
2941 |
{ 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
|
2942 |
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
|
2943 |
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
|
2944 |
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
|
2945 |
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
|
2946 |
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
|
2947 |
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
|
2948 |
} 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
|
2949 |
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
|
2950 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma neq_taker_th: "taker \<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
|
2952 |
using th_not_waiting waiting_taker 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
|
2953 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2955 |
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
|
2956 |
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
|
2957 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2959 |
"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
|
2960 |
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
|
2961 |
{ 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
|
2962 |
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
|
2963 |
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
|
2964 |
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
|
2965 |
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
|
2966 |
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
|
2967 |
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
|
2968 |
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
|
2969 |
} 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
|
2970 |
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
|
2971 |
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
|
2972 |
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
|
2973 |
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
|
2974 |
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
|
2975 |
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
|
2976 |
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
|
2977 |
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
|
2978 |
thus ?thesis by (auto simp:holdents_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2979 |
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
|
2980 |
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
|
2981 |
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
|
2982 |
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
|
2983 |
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
|
2984 |
} 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
|
2985 |
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
|
2986 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2988 |
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
|
2989 |
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
|
2990 |
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
|
2991 |
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
|
2992 |
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
|
2993 |
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
|
2994 |
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
|
2995 |
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
|
2996 |
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
|
2997 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
2999 |
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
|
3000 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3001 |
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
|
3002 |
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
|
3003 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
3005 |
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
|
3006 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3007 |
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
|
3008 |
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
|
3009 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3010 |
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
|
3011 |
"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
|
3012 |
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
|
3013 |
{ 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
|
3014 |
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
|
3015 |
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
|
3016 |
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
|
3017 |
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
|
3018 |
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
|
3019 |
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
|
3020 |
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
|
3021 |
} 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
|
3022 |
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
|
3023 |
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
|
3024 |
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
|
3025 |
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
|
3026 |
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
|
3027 |
} 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
|
3028 |
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
|
3029 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3030 |
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
|
3031 |
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
|
3032 |
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
|
3033 |
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
|
3034 |
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
|
3035 |
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
|
3036 |
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
|
3037 |
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
|
3038 |
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
|
3039 |
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
|
3040 |
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
|
3041 |
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
|
3042 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
3044 |
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
|
3045 |
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
|
3046 |
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
|
3047 |
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
|
3048 |
{ 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
|
3049 |
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
|
3050 |
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
|
3051 |
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
|
3052 |
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
|
3053 |
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
|
3054 |
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
|
3055 |
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
|
3056 |
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
|
3057 |
by (unfold holdents_def s_holding_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
|
3058 |
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
|
3059 |
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
|
3060 |
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
|
3061 |
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
|
3062 |
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
|
3063 |
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
|
3064 |
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
|
3065 |
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
|
3066 |
} 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
|
3067 |
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
|
3068 |
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
|
3069 |
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
|
3070 |
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
|
3071 |
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
|
3072 |
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
|
3073 |
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
|
3074 |
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
|
3075 |
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
|
3076 |
by (unfold holdents_def s_holding_def, fold wq_def, insert eq_wq, 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
|
3077 |
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
|
3078 |
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
|
3079 |
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
|
3080 |
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
|
3081 |
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
|
3082 |
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
|
3083 |
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
|
3084 |
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
|
3085 |
} 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
|
3086 |
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
|
3087 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3088 |
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
|
3089 |
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
|
3090 |
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
|
3091 |
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
|
3092 |
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
|
3093 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3094 |
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
|
3095 |
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
|
3096 |
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
|
3097 |
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
|
3098 |
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
|
3099 |
{ 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
|
3100 |
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
|
3101 |
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
|
3102 |
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
|
3103 |
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
|
3104 |
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
|
3105 |
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
|
3106 |
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
|
3107 |
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
|
3108 |
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
|
3109 |
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
|
3110 |
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
|
3111 |
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
|
3112 |
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
|
3113 |
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
|
3114 |
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
|
3115 |
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
|
3116 |
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
|
3117 |
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
|
3118 |
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
|
3119 |
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
|
3120 |
} 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
|
3121 |
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
|
3122 |
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
|
3123 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
3125 |
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
|
3126 |
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
|
3127 |
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
|
3128 |
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
|
3129 |
{ 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
|
3130 |
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
|
3131 |
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
|
3132 |
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
|
3133 |
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
|
3134 |
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
|
3135 |
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
|
3136 |
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
|
3137 |
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
|
3138 |
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
|
3139 |
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
|
3140 |
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
|
3141 |
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
|
3142 |
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
|
3143 |
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
|
3144 |
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
|
3145 |
using n_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
|
3146 |
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
|
3147 |
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
|
3148 |
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
|
3149 |
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
|
3150 |
} 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
|
3151 |
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
|
3152 |
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
|
3153 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3154 |
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
|
3155 |
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
|
3156 |
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
|
3157 |
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
|
3158 |
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
|
3159 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3160 |
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
|
3161 |
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
|
3162 |
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
|
3163 |
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
|
3164 |
{ 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
|
3165 |
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
|
3166 |
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
|
3167 |
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
|
3168 |
} 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
|
3169 |
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
|
3170 |
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
|
3171 |
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
|
3172 |
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
|
3173 |
} 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
|
3174 |
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
|
3175 |
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
|
3176 |
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
|
3177 |
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
|
3178 |
} 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
|
3179 |
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
|
3180 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3181 |
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
|
3182 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3183 |
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
|
3184 |
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
|
3185 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3186 |
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
|
3187 |
"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
|
3188 |
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
|
3189 |
{ 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
|
3190 |
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
|
3191 |
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
|
3192 |
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
|
3193 |
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
|
3194 |
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
|
3195 |
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
|
3196 |
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
|
3197 |
} 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
|
3198 |
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
|
3199 |
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
|
3200 |
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
|
3201 |
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
|
3202 |
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
|
3203 |
} 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
|
3204 |
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
|
3205 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3206 |
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
|
3207 |
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
|
3208 |
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
|
3209 |
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
|
3210 |
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
|
3211 |
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
|
3212 |
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
|
3213 |
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
|
3214 |
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
|
3215 |
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
|
3216 |
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
|
3217 |
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
|
3218 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3219 |
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
|
3220 |
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
|
3221 |
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
|
3222 |
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
|
3223 |
{ 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
|
3224 |
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
|
3225 |
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
|
3226 |
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
|
3227 |
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
|
3228 |
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
|
3229 |
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
|
3230 |
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
|
3231 |
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
|
3232 |
by (unfold holdents_def s_holding_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
|
3233 |
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
|
3234 |
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
|
3235 |
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
|
3236 |
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
|
3237 |
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
|
3238 |
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
|
3239 |
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
|
3240 |
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
|
3241 |
} 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
|
3242 |
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
|
3243 |
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
|
3244 |
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
|
3245 |
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
|
3246 |
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
|
3247 |
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
|
3248 |
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
|
3249 |
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
|
3250 |
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
|
3251 |
by (unfold holdents_def s_holding_def, fold wq_def, insert eq_wq, 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
|
3252 |
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
|
3253 |
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
|
3254 |
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
|
3255 |
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
|
3256 |
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
|
3257 |
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
|
3258 |
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
|
3259 |
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
|
3260 |
} 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
|
3261 |
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
|
3262 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3263 |
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
|
3264 |
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
|
3265 |
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
|
3266 |
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
|
3267 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3268 |
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
|
3269 |
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
|
3270 |
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
|
3271 |
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
|
3272 |
{ 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
|
3273 |
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
|
3274 |
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
|
3275 |
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
|
3276 |
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
|
3277 |
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
|
3278 |
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
|
3279 |
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
|
3280 |
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
|
3281 |
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
|
3282 |
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
|
3283 |
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
|
3284 |
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
|
3285 |
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
|
3286 |
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
|
3287 |
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
|
3288 |
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
|
3289 |
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
|
3290 |
} 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
|
3291 |
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
|
3292 |
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
|
3293 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3294 |
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
|
3295 |
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
|
3296 |
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
|
3297 |
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
|
3298 |
{ 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
|
3299 |
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
|
3300 |
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
|
3301 |
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
|
3302 |
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
|
3303 |
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
|
3304 |
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
|
3305 |
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
|
3306 |
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
|
3307 |
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
|
3308 |
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
|
3309 |
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
|
3310 |
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
|
3311 |
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
|
3312 |
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
|
3313 |
thus ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3314 |
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
|
3315 |
} 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
|
3316 |
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
|
3317 |
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
|
3318 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3319 |
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
|
3320 |
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
|
3321 |
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
|
3322 |
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
|
3323 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3324 |
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
|
3325 |
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
|
3326 |
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
|
3327 |
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
|
3328 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3329 |
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
|
3330 |
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
|
3331 |
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
|
3332 |
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
|
3333 |
} 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
|
3334 |
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
|
3335 |
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
|
3336 |
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
|
3337 |
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
|
3338 |
} 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
|
3339 |
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
|
3340 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3341 |
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
|
3342 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3343 |
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
|
3344 |
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
|
3345 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3346 |
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
|
3347 |
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
|
3348 |
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
|
3349 |
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
|
3350 |
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
|
3351 |
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
|
3352 |
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
|
3353 |
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
|
3354 |
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
|
3355 |
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
|
3356 |
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
|
3357 |
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
|
3358 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3359 |
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
|
3360 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3361 |
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
|
3362 |
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
|
3363 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3364 |
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
|
3365 |
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
|
3366 |
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
|
3367 |
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
|
3368 |
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
|
3369 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3370 |
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
|
3371 |
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
|
3372 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3373 |
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
|
3374 |
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
|
3375 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3376 |
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
|
3377 |
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
|
3378 |
assume "waiting s th cs'" |
99 | 3379 |
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
|
3380 |
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
|
3381 |
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
|
3382 |
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
|
3383 |
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
|
3384 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3385 |
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
|
3386 |
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
|
3387 |
assume "holding s th cs'" |
99 | 3388 |
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
|
3389 |
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
|
3390 |
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
|
3391 |
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
|
3392 |
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
|
3393 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3394 |
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
|
3395 |
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
|
3396 |
assume "waiting (e # s) th cs'" |
99 | 3397 |
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
|
3398 |
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
|
3399 |
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
|
3400 |
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
|
3401 |
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
|
3402 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3403 |
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
|
3404 |
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
|
3405 |
assume "holding (e # s) th cs'" |
99 | 3406 |
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
|
3407 |
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
|
3408 |
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
|
3409 |
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
|
3410 |
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
|
3411 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3412 |
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
|
3413 |
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
|
3414 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3415 |
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
|
3416 |
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
|
3417 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3418 |
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
|
3419 |
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
|
3420 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3421 |
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
|
3422 |
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
|
3423 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3424 |
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
|
3425 |
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
|
3426 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3427 |
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
|
3428 |
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
|
3429 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3430 |
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
|
3431 |
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
|
3432 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3433 |
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
|
3434 |
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
|
3435 |
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
|
3436 |
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
|
3437 |
{ 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
|
3438 |
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
|
3439 |
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
|
3440 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3441 |
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
|
3442 |
} 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
|
3443 |
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
|
3444 |
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
|
3445 |
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
|
3446 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3447 |
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
|
3448 |
} 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
|
3449 |
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
|
3450 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3451 |
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
|
3452 |
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
|
3453 |
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
|
3454 |
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
|
3455 |
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
|
3456 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3457 |
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
|
3458 |
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
|
3459 |
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
|
3460 |
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
|
3461 |
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
|
3462 |
{ 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
|
3463 |
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
|
3464 |
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
|
3465 |
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
|
3466 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 3467 |
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
|
3468 |
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
|
3469 |
} 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
|
3470 |
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
|
3471 |
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
|
3472 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3473 |
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
|
3474 |
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
|
3475 |
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
|
3476 |
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
|
3477 |
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
|
3478 |
{ 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
|
3479 |
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
|
3480 |
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
|
3481 |
using assms(2) by (auto simp:readys_def) |
99 | 3482 |
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
|
3483 |
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
|
3484 |
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
|
3485 |
} 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
|
3486 |
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
|
3487 |
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
|
3488 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3489 |
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
|
3490 |
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
|
3491 |
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
|
3492 |
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
|
3493 |
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
|
3494 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3495 |
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
|
3496 |
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
|
3497 |
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
|
3498 |
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
|
3499 |
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
|
3500 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3501 |
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
|
3502 |
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
|
3503 |
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
|
3504 |
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
|
3505 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3506 |
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
|
3507 |
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
|
3508 |
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
|
3509 |
} 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
|
3510 |
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
|
3511 |
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
|
3512 |
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
|
3513 |
} 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
|
3514 |
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
|
3515 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3516 |
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
|
3517 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3518 |
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
|
3519 |
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
|
3520 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3521 |
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
|
3522 |
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
|
3523 |
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
|
3524 |
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
|
3525 |
by (cases, unfold runing_def 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
|
3526 |
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
|
3527 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3528 |
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
|
3529 |
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
|
3530 |
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
|
3531 |
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
|
3532 |
by (cases, unfold runing_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
|
3533 |
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
|
3534 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3535 |
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
|
3536 |
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
|
3537 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3538 |
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
|
3539 |
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
|
3540 |
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
|
3541 |
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
|
3542 |
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
|
3543 |
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
|
3544 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3545 |
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
|
3546 |
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
|
3547 |
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
|
3548 |
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
|
3549 |
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
|
3550 |
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
|
3551 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3552 |
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
|
3553 |
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
|
3554 |
assume "holding (e # s) th cs'" |
99 | 3555 |
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
|
3556 |
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
|
3557 |
by (unfold s_holding_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
|
3558 |
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
|
3559 |
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
|
3560 |
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
|
3561 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3562 |
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
|
3563 |
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
|
3564 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3565 |
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
|
3566 |
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
|
3567 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3568 |
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
|
3569 |
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
|
3570 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3571 |
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
|
3572 |
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
|
3573 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3574 |
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
|
3575 |
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
|
3576 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3577 |
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
|
3578 |
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
|
3579 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3580 |
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
|
3581 |
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
|
3582 |
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
|
3583 |
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
|
3584 |
{ 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
|
3585 |
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
|
3586 |
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
|
3587 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3588 |
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
|
3589 |
} 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
|
3590 |
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
|
3591 |
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
|
3592 |
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
|
3593 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3594 |
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
|
3595 |
} 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
|
3596 |
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
|
3597 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3598 |
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
|
3599 |
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
|
3600 |
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
|
3601 |
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
|
3602 |
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
|
3603 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3604 |
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
|
3605 |
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
|
3606 |
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
|
3607 |
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
|
3608 |
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
|
3609 |
{ 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
|
3610 |
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
|
3611 |
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
|
3612 |
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
|
3613 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 3614 |
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
|
3615 |
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
|
3616 |
} 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
|
3617 |
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
|
3618 |
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
|
3619 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3620 |
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
|
3621 |
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
|
3622 |
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
|
3623 |
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
|
3624 |
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
|
3625 |
{ 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
|
3626 |
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
|
3627 |
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
|
3628 |
using assms(2) by (auto simp:readys_def) |
99 | 3629 |
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
|
3630 |
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
|
3631 |
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
|
3632 |
} 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
|
3633 |
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
|
3634 |
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
|
3635 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3636 |
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
|
3637 |
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
|
3638 |
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
|
3639 |
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
|
3640 |
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
|
3641 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3642 |
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
|
3643 |
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
|
3644 |
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
|
3645 |
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
|
3646 |
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
|
3647 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3648 |
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
|
3649 |
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
|
3650 |
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
|
3651 |
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
|
3652 |
{ |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3653 |
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
|
3654 |
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
|
3655 |
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
|
3656 |
} 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
|
3657 |
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
|
3658 |
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
|
3659 |
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
|
3660 |
} 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
|
3661 |
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
|
3662 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3663 |
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
|
3664 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3665 |
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
|
3666 |
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
|
3667 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3668 |
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
|
3669 |
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
|
3670 |
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
|
3671 |
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
|
3672 |
by (cases, unfold runing_def 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
|
3673 |
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
|
3674 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3675 |
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
|
3676 |
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
|
3677 |
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
|
3678 |
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
|
3679 |
by (cases, unfold runing_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
|
3680 |
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
|
3681 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3682 |
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
|
3683 |
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
|
3684 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3685 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3686 |
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
|
3687 |
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
|
3688 |
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
|
3689 |
{ 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
|
3690 |
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
|
3691 |
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
|
3692 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3693 |
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
|
3694 |
} 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
|
3695 |
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
|
3696 |
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
|
3697 |
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
|
3698 |
by (unfold holdents_def s_holding_def, fold wq_def, |
99 | 3699 |
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
|
3700 |
} 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
|
3701 |
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
|
3702 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3703 |
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
|
3704 |
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
|
3705 |
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
|
3706 |
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
|
3707 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3708 |
lemma threads_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
|
3709 |
"threads (e#s) = 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
|
3710 |
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
|
3711 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3712 |
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
|
3713 |
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
|
3714 |
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
|
3715 |
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
|
3716 |
{ 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
|
3717 |
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
|
3718 |
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
|
3719 |
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
|
3720 |
from wait[unfolded s_waiting_def, folded wq_def] |
99 | 3721 |
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
|
3722 |
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
|
3723 |
} 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
|
3724 |
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
|
3725 |
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
|
3726 |
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
|
3727 |
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
|
3728 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3729 |
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
|
3730 |
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
|
3731 |
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
|
3732 |
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
|
3733 |
{ 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
|
3734 |
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
|
3735 |
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
|
3736 |
using assms by (auto simp:readys_def) |
99 | 3737 |
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
|
3738 |
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
|
3739 |
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
|
3740 |
} 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
|
3741 |
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
|
3742 |
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
|
3743 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3744 |
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
|
3745 |
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
|
3746 |
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
|
3747 |
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
|
3748 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3749 |
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
|
3750 |
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
|
3751 |
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
|
3752 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3753 |
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
|
3754 |
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
|
3755 |
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
|
3756 |
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
|
3757 |
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
|
3758 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3759 |
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
|
3760 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3761 |
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
|
3762 |
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
|
3763 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3764 |
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
|
3765 |
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
|
3766 |
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
|
3767 |
thus ?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
|
3768 |
by (unfold cntP_def cntV_def pvD_def cntCS_def 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
|
3769 |
s_holding_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
|
3770 |
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
|
3771 |
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
|
3772 |
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
|
3773 |
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
|
3774 |
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
|
3775 |
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
|
3776 |
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
|
3777 |
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
|
3778 |
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
|
3779 |
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
|
3780 |
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
|
3781 |
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
|
3782 |
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
|
3783 |
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
|
3784 |
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
|
3785 |
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
|
3786 |
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
|
3787 |
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
|
3788 |
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
|
3789 |
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
|
3790 |
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
|
3791 |
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
|
3792 |
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
|
3793 |
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
|
3794 |
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
|
3795 |
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
|
3796 |
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
|
3797 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3798 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3799 |
|
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
|
3800 |
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
|
3801 |
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
|
3802 |
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
|
3803 |
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
|
3804 |
{ 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
|
3805 |
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
|
3806 |
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
|
3807 |
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
|
3808 |
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
|
3809 |
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
|
3810 |
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
|
3811 |
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
|
3812 |
} 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
|
3813 |
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
|
3814 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3815 |
lemma not_thread_cncs: |
63 | 3816 |
assumes not_in: "th \<notin> threads s" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3817 |
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
|
3818 |
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
|
3819 |
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
|
3820 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3821 |
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
|
3822 |
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
|
3823 |
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
|
3824 |
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
|
3825 |
by (auto) |
63 | 3826 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3827 |
lemma runing_unique: |
63 | 3828 |
assumes runing_1: "th1 \<in> runing s" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3829 |
and runing_2: "th2 \<in> runing s" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3830 |
shows "th1 = th2" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3831 |
proof - |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3832 |
from runing_1 and runing_2 have "cp s th1 = cp s th2" |
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
|
3833 |
unfolding runing_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
|
3834 |
from this[unfolded cp_alt_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
|
3835 |
have eq_max: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3836 |
"Max (the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th1)}) = |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3837 |
Max (the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th2)})" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3838 |
(is "Max ?L = Max ?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
|
3839 |
have "Max ?L \<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
|
3840 |
proof(rule Max_in) |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3841 |
show "finite ?L" by (simp add: finite_subtree_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
|
3842 |
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
|
3843 |
show "?L \<noteq> {}" using subtree_def 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
|
3844 |
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
|
3845 |
then obtain th1' 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
|
3846 |
h_1: "Th th1' \<in> subtree (RAG s) (Th th1)" "the_preced s th1' = Max ?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
|
3847 |
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
|
3848 |
have "Max ?R \<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
|
3849 |
proof(rule Max_in) |
4763aa246dbd
Original files overwrite by 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 |
show "finite ?R" by (simp add: finite_subtree_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
|
3851 |
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
|
3852 |
show "?R \<noteq> {}" using subtree_def by fastforce |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3853 |
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
|
3854 |
then obtain th2' 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
|
3855 |
h_2: "Th th2' \<in> subtree (RAG s) (Th th2)" "the_preced s th2' = Max ?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
|
3856 |
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
|
3857 |
have "th1' = th2'" |
4763aa246dbd
Original files overwrite by 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(rule preced_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
|
3859 |
from h_1(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
|
3860 |
show "th1' \<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
|
3861 |
proof(cases rule:subtreeE) |
4763aa246dbd
Original files overwrite by 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 |
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
|
3863 |
hence "th1' = th1" 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
|
3864 |
with runing_1 show ?thesis by (auto simp:runing_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
|
3865 |
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
|
3866 |
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
|
3867 |
from this(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
|
3868 |
have "(Th th1', Th th1) \<in> (RAG s)^+" by (auto simp:ancestors_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
|
3869 |
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
|
3870 |
have "(Th th1') \<in> Domain (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
|
3871 |
from dm_RAG_threads[OF this] show ?thesis . |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3872 |
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
|
3873 |
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
|
3874 |
from h_2(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
|
3875 |
show "th2' \<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
|
3876 |
proof(cases rule:subtreeE) |
4763aa246dbd
Original files overwrite by 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 |
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
|
3878 |
hence "th2' = th2" 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
|
3879 |
with runing_2 show ?thesis by (auto simp:runing_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
|
3880 |
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
|
3881 |
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
|
3882 |
from this(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
|
3883 |
have "(Th th2', Th th2) \<in> (RAG s)^+" by (auto simp:ancestors_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
|
3884 |
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
|
3885 |
have "(Th th2') \<in> Domain (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
|
3886 |
from dm_RAG_threads[OF this] show ?thesis . |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3887 |
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
|
3888 |
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
|
3889 |
have "the_preced s th1' = the_preced s th2'" |
4763aa246dbd
Original files overwrite by 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 |
using eq_max h_1(2) h_2(2) 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
|
3891 |
thus "preced th1' s = preced th2' s" by (simp add:the_preced_def) |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3892 |
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
|
3893 |
from h_1(1)[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
|
3894 |
have star1: "(Th th2', Th th1) \<in> (RAG s)^*" by (auto simp:subtree_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
|
3895 |
from h_2(1)[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
|
3896 |
have star2: "(Th th2', Th th2) \<in> (RAG s)^*" by (auto simp:subtree_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
|
3897 |
from star_rpath[OF star1] obtain xs1 |
4763aa246dbd
Original files overwrite by 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 |
where rp1: "rpath (RAG s) (Th th2') xs1 (Th th1)" |
4763aa246dbd
Original files overwrite by 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 |
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
|
3900 |
from star_rpath[OF star2] obtain xs2 |
4763aa246dbd
Original files overwrite by 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 |
where rp2: "rpath (RAG s) (Th th2') xs2 (Th th2)" |
4763aa246dbd
Original files overwrite by 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 |
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
|
3903 |
from rp1 rp2 |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3904 |
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
|
3905 |
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
|
3906 |
case (less_1 xs') |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3907 |
moreover have "xs' = []" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3908 |
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
|
3909 |
assume otherwise: "xs' \<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
|
3910 |
from rpath_plus[OF less_1(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
|
3911 |
have "(Th th1, Th th2) \<in> (RAG s)\<^sup>+" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3912 |
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
|
3913 |
obtain cs where "waiting s th1 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
|
3914 |
by (unfold s_RAG_def, fold waiting_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
|
3915 |
with runing_1 show False |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3916 |
by (unfold runing_def readys_def, auto) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3917 |
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
|
3918 |
ultimately have "xs2 = xs1" 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
|
3919 |
from rpath_dest_eq[OF rp1 rp2[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
|
3920 |
show ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3921 |
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
|
3922 |
case (less_2 xs') |
4763aa246dbd
Original files overwrite by 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 |
moreover have "xs' = []" |
4763aa246dbd
Original files overwrite by 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 |
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
|
3925 |
assume otherwise: "xs' \<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
|
3926 |
from rpath_plus[OF less_2(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
|
3927 |
have "(Th th2, Th th1) \<in> (RAG s)\<^sup>+" . |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
3928 |
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
|
3929 |
obtain cs where "waiting s th2 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
|
3930 |
by (unfold s_RAG_def, fold waiting_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
|
3931 |
with runing_2 show False |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3932 |
by (unfold runing_def readys_def, auto) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3933 |
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
|
3934 |
ultimately have "xs2 = xs1" 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
|
3935 |
from rpath_dest_eq[OF rp1 rp2[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
|
3936 |
show ?thesis by simp |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3937 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3938 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3939 |
|
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
|
3940 |
lemma card_runing: "card (runing s) \<le> 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
|
3941 |
proof(cases "runing 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
|
3942 |
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
|
3943 |
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
|
3944 |
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
|
3945 |
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
|
3946 |
then obtain th where [simp]: "th \<in> runing 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
|
3947 |
from runing_unique[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
|
3948 |
have "runing s = {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
|
3949 |
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
|
3950 |
qed |
63 | 3951 |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3952 |
lemma create_pre: |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3953 |
assumes stp: "step s e" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3954 |
and not_in: "th \<notin> threads s" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3955 |
and is_in: "th \<in> threads (e#s)" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3956 |
obtains prio where "e = Create th prio" |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3957 |
proof - |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3958 |
from assms |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3959 |
show ?thesis |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3960 |
proof(cases) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3961 |
case (thread_create thread prio) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3962 |
with is_in not_in have "e = Create th prio" by simp |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3963 |
from that[OF this] show ?thesis . |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3964 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3965 |
case (thread_exit thread) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3966 |
with assms show ?thesis by (auto intro!:that) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3967 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3968 |
case (thread_P thread) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3969 |
with assms show ?thesis by (auto intro!:that) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3970 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3971 |
case (thread_V thread) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3972 |
with assms show ?thesis by (auto intro!:that) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3973 |
next |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3974 |
case (thread_set thread) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3975 |
with assms show ?thesis by (auto intro!:that) |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3976 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3977 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3978 |
|
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
|
3979 |
lemma eq_pv_children: |
63 | 3980 |
assumes eq_pv: "cntP s th = cntV s 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
|
3981 |
shows "children (RAG s) (Th th) = {}" |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3982 |
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
|
3983 |
from cnp_cnv_cncs and eq_pv |
4763aa246dbd
Original files overwrite by 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 |
have "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
|
3985 |
by (auto split:if_splits) |
4763aa246dbd
Original files overwrite by 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 |
from this[unfolded cntCS_def holdents_alt_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
|
3987 |
have card_0: "card (the_cs ` children (RAG s) (Th 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
|
3988 |
have "finite (the_cs ` 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
|
3989 |
by (simp add: fsbtRAGs.finite_children) |
4763aa246dbd
Original files overwrite by 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 |
from card_0[unfolded card_0_eq[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
|
3991 |
show ?thesis by auto |
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3992 |
qed |
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3993 |
|
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
|
3994 |
lemma eq_pv_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
|
3995 |
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
|
3996 |
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
|
3997 |
by (unfold holdents_alt_def eq_pv_children[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
|
3998 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma eq_pv_subtree: |
4763aa246dbd
Original files overwrite by 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 |
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
|
4001 |
shows "subtree (RAG s) (Th 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
|
4002 |
using 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
|
4003 |
by (unfold subtree_children, simp) |
63 | 4004 |
|
4005 |
end |
|
0
110247f9d47e
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4006 |
|
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4007 |
lemma cp_gen_alt_def: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4008 |
"cp_gen s = (Max \<circ> (\<lambda>x. (the_preced s \<circ> the_thread) ` subtree (tRAG s) x))" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4009 |
by (auto simp:cp_gen_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4010 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4011 |
lemma tRAG_nodeE: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4012 |
assumes "(n1, n2) \<in> tRAG s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4013 |
obtains th1 th2 where "n1 = Th th1" "n2 = Th th2" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4014 |
using assms |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4015 |
by (auto simp: tRAG_def wRAG_def hRAG_def tRAG_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4016 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4017 |
lemma subtree_nodeE: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4018 |
assumes "n \<in> subtree (tRAG s) (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4019 |
obtains th1 where "n = Th th1" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4020 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4021 |
show ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4022 |
proof(rule subtreeE[OF assms]) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4023 |
assume "n = Th th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4024 |
from that[OF this] show ?thesis . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4025 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4026 |
assume "Th th \<in> ancestors (tRAG s) n" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4027 |
hence "(n, Th th) \<in> (tRAG s)^+" by (auto simp:ancestors_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4028 |
hence "\<exists> th1. n = Th th1" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4029 |
proof(induct) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4030 |
case (base y) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4031 |
from tRAG_nodeE[OF this] show ?case by metis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4032 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4033 |
case (step y z) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4034 |
thus ?case by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4035 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4036 |
with that show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4037 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4038 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4039 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4040 |
lemma tRAG_star_RAG: "(tRAG s)^* \<subseteq> (RAG s)^*" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4041 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4042 |
have "(wRAG s O hRAG s)^* \<subseteq> (RAG s O RAG s)^*" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4043 |
by (rule rtrancl_mono, auto simp:RAG_split) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4044 |
also have "... \<subseteq> ((RAG s)^*)^*" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4045 |
by (rule rtrancl_mono, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4046 |
also have "... = (RAG s)^*" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4047 |
finally show ?thesis by (unfold tRAG_def, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4048 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4049 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4050 |
lemma tRAG_subtree_RAG: "subtree (tRAG s) x \<subseteq> subtree (RAG s) x" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4051 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4052 |
{ fix a |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4053 |
assume "a \<in> subtree (tRAG s) x" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4054 |
hence "(a, x) \<in> (tRAG s)^*" by (auto simp:subtree_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
|
4055 |
with tRAG_star_RAG |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4056 |
have "(a, x) \<in> (RAG s)^*" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4057 |
hence "a \<in> subtree (RAG s) x" by (auto simp:subtree_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4058 |
} thus ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4059 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4060 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4061 |
lemma tRAG_trancl_eq: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4062 |
"{th'. (Th th', Th th) \<in> (tRAG s)^+} = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4063 |
{th'. (Th th', Th th) \<in> (RAG s)^+}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4064 |
(is "?L = ?R") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4065 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4066 |
{ fix th' |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4067 |
assume "th' \<in> ?L" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4068 |
hence "(Th th', Th th) \<in> (tRAG s)^+" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4069 |
from tranclD[OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4070 |
obtain z where h: "(Th th', z) \<in> tRAG s" "(z, Th th) \<in> (tRAG s)\<^sup>*" 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
|
4071 |
from tRAG_subtree_RAG and this(2) |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4072 |
have "(z, Th th) \<in> (RAG s)^*" by (meson subsetCE tRAG_star_RAG) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4073 |
moreover from h(1) have "(Th th', z) \<in> (RAG s)^+" using tRAG_alt_def by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4074 |
ultimately have "th' \<in> ?R" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4075 |
} moreover |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4076 |
{ fix th' |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4077 |
assume "th' \<in> ?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4078 |
hence "(Th th', Th th) \<in> (RAG s)^+" by (auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4079 |
from plus_rpath[OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4080 |
obtain xs where rp: "rpath (RAG s) (Th th') xs (Th th)" "xs \<noteq> []" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4081 |
hence "(Th th', Th th) \<in> (tRAG s)^+" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4082 |
proof(induct xs arbitrary:th' th rule:length_induct) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4083 |
case (1 xs th' th) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4084 |
then obtain x1 xs1 where Cons1: "xs = x1#xs1" by (cases xs, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4085 |
show ?case |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4086 |
proof(cases "xs1") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4087 |
case Nil |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4088 |
from 1(2)[unfolded Cons1 Nil] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4089 |
have rp: "rpath (RAG s) (Th th') [x1] (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
|
4090 |
hence "(Th th', x1) \<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
|
4091 |
by (cases, auto) |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4092 |
then obtain cs where "x1 = Cs cs" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4093 |
by (unfold s_RAG_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4094 |
from rpath_nnl_lastE[OF rp[unfolded this]] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4095 |
show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4096 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4097 |
case (Cons x2 xs2) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4098 |
from 1(2)[unfolded Cons1[unfolded this]] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4099 |
have rp: "rpath (RAG s) (Th th') (x1 # x2 # xs2) (Th th)" . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4100 |
from rpath_edges_on[OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4101 |
have eds: "edges_on (Th th' # x1 # x2 # xs2) \<subseteq> RAG s" . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4102 |
have "(Th th', x1) \<in> edges_on (Th th' # x1 # x2 # xs2)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4103 |
by (simp add: edges_on_unfold) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4104 |
with eds have rg1: "(Th th', x1) \<in> RAG s" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4105 |
then obtain cs1 where eq_x1: "x1 = Cs cs1" by (unfold s_RAG_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4106 |
have "(x1, x2) \<in> edges_on (Th th' # x1 # x2 # xs2)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4107 |
by (simp add: edges_on_unfold) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4108 |
from this eds |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4109 |
have rg2: "(x1, x2) \<in> RAG s" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4110 |
from this[unfolded eq_x1] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4111 |
obtain th1 where eq_x2: "x2 = Th th1" by (unfold s_RAG_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4112 |
from rg1[unfolded eq_x1] rg2[unfolded eq_x1 eq_x2] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4113 |
have rt1: "(Th th', Th th1) \<in> tRAG s" by (unfold tRAG_alt_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4114 |
from rp have "rpath (RAG s) x2 xs2 (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4115 |
by (elim rpath_ConsE, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4116 |
from this[unfolded eq_x2] have rp': "rpath (RAG s) (Th th1) xs2 (Th th)" . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4117 |
show ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4118 |
proof(cases "xs2 = []") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4119 |
case True |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4120 |
from rpath_nilE[OF rp'[unfolded this]] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4121 |
have "th1 = th" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4122 |
from rt1[unfolded this] show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4123 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4124 |
case False |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4125 |
from 1(1)[rule_format, OF _ rp' this, unfolded Cons1 Cons] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4126 |
have "(Th th1, Th th) \<in> (tRAG s)\<^sup>+" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4127 |
with rt1 show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4128 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4129 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4130 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4131 |
hence "th' \<in> ?L" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4132 |
} ultimately show ?thesis by blast |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4133 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4134 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4135 |
lemma tRAG_trancl_eq_Th: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4136 |
"{Th th' | th'. (Th th', Th th) \<in> (tRAG s)^+} = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4137 |
{Th th' | th'. (Th th', Th th) \<in> (RAG s)^+}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4138 |
using tRAG_trancl_eq by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4139 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4140 |
lemma dependants_alt_def: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4141 |
"dependants s th = {th'. (Th th', Th th) \<in> (tRAG s)^+}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4142 |
by (metis eq_RAG s_dependants_def tRAG_trancl_eq) |
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
|
4143 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma 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
|
4145 |
"dependants (s::state) th = {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
|
4146 |
using dependants_alt_def tRAG_trancl_eq 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
|
4147 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4149 |
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
|
4150 |
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
|
4151 |
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
|
4152 |
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
|
4153 |
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
|
4154 |
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
|
4155 |
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
|
4156 |
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
|
4157 |
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
|
4158 |
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
|
4159 |
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
|
4160 |
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
|
4161 |
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
|
4162 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4163 |
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
|
4164 |
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
|
4165 |
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
|
4166 |
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
|
4167 |
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
|
4168 |
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
|
4169 |
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
|
4170 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4172 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma eq_dependants: "dependants (wq s) = dependants 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
|
4174 |
by (simp add: s_dependants_abv 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
|
4175 |
|
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4176 |
context valid_trace |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4177 |
begin |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4178 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4179 |
lemma count_eq_tRAG_plus: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4180 |
assumes "cntP s th = cntV s th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4181 |
shows "{th'. (Th th', Th th) \<in> (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
|
4182 |
using assms eq_pv_dependants dependants_alt_def eq_dependants by auto |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4183 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4184 |
lemma count_eq_RAG_plus_Th: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4185 |
assumes "cntP s th = cntV s th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4186 |
shows "{Th th' | th'. (Th th', Th th) \<in> (RAG s)^+} = {}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4187 |
using count_eq_RAG_plus[OF assms] by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4188 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4189 |
lemma count_eq_tRAG_plus_Th: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4190 |
assumes "cntP s th = cntV s th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4191 |
shows "{Th th' | th'. (Th th', Th th) \<in> (tRAG s)^+} = {}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4192 |
using count_eq_tRAG_plus[OF assms] 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
|
4193 |
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
|
4194 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4195 |
lemma inj_the_preced: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4196 |
"inj_on (the_preced s) (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
|
4197 |
by (metis inj_onI preced_unique the_preced_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
|
4198 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4199 |
lemma tRAG_Field: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4200 |
"Field (tRAG s) \<subseteq> Field (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
|
4201 |
by (unfold tRAG_alt_def Field_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
|
4202 |
|
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4203 |
lemma tRAG_ancestorsE: |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4204 |
assumes "x \<in> ancestors (tRAG s) u" |
4763aa246dbd
Original files overwrite by their parallels (Correctness.thy v.s. PrioG.thy, PIPBasics.thy v.s. CpsG.thy, Implementation v.s. ExtGG.thy).
zhangx
parents:
90
diff
changeset
|
4205 |
obtains th where "x = 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
|
4206 |
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
|
4207 |
from assms have "(u, x) \<in> (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
|
4208 |
by (unfold ancestors_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
|
4209 |
from tranclE[OF this] obtain c where "(c, x) \<in> tRAG 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
|
4210 |
then obtain th where "x = 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
|
4211 |
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
|
4212 |
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
|
4213 |
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
|
4214 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma tRAG_mono: |
4763aa246dbd
Original files overwrite by 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 |
assumes "RAG 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
|
4217 |
shows "tRAG s' \<subseteq> 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
|
4218 |
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
|
4219 |
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
|
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 holding_next_thI: |
4763aa246dbd
Original files overwrite by 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 |
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
|
4223 |
and "length (wq s cs) > 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
|
4224 |
obtains th' where "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
|
4225 |
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
|
4226 |
from assms(1)[folded holding_eq, unfolded cs_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
|
4227 |
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
|
4228 |
by (unfold s_holding_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
|
4229 |
then obtain rest where h1: "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
|
4230 |
by (cases "wq s 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
|
4231 |
with assms(2) have h2: "rest \<noteq> []" 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
|
4232 |
let ?th' = "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
|
4233 |
have "next_th s th cs ?th'" using h1(1) h2 |
4763aa246dbd
Original files overwrite by 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 |
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
|
4235 |
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
|
4236 |
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
|
4237 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma RAG_tRAG_transfer: |
4763aa246dbd
Original files overwrite by 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 |
assumes "vt 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
|
4240 |
assumes "RAG s = 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
|
4241 |
and "(Cs cs, 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
|
4242 |
shows "tRAG s = tRAG s' \<union> {(Th th, 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
|
4243 |
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
|
4244 |
interpret vt_s': valid_trace "s'" using 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
|
4245 |
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
|
4246 |
{ 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
|
4247 |
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
|
4248 |
from this[unfolded tRAG_alt_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
|
4249 |
obtain th1 th2 cs' 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
|
4250 |
h: "n1 = Th th1" "n2 = Th th2" |
4763aa246dbd
Original files overwrite by 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 |
"(Th th1, 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
|
4252 |
"(Cs cs', Th th2) \<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
|
4253 |
from h(4) and assms(2) have cs_in: "(Cs cs', Th th2) \<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
|
4254 |
from h(3) and 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
|
4255 |
have "(Th th1, Cs cs') = (Th th, 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
|
4256 |
(Th th1, Cs cs') \<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
|
4257 |
hence "(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
|
4258 |
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
|
4259 |
assume h1: "(Th th1, Cs cs') = (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
|
4260 |
hence eq_th1: "th1 = 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
|
4261 |
moreover have "th2 = 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
|
4262 |
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
|
4263 |
from h1 have "cs' = 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
|
4264 |
from assms(3) cs_in[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
|
4265 |
show ?thesis using vt_s'.unique_RAG 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
|
4266 |
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
|
4267 |
ultimately show ?thesis using h(1,2) 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
|
4268 |
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
|
4269 |
assume "(Th th1, 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
|
4270 |
with cs_in have "(Th th1, Th th2) \<in> 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
|
4271 |
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
|
4272 |
from this[folded h(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
|
4273 |
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
|
4274 |
} 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
|
4275 |
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
|
4276 |
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
|
4277 |
hence "(n1, n2) \<in>tRAG s' \<or> (n1, n2) = (Th th, 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
|
4278 |
hence "(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
|
4279 |
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
|
4280 |
assume "(n1, n2) \<in> 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
|
4281 |
moreover have "... \<subseteq> ?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
|
4282 |
proof(rule tRAG_mono) |
4763aa246dbd
Original files overwrite by 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 |
show "RAG s' \<subseteq> RAG s" by (unfold assms(2), 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
|
4284 |
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
|
4285 |
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
|
4286 |
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
|
4287 |
assume eq_n: "(n1, n2) = (Th 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
|
4288 |
from assms(2, 3) have "(Cs cs, 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
|
4289 |
moreover have "(Th th, Cs cs) \<in> RAG s" using assms(2) 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
|
4290 |
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
|
4291 |
by (unfold eq_n 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
|
4292 |
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
|
4293 |
} 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
|
4294 |
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
|
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 |
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
|
4297 |
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
|
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 |
lemmas RAG_tRAG_transfer = RAG_tRAG_transfer[OF vt] |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4300 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4301 |
end |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4302 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4303 |
lemma tRAG_subtree_eq: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4304 |
"(subtree (tRAG s) (Th th)) = {Th th' | th'. Th th' \<in> (subtree (RAG s) (Th th))}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4305 |
(is "?L = ?R") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4306 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4307 |
{ fix n |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4308 |
assume h: "n \<in> ?L" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4309 |
hence "n \<in> ?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4310 |
by (smt mem_Collect_eq subsetCE subtree_def subtree_nodeE tRAG_subtree_RAG) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4311 |
} moreover { |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4312 |
fix n |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4313 |
assume "n \<in> ?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4314 |
then obtain th' where h: "n = Th th'" "(Th th', Th th) \<in> (RAG s)^*" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4315 |
by (auto simp:subtree_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4316 |
from rtranclD[OF this(2)] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4317 |
have "n \<in> ?L" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4318 |
proof |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4319 |
assume "Th th' \<noteq> Th th \<and> (Th th', Th th) \<in> (RAG s)\<^sup>+" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4320 |
with h have "n \<in> {Th th' | th'. (Th th', Th th) \<in> (RAG s)^+}" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4321 |
thus ?thesis using subtree_def tRAG_trancl_eq by fastforce |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4322 |
qed (insert h, auto simp:subtree_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4323 |
} ultimately show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4324 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4325 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4326 |
lemma threads_set_eq: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4327 |
"the_thread ` (subtree (tRAG s) (Th th)) = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4328 |
{th'. Th th' \<in> (subtree (RAG s) (Th th))}" (is "?L = ?R") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4329 |
by (auto intro:rev_image_eqI simp:tRAG_subtree_eq) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4330 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4331 |
lemma cp_alt_def1: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4332 |
"cp s th = Max ((the_preced s o the_thread) ` (subtree (tRAG s) (Th th)))" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4333 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4334 |
have "(the_preced s ` the_thread ` subtree (tRAG s) (Th th)) = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4335 |
((the_preced s \<circ> the_thread) ` subtree (tRAG s) (Th th))" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4336 |
by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4337 |
thus ?thesis by (unfold cp_alt_def, fold threads_set_eq, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4338 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4339 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4340 |
lemma cp_gen_def_cond: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4341 |
assumes "x = Th th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4342 |
shows "cp s th = cp_gen s (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4343 |
by (unfold cp_alt_def1 cp_gen_def, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4344 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4345 |
lemma cp_gen_over_set: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4346 |
assumes "\<forall> x \<in> A. \<exists> th. x = Th th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4347 |
shows "cp_gen s ` A = (cp s \<circ> the_thread) ` A" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4348 |
proof(rule f_image_eq) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4349 |
fix a |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4350 |
assume "a \<in> A" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4351 |
from assms[rule_format, OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4352 |
obtain th where eq_a: "a = Th th" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4353 |
show "cp_gen s a = (cp s \<circ> the_thread) a" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4354 |
by (unfold eq_a, simp, unfold cp_gen_def_cond[OF refl[of "Th th"]], simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4355 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4356 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4357 |
context valid_trace |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4358 |
begin |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4359 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4360 |
lemma subtree_tRAG_thread: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4361 |
assumes "th \<in> threads s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4362 |
shows "subtree (tRAG s) (Th th) \<subseteq> Th ` threads s" (is "?L \<subseteq> ?R") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4363 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4364 |
have "?L = {Th th' |th'. Th th' \<in> subtree (RAG s) (Th th)}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4365 |
by (unfold tRAG_subtree_eq, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4366 |
also have "... \<subseteq> ?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4367 |
proof |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4368 |
fix x |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4369 |
assume "x \<in> {Th th' |th'. Th th' \<in> subtree (RAG s) (Th th)}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4370 |
then obtain th' where h: "x = Th th'" "Th th' \<in> subtree (RAG s) (Th th)" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4371 |
from this(2) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4372 |
show "x \<in> ?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4373 |
proof(cases rule:subtreeE) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4374 |
case 1 |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4375 |
thus ?thesis by (simp add: assms h(1)) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4376 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4377 |
case 2 |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4378 |
thus ?thesis by (metis ancestors_Field dm_RAG_threads h(1) image_eqI) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4379 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4380 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4381 |
finally show ?thesis . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4382 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4383 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4384 |
lemma readys_root: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4385 |
assumes "th \<in> readys s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4386 |
shows "root (RAG s) (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4387 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4388 |
{ fix x |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4389 |
assume "x \<in> ancestors (RAG s) (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4390 |
hence h: "(Th th, x) \<in> (RAG s)^+" by (auto simp:ancestors_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4391 |
from tranclD[OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4392 |
obtain z where "(Th th, z) \<in> RAG s" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4393 |
with assms(1) have False |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4394 |
apply (case_tac z, auto simp:readys_def s_RAG_def s_waiting_def cs_waiting_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4395 |
by (fold wq_def, blast) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4396 |
} thus ?thesis by (unfold root_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4397 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4398 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4399 |
lemma readys_in_no_subtree: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4400 |
assumes "th \<in> readys s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4401 |
and "th' \<noteq> th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4402 |
shows "Th th \<notin> subtree (RAG s) (Th th')" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4403 |
proof |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4404 |
assume "Th th \<in> subtree (RAG s) (Th th')" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4405 |
thus False |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4406 |
proof(cases rule:subtreeE) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4407 |
case 1 |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4408 |
with assms show ?thesis by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4409 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4410 |
case 2 |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4411 |
with readys_root[OF assms(1)] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4412 |
show ?thesis by (auto simp:root_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4413 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4414 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4415 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4416 |
lemma not_in_thread_isolated: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4417 |
assumes "th \<notin> threads s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4418 |
shows "(Th th) \<notin> Field (RAG s)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4419 |
proof |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4420 |
assume "(Th th) \<in> Field (RAG 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
|
4421 |
with dm_RAG_threads and rg_RAG_threads assms |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4422 |
show False by (unfold Field_def, blast) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4423 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4424 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4425 |
end |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4426 |
|
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
|
4427 |
definition detached :: "state \<Rightarrow> thread \<Rightarrow> bool" |
4763aa246dbd
Original files overwrite by 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 |
where "detached s th \<equiv> (\<not>(\<exists> cs. holding s th cs)) \<and> (\<not>(\<exists>cs. 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
|
4429 |
|
4763aa246dbd
Original files overwrite by 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 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma detached_test: |
4763aa246dbd
Original files overwrite by 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 |
shows "detached s th = (Th th \<notin> Field (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
|
4433 |
apply(simp add: detached_def Field_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
|
4434 |
apply(simp add: 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
|
4435 |
apply(simp add: s_holding_abv 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
|
4436 |
apply(simp add: 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
|
4437 |
apply(simp add: 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 |
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
|
4439 |
done |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4440 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4441 |
context valid_trace |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4442 |
begin |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4443 |
|
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
|
4444 |
lemma detached_intro: |
4763aa246dbd
Original files overwrite by 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 |
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
|
4446 |
shows "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
|
4447 |
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
|
4448 |
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
|
4449 |
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
|
4450 |
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
|
4451 |
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
|
4452 |
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
|
4453 |
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
|
4454 |
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
|
4455 |
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
|
4456 |
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
|
4457 |
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
|
4458 |
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
|
4459 |
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
|
4460 |
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
|
4461 |
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
|
4462 |
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
|
4463 |
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
|
4464 |
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
|
4465 |
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
|
4466 |
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
|
4467 |
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
|
4468 |
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
|
4469 |
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
|
4470 |
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
|
4471 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4473 |
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
|
4474 |
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
|
4475 |
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
|
4476 |
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
|
4477 |
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
|
4478 |
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
|
4479 |
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
|
4480 |
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
|
4481 |
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
|
4482 |
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
|
4483 |
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
|
4484 |
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
|
4485 |
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
|
4486 |
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
|
4487 |
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
|
4488 |
by (unfold readys_def detached_def Field_def Domain_def Range_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
|
4489 |
auto simp:waiting_eq 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
|
4490 |
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
|
4491 |
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
|
4492 |
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
|
4493 |
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
|
4494 |
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
|
4495 |
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
|
4496 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4498 |
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
|
4499 |
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
|
4500 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4502 |
|
4763aa246dbd
Original files overwrite by 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 |
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
|
4504 |
begin |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4505 |
(* ddd *) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4506 |
lemma cp_gen_rec: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4507 |
assumes "x = Th th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4508 |
shows "cp_gen s x = Max ({the_preced s th} \<union> (cp_gen s) ` children (tRAG s) x)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4509 |
proof(cases "children (tRAG s) x = {}") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4510 |
case True |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4511 |
show ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4512 |
by (unfold True cp_gen_def subtree_children, simp add:assms) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4513 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4514 |
case False |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4515 |
hence [simp]: "children (tRAG s) x \<noteq> {}" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4516 |
note fsbttRAGs.finite_subtree[simp] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4517 |
have [simp]: "finite (children (tRAG s) x)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4518 |
by (intro rev_finite_subset[OF fsbttRAGs.finite_subtree], |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4519 |
rule children_subtree) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4520 |
{ fix r x |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4521 |
have "subtree r x \<noteq> {}" by (auto simp:subtree_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4522 |
} note this[simp] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4523 |
have [simp]: "\<exists>x\<in>children (tRAG s) x. subtree (tRAG s) x \<noteq> {}" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4524 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4525 |
from False obtain q where "q \<in> children (tRAG s) x" by blast |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4526 |
moreover have "subtree (tRAG s) q \<noteq> {}" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4527 |
ultimately show ?thesis by blast |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4528 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4529 |
have h: "Max ((the_preced s \<circ> the_thread) ` |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4530 |
({x} \<union> \<Union>(subtree (tRAG s) ` children (tRAG s) x))) = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4531 |
Max ({the_preced s th} \<union> cp_gen s ` children (tRAG s) x)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4532 |
(is "?L = ?R") |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4533 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4534 |
let "Max (?f ` (?A \<union> \<Union> (?g ` ?B)))" = ?L |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4535 |
let "Max (_ \<union> (?h ` ?B))" = ?R |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4536 |
let ?L1 = "?f ` \<Union>(?g ` ?B)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4537 |
have eq_Max_L1: "Max ?L1 = Max (?h ` ?B)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4538 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4539 |
have "?L1 = ?f ` (\<Union> x \<in> ?B.(?g x))" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4540 |
also have "... = (\<Union> x \<in> ?B. ?f ` (?g x))" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4541 |
finally have "Max ?L1 = Max ..." by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4542 |
also have "... = Max (Max ` (\<lambda>x. ?f ` subtree (tRAG s) x) ` ?B)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4543 |
by (subst Max_UNION, simp+) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4544 |
also have "... = Max (cp_gen s ` children (tRAG s) x)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4545 |
by (unfold image_comp cp_gen_alt_def, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4546 |
finally show ?thesis . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4547 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4548 |
show ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4549 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4550 |
have "?L = Max (?f ` ?A \<union> ?L1)" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4551 |
also have "... = max (the_preced s (the_thread x)) (Max ?L1)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4552 |
by (subst Max_Un, simp+) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4553 |
also have "... = max (?f x) (Max (?h ` ?B))" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4554 |
by (unfold eq_Max_L1, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4555 |
also have "... =?R" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4556 |
by (rule max_Max_eq, (simp)+, unfold assms, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4557 |
finally show ?thesis . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4558 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4559 |
qed thus ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4560 |
by (fold h subtree_children, unfold cp_gen_def, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4561 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4562 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4563 |
lemma cp_rec: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4564 |
"cp s th = Max ({the_preced s th} \<union> |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4565 |
(cp s o the_thread) ` children (tRAG s) (Th th))" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4566 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4567 |
have "Th th = Th th" by simp |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4568 |
note h = cp_gen_def_cond[OF this] cp_gen_rec[OF this] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4569 |
show ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4570 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4571 |
have "cp_gen s ` children (tRAG s) (Th th) = |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4572 |
(cp s \<circ> the_thread) ` children (tRAG s) (Th th)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4573 |
proof(rule cp_gen_over_set) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4574 |
show " \<forall>x\<in>children (tRAG s) (Th th). \<exists>th. x = Th th" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4575 |
by (unfold tRAG_alt_def, auto simp:children_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4576 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4577 |
thus ?thesis by (subst (1) h(1), unfold h(2), simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4578 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4579 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4580 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4581 |
lemma next_th_holding: |
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
|
4582 |
assumes nxt: "next_th s th cs th'" |
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4583 |
shows "holding (wq s) th cs" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4584 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4585 |
from nxt[unfolded next_th_def] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4586 |
obtain rest where h: "wq s cs = th # rest" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4587 |
"rest \<noteq> []" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4588 |
"th' = hd (SOME q. distinct q \<and> set q = set rest)" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4589 |
thus ?thesis |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4590 |
by (unfold cs_holding_def, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4591 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4592 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4593 |
lemma next_th_waiting: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4594 |
assumes nxt: "next_th s th cs th'" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4595 |
shows "waiting (wq s) th' cs" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4596 |
proof - |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4597 |
from nxt[unfolded next_th_def] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4598 |
obtain rest where h: "wq s cs = th # rest" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4599 |
"rest \<noteq> []" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4600 |
"th' = hd (SOME q. distinct q \<and> set q = set rest)" by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4601 |
from wq_distinct[of cs, unfolded h] |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4602 |
have dst: "distinct (th # rest)" . |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4603 |
have in_rest: "th' \<in> set rest" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4604 |
proof(unfold h, rule someI2) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4605 |
show "distinct rest \<and> set rest = set rest" using dst by auto |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4606 |
next |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4607 |
fix x assume "distinct x \<and> set x = set rest" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4608 |
with h(2) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4609 |
show "hd x \<in> set (rest)" by (cases x, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4610 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4611 |
hence "th' \<in> set (wq s cs)" by (unfold h(1), auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4612 |
moreover have "th' \<noteq> hd (wq s cs)" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4613 |
by (unfold h(1), insert in_rest dst, auto) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4614 |
ultimately show ?thesis by (auto simp:cs_waiting_def) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4615 |
qed |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4616 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4617 |
lemma next_th_RAG: |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4618 |
assumes nxt: "next_th (s::event list) th cs th'" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4619 |
shows "{(Cs cs, Th th), (Th th', Cs cs)} \<subseteq> RAG s" |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4620 |
using vt assms next_th_holding next_th_waiting |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4621 |
by (unfold s_RAG_def, simp) |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4622 |
|
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4623 |
end |
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4624 |
|
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
|
4625 |
lemma next_th_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
|
4626 |
assumes nt1: "next_th s th cs th1" |
4763aa246dbd
Original files overwrite by 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 |
and nt2: "next_th s th cs th2" |
4763aa246dbd
Original files overwrite by 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 |
shows "th1 = th2" |
4763aa246dbd
Original files overwrite by 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 |
using assms 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
|
4630 |
|
80
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
4631 |
context valid_trace |
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
4632 |
begin |
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
4633 |
|
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
|
4634 |
lemma threads_alt_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
|
4635 |
"(threads s) = (\<Union> th \<in> readys s. {th'. Th th' \<in> subtree (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
|
4636 |
(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
|
4637 |
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
|
4638 |
{ fix th1 |
4763aa246dbd
Original files overwrite by 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 |
assume "th1 \<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
|
4640 |
from th_chain_to_ready[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
|
4641 |
have "th1 \<in> readys s \<or> (\<exists>th'. th' \<in> readys s \<and> (Th th1, Th th') \<in> (RAG s)\<^sup>+)" . |
4763aa246dbd
Original files overwrite by 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 |
hence "th1 \<in> ?R" by (auto simp:subtree_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
|
4643 |
} 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
|
4644 |
{ fix 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 |
assume "th' \<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
|
4646 |
then obtain th where h: "th \<in> readys s" " Th th' \<in> subtree (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
|
4647 |
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
|
4648 |
from this(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
|
4649 |
have "th' \<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
|
4650 |
proof(cases rule:subtreeE) |
4763aa246dbd
Original files overwrite by 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 |
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
|
4652 |
with h(1) show ?thesis 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
|
4653 |
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
|
4654 |
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
|
4655 |
from tranclD[OF this(2)[unfolded ancestors_def, simplified]] |
4763aa246dbd
Original files overwrite by 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 |
have "Th th' \<in> Domain (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
|
4657 |
from dm_RAG_threads[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
|
4658 |
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
|
4659 |
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
|
4660 |
} 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
|
4661 |
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
|
4662 |
|
4763aa246dbd
Original files overwrite by 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 |
lemma finite_readys [simp]: "finite (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
|
4664 |
using finite_threads readys_threads rev_finite_subset 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
|
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 |
text {* (* ccc *) \noindent |
4763aa246dbd
Original files overwrite by 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 |
Since the current precedence of the threads in ready queue will always be boosted, |
4763aa246dbd
Original files overwrite by 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 |
there must be one inside it has the maximum precedence of the whole system. |
4763aa246dbd
Original files overwrite by 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 |
*} |
4763aa246dbd
Original files overwrite by 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 |
lemma max_cp_readys_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
|
4671 |
shows "Max (cp s ` readys s) = Max (cp s ` threads s)" (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
|
4672 |
proof(cases "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
|
4673 |
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
|
4674 |
have "?R = Max (the_preced s ` threads s)" by (unfold max_cp_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
|
4675 |
also have "... = |
4763aa246dbd
Original files overwrite by 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 |
Max (the_preced s ` (\<Union>th\<in>readys s. {th'. Th th' \<in> subtree (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
|
4677 |
by (unfold threads_alt_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
|
4678 |
also have "... = |
4763aa246dbd
Original files overwrite by 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 |
Max ((\<Union>th\<in>readys s. the_preced s ` {th'. Th th' \<in> subtree (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
|
4680 |
by (unfold image_UN, 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
|
4681 |
also have "... = |
4763aa246dbd
Original files overwrite by 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 |
Max (Max ` (\<lambda>th. the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)}) ` 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
|
4683 |
proof(rule Max_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
|
4684 |
show "\<forall>M\<in>(\<lambda>x. the_preced 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
|
4685 |
{th'. Th th' \<in> subtree (RAG s) (Th x)}) ` readys s. finite M" |
4763aa246dbd
Original files overwrite by 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 |
using finite_subtree_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
|
4687 |
qed (auto simp:False subtree_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
|
4688 |
also have "... = |
4763aa246dbd
Original files overwrite by 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 |
Max ((Max \<circ> (\<lambda>th. the_preced s ` {th'. Th th' \<in> subtree (RAG s) (Th th)})) ` 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
|
4690 |
by (unfold image_comp, 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
|
4691 |
also have "... = ?L" (is "Max (?f ` ?A) = Max (?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
|
4692 |
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
|
4693 |
have "(?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
|
4694 |
proof(rule 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
|
4695 |
fix th1 |
4763aa246dbd
Original files overwrite by 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 |
assume "th1 \<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
|
4697 |
thus "?f th1 = ?g th1" |
4763aa246dbd
Original files overwrite by 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 |
by (unfold cp_alt_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
|
4699 |
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
|
4700 |
thus ?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
|
4701 |
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
|
4702 |
finally 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
|
4703 |
qed (auto simp:threads_alt_def) |
77
d37703e0c5c4
CpsG.thy updated. It is a copy of PIPBasics.thy under drastic improvement.
zhangx
parents:
69
diff
changeset
|
4704 |
|
65
633b1fc8631b
Reorganization completed, added "scripts_structure.pdf" and "scirpts_structure.pptx".
zhangx
parents:
64
diff
changeset
|
4705 |
end |
80
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
4706 |
|
17305a85493d
CpsG.thy retrofiting almost completed. An important mile stone.
zhangx
parents:
77
diff
changeset
|
4707 |
end |
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
|
4708 |