-
Notifications
You must be signed in to change notification settings - Fork 0
/
Weak_Psi_Congruence.thy
221 lines (175 loc) · 7.21 KB
/
Weak_Psi_Congruence.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
(*
Title: Psi-calculi
Based on the AFP entry by Jesper Bengtson ([email protected]), 2012
*)
theory Weak_Psi_Congruence
imports Weak_Cong_Simulation Weak_Bisimulation
begin
context env begin
definition weakPsiCongruence :: "'b \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<rhd> _ \<doteq> _" [70, 70, 70] 65)
where
"\<Psi> \<rhd> P \<doteq> Q \<equiv> \<Psi> \<rhd> P \<approx> Q \<and> \<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q \<and> \<Psi> \<rhd> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P"
abbreviation
weakPsiCongNilJudge ("_ \<doteq> _" [70, 70] 65) where "P \<doteq> Q \<equiv> \<one> \<rhd> P \<doteq> Q"
lemma weakPsiCongSym:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<doteq> Q"
shows "\<Psi> \<rhd> Q \<doteq> P"
using assms
by(auto simp add: weakPsiCongruence_def weakBisimE)
lemma weakPsiCongE:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<doteq> Q"
shows "\<Psi> \<rhd> P \<approx> Q"
and "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q"
and "\<Psi> \<rhd> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P"
using assms
by(auto simp add: weakPsiCongruence_def)
lemma weakPsiCongI[case_names cWeakBisim cSimLeft cSimRight]:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<approx> Q"
and "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q"
and "\<Psi> \<rhd> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P"
shows "\<Psi> \<rhd> P \<doteq> Q"
using assms
by(auto simp add: weakPsiCongruence_def)
lemma weakPsiCongSymI[consumes 1, case_names cSym cWeakBisim cSim]:
fixes \<Psi> :: 'b
and P :: "'d::fs_name"
and Q :: 'd
and \<Psi>' :: 'b
assumes "Prop P Q"
and "\<And>P Q. Prop P Q \<Longrightarrow> Prop Q P"
and "\<And>P Q. Prop P Q \<Longrightarrow> \<Psi> \<rhd> (C P) \<approx> (C Q)"
and "\<And>P Q. Prop P Q \<Longrightarrow> \<Psi> \<rhd> (C P) \<leadsto>\<guillemotleft>weakBisim\<guillemotright> (C Q)"
shows "\<Psi> \<rhd> (C P) \<doteq> (C Q)"
using assms
by(rule_tac weakPsiCongI) auto
lemma weakPsiCongSym2[consumes 1, case_names cWeakBisim cSim]:
fixes \<Psi> :: 'b
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<doteq> Q"
and "\<And>P Q. \<Psi> \<rhd> P \<doteq> Q \<Longrightarrow> \<Psi> \<rhd> (C P) \<approx> (C Q)"
and "\<And>P Q. \<Psi> \<rhd> P \<doteq> Q \<Longrightarrow> \<Psi> \<rhd> (C P) \<leadsto>\<guillemotleft>weakBisim\<guillemotright> (C Q)"
shows "\<Psi> \<rhd> (C P) \<doteq> (C Q)"
using assms
apply(rule_tac weakPsiCongSymI[where C=C])
apply assumption
by(auto simp add: weakPsiCongruence_def dest: weakBisimE)
lemma statEqWeakCong:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<doteq> Q"
and "\<Psi> \<simeq> \<Psi>'"
shows "\<Psi>' \<rhd> P \<doteq> Q"
proof -
let ?Prop = "\<lambda>P Q. \<Psi> \<rhd> P \<doteq> Q \<and> \<Psi> \<simeq> \<Psi>'"
from assms have "?Prop P Q" by auto
thus ?thesis
proof(induct rule: weakPsiCongSymI)
case(cSym P Q)
thus ?case by(blast dest: weakPsiCongSym)
next
case(cSim P Q)
from `\<Psi> \<rhd> P \<doteq> Q \<and> \<Psi> \<simeq> \<Psi>'` have "\<Psi> \<rhd> P \<doteq> Q" and "\<Psi> \<simeq> \<Psi>'" by simp+
from `\<Psi> \<rhd> P \<doteq> Q` have "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q" by(rule weakPsiCongE)
with `\<Psi> \<simeq> \<Psi>'` show ?case using statEqWeakBisim
by(rule_tac weakCongSimStatEq) auto
next
case(cWeakBisim P Q)
from `\<Psi> \<rhd> P \<doteq> Q \<and> \<Psi> \<simeq> \<Psi>'`
have "\<Psi> \<rhd> P \<approx> Q" and "\<Psi> \<simeq> \<Psi>'" by(auto dest: weakPsiCongE)
thus ?case by(rule statEqWeakBisim)
qed
qed
lemma weakPsiCongReflexive:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
shows "\<Psi> \<rhd> P \<doteq> P"
by(fastforce intro: weakPsiCongI weakCongSimReflexive weakBisimReflexive)
lemma weakPsiCongClosed:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and p :: "name prm"
assumes "\<Psi> \<rhd> P \<doteq> Q"
shows "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<doteq> (p \<bullet> Q)"
using assms
proof(induct rule: weakPsiCongSymI)
case(cSym P Q)
thus ?case by(rule weakPsiCongSym)
next
case(cSim P Q)
from `\<Psi> \<rhd> P \<doteq> Q` have "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q" by(rule weakPsiCongE)
thus ?case by(drule_tac p=p in weakCongSimClosed(1)[OF weakBisimEqvt]) (simp add: eqvts)
next
case(cWeakBisim P Q)
from `\<Psi> \<rhd> P \<doteq> Q` have "\<Psi> \<rhd> P \<approx> Q" by(rule weakPsiCongE)
thus ?case by(rule weakBisimClosed)
qed
lemma weakPsiCongTransitive:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and R :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<doteq> Q"
and "\<Psi> \<rhd> Q \<doteq> R"
shows "\<Psi> \<rhd> P \<doteq> R"
proof -
from assms have "\<Psi> \<rhd> P \<doteq> Q \<and> \<Psi> \<rhd> Q \<doteq> R" by auto
thus ?thesis
proof(induct rule: weakPsiCongSymI)
case(cSym P R)
thus ?case by(auto dest: weakPsiCongSym)
next
case(cSim P R)
hence "\<Psi> \<rhd> P \<doteq> Q" and "\<Psi> \<rhd> Q \<doteq> R" by auto
moreover from `\<Psi> \<rhd> P \<doteq> Q` have "\<Psi> \<rhd> P \<approx> Q" by(metis weakBisimE weakPsiCongE)
moreover from `\<Psi> \<rhd> P \<doteq> Q` have "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q" by(rule weakPsiCongE)
moreover from `\<Psi> \<rhd> Q \<doteq> R` have "\<Psi> \<rhd> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R" by(rule weakPsiCongE)
moreover have "{(\<Psi>, P, R) | \<Psi> P R. \<exists>Q. \<Psi> \<rhd> P \<approx> Q \<and> \<Psi> \<rhd> Q \<approx> R} \<subseteq> weakBisim"
by(auto dest: weakBisimTransitive)
ultimately show ?case using weakBisimE(2) by(rule_tac weakCongSimTransitive)
next
case(cWeakBisim P R)
thus ?case by(auto dest: weakBisimTransitive weakPsiCongE)
qed
qed
lemma strongBisimWeakPsiCong:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<sim> Q"
shows "\<Psi> \<rhd> P \<doteq> Q"
using assms
proof(induct rule: weakPsiCongSymI)
case(cSym P Q)
from `\<Psi> \<rhd> P \<sim> Q` show ?case by(rule bisimE)
next
case(cSim P Q)
from `\<Psi> \<rhd> P \<sim> Q` have "\<Psi> \<rhd> P \<leadsto>[bisim] Q" by(rule bisimE)
thus "\<Psi> \<rhd> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q" using strongBisimWeakBisim
by(rule_tac strongSimWeakCongSim) auto
next
case(cWeakBisim P Q)
thus ?case by(rule strongBisimWeakBisim)
qed
lemma structCongWeakPsiCong:
fixes P :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
assumes "P \<equiv>\<^sub>s Q"
shows "P \<doteq> Q"
using assms
by(metis struct_cong_bisim strongBisimWeakPsiCong)
end
end