1048
|
1 |
(* Title: Confluence.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Ole Rasmussen
|
|
4 |
Copyright 1995 University of Cambridge
|
|
5 |
Logic Image: ZF
|
|
6 |
*)
|
|
7 |
|
|
8 |
open Confluence;
|
|
9 |
|
|
10 |
(* ------------------------------------------------------------------------- *)
|
|
11 |
(* Confluence *)
|
|
12 |
(* ------------------------------------------------------------------------- *)
|
|
13 |
|
|
14 |
goalw Confluence.thy [confluence_def]
|
|
15 |
"!!u.[|confluence(Spar_red)|]==> confluence(Sred)";
|
|
16 |
by (step_tac ZF_cs 1);
|
|
17 |
by (dres_inst_tac [("x4","x"),("x3","y"),("x1","z")]
|
|
18 |
(spec RS spec RS mp RS spec RS mp) 1);
|
|
19 |
by (ALLGOALS(asm_simp_tac (reduc_ss addsimps [red_par_red])));
|
|
20 |
by (fast_tac (reduc_cs addIs [par_red_red]) 1);
|
|
21 |
val lemma1 = result();
|
|
22 |
|
|
23 |
(* ------------------------------------------------------------------------- *)
|
|
24 |
(* strip lemmas *)
|
|
25 |
(* ------------------------------------------------------------------------- *)
|
|
26 |
|
|
27 |
goalw Confluence.thy [confluence_def,strip_def]
|
|
28 |
"!!u.[|confluence(Spar_red1)|]==> strip";
|
|
29 |
by (resolve_tac [impI RS allI RS allI] 1);
|
|
30 |
by (eresolve_tac [par_red_induct] 1);
|
|
31 |
by (fast_tac reduc_cs 1);
|
|
32 |
by (fast_tac (ZF_cs addIs [Spar_red.trans]) 1);
|
|
33 |
val strip_lemma_r = result();
|
|
34 |
|
|
35 |
|
|
36 |
goalw Confluence.thy [confluence_def,strip_def]
|
|
37 |
"!!u.strip==> confluence(Spar_red)";
|
|
38 |
by (resolve_tac [impI RS allI RS allI] 1);
|
|
39 |
by (eresolve_tac [par_red_induct] 1);
|
|
40 |
by (fast_tac reduc_cs 1);
|
|
41 |
by (step_tac ZF_cs 1);
|
|
42 |
by (dres_inst_tac [("x1","z")] (spec RS mp) 1);
|
|
43 |
by (REPEAT(eresolve_tac [exE,conjE] 2));
|
|
44 |
by (dres_inst_tac [("x1","ua")] (spec RS mp) 2);
|
|
45 |
by (fast_tac (ZF_cs addIs [Spar_red.trans]) 3);
|
|
46 |
by (TRYALL assume_tac );
|
|
47 |
val strip_lemma_l = result();
|
|
48 |
|
|
49 |
(* ------------------------------------------------------------------------- *)
|
|
50 |
(* Confluence *)
|
|
51 |
(* ------------------------------------------------------------------------- *)
|
|
52 |
|
|
53 |
|
|
54 |
goal Confluence.thy
|
|
55 |
"!!u.confluence(Spar_red1)==> confluence(Spar_red)";
|
|
56 |
by (resolve_tac [strip_lemma_r RS strip_lemma_l] 1);
|
|
57 |
by (assume_tac 1);
|
|
58 |
val lemma2 = result();
|
|
59 |
|
|
60 |
|
|
61 |
goalw Confluence.thy [confluence_def] "confluence(Spar_red1)";
|
|
62 |
by (step_tac ZF_cs 1);
|
|
63 |
by (forward_tac [simulation] 1);
|
|
64 |
by (forw_inst_tac [("n","z")] simulation 1);
|
|
65 |
by (step_tac ZF_cs 1);
|
|
66 |
by (forw_inst_tac [("v","va")] paving 1);
|
|
67 |
by (TRYALL assume_tac);
|
|
68 |
by (REPEAT(step_tac ZF_cs 1));
|
|
69 |
by (res_inst_tac [("v","vu")] completeness 1);
|
|
70 |
by (ALLGOALS(asm_simp_tac (reduc_ss addsimps [completeness])));
|
|
71 |
val parallel_moves = result();
|
|
72 |
|
|
73 |
goal Confluence.thy "confluence(Spar_red)";
|
|
74 |
by (resolve_tac [parallel_moves RS lemma2] 1);
|
|
75 |
val confluence_parallel_reduction = result();
|
|
76 |
|
|
77 |
goal Confluence.thy "confluence(Sred)";
|
|
78 |
by (resolve_tac [confluence_parallel_reduction RS lemma1] 1);
|
|
79 |
val confluence_beta_reduction = result();
|