-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinduc.v
438 lines (431 loc) · 14.2 KB
/
induc.v
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
(* This program is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1 *)
(* of the License, or (at your option) any later version. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this program; if not, write to the Free *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA *)
Require Import processus.
Theorem inp_ind :
forall Pr : proc -> proc -> PP -> PP -> Prop,
(forall (p q : PP) (x : VV) (P : proc),
Pr (inp (pname p) x P) (subs_var_proc P (pname q) x) p q) ->
(forall (P P' : proc) (p q : PP) (x y : VV) (t : type),
(forall r : PP,
sem (subs_var_proc P (pname r) x) (ainp p q)
(subs_var_proc P' (pname r) y)) ->
(forall r : PP,
Pr (subs_var_proc P (pname r) x) (subs_var_proc P' (pname r) y) p q) ->
Pr (res x t P) (res y t P') p q) ->
(forall (P P' : proc) (p q : PP),
sem (par (ban P) P) (ainp p q) P' ->
Pr (par (ban P) P) P' p q -> Pr (ban P) P' p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (ainp p q) P' -> Pr P P' p q -> Pr (par P Q) (par P' Q) p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (ainp p q) P' -> Pr P P' p q -> Pr (par Q P) (par Q P') p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (ainp p q) P' -> Pr P P' p q -> Pr (sum P Q) P' p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (ainp p q) P' -> Pr P P' p q -> Pr (sum Q P) P' p q) ->
(forall (P P' : proc) (p q r : PP),
sem P (ainp p q) P' -> Pr P P' p q -> Pr (mat (pname r) (pname r) P) P' p q) ->
forall (P P' : proc) (p q : PP), sem P (ainp p q) P' -> Pr P P' p q.
Proof.
intros Pr ok_inp ok_res ok_ban ok_parl ok_parr ok_suml ok_sumr ok_mat.
cut
(forall (P : proc) (mu : act) (P' : proc),
sem P mu P' -> forall p q : PP, mu = ainp p q -> Pr P P' p q).
intros cond P P' p q reduction.
apply cond with (mu := ainp p q).
exact reduction.
reflexivity.
intros P mu P' reduction.
apply
sem_ind
with
(P := fun (P : proc) (mu : act) (P' : proc) =>
forall p q : PP, mu = ainp p q -> Pr P P' p q).
intros pp qq xx QQ ppp qqq inp_is_inp.
injection inp_is_inp.
intros qq_is_qqq pp_is_ppp; rewrite qq_is_qqq; rewrite pp_is_ppp.
apply ok_inp.
intros p q Q pp qq absurd.
discriminate absurd.
intros until q0.
intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros PP PP' nu x y t cond_sem cond_pr.
intros p q nu_is.
apply ok_res.
intro r.
rewrite nu_is in cond_sem.
apply cond_sem.
intro r.
rewrite nu_is in cond_pr.
apply cond_pr.
reflexivity.
intros PP PP' mu' reduction' cond_pr p q mu_is_inp.
apply ok_ban.
rewrite mu_is_inp in reduction'.
assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond_fresh reduction' cond_pr p q mu_is_inp.
apply ok_parl.
rewrite mu_is_inp in reduction'; assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond_fresh reduction' cond_pr p q mu_is_inp.
apply ok_parr.
rewrite mu_is_inp in reduction'.
assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' reduction' cond_pr.
intros p q mu_is_inp; apply ok_suml.
rewrite mu_is_inp in reduction'.
assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' reduction' cond_pr p q mu_is_inp.
rewrite mu_is_inp in reduction'.
apply ok_sumr.
assumption.
apply cond_pr.
assumption.
intros PP PP' p mu' reduction' cond_pr p' q mu_is_inp.
rewrite mu_is_inp in reduction'.
apply ok_mat.
assumption.
apply cond_pr.
assumption.
assumption.
Qed.
Theorem out_ind :
forall Pr : proc -> proc -> PP -> PP -> Prop,
(forall (p q : PP) (P : proc), Pr (out (pname p) (pname q) P) P p q) ->
(forall (P P' : proc) (p q : PP) (x y : VV) (t : type),
(forall r : PP,
sem (subs_var_proc P (pname r) x) (aout p q)
(subs_var_proc P' (pname r) y)) ->
(forall r : PP,
Pr (subs_var_proc P (pname r) x) (subs_var_proc P' (pname r) y) p q) ->
Pr (res x t P) (res y t P') p q) ->
(forall (P P' : proc) (p q : PP),
sem (par (ban P) P) (aout p q) P' ->
Pr (par (ban P) P) P' p q -> Pr (ban P) P' p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (aout p q) P' -> Pr P P' p q -> Pr (par P Q) (par P' Q) p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (aout p q) P' -> Pr P P' p q -> Pr (par Q P) (par Q P') p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (aout p q) P' -> Pr P P' p q -> Pr (sum P Q) P' p q) ->
(forall (P P' Q : proc) (p q : PP),
sem P (aout p q) P' -> Pr P P' p q -> Pr (sum Q P) P' p q) ->
(forall (P P' : proc) (p q r : PP),
sem P (aout p q) P' -> Pr P P' p q -> Pr (mat (pname r) (pname r) P) P' p q) ->
forall (P P' : proc) (p q : PP), sem P (aout p q) P' -> Pr P P' p q.
Proof.
intros Pr ok_inp ok_res ok_ban ok_parl ok_parr ok_suml ok_sumr ok_mat.
cut
(forall (P : proc) (mu : act) (P' : proc),
sem P mu P' -> forall p q : PP, mu = aout p q -> Pr P P' p q).
intros cond P P' p q reduction.
apply cond with (mu := aout p q).
exact reduction.
reflexivity.
intros P mu P' reduction.
apply
sem_ind
with
(P := fun (P : proc) (mu : act) (P' : proc) =>
forall p q : PP, mu = aout p q -> Pr P P' p q).
intros until q0; intro absurd; discriminate absurd.
intros p q Q p0 q0 out_is_out.
injection out_is_out.
intros q_is_q0 p_is_p0.
rewrite q_is_q0.
rewrite p_is_p0.
apply ok_inp.
intros until q0.
intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros until q0; intro absurd; discriminate absurd.
intros PP PP' mu' x y t cond_red cond_pr p q mu_is.
apply ok_res.
intro r.
rewrite mu_is in cond_red.
apply cond_red.
intro r.
rewrite mu_is in cond_pr.
apply cond_pr.
reflexivity.
intros PP PP' mu' red cond_pr p q mu_is.
apply ok_ban.
rewrite mu_is in red.
exact red.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond red cond_pr p q mu_is.
apply ok_parl.
rewrite mu_is in red; exact red.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond red cond_pr p q mu_is.
apply ok_parr.
rewrite mu_is in red; exact red.
apply cond_pr.
assumption.
intros PP PP' Q mu' red cond_pr p q mu_is.
apply ok_suml.
rewrite mu_is in red.
assumption.
apply cond_pr; assumption.
intros PP PP' Q mu' red cond_pr p q mu_is.
apply ok_sumr.
rewrite mu_is in red; exact red.
apply cond_pr; assumption.
intros PP PP' p mu' red cond_pr p' q mu_is.
apply ok_mat.
rewrite mu_is in red.
assumption.
apply cond_pr.
assumption.
assumption.
Qed.
Theorem bout_ind :
forall Pr : proc -> proc -> PP -> PP -> type -> Prop,
(forall (p q : PP) (x : VV) (t : type) (P P' : proc),
fresh q P ->
q <> p ->
sem (subs_var_proc P (pname q) x) (aout p q) P' -> Pr (res x t P) P' p q t) ->
(forall (p q : PP) (x y : VV) (t t' : type) (P P' : proc),
(forall r : PP,
sem (subs_var_proc P (pname r) x) (about p q t)
(subs_var_proc P' (pname r) y)) ->
(forall r : PP,
Pr (subs_var_proc P (pname r) x) (subs_var_proc P' (pname r) y) p q t) ->
Pr (res x t' P) (res y t' P') p q t) ->
(forall (P P' : proc) (p q : PP) (t : type),
sem (par (ban P) P) (about p q t) P' ->
Pr (par (ban P) P) P' p q t -> Pr (ban P) P' p q t) ->
(forall (P P' Q : proc) (p q : PP) (t : type),
fresh q Q ->
sem P (about p q t) P' -> Pr P P' p q t -> Pr (par P Q) (par P' Q) p q t) ->
(forall (P P' Q : proc) (p q : PP) (t : type),
fresh q Q ->
sem P (about p q t) P' -> Pr P P' p q t -> Pr (par Q P) (par Q P') p q t) ->
(forall (P P' Q : proc) (p q : PP) (t : type),
sem P (about p q t) P' -> Pr P P' p q t -> Pr (sum P Q) P' p q t) ->
(forall (P P' Q : proc) (p q : PP) (t : type),
sem P (about p q t) P' -> Pr P P' p q t -> Pr (sum Q P) P' p q t) ->
(forall (P P' : proc) (p q r : PP) (t : type),
sem P (about p q t) P' ->
Pr P P' p q t -> Pr (mat (pname r) (pname r) P) P' p q t) ->
forall (P P' : proc) (p q : PP) (t : type),
sem P (about p q t) P' -> Pr P P' p q t.
Proof.
intros Pr ok_bout ok_res ok_ban ok_parl ok_parr ok_suml ok_sumr ok_mat.
cut
(forall (P : proc) (mu : act) (P' : proc),
sem P mu P' ->
forall (p q : PP) (t : type), mu = about p q t -> Pr P P' p q t).
intros cond P P' p q t reduction.
apply cond with (mu := about p q t).
exact reduction.
reflexivity.
intros P mu P' reduction.
apply
sem_ind
with
(P := fun (P : proc) (mu : act) (P' : proc) =>
forall (p q : PP) (t : type), mu = about p q t -> Pr P P' p q t).
intros until t; intro absurd; discriminate absurd.
intros until t; intro absurd; discriminate absurd.
intros until t; intro absurd; discriminate absurd.
intros until t; intro absurd; discriminate absurd.
intros PP PP' p q x t fresh_q p_not_q reduction' cond_pr p0 q0 t0
bout_is_bout.
injection bout_is_bout.
intros t_is_t0 q_is_q0 p_is_p0.
rewrite t_is_t0.
apply ok_bout.
rewrite <- q_is_q0.
assumption.
rewrite <- q_is_q0; rewrite <- p_is_p0.
red in |- *; intro; elim p_not_q; symmetry in |- *; assumption.
rewrite p_is_p0 in reduction'; rewrite q_is_q0 in reduction'.
assumption.
intros until t0; intro absurd; discriminate absurd.
intros until t0; intro absurd; discriminate absurd.
intros PP PP' mu' x y t cond_red cond_pr p q t' mu_is.
apply ok_res.
intro r.
rewrite mu_is in cond_red.
apply cond_red.
intro r.
rewrite mu_is in cond_pr.
apply cond_pr.
reflexivity.
intros PP PP' mu' red cond_pr p q t mu''.
apply ok_ban.
rewrite mu'' in red; assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond red cond_pr p q t mu_is.
apply ok_parl.
apply cond with (p := p) (t := t).
assumption.
rewrite mu_is in red.
assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' cond red cond_pr p q t mu_is.
apply ok_parr.
apply cond with (p := p) (t := t).
assumption.
rewrite mu_is in red.
assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' red cond_pr p q t mu_is.
apply ok_suml.
rewrite mu_is in red; assumption.
apply cond_pr.
assumption.
intros PP PP' Q mu' red cond_pr p q t mu_is.
apply ok_sumr.
rewrite mu_is in red; assumption.
apply cond_pr; assumption.
intros PP PP' q mu' red cond_pr p0 q' t mu''.
apply ok_mat.
rewrite mu'' in red; assumption.
apply cond_pr; assumption.
assumption.
Qed.
Theorem tau_ind :
forall Pr : proc -> proc -> Prop,
(forall (P P' Q Q' : proc) (p q : PP),
sem P (ainp p q) P' -> sem Q (aout p q) Q' -> Pr (par P Q) (par P' Q')) ->
(forall (P P' Q Q' : proc) (p q : PP),
sem P (ainp p q) P' -> sem Q (aout p q) Q' -> Pr (par Q P) (par Q' P')) ->
(forall (P P' Q Q' : proc) (p q r : PP) (t : type) (x : VV),
fresh q P ->
freshvar x P' ->
freshvar x Q' ->
sem P (ainp p q) P' ->
sem Q (about p r t) Q' ->
Pr (par P Q)
(res x t
(par (subs_par_proc P' (vname x) q) (subs_par_proc Q' (vname x) r)))) ->
(forall (P P' Q Q' : proc) (p q r : PP) (t : type) (x : VV),
fresh q P ->
freshvar x P' ->
freshvar x Q' ->
sem P (ainp p q) P' ->
sem Q (about p r t) Q' ->
Pr (par Q P)
(res x t
(par (subs_par_proc Q' (vname x) r) (subs_par_proc P' (vname x) q)))) ->
(forall (x y : VV) (t' : type) (P P' : proc),
(forall r : PP,
sem (subs_var_proc P (pname r) x) tau (subs_var_proc P' (pname r) y)) ->
(forall r : PP,
Pr (subs_var_proc P (pname r) x) (subs_var_proc P' (pname r) y)) ->
Pr (res x t' P) (res y t' P')) ->
(forall P P' : proc,
sem (par (ban P) P) tau P' -> Pr (par (ban P) P) P' -> Pr (ban P) P') ->
(forall P P' Q : proc, sem P tau P' -> Pr P P' -> Pr (par P Q) (par P' Q)) ->
(forall P P' Q : proc, sem P tau P' -> Pr P P' -> Pr (par Q P) (par Q P')) ->
(forall P P' Q : proc, sem P tau P' -> Pr P P' -> Pr (sum P Q) P') ->
(forall P P' Q : proc, sem P tau P' -> Pr P P' -> Pr (sum Q P) P') ->
(forall (P P' : proc) (r : PP),
sem P tau P' -> Pr P P' -> Pr (mat (pname r) (pname r) P) P') ->
forall P P' : proc, sem P tau P' -> Pr P P'.
Proof.
intros Pr ok_coml ok_comr ok_closel ok_closer ok_res ok_ban ok_parl ok_parr
ok_suml ok_sumr ok_mat.
cut
(forall (P : proc) (mu : act) (P' : proc),
sem P mu P' -> mu = tau -> Pr P P').
intros cond P P' reduction.
apply cond with (mu := tau).
exact reduction.
reflexivity.
intros P mu P' reduction.
apply
sem_ind
with (P := fun (P : proc) (mu : act) (P' : proc) => mu = tau -> Pr P P').
intros until Q; intro absurd; discriminate absurd.
intros until Q; intro absurd; discriminate absurd.
intros PP PP' Q Q' p q redinp boom redout bam ok.
apply ok_coml with (p := p) (q := q).
assumption.
assumption.
intros PP PP' Q Q' p q redout boom redinp bam ok.
apply ok_comr with (p := p) (q := q).
assumption.
assumption.
intros z0 z1 z2 z3 z4 z5 z6 z7 z8 absurd.
intro absurd'; discriminate absurd'.
intros PP PP' Q Q' p q r t x fresh_q fresh_P' fresh_Q' redinp boom redout bam
ok.
apply ok_closel with (p := p) (q := q) (r := r) (t := t) (x := x).
assumption.
assumption.
assumption.
assumption.
assumption.
intros PP PP' Q Q' p q r t x fresh_q fresh_P' fresh_Q' redinp boom redout bam
ok.
apply ok_closer with (p := p).
assumption.
assumption.
assumption.
assumption.
assumption.
intros PP PP' mu' x y t cond_red cond_pr mu_is.
apply ok_res.
intro r.
rewrite mu_is in cond_red; apply cond_red.
intro; apply cond_pr.
assumption. intros PP PP' mu' red cond mu_is.
apply ok_ban.
rewrite mu_is in red; exact red.
apply cond; assumption.
intros PP PP' Q mu' cond red cond2 mu_is.
apply ok_parl.
rewrite mu_is in red.
assumption.
apply cond2; assumption.
intros PP PP' Q mu' cond red cond_pr mu_is.
apply ok_parr.
rewrite mu_is in red; apply red.
apply cond_pr; assumption.
intros PP PP' Q mu' red cond mu_is.
apply ok_suml.
rewrite mu_is in red; assumption.
apply cond; assumption.
intros PP PP' Q mu' red cond mu_is.
apply ok_sumr.
rewrite mu_is in red; assumption.
apply cond; assumption.
intros PP PP' p mu' red cond mu_is.
apply ok_mat.
rewrite mu_is in red; assumption.
apply cond; assumption.
assumption.
Qed.