author | nipkow |
Mon, 22 May 1995 14:12:40 +0200 | |
changeset 1124 | a6233ea105a4 |
parent 1120 | ff7dd80513e6 |
child 1156 | b373cb33352f |
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 |
||
12 |
val parred_ss = lambda_ss addsimps |
|
13 |
par_beta.intrs @ [cd_Var,cd_Fun]; |
|
14 |
||
15 |
val par_beta_cases = map (par_beta.mk_cases db.simps) |
|
16 |
["Var n => t", "Fun s => Fun t", |
|
17 |
"(Fun s) @ t => u", "s @ t => u", "Fun s => t"]; |
|
18 |
||
19 |
val parred_cs = lambda_cs addSIs par_beta.intrs addSEs par_beta_cases; |
|
20 |
||
21 |
(*** beta <= par_beta <= beta^* ***) |
|
22 |
||
23 |
goal ParRed.thy "(Var n => t) = (t = Var n)"; |
|
24 |
by(fast_tac parred_cs 1); |
|
25 |
qed "par_beta_varL"; |
|
26 |
val parred_ss = parred_ss addsimps [par_beta_varL]; |
|
27 |
||
28 |
goal ParRed.thy "t => t"; |
|
29 |
by(db.induct_tac "t" 1); |
|
30 |
by(ALLGOALS(asm_simp_tac parred_ss)); |
|
31 |
qed"par_beta_refl"; |
|
32 |
val parred_ss = parred_ss addsimps [par_beta_refl]; |
|
33 |
||
34 |
goal ParRed.thy "beta <= par_beta"; |
|
35 |
br subsetI 1; |
|
36 |
by (res_inst_tac[("p","x")]PairE 1); |
|
37 |
by (hyp_subst_tac 1); |
|
38 |
be (beta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1; |
|
39 |
by (ALLGOALS(fast_tac (parred_cs addSIs [par_beta_refl]))); |
|
40 |
qed "beta_subset_par_beta"; |
|
41 |
||
42 |
goal ParRed.thy "par_beta <= beta^*"; |
|
43 |
br subsetI 1; |
|
44 |
by (res_inst_tac[("p","x")]PairE 1); |
|
45 |
by (hyp_subst_tac 1); |
|
46 |
be (par_beta.mutual_induct RS spec RS spec RSN (2,rev_mp)) 1; |
|
47 |
by (ALLGOALS(fast_tac (parred_cs addIs |
|
48 |
[rtrancl_beta_Fun,rtrancl_beta_App,rtrancl_refl, |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
49 |
rtrancl_into_rtrancl] addEs [rtrancl_trans]))); |
1120 | 50 |
qed "par_beta_subset_beta"; |
51 |
||
52 |
(*** cd ***) |
|
53 |
||
54 |
goal ParRed.thy "cd(Var n @ t) = Var n @ cd t"; |
|
55 |
by(simp_tac (parred_ss addsimps [cd_App]) 1); |
|
56 |
qed"cd_App_Var"; |
|
57 |
||
58 |
goal ParRed.thy "cd((r @ s) @ t) = cd(r @ s) @ cd t"; |
|
59 |
by(simp_tac (parred_ss addsimps [cd_App]) 1); |
|
60 |
qed"cd_App_App"; |
|
61 |
||
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
62 |
goal ParRed.thy "cd((Fun s) @ t) = (cd s)[cd t/0]"; |
1120 | 63 |
by(simp_tac (parred_ss addsimps [cd_App,deFun_Fun]) 1); |
64 |
qed"cd_App_Fun"; |
|
65 |
||
66 |
val parred_ss = parred_ss addsimps [cd_App_Var,cd_App_App,cd_App_Fun]; |
|
67 |
||
68 |
(*** => ***) |
|
69 |
||
70 |
goal ParRed.thy "!s' n. s => s' --> lift s n => lift s' n"; |
|
71 |
by(db.induct_tac "s" 1); |
|
72 |
by(ALLGOALS(fast_tac (parred_cs addss parred_ss))); |
|
73 |
bind_thm("par_beta_lift", result() RS spec RS spec RS mp); |
|
74 |
val parred_ss = parred_ss addsimps [par_beta_lift]; |
|
75 |
||
76 |
goal ParRed.thy |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
77 |
"!s s' t' n. s => s' --> t => t' --> t[s/n] => t'[s'/n]"; |
1120 | 78 |
by(db.induct_tac "t" 1); |
79 |
by(asm_simp_tac (addsplit parred_ss) 1); |
|
80 |
by(strip_tac 1); |
|
81 |
bes par_beta_cases 1; |
|
82 |
by(asm_simp_tac parred_ss 1); |
|
83 |
by(asm_simp_tac parred_ss 1); |
|
84 |
br (zero_less_Suc RS subst_subst RS subst) 1; |
|
85 |
by(fast_tac (parred_cs addSIs [par_beta_lift] addss parred_ss) 1); |
|
86 |
by(fast_tac (parred_cs addss parred_ss) 1); |
|
87 |
bind_thm("par_beta_subst", |
|
88 |
result() RS spec RS spec RS spec RS spec RS mp RS mp); |
|
89 |
||
90 |
goal ParRed.thy "!t. s => t --> t => cd s"; |
|
91 |
by(db.induct_tac "s" 1); |
|
92 |
by(simp_tac parred_ss 1); |
|
93 |
be rev_mp 1; |
|
94 |
by(db.induct_tac "db1" 1); |
|
95 |
by(ALLGOALS(fast_tac (parred_cs addSIs [par_beta_subst] addss parred_ss))); |
|
96 |
bind_thm("par_beta_cd", result() RS spec RS mp); |
|
97 |
||
98 |
(*** Confluence ***) |
|
99 |
||
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
100 |
goalw ParRed.thy [diamond_def] "diamond(par_beta)"; |
1120 | 101 |
by(fast_tac (HOL_cs addIs [par_beta_cd]) 1); |
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
102 |
qed "diamond_par_beta"; |
1120 | 103 |
|
104 |
goal ParRed.thy "confluent(beta)"; |
|
1124
a6233ea105a4
Polished the presentation making it completely definitional.
nipkow
parents:
1120
diff
changeset
|
105 |
by(fast_tac (HOL_cs addIs [diamond_par_beta,diamond_to_confluence, |
1120 | 106 |
par_beta_subset_beta,beta_subset_par_beta]) 1); |
107 |
qed"beta_confluent"; |