author | clasohm |
Wed, 04 Oct 1995 13:12:14 +0100 | |
changeset 1266 | 3ae9fe3c0f68 |
parent 1172 | ab725b698cb2 |
child 1269 | ee011b365770 |
permissions | -rw-r--r-- |
1120 | 1 |
(* Title: HOL/Lambda/ParRed.thy |
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 |
||
10 |
open ParRed; |
|
11 |
||
1266 | 12 |
Addsimps par_beta.intrs; |
1120 | 13 |
|
14 |
val par_beta_cases = map (par_beta.mk_cases db.simps) |
|
15 |
["Var n => t", "Fun s => Fun t", |
|
16 |
"(Fun s) @ t => u", "s @ t => u", "Fun s => t"]; |
|
17 |
||
18 |
val parred_cs = lambda_cs addSIs par_beta.intrs addSEs par_beta_cases; |
|
19 |
||
20 |
(*** beta <= par_beta <= beta^* ***) |
|
21 |
||
22 |
goal ParRed.thy "(Var n => t) = (t = Var n)"; |
|
23 |
by(fast_tac parred_cs 1); |
|
24 |
qed "par_beta_varL"; |
|
1266 | 25 |
Addsimps [par_beta_varL]; |
1120 | 26 |
|
27 |
goal ParRed.thy "t => t"; |
|
28 |
by(db.induct_tac "t" 1); |
|
1266 | 29 |
by(ALLGOALS Asm_simp_tac); |
1120 | 30 |
qed"par_beta_refl"; |
1266 | 31 |
Addsimps [par_beta_refl]; |
1120 | 32 |
|
33 |
goal ParRed.thy "beta <= par_beta"; |
|
34 |
br subsetI 1; |
|
35 |
by (res_inst_tac[("p","x")]PairE 1); |
|
36 |
by (hyp_subst_tac 1); |
|
37 |
be (beta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1; |
|
38 |
by (ALLGOALS(fast_tac (parred_cs addSIs [par_beta_refl]))); |
|
39 |
qed "beta_subset_par_beta"; |
|
40 |
||
41 |
goal ParRed.thy "par_beta <= beta^*"; |
|
42 |
br subsetI 1; |
|
43 |
by (res_inst_tac[("p","x")]PairE 1); |
|
44 |
by (hyp_subst_tac 1); |
|
45 |
be (par_beta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1; |
|
46 |
by (ALLGOALS(fast_tac (parred_cs addIs |
|
47 |
[rtrancl_beta_Fun,rtrancl_beta_App,rtrancl_refl, |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
48 |
rtrancl_into_rtrancl] addEs [rtrancl_trans]))); |
1120 | 49 |
qed "par_beta_subset_beta"; |
50 |
||
51 |
(*** => ***) |
|
52 |
||
1172 | 53 |
goal ParRed.thy "!t' n. t => t' --> lift t n => lift t' n"; |
54 |
by(db.induct_tac "t" 1); |
|
1266 | 55 |
by(ALLGOALS(fast_tac (parred_cs addss (!simpset)))); |
1120 | 56 |
bind_thm("par_beta_lift", result() RS spec RS spec RS mp); |
1266 | 57 |
Addsimps [par_beta_lift]; |
1120 | 58 |
|
59 |
goal ParRed.thy |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
60 |
"!s s' t' n. s => s' --> t => t' --> t[s/n] => t'[s'/n]"; |
1120 | 61 |
by(db.induct_tac "t" 1); |
1266 | 62 |
by(asm_simp_tac (!simpset setloop (split_tac [expand_if])) 1); |
1120 | 63 |
by(strip_tac 1); |
64 |
bes par_beta_cases 1; |
|
1266 | 65 |
by(Asm_simp_tac 1); |
66 |
by(Asm_simp_tac 1); |
|
1120 | 67 |
br (zero_less_Suc RS subst_subst RS subst) 1; |
1266 | 68 |
by(fast_tac (parred_cs addSIs [par_beta_lift] addss (!simpset)) 1); |
69 |
by(fast_tac (parred_cs addss (!simpset)) 1); |
|
1120 | 70 |
bind_thm("par_beta_subst", |
71 |
result() RS spec RS spec RS spec RS spec RS mp RS mp); |
|
72 |
||
1156 | 73 |
(*** Confluence (directly) ***) |
74 |
||
75 |
goalw ParRed.thy [diamond_def] "diamond(par_beta)"; |
|
76 |
by(REPEAT(rtac allI 1)); |
|
77 |
br impI 1; |
|
78 |
be (par_beta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1; |
|
79 |
by(ALLGOALS(fast_tac (parred_cs addSIs [par_beta_subst]))); |
|
80 |
qed "diamond_par_beta"; |
|
81 |
||
82 |
||
83 |
(*** cd ***) |
|
84 |
||
85 |
goal ParRed.thy "cd(Var n @ t) = Var n @ cd t"; |
|
1266 | 86 |
by(Simp_tac 1); |
1156 | 87 |
qed"cd_App_Var"; |
88 |
||
89 |
goal ParRed.thy "cd((r @ s) @ t) = cd(r @ s) @ cd t"; |
|
1266 | 90 |
by(Simp_tac 1); |
1156 | 91 |
qed"cd_App_App"; |
92 |
||
93 |
goal ParRed.thy "cd((Fun s) @ t) = (cd s)[cd t/0]"; |
|
1266 | 94 |
by(Simp_tac 1); |
1156 | 95 |
qed"cd_App_Fun"; |
96 |
||
1266 | 97 |
Addsimps [cd_App_Var,cd_App_App,cd_App_Fun]; |
1156 | 98 |
|
1120 | 99 |
goal ParRed.thy "!t. s => t --> t => cd s"; |
100 |
by(db.induct_tac "s" 1); |
|
1266 | 101 |
by(Simp_tac 1); |
1120 | 102 |
be rev_mp 1; |
103 |
by(db.induct_tac "db1" 1); |
|
1266 | 104 |
by(ALLGOALS(fast_tac (parred_cs addSIs [par_beta_subst] addss (!simpset)))); |
1120 | 105 |
bind_thm("par_beta_cd", result() RS spec RS mp); |
106 |
||
1156 | 107 |
(*** Confluence (via cd) ***) |
1120 | 108 |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
109 |
goalw ParRed.thy [diamond_def] "diamond(par_beta)"; |
1120 | 110 |
by(fast_tac (HOL_cs addIs [par_beta_cd]) 1); |
1266 | 111 |
qed "diamond_par_beta2"; |
1120 | 112 |
|
113 |
goal ParRed.thy "confluent(beta)"; |
|
1266 | 114 |
by(fast_tac (HOL_cs addIs [diamond_par_beta2,diamond_to_confluence, |
1120 | 115 |
par_beta_subset_beta,beta_subset_par_beta]) 1); |
116 |
qed"beta_confluent"; |