author | wenzelm |
Fri, 25 Apr 1997 17:50:55 +0200 | |
changeset 3061 | 25b2a895f864 |
parent 3018 | e65b60b28341 |
child 3207 | fe79ad367d77 |
permissions | -rw-r--r-- |
2520 | 1 |
(* Title: HOL/W0/W.ML |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
3 |
Author: Dieter Nazareth and Tobias Nipkow |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
4 |
Copyright 1995 TU Muenchen |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
5 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
6 |
Correctness and completeness of type inference algorithm W |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
7 |
*) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
8 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
9 |
Addsimps [Suc_le_lessD]; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
10 |
Delsimps (ex_simps @ all_simps); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
11 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
12 |
(* correctness of W with respect to has_type *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
13 |
goal W.thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
14 |
"!a s t m n . Ok (s,t,m) = W e a n --> $s a |- e :: t"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
15 |
by (expr.induct_tac "e" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
16 |
(* case Var n *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
17 |
by (asm_simp_tac (!simpset setloop (split_tac [expand_if])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
18 |
(* case Abs e *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
19 |
by (asm_full_simp_tac (!simpset addsimps [app_subst_list] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
20 |
setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
21 |
by (strip_tac 1); |
3018 | 22 |
by (dtac sym 1); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
23 |
by (fast_tac (HOL_cs addss !simpset) 1); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
24 |
(* case App e1 e2 *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
25 |
by (simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
26 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
27 |
by ( rename_tac "sa ta na sb tb nb sc" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
28 |
by (res_inst_tac [("t2.0","$ sc tb")] has_type.AppI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
29 |
by (res_inst_tac [("s1","sc")] (app_subst_TVar RS subst) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
30 |
by (rtac (app_subst_Fun RS subst) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
31 |
by (res_inst_tac [("t","$sc(tb -> (TVar nb))"),("s","$sc($sb ta)")] subst 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
32 |
by (Asm_full_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
33 |
by (simp_tac (HOL_ss addsimps [subst_comp_tel RS sym]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
34 |
by ( (rtac has_type_cl_sub 1) THEN (rtac has_type_cl_sub 1)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
35 |
by (asm_full_simp_tac (!simpset addsimps [eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
36 |
by (asm_full_simp_tac (!simpset addsimps [subst_comp_tel RS sym,o_def,has_type_cl_sub,eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
37 |
qed_spec_mp "W_correct"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
38 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
39 |
val has_type_casesE = map(has_type.mk_cases expr.simps) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
40 |
[" s |- Var n :: t"," s |- Abs e :: t","s |- App e1 e2 ::t"]; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
41 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
42 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
43 |
(* the resulting type variable is always greater or equal than the given one *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
44 |
goal thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
45 |
"!a n s t m. W e a n = Ok (s,t,m) --> n<=m"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
46 |
by (expr.induct_tac "e" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
47 |
(* case Var(n) *) |
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2596
diff
changeset
|
48 |
by (fast_tac (HOL_cs unsafe_addss(!simpset setloop (split_tac [expand_if]))) 1); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
49 |
(* case Abs e *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
50 |
by (simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
51 |
by (fast_tac (HOL_cs addDs [Suc_leD]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
52 |
(* case App e1 e2 *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
53 |
by (simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
54 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
55 |
by (rename_tac "s t na sa ta nb sb sc tb m" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
56 |
by (eres_inst_tac [("x","a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
57 |
by (eres_inst_tac [("x","n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
58 |
by (eres_inst_tac [("x","$ s a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
59 |
by (eres_inst_tac [("x","s")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
60 |
by (eres_inst_tac [("x","t")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
61 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
62 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
63 |
by (asm_full_simp_tac (!simpset addsimps [eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
64 |
by (etac conjE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
65 |
by (eres_inst_tac [("x","sa")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
66 |
by (eres_inst_tac [("x","ta")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
67 |
by (eres_inst_tac [("x","nb")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
68 |
by (etac conjE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
69 |
by (res_inst_tac [("j","na")] le_trans 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
70 |
by (Asm_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
71 |
by (Asm_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
72 |
qed_spec_mp "W_var_ge"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
73 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
74 |
Addsimps [W_var_ge]; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
75 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
76 |
goal thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
77 |
"!! s. Ok (s,t,m) = W e a n ==> n<=m"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
78 |
by (asm_full_simp_tac (!simpset addsimps [eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
79 |
qed "W_var_geD"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
80 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
81 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
82 |
(* auxiliary lemma *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
83 |
goal Maybe.thy "(y = Ok x) = (Ok x = y)"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
84 |
by ( simp_tac (!simpset addsimps [eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
85 |
qed "rotate_Ok"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
86 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
87 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
88 |
(* resulting type variable is new *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
89 |
goal thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
90 |
"!n a s t m. new_tv n a --> W e a n = Ok (s,t,m) --> \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
91 |
\ new_tv m s & new_tv m t"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
92 |
by (expr.induct_tac "e" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
93 |
(* case Var n *) |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
94 |
by (fast_tac (HOL_cs addDs [list_all_nth] unsafe_addss (!simpset |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
95 |
addsimps [id_subst_def,new_tv_list,new_tv_subst] |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
96 |
setloop (split_tac [expand_if]))) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
97 |
(* case Abs e *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
98 |
by (simp_tac (!simpset addsimps [new_tv_subst,new_tv_Suc_list] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
99 |
setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
100 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
101 |
by (eres_inst_tac [("x","Suc n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
102 |
by (eres_inst_tac [("x","(TVar n)#a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
103 |
by (fast_tac (HOL_cs addss (!simpset |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
104 |
addsimps [new_tv_subst,new_tv_Suc_list])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
105 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
106 |
(* case App e1 e2 *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
107 |
by (simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
108 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
109 |
by (rename_tac "s t na sa ta nb sb sc tb m" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
110 |
by (eres_inst_tac [("x","n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
111 |
by (eres_inst_tac [("x","a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
112 |
by (eres_inst_tac [("x","s")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
113 |
by (eres_inst_tac [("x","t")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
114 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
115 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
116 |
by (asm_full_simp_tac (!simpset addsimps [eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
117 |
by (eres_inst_tac [("x","$ s a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
118 |
by (eres_inst_tac [("x","sa")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
119 |
by (eres_inst_tac [("x","ta")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
120 |
by (eres_inst_tac [("x","nb")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
121 |
by ( asm_full_simp_tac (!simpset addsimps [o_def,rotate_Ok]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
122 |
by (rtac conjI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
123 |
by (rtac new_tv_subst_comp_2 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
124 |
by (rtac new_tv_subst_comp_2 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
125 |
by (rtac (lessI RS less_imp_le RS new_tv_subst_le) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
126 |
by (res_inst_tac [("n","na")] new_tv_subst_le 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
127 |
by (asm_full_simp_tac (!simpset addsimps [rotate_Ok]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
128 |
by (Asm_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
129 |
by (fast_tac (HOL_cs addDs [W_var_geD] addIs |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
130 |
[new_tv_list_le,new_tv_subst_tel,lessI RS less_imp_le RS new_tv_subst_le]) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
131 |
1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
132 |
by (etac (sym RS mgu_new) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
133 |
by (best_tac (HOL_cs addDs [W_var_geD] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
134 |
addIs [new_tv_subst_te,new_tv_list_le, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
135 |
new_tv_subst_tel, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
136 |
lessI RS less_imp_le RS new_tv_le, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
137 |
lessI RS less_imp_le RS new_tv_subst_le, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
138 |
new_tv_le]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
139 |
by (fast_tac (HOL_cs addDs [W_var_geD] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
140 |
addIs [new_tv_list_le,new_tv_subst_tel,new_tv_le] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
141 |
addss (!simpset)) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
142 |
by (rtac (lessI RS new_tv_subst_var) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
143 |
by (etac (sym RS mgu_new) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
144 |
by (best_tac (HOL_cs addSIs [lessI RS less_imp_le RS new_tv_le,new_tv_subst_te] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
145 |
addDs [W_var_geD] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
146 |
addIs [new_tv_list_le, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
147 |
new_tv_subst_tel, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
148 |
lessI RS less_imp_le RS new_tv_subst_le, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
149 |
new_tv_le] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
150 |
addss !simpset) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
151 |
by (fast_tac (HOL_cs addDs [W_var_geD] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
152 |
addIs [new_tv_list_le,new_tv_subst_tel,new_tv_le] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
153 |
addss (!simpset)) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
154 |
qed_spec_mp "new_tv_W"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
155 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
156 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
157 |
goal thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
158 |
"!n a s t m v. W e a n = Ok (s,t,m) --> \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
159 |
\ (v:free_tv s | v:free_tv t) --> v<n --> v:free_tv a"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
160 |
by (expr.induct_tac "e" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
161 |
(* case Var n *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
162 |
by (fast_tac (HOL_cs addIs [nth_mem,subsetD,ftv_mem_sub_ftv_list] |
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2596
diff
changeset
|
163 |
unsafe_addss (!simpset setloop (split_tac [expand_if]))) 1); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
164 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
165 |
(* case Abs e *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
166 |
by (asm_full_simp_tac (!simpset addsimps |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
167 |
[free_tv_subst] setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
168 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
169 |
by (rename_tac "s t na sa ta m v" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
170 |
by (eres_inst_tac [("x","Suc n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
171 |
by (eres_inst_tac [("x","TVar n # a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
172 |
by (eres_inst_tac [("x","s")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
173 |
by (eres_inst_tac [("x","t")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
174 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
175 |
by (eres_inst_tac [("x","v")] allE 1); |
2520 | 176 |
by (fast_tac (HOL_cs addSEs [allE] |
3008 | 177 |
addIs [cod_app_subst] |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
178 |
addss (!simpset addsimps [less_Suc_eq])) 1); |
2520 | 179 |
(** LEVEL 12 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
180 |
(* case App e1 e2 *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
181 |
by (simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
182 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
183 |
by (rename_tac "s t na sa ta nb sb sc tb m v" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
184 |
by (eres_inst_tac [("x","n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
185 |
by (eres_inst_tac [("x","a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
186 |
by (eres_inst_tac [("x","s")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
187 |
by (eres_inst_tac [("x","t")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
188 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
189 |
by (eres_inst_tac [("x","na")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
190 |
by (eres_inst_tac [("x","v")] allE 1); |
2520 | 191 |
(** LEVEL 22 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
192 |
(* second case *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
193 |
by (eres_inst_tac [("x","$ s a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
194 |
by (eres_inst_tac [("x","sa")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
195 |
by (eres_inst_tac [("x","ta")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
196 |
by (eres_inst_tac [("x","nb")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
197 |
by (eres_inst_tac [("x","v")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
198 |
by (safe_tac (empty_cs addSIs [conjI,impI] addSEs [conjE]) ); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
199 |
by (asm_full_simp_tac (!simpset addsimps [rotate_Ok,o_def]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
200 |
by (dtac W_var_geD 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
201 |
by (dtac W_var_geD 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
202 |
by ( (forward_tac [less_le_trans] 1) THEN (assume_tac 1) ); |
2520 | 203 |
(** LEVEL 32 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
204 |
by (fast_tac (HOL_cs addDs [free_tv_comp_subst RS subsetD,sym RS mgu_free, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
205 |
codD,free_tv_app_subst_te RS subsetD,free_tv_app_subst_tel RS subsetD, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
206 |
less_le_trans,less_not_refl2,subsetD] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
207 |
addEs [UnE] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
208 |
addss !simpset) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
209 |
by (Asm_full_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
210 |
by (dtac (sym RS W_var_geD) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
211 |
by (dtac (sym RS W_var_geD) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
212 |
by ( (forward_tac [less_le_trans] 1) THEN (assume_tac 1) ); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
213 |
by (fast_tac (HOL_cs addDs [mgu_free, codD,free_tv_subst_var RS subsetD, |
3008 | 214 |
free_tv_app_subst_te RS subsetD, |
215 |
free_tv_app_subst_tel RS subsetD, |
|
216 |
less_le_trans,subsetD] |
|
217 |
addSEs [UnE] |
|
218 |
addss !simpset) 1); |
|
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
219 |
qed_spec_mp "free_tv_W"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
220 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
221 |
(* Completeness of W w.r.t. has_type *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
222 |
goal thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
223 |
"!s' a t' n. $s' a |- e :: t' --> new_tv n a --> \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
224 |
\ (? s t. (? m. W e a n = Ok (s,t,m)) & \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
225 |
\ (? r. $s' a = $r ($s a) & t' = $r t))"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
226 |
by (expr.induct_tac "e" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
227 |
(* case Var n *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
228 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
229 |
by (simp_tac (!simpset addcongs [conj_cong] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
230 |
setloop (split_tac [expand_if])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
231 |
by (eresolve_tac has_type_casesE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
232 |
by (asm_full_simp_tac (!simpset addsimps [eq_sym_conv,app_subst_list]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
233 |
by (res_inst_tac [("x","id_subst")] exI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
234 |
by (res_inst_tac [("x","nth nat a")] exI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
235 |
by (Simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
236 |
by (res_inst_tac [("x","s'")] exI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
237 |
by (Asm_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
238 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
239 |
(** LEVEL 10 **) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
240 |
(* case Abs e *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
241 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
242 |
by (eresolve_tac has_type_casesE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
243 |
by (eres_inst_tac [("x","%x.if x=n then t1 else (s' x)")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
244 |
by (eres_inst_tac [("x","(TVar n)#a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
245 |
by (eres_inst_tac [("x","t2")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
246 |
by (eres_inst_tac [("x","Suc n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
247 |
by (fast_tac (HOL_cs addss (!simpset addcongs [conj_cong] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
248 |
setloop (split_tac [expand_bind]))) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
249 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
250 |
(** LEVEL 17 **) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
251 |
(* case App e1 e2 *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
252 |
by (strip_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
253 |
by (eresolve_tac has_type_casesE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
254 |
by (eres_inst_tac [("x","s'")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
255 |
by (eres_inst_tac [("x","a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
256 |
by (eres_inst_tac [("x","t2 -> t'")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
257 |
by (eres_inst_tac [("x","n")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
258 |
by (safe_tac HOL_cs); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
259 |
by (eres_inst_tac [("x","r")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
260 |
by (eres_inst_tac [("x","$ s a")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
261 |
by (eres_inst_tac [("x","t2")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
262 |
by (eres_inst_tac [("x","m")] allE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
263 |
by (dtac asm_rl 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
264 |
by (dtac asm_rl 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
265 |
by (dtac asm_rl 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
266 |
by (Asm_full_simp_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
267 |
by (safe_tac HOL_cs); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
268 |
by (fast_tac HOL_cs 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
269 |
by (fast_tac (HOL_cs addIs [sym RS W_var_geD,new_tv_W RS |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
270 |
conjunct1,new_tv_list_le,new_tv_subst_tel]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
271 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
272 |
(** LEVEL 35 **) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
273 |
by (subgoal_tac |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
274 |
"$ (%x.if x=ma then t' else (if x:(free_tv t - free_tv sa) then r x \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
275 |
\ else ra x)) ($ sa t) = \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
276 |
\ $ (%x.if x=ma then t' else (if x:(free_tv t - free_tv sa) then r x \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
277 |
\ else ra x)) (ta -> (TVar ma))" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
278 |
by (res_inst_tac [("t","$ (%x. if x = ma then t' else \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
279 |
\ (if x:(free_tv t - free_tv sa) then r x else ra x)) ($ sa t)"), |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
280 |
("s","($ ra ta) -> t'")] ssubst 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
281 |
by (asm_simp_tac (!simpset addsimps [subst_comp_te]) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
282 |
by (rtac eq_free_eq_subst_te 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
283 |
by (strip_tac 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
284 |
by (subgoal_tac "na ~=ma" 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
285 |
by (fast_tac (HOL_cs addDs [new_tv_W,sym RS W_var_geD, |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
286 |
new_tv_not_free_tv,new_tv_le]) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
287 |
(** LEVEL 42 **) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
288 |
by (case_tac "na:free_tv sa" 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
289 |
(* na ~: free_tv sa *) |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
290 |
by (forward_tac [not_free_impl_id] 3); |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
291 |
by (asm_simp_tac (!simpset setloop (split_tac [expand_if])) 3); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
292 |
(* na : free_tv sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
293 |
by (dres_inst_tac [("ts1","$ s a")] (subst_comp_tel RSN (2,trans)) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
294 |
by (dtac eq_subst_tel_eq_free 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
295 |
by (fast_tac (HOL_cs addIs [free_tv_W,free_tv_le_new_tv] addDs [new_tv_W]) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
296 |
by (Asm_simp_tac 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
297 |
by (case_tac "na:dom sa" 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
298 |
(* na ~: dom sa *) |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
299 |
(** LEVEL 50 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
300 |
by (asm_full_simp_tac (!simpset addsimps [dom_def] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
301 |
setloop (split_tac [expand_if])) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
302 |
(* na : dom sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
303 |
by (rtac eq_free_eq_subst_te 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
304 |
by (strip_tac 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
305 |
by (subgoal_tac "nb ~= ma" 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
306 |
by ((forward_tac [new_tv_W] 3) THEN (atac 3)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
307 |
by (etac conjE 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
308 |
by (dtac new_tv_subst_tel 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
309 |
by (fast_tac (HOL_cs addIs [new_tv_list_le] addDs [sym RS W_var_geD]) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
310 |
by (fast_tac (set_cs addDs [new_tv_W,new_tv_not_free_tv] addss |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
311 |
(!simpset addsimps [cod_def,free_tv_subst])) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
312 |
by (fast_tac (set_cs addss (!simpset addsimps [cod_def,free_tv_subst] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
313 |
setloop (split_tac [expand_if]))) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
314 |
|
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
315 |
(** LEVEL 60 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
316 |
by (Simp_tac 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
317 |
by (rtac eq_free_eq_subst_te 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
318 |
by (strip_tac 2 ); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
319 |
by (subgoal_tac "na ~= ma" 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
320 |
by ((forward_tac [new_tv_W] 3) THEN (atac 3)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
321 |
by (etac conjE 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
322 |
by (dtac (sym RS W_var_geD) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
323 |
by (fast_tac (HOL_cs addDs [new_tv_list_le,new_tv_subst_tel,new_tv_W,new_tv_not_free_tv]) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
324 |
by (case_tac "na: free_tv t - free_tv sa" 2); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
325 |
(** LEVEL 69 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
326 |
(* case na ~: free_tv t - free_tv sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
327 |
by ( asm_full_simp_tac (!simpset setloop (split_tac [expand_if])) 3); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
328 |
(* case na : free_tv t - free_tv sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
329 |
by ( asm_full_simp_tac (!simpset setloop (split_tac [expand_if])) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
330 |
by (dres_inst_tac [("ts1","$ s a")] (subst_comp_tel RSN (2,trans)) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
331 |
by (dtac eq_subst_tel_eq_free 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
332 |
by (fast_tac (HOL_cs addIs [free_tv_W,free_tv_le_new_tv] addDs [new_tv_W]) 2); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
333 |
by (asm_full_simp_tac (!simpset addsimps [free_tv_subst,dom_def]) 2); |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
334 |
by (Fast_tac 2); |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
335 |
(** LEVEL 76 **) |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
336 |
by (asm_simp_tac (!simpset setloop (split_tac [expand_bind])) 1); |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
337 |
by (safe_tac HOL_cs); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
338 |
by (dtac mgu_Ok 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
339 |
by ( fast_tac (HOL_cs addss !simpset) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
340 |
by (REPEAT (resolve_tac [exI,conjI] 1)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
341 |
by (fast_tac HOL_cs 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
342 |
by (fast_tac HOL_cs 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
343 |
by ((dtac mgu_mg 1) THEN (atac 1)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
344 |
by (etac exE 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
345 |
by (res_inst_tac [("x","rb")] exI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
346 |
by (rtac conjI 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
347 |
by (dres_inst_tac [("x","ma")] fun_cong 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
348 |
by ( asm_full_simp_tac (!simpset addsimps [eq_sym_conv]) 2); |
2596
3b4ad6c7726f
Modified proofs because of added "triv_forall_equality".
nipkow
parents:
2520
diff
changeset
|
349 |
by (simp_tac (!simpset addsimps [o_def,subst_comp_tel RS sym]) 1); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
350 |
(** LEVEL 90 **) |
2596
3b4ad6c7726f
Modified proofs because of added "triv_forall_equality".
nipkow
parents:
2520
diff
changeset
|
351 |
by (rtac ((subst_comp_tel RS sym) RSN (2,trans)) 1); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
352 |
by ( asm_full_simp_tac (!simpset addsimps [o_def,eq_sym_conv]) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
353 |
by (rtac eq_free_eq_subst_tel 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
354 |
by ( safe_tac HOL_cs ); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
355 |
by (subgoal_tac "ma ~= na" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
356 |
by ((forward_tac [new_tv_W] 2) THEN (atac 2)); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
357 |
by (etac conjE 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
358 |
by (dtac new_tv_subst_tel 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
359 |
by (fast_tac (HOL_cs addIs [new_tv_list_le] addDs [sym RS W_var_geD]) 2); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
360 |
by (forw_inst_tac [("n","m")] new_tv_W 2 THEN atac 2); |
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
361 |
(** LEVEL 100 **) |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
362 |
by (etac conjE 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
363 |
by (dtac (free_tv_app_subst_tel RS subsetD) 2); |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
364 |
by (fast_tac (set_cs addDs [sym RS W_var_geD,new_tv_list_le,codD, |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
365 |
new_tv_not_free_tv]) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
366 |
by (case_tac "na: free_tv t - free_tv sa" 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
367 |
(* case na ~: free_tv t - free_tv sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
368 |
by (asm_full_simp_tac (!simpset setloop (split_tac [expand_if])) 2); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
369 |
(* case na : free_tv t - free_tv sa *) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
370 |
by (asm_full_simp_tac (!simpset setloop (split_tac [expand_if])) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
371 |
by (dtac (free_tv_app_subst_tel RS subsetD) 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
372 |
by (fast_tac (set_cs addDs [codD,subst_comp_tel RSN (2,trans), |
3008 | 373 |
eq_subst_tel_eq_free] |
2793
b30c41754c86
Modified proofs because simplifier does not eta-contract any longer.
nipkow
parents:
2637
diff
changeset
|
374 |
addss ((!simpset addsimps [free_tv_subst,dom_def]))) 1); |
2518
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
375 |
(** LEVEL 106 **) |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
376 |
by (Fast_tac 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
377 |
qed_spec_mp "W_complete_lemma"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
378 |
|
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
379 |
goal W.thy |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
380 |
"!!e. [] |- e :: t' ==> (? s t. (? m. W e [] n = Ok(s,t,m)) & \ |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
381 |
\ (? r. t' = $r t))"; |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
382 |
by (cut_inst_tac [("a","[]"),("s'","id_subst"),("e","e"),("t'","t'")] |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
383 |
W_complete_lemma 1); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
384 |
by (ALLGOALS Asm_full_simp_tac); |
bee082efaa46
This is the old version og MiniML for the monomorphic case.
nipkow
parents:
diff
changeset
|
385 |
qed "W_complete"; |