author | wenzelm |
Sat, 27 Oct 2001 00:09:59 +0200 | |
changeset 11963 | a6608d44a46b |
parent 11318 | 6536fb8c9fc6 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/Coind/MT.ML |
915 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Jacob Frost, Cambridge University Computer Laboratory |
915 | 4 |
Copyright 1995 University of Cambridge |
5 |
*) |
|
6 |
||
7 |
(* ############################################################ *) |
|
8 |
(* The Consistency theorem *) |
|
9 |
(* ############################################################ *) |
|
10 |
||
11318 | 11 |
Goal "[| c \\<in> Const; hastyenv(ve,te);<te,e_const(c),t>:ElabRel |] ==> \ |
12 |
\ <v_const(c), t> \\<in> HasTyRel"; |
|
2469 | 13 |
by (Fast_tac 1); |
915 | 14 |
qed "consistency_const"; |
15 |
||
16 |
||
5068 | 17 |
Goalw [hastyenv_def] |
11318 | 18 |
"[| x \\<in> ve_dom(ve); hastyenv(ve,te); <te,e_var(x),t>:ElabRel |] ==> \ |
915 | 19 |
\ <ve_app(ve,x),t>:HasTyRel"; |
2469 | 20 |
by (Fast_tac 1); |
915 | 21 |
qed "consistency_var"; |
22 |
||
23 |
||
5068 | 24 |
Goalw [hastyenv_def] |
11318 | 25 |
"[| ve \\<in> ValEnv; x \\<in> ExVar; e \\<in> Exp; hastyenv(ve,te); \ |
2469 | 26 |
\ <te,e_fn(x,e),t>:ElabRel \ |
11318 | 27 |
\ |] ==> <v_clos(x, e, ve), t> \\<in> HasTyRel"; |
6046 | 28 |
by (Blast_tac 1); |
915 | 29 |
qed "consistency_fn"; |
30 |
||
6154
6a00a5baef2b
automatic insertion of datatype intr rules into claset
paulson
parents:
6141
diff
changeset
|
31 |
AddDs [te_owrE, ElabRel.dom_subset RS subsetD]; |
915 | 32 |
|
6046 | 33 |
Addsimps [ve_dom_owr, ve_app_owr1, ve_app_owr2, |
2493 | 34 |
te_app_owr1, te_app_owr2]; |
915 | 35 |
|
36 |
val clean_tac = |
|
37 |
REPEAT_FIRST (fn i => |
|
38 |
(eq_assume_tac i) ORELSE |
|
39 |
(match_tac (Ty.intrs@TyEnv.intrs@Val_ValEnv.intrs) i) ORELSE |
|
40 |
(ematch_tac [te_owrE] i)); |
|
41 |
||
6046 | 42 |
Goalw [hastyenv_def] |
11318 | 43 |
"[| ve \\<in> ValEnv; x \\<in> ExVar; e \\<in> Exp; f \\<in> ExVar; cl \\<in> Val; \ |
1461 | 44 |
\ v_clos(x,e,ve_owr(ve,f,cl)) = cl; \ |
45 |
\ hastyenv(ve,te); <te,e_fix(f,x,e),t>:ElabRel |] ==> \ |
|
915 | 46 |
\ <cl,t>:HasTyRel"; |
47 |
by (etac elab_fixE 1); |
|
4152 | 48 |
by Safe_tac; |
7499 | 49 |
by (EVERY [ftac subst 1,atac 2,rtac htr_closCI 1]); |
915 | 50 |
by clean_tac; |
51 |
by (rtac ve_owrI 1); |
|
52 |
by clean_tac; |
|
53 |
by (dtac (ElabRel.dom_subset RS subsetD) 1); |
|
2885
8d229dc0cfe2
Two extra commands shorten the proof time by 800 seconds...
paulson
parents:
2493
diff
changeset
|
54 |
by (eres_inst_tac [("Q","te_owr(te,f,t_fun(t1,t2)):TyEnv")] |
8d229dc0cfe2
Two extra commands shorten the proof time by 800 seconds...
paulson
parents:
2493
diff
changeset
|
55 |
(SigmaD1 RS te_owrE) 1); |
915 | 56 |
by (assume_tac 1); |
6141 | 57 |
by (rtac ElabRel.fnI 1); |
915 | 58 |
by clean_tac; |
2469 | 59 |
by (Asm_simp_tac 1); |
2034 | 60 |
by (stac ve_dom_owr 1); |
915 | 61 |
by (assume_tac 1); |
62 |
by (etac subst 1); |
|
63 |
by (rtac v_closNE 1); |
|
2469 | 64 |
by (Asm_simp_tac 1); |
915 | 65 |
|
66 |
by (rtac PowI 1); |
|
2034 | 67 |
by (stac ve_dom_owr 1); |
915 | 68 |
by (assume_tac 1); |
69 |
by (etac subst 1); |
|
70 |
by (rtac v_closNE 1); |
|
71 |
by (rtac subsetI 1); |
|
72 |
by (etac RepFunE 1); |
|
6154
6a00a5baef2b
automatic insertion of datatype intr rules into claset
paulson
parents:
6141
diff
changeset
|
73 |
by (case_tac "f=y" 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4152
diff
changeset
|
74 |
by Auto_tac; |
915 | 75 |
qed "consistency_fix"; |
76 |
||
77 |
||
11318 | 78 |
Goal "[| ve \\<in> ValEnv; e1 \\<in> Exp; e2 \\<in> Exp; c1 \\<in> Const; c2 \\<in> Const; \ |
1461 | 79 |
\ <ve,e1,v_const(c1)>:EvalRel; \ |
11318 | 80 |
\ \\<forall>t te. \ |
915 | 81 |
\ hastyenv(ve,te) --> <te,e1,t>:ElabRel --> <v_const(c1),t>:HasTyRel; \ |
11318 | 82 |
\ <ve, e2, v_const(c2)> \\<in> EvalRel; \ |
83 |
\ \\<forall>t te. \ |
|
915 | 84 |
\ hastyenv(ve,te) --> <te,e2,t>:ElabRel --> <v_const(c2),t>:HasTyRel; \ |
1461 | 85 |
\ hastyenv(ve, te); \ |
86 |
\ <te,e_app(e1,e2),t>:ElabRel |] ==> \ |
|
915 | 87 |
\ <v_const(c_app(c1, c2)),t>:HasTyRel"; |
88 |
by (etac elab_appE 1); |
|
89 |
by (fast_tac ((mk_htr_cs ZF_cs) addSIs [c_appI] addIs [isof_app]) 1); |
|
90 |
qed "consistency_app1"; |
|
91 |
||
11318 | 92 |
Goal "[| ve \\<in> ValEnv; vem \\<in> ValEnv; e1 \\<in> Exp; e2 \\<in> Exp; em \\<in> Exp; xm \\<in> ExVar; v \\<in> Val; \ |
6141 | 93 |
\ <ve,e1,v_clos(xm,em,vem)>:EvalRel; \ |
11318 | 94 |
\ \\<forall>t te. \ |
6141 | 95 |
\ hastyenv(ve,te) --> \ |
96 |
\ <te,e1,t>:ElabRel --> \ |
|
97 |
\ <v_clos(xm,em,vem),t>:HasTyRel; \ |
|
98 |
\ <ve,e2,v2>:EvalRel; \ |
|
11318 | 99 |
\ \\<forall>t te. \ |
6141 | 100 |
\ hastyenv(ve,te) --> \ |
101 |
\ <te,e2,t>:ElabRel --> \ |
|
102 |
\ <v2,t>:HasTyRel; \ |
|
103 |
\ <ve_owr(vem,xm,v2),em,v>:EvalRel; \ |
|
11318 | 104 |
\ \\<forall>t te. \ |
6141 | 105 |
\ hastyenv(ve_owr(vem,xm,v2),te) --> \ |
106 |
\ <te,em,t>:ElabRel --> \ |
|
107 |
\ <v,t>:HasTyRel; \ |
|
108 |
\ hastyenv(ve,te); <te,e_app(e1,e2),t>:ElabRel |] ==> \ |
|
109 |
\ <v,t>:HasTyRel "; |
|
915 | 110 |
by (etac elab_appE 1); |
111 |
by (dtac (spec RS spec RS mp RS mp) 1); |
|
112 |
by (assume_tac 1); |
|
113 |
by (assume_tac 1); |
|
114 |
by (dtac (spec RS spec RS mp RS mp) 1); |
|
115 |
by (assume_tac 1); |
|
116 |
by (assume_tac 1); |
|
117 |
by (etac htr_closE 1); |
|
118 |
by (etac elab_fnE 1); |
|
6141 | 119 |
by (Full_simp_tac 1); |
120 |
by (Clarify_tac 1); |
|
915 | 121 |
by (dtac (spec RS spec RS mp RS mp) 1); |
122 |
by (assume_tac 3); |
|
123 |
by (assume_tac 2); |
|
124 |
by (rtac hastyenv_owr 1); |
|
125 |
by (assume_tac 1); |
|
126 |
by (assume_tac 1); |
|
127 |
by (assume_tac 2); |
|
6141 | 128 |
by (asm_simp_tac (simpset() addsimps [hastyenv_def]) 1); |
2469 | 129 |
by (Fast_tac 1); |
915 | 130 |
qed "consistency_app2"; |
131 |
||
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5068
diff
changeset
|
132 |
Goal "<ve,e,v>:EvalRel ==> \ |
11318 | 133 |
\ (\\<forall>t te. hastyenv(ve,te) --> <te,e,t>:ElabRel --> <v,t>:HasTyRel)"; |
1740 | 134 |
by (etac EvalRel.induct 1); |
6141 | 135 |
by (blast_tac (claset() addIs [consistency_app2]) 6); |
136 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [consistency_const, consistency_var, consistency_fn, consistency_fix, consistency_app1]))); |
|
915 | 137 |
qed "consistency"; |
138 |
||
139 |
||
11318 | 140 |
Goal "[| ve \\<in> ValEnv; te \\<in> TyEnv; \ |
6141 | 141 |
\ isofenv(ve,te); \ |
142 |
\ <ve,e,v_const(c)>:EvalRel; \ |
|
143 |
\ <te,e,t>:ElabRel \ |
|
144 |
\ |] ==> isof(c,t)"; |
|
145 |
by (rtac htr_constE 1); |
|
915 | 146 |
by (dtac consistency 1); |
6154
6a00a5baef2b
automatic insertion of datatype intr rules into claset
paulson
parents:
6141
diff
changeset
|
147 |
by (blast_tac (claset() addSIs [basic_consistency_lem]) 1); |
915 | 148 |
by (assume_tac 1); |
149 |
qed "basic_consistency"; |