author | paulson |
Tue, 19 Jan 1999 11:18:11 +0100 | |
changeset 6141 | a6922171b396 |
parent 5184 | 9b8547a9496a |
child 8624 | 69619f870939 |
permissions | -rw-r--r-- |
1288 | 1 |
(* Title: HOL/Lambda/ParRed.ML |
1120 | 2 |
ID: $Id$ |
3 |
Author: Tobias Nipkow |
|
4 |
Copyright 1995 TU Muenchen |
|
5 |
||
6 |
Properties of => and cd, in particular the diamond property of => and |
|
7 |
confluence of beta. |
|
8 |
*) |
|
9 |
||
1266 | 10 |
Addsimps par_beta.intrs; |
1120 | 11 |
|
6141 | 12 |
val par_beta_cases = |
13 |
map par_beta.mk_cases |
|
14 |
["Var n => t", |
|
15 |
"Abs s => Abs t", |
|
16 |
"(Abs s) $ t => u", |
|
17 |
"s $ t => u", |
|
18 |
"Abs s => t"]; |
|
1120 | 19 |
|
1974
b50f96543dec
Removed refs to clasets like rel_cs etc. Used implicit claset.
nipkow
parents:
1730
diff
changeset
|
20 |
AddSIs par_beta.intrs; |
b50f96543dec
Removed refs to clasets like rel_cs etc. Used implicit claset.
nipkow
parents:
1730
diff
changeset
|
21 |
AddSEs par_beta_cases; |
1120 | 22 |
|
23 |
(*** beta <= par_beta <= beta^* ***) |
|
24 |
||
5069 | 25 |
Goal "(Var n => t) = (t = Var n)"; |
2891 | 26 |
by (Blast_tac 1); |
1120 | 27 |
qed "par_beta_varL"; |
1266 | 28 |
Addsimps [par_beta_varL]; |
1120 | 29 |
|
5069 | 30 |
Goal "t => t"; |
5184 | 31 |
by (induct_tac "t" 1); |
2031 | 32 |
by (ALLGOALS Asm_simp_tac); |
1120 | 33 |
qed"par_beta_refl"; |
1266 | 34 |
Addsimps [par_beta_refl]; |
1974
b50f96543dec
Removed refs to clasets like rel_cs etc. Used implicit claset.
nipkow
parents:
1730
diff
changeset
|
35 |
(* AddSIs [par_beta_refl]; causes search to blow up *) |
1120 | 36 |
|
5069 | 37 |
Goal "beta <= par_beta"; |
1465 | 38 |
by (rtac subsetI 1); |
1431 | 39 |
by (split_all_tac 1); |
1730 | 40 |
by (etac beta.induct 1); |
4089 | 41 |
by (ALLGOALS(blast_tac (claset() addSIs [par_beta_refl]))); |
1120 | 42 |
qed "beta_subset_par_beta"; |
43 |
||
5069 | 44 |
Goal "par_beta <= beta^*"; |
1465 | 45 |
by (rtac subsetI 1); |
1431 | 46 |
by (split_all_tac 1); |
1730 | 47 |
by (etac par_beta.induct 1); |
2922 | 48 |
by (Blast_tac 1); |
49 |
(* rtrancl_refl complicates the proof by increasing the branching factor*) |
|
4089 | 50 |
by (ALLGOALS (blast_tac (claset() delrules [rtrancl_refl] |
2922 | 51 |
addIs [rtrancl_into_rtrancl]))); |
1120 | 52 |
qed "par_beta_subset_beta"; |
53 |
||
54 |
(*** => ***) |
|
55 |
||
5069 | 56 |
Goal "!t' n. t => t' --> lift t n => lift t' n"; |
5184 | 57 |
by (induct_tac "t" 1); |
4089 | 58 |
by (ALLGOALS(fast_tac (claset() addss (simpset())))); |
1486 | 59 |
qed_spec_mp "par_beta_lift"; |
1266 | 60 |
Addsimps [par_beta_lift]; |
1120 | 61 |
|
5069 | 62 |
Goal |
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
63 |
"!s s' t' n. s => s' --> t => t' --> t[s/n] => t'[s'/n]"; |
5184 | 64 |
by (induct_tac "t" 1); |
4089 | 65 |
by (asm_simp_tac (addsplit(simpset())) 1); |
2057 | 66 |
by (strip_tac 1); |
67 |
by (eresolve_tac par_beta_cases 1); |
|
68 |
by (Asm_simp_tac 1); |
|
4089 | 69 |
by (asm_simp_tac (simpset() addsimps [subst_subst RS sym]) 1); |
70 |
by (fast_tac (claset() addSIs [par_beta_lift] addss (simpset())) 1); |
|
71 |
by (fast_tac (claset() addss (simpset())) 1); |
|
1486 | 72 |
qed_spec_mp "par_beta_subst"; |
1120 | 73 |
|
1156 | 74 |
(*** Confluence (directly) ***) |
75 |
||
5069 | 76 |
Goalw [diamond_def,commute_def,square_def] "diamond(par_beta)"; |
1730 | 77 |
by (rtac (impI RS allI RS allI) 1); |
78 |
by (etac par_beta.induct 1); |
|
4089 | 79 |
by (ALLGOALS(blast_tac (claset() addSIs [par_beta_subst]))); |
1156 | 80 |
qed "diamond_par_beta"; |
81 |
||
82 |
||
83 |
(*** cd ***) |
|
84 |
||
5134 | 85 |
Addsimps cd.rules; |
86 |
||
5069 | 87 |
Goal "!t. s => t --> t => cd s"; |
5168 | 88 |
by (res_inst_tac[("u","s")] cd.induct 1); |
89 |
by (Auto_tac); |
|
90 |
by (fast_tac (claset() addSIs [par_beta_subst]) 1); |
|
1486 | 91 |
qed_spec_mp "par_beta_cd"; |
1120 | 92 |
|
1156 | 93 |
(*** Confluence (via cd) ***) |
1120 | 94 |
|
5069 | 95 |
Goalw [diamond_def,commute_def,square_def] "diamond(par_beta)"; |
4089 | 96 |
by (blast_tac (claset() addIs [par_beta_cd]) 1); |
1266 | 97 |
qed "diamond_par_beta2"; |
1120 | 98 |
|
5069 | 99 |
Goal "confluent(beta)"; |
2891 | 100 |
by (blast_tac (HOL_cs addIs [diamond_par_beta2, diamond_to_confluence, |
101 |
par_beta_subset_beta, beta_subset_par_beta]) 1); |
|
1120 | 102 |
qed"beta_confluent"; |