src/HOL/ex/MT.ML
author paulson
Fri Jul 31 11:03:21 1998 +0200 (1998-07-31)
changeset 5227 e5a6ace920a0
parent 5148 74919e8f221c
child 5278 a903b66822e2
permissions -rw-r--r--
Removal of obsolete "open" commands from heads of .ML files
clasohm@1465
     1
(*  Title:      HOL/ex/MT.ML
clasohm@969
     2
    ID:         $Id$
clasohm@1465
     3
    Author:     Jacob Frost, Cambridge University Computer Laboratory
clasohm@969
     4
    Copyright   1993  University of Cambridge
clasohm@969
     5
clasohm@969
     6
Based upon the article
clasohm@969
     7
    Robin Milner and Mads Tofte,
clasohm@969
     8
    Co-induction in Relational Semantics,
clasohm@969
     9
    Theoretical Computer Science 87 (1991), pages 209-220.
clasohm@969
    10
clasohm@969
    11
Written up as
clasohm@969
    12
    Jacob Frost, A Case Study of Co-induction in Isabelle/HOL
clasohm@969
    13
    Report 308, Computer Lab, University of Cambridge (1993).
lcp@1047
    14
lcp@1047
    15
NEEDS TO USE INDUCTIVE DEFS PACKAGE
clasohm@969
    16
*)
clasohm@969
    17
clasohm@969
    18
(* ############################################################ *)
clasohm@969
    19
(* Inference systems                                            *)
clasohm@969
    20
(* ############################################################ *)
clasohm@969
    21
paulson@2935
    22
val infsys_mono_tac = (REPEAT (ares_tac (basic_monos@[allI,impI]) 1));
clasohm@969
    23
clasohm@972
    24
val prems = goal MT.thy "P a b ==> P (fst (a,b)) (snd (a,b))";
wenzelm@4089
    25
by (simp_tac (simpset() addsimps prems) 1);
clasohm@969
    26
qed "infsys_p1";
clasohm@969
    27
paulson@5148
    28
Goal "P (fst (a,b)) (snd (a,b)) ==> P a b";
clasohm@1266
    29
by (Asm_full_simp_tac 1);
clasohm@969
    30
qed "infsys_p2";
clasohm@969
    31
paulson@5148
    32
Goal "P a b c ==> P (fst(fst((a,b),c))) (snd(fst ((a,b),c))) (snd ((a,b),c))";
clasohm@1266
    33
by (Asm_full_simp_tac 1);
clasohm@969
    34
qed "infsys_pp1";
clasohm@969
    35
paulson@5148
    36
Goal "P (fst(fst((a,b),c))) (snd(fst((a,b),c))) (snd((a,b),c)) ==> P a b c";
clasohm@1266
    37
by (Asm_full_simp_tac 1);
clasohm@969
    38
qed "infsys_pp2";
clasohm@969
    39
clasohm@969
    40
(* ############################################################ *)
clasohm@969
    41
(* Fixpoints                                                    *)
clasohm@969
    42
(* ############################################################ *)
clasohm@969
    43
clasohm@969
    44
(* Least fixpoints *)
clasohm@969
    45
clasohm@969
    46
val prems = goal MT.thy "[| mono(f); x:f(lfp(f)) |] ==> x:lfp(f)";
clasohm@969
    47
by (rtac subsetD 1);
clasohm@969
    48
by (rtac lfp_lemma2 1);
lcp@1047
    49
by (resolve_tac prems 1);
lcp@1047
    50
by (resolve_tac prems 1);
clasohm@969
    51
qed "lfp_intro2";
clasohm@969
    52
clasohm@969
    53
val prems = goal MT.thy
clasohm@969
    54
  " [| x:lfp(f); mono(f); !!y. y:f(lfp(f)) ==> P(y) |] ==> \
clasohm@969
    55
\   P(x)";
clasohm@969
    56
by (cut_facts_tac prems 1);
lcp@1047
    57
by (resolve_tac prems 1);
lcp@1047
    58
by (rtac subsetD 1);
lcp@1047
    59
by (rtac lfp_lemma3 1);
lcp@1047
    60
by (assume_tac 1);
lcp@1047
    61
by (assume_tac 1);
clasohm@969
    62
qed "lfp_elim2";
clasohm@969
    63
clasohm@969
    64
val prems = goal MT.thy
wenzelm@3842
    65
  " [| x:lfp(f); mono(f); !!y. y:f(lfp(f) Int {x. P(x)}) ==> P(y) |] ==> \
clasohm@969
    66
\   P(x)";
clasohm@969
    67
by (cut_facts_tac prems 1);
lcp@1047
    68
by (etac induct 1);
lcp@1047
    69
by (assume_tac 1);
clasohm@969
    70
by (eresolve_tac prems 1);
clasohm@969
    71
qed "lfp_ind2";
clasohm@969
    72
clasohm@969
    73
(* Greatest fixpoints *)
clasohm@969
    74
clasohm@969
    75
(* Note : "[| x:S; S <= f(S Un gfp(f)); mono(f) |] ==> x:gfp(f)" *)
clasohm@969
    76
clasohm@969
    77
val [cih,monoh] = goal MT.thy "[| x:f({x} Un gfp(f)); mono(f) |] ==> x:gfp(f)";
clasohm@969
    78
by (rtac (cih RSN (2,gfp_upperbound RS subsetD)) 1);
clasohm@969
    79
by (rtac (monoh RS monoD) 1);
lcp@1047
    80
by (rtac (UnE RS subsetI) 1);
lcp@1047
    81
by (assume_tac 1);
wenzelm@4089
    82
by (blast_tac (claset() addSIs [cih]) 1);
clasohm@969
    83
by (rtac (monoh RS monoD RS subsetD) 1);
clasohm@969
    84
by (rtac Un_upper2 1);
clasohm@969
    85
by (etac (monoh RS gfp_lemma2 RS subsetD) 1);
clasohm@969
    86
qed "gfp_coind2";
clasohm@969
    87
clasohm@969
    88
val [gfph,monoh,caseh] = goal MT.thy 
clasohm@969
    89
  "[| x:gfp(f); mono(f); !! y. y:f(gfp(f)) ==> P(y) |] ==> P(x)";
lcp@1047
    90
by (rtac caseh 1);
lcp@1047
    91
by (rtac subsetD 1);
lcp@1047
    92
by (rtac gfp_lemma2 1);
lcp@1047
    93
by (rtac monoh 1);
lcp@1047
    94
by (rtac gfph 1);
clasohm@969
    95
qed "gfp_elim2";
clasohm@969
    96
clasohm@969
    97
(* ############################################################ *)
clasohm@969
    98
(* Expressions                                                  *)
clasohm@969
    99
(* ############################################################ *)
clasohm@969
   100
clasohm@969
   101
val e_injs = [e_const_inj, e_var_inj, e_fn_inj, e_fix_inj, e_app_inj];
clasohm@969
   102
clasohm@969
   103
val e_disjs = 
clasohm@969
   104
  [ e_disj_const_var, 
clasohm@969
   105
    e_disj_const_fn, 
clasohm@969
   106
    e_disj_const_fix, 
clasohm@969
   107
    e_disj_const_app,
clasohm@969
   108
    e_disj_var_fn, 
clasohm@969
   109
    e_disj_var_fix, 
clasohm@969
   110
    e_disj_var_app, 
clasohm@969
   111
    e_disj_fn_fix, 
clasohm@969
   112
    e_disj_fn_app, 
clasohm@969
   113
    e_disj_fix_app
clasohm@969
   114
  ];
clasohm@969
   115
clasohm@969
   116
val e_disj_si = e_disjs @ (e_disjs RL [not_sym]);
clasohm@969
   117
val e_disj_se = (e_disj_si RL [notE]);
clasohm@969
   118
clasohm@969
   119
fun e_ext_cs cs = cs addSIs e_disj_si addSEs e_disj_se addSDs e_injs;
clasohm@969
   120
clasohm@969
   121
(* ############################################################ *)
clasohm@969
   122
(* Values                                                      *)
clasohm@969
   123
(* ############################################################ *)
clasohm@969
   124
clasohm@969
   125
val v_disjs = [v_disj_const_clos];
clasohm@969
   126
val v_disj_si = v_disjs @ (v_disjs RL [not_sym]);
clasohm@969
   127
val v_disj_se = (v_disj_si RL [notE]);
clasohm@969
   128
clasohm@969
   129
val v_injs = [v_const_inj, v_clos_inj];
clasohm@969
   130
clasohm@969
   131
fun v_ext_cs cs  = cs addSIs v_disj_si addSEs v_disj_se addSDs v_injs;
clasohm@969
   132
clasohm@969
   133
(* ############################################################ *)
clasohm@969
   134
(* Evaluations                                                  *)
clasohm@969
   135
(* ############################################################ *)
clasohm@969
   136
clasohm@969
   137
(* Monotonicity of eval_fun *)
clasohm@969
   138
wenzelm@5069
   139
Goalw [mono_def, eval_fun_def] "mono(eval_fun)";
clasohm@969
   140
by infsys_mono_tac;
clasohm@969
   141
qed "eval_fun_mono";
clasohm@969
   142
clasohm@969
   143
(* Introduction rules *)
clasohm@969
   144
wenzelm@5069
   145
Goalw [eval_def, eval_rel_def] "ve |- e_const(c) ---> v_const(c)";
clasohm@969
   146
by (rtac lfp_intro2 1);
clasohm@969
   147
by (rtac eval_fun_mono 1);
clasohm@969
   148
by (rewtac eval_fun_def);
paulson@2935
   149
	(*Naughty!  But the quantifiers are nested VERY deeply...*)
wenzelm@4089
   150
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   151
qed "eval_const";
clasohm@969
   152
paulson@5148
   153
Goalw [eval_def, eval_rel_def] 
clasohm@969
   154
  "ev:ve_dom(ve) ==> ve |- e_var(ev) ---> ve_app ve ev";
clasohm@969
   155
by (rtac lfp_intro2 1);
clasohm@969
   156
by (rtac eval_fun_mono 1);
clasohm@969
   157
by (rewtac eval_fun_def);
wenzelm@4089
   158
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@1266
   159
qed "eval_var2";
clasohm@969
   160
paulson@5148
   161
Goalw [eval_def, eval_rel_def] 
clasohm@969
   162
  "ve |- fn ev => e ---> v_clos(<|ev,e,ve|>)";
clasohm@969
   163
by (rtac lfp_intro2 1);
clasohm@969
   164
by (rtac eval_fun_mono 1);
clasohm@969
   165
by (rewtac eval_fun_def);
wenzelm@4089
   166
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   167
qed "eval_fn";
clasohm@969
   168
paulson@5148
   169
Goalw [eval_def, eval_rel_def] 
clasohm@969
   170
  " cl = <| ev1, e, ve + {ev2 |-> v_clos(cl)} |> ==> \
clasohm@969
   171
\   ve |- fix ev2(ev1) = e ---> v_clos(cl)";
clasohm@969
   172
by (rtac lfp_intro2 1);
clasohm@969
   173
by (rtac eval_fun_mono 1);
clasohm@969
   174
by (rewtac eval_fun_def);
wenzelm@4089
   175
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   176
qed "eval_fix";
clasohm@969
   177
paulson@5148
   178
Goalw [eval_def, eval_rel_def]
clasohm@969
   179
  " [| ve |- e1 ---> v_const(c1); ve |- e2 ---> v_const(c2) |] ==> \
clasohm@969
   180
\   ve |- e1 @ e2 ---> v_const(c_app c1 c2)";
clasohm@969
   181
by (rtac lfp_intro2 1);
clasohm@969
   182
by (rtac eval_fun_mono 1);
clasohm@969
   183
by (rewtac eval_fun_def);
wenzelm@4089
   184
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   185
qed "eval_app1";
clasohm@969
   186
paulson@5148
   187
Goalw [eval_def, eval_rel_def] 
clasohm@969
   188
  " [|  ve |- e1 ---> v_clos(<|xm,em,vem|>); \
clasohm@969
   189
\       ve |- e2 ---> v2; \
clasohm@969
   190
\       vem + {xm |-> v2} |- em ---> v \
clasohm@969
   191
\   |] ==> \
clasohm@969
   192
\   ve |- e1 @ e2 ---> v";
clasohm@969
   193
by (rtac lfp_intro2 1);
clasohm@969
   194
by (rtac eval_fun_mono 1);
clasohm@969
   195
by (rewtac eval_fun_def);
wenzelm@4089
   196
by (blast_tac (claset() addSIs [disjI2]) 1);
clasohm@969
   197
qed "eval_app2";
clasohm@969
   198
clasohm@969
   199
(* Strong elimination, induction on evaluations *)
clasohm@969
   200
clasohm@969
   201
val prems = goalw MT.thy [eval_def, eval_rel_def]
clasohm@969
   202
  " [| ve |- e ---> v; \
clasohm@972
   203
\      !!ve c. P(((ve,e_const(c)),v_const(c))); \
clasohm@972
   204
\      !!ev ve. ev:ve_dom(ve) ==> P(((ve,e_var(ev)),ve_app ve ev)); \
clasohm@972
   205
\      !!ev ve e. P(((ve,fn ev => e),v_clos(<|ev,e,ve|>))); \
clasohm@969
   206
\      !!ev1 ev2 ve cl e. \
clasohm@969
   207
\        cl = <| ev1, e, ve + {ev2 |-> v_clos(cl)} |> ==> \
clasohm@972
   208
\        P(((ve,fix ev2(ev1) = e),v_clos(cl))); \
clasohm@969
   209
\      !!ve c1 c2 e1 e2. \
clasohm@972
   210
\        [| P(((ve,e1),v_const(c1))); P(((ve,e2),v_const(c2))) |] ==> \
clasohm@972
   211
\        P(((ve,e1 @ e2),v_const(c_app c1 c2))); \
clasohm@969
   212
\      !!ve vem xm e1 e2 em v v2. \
clasohm@972
   213
\        [|  P(((ve,e1),v_clos(<|xm,em,vem|>))); \
clasohm@972
   214
\            P(((ve,e2),v2)); \
clasohm@972
   215
\            P(((vem + {xm |-> v2},em),v)) \
clasohm@969
   216
\        |] ==> \
clasohm@972
   217
\        P(((ve,e1 @ e2),v)) \
clasohm@969
   218
\   |] ==> \
clasohm@972
   219
\   P(((ve,e),v))";
clasohm@969
   220
by (resolve_tac (prems RL [lfp_ind2]) 1);
clasohm@969
   221
by (rtac eval_fun_mono 1);
clasohm@969
   222
by (rewtac eval_fun_def);
clasohm@969
   223
by (dtac CollectD 1);
paulson@4153
   224
by Safe_tac;
clasohm@969
   225
by (ALLGOALS (resolve_tac prems));
paulson@2935
   226
by (ALLGOALS (Blast_tac));
clasohm@969
   227
qed "eval_ind0";
clasohm@969
   228
clasohm@969
   229
val prems = goal MT.thy 
clasohm@969
   230
  " [| ve |- e ---> v; \
clasohm@969
   231
\      !!ve c. P ve (e_const c) (v_const c); \
clasohm@969
   232
\      !!ev ve. ev:ve_dom(ve) ==> P ve (e_var ev) (ve_app ve ev); \
clasohm@969
   233
\      !!ev ve e. P ve (fn ev => e) (v_clos <|ev,e,ve|>); \
clasohm@969
   234
\      !!ev1 ev2 ve cl e. \
clasohm@969
   235
\        cl = <| ev1, e, ve + {ev2 |-> v_clos(cl)} |> ==> \
clasohm@969
   236
\        P ve (fix ev2(ev1) = e) (v_clos cl); \
clasohm@969
   237
\      !!ve c1 c2 e1 e2. \
clasohm@969
   238
\        [| P ve e1 (v_const c1); P ve e2 (v_const c2) |] ==> \
clasohm@969
   239
\        P ve (e1 @ e2) (v_const(c_app c1 c2)); \
clasohm@969
   240
\      !!ve vem evm e1 e2 em v v2. \
clasohm@969
   241
\        [|  P ve e1 (v_clos <|evm,em,vem|>); \
clasohm@969
   242
\            P ve e2 v2; \
clasohm@969
   243
\            P (vem + {evm |-> v2}) em v \
clasohm@969
   244
\        |] ==> P ve (e1 @ e2) v \
clasohm@969
   245
\   |] ==> P ve e v";
clasohm@969
   246
by (res_inst_tac [("P","P")] infsys_pp2 1);
clasohm@969
   247
by (rtac eval_ind0 1);
clasohm@969
   248
by (ALLGOALS (rtac infsys_pp1));
clasohm@969
   249
by (ALLGOALS (resolve_tac prems));
clasohm@969
   250
by (REPEAT ((assume_tac 1) ORELSE (dtac infsys_pp2 1)));
clasohm@969
   251
qed "eval_ind";
clasohm@969
   252
clasohm@969
   253
(* ############################################################ *)
clasohm@969
   254
(* Elaborations                                                 *)
clasohm@969
   255
(* ############################################################ *)
clasohm@969
   256
wenzelm@5069
   257
Goalw [mono_def, elab_fun_def] "mono(elab_fun)";
clasohm@969
   258
by infsys_mono_tac;
clasohm@969
   259
qed "elab_fun_mono";
clasohm@969
   260
clasohm@969
   261
(* Introduction rules *)
clasohm@969
   262
wenzelm@5069
   263
Goalw [elab_def, elab_rel_def] 
paulson@5148
   264
  "c isof ty ==> te |- e_const(c) ===> ty";
clasohm@969
   265
by (rtac lfp_intro2 1);
clasohm@969
   266
by (rtac elab_fun_mono 1);
clasohm@969
   267
by (rewtac elab_fun_def);
wenzelm@4089
   268
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   269
qed "elab_const";
clasohm@969
   270
wenzelm@5069
   271
Goalw [elab_def, elab_rel_def] 
paulson@5148
   272
  "x:te_dom(te) ==> te |- e_var(x) ===> te_app te x";
clasohm@969
   273
by (rtac lfp_intro2 1);
clasohm@969
   274
by (rtac elab_fun_mono 1);
clasohm@969
   275
by (rewtac elab_fun_def);
wenzelm@4089
   276
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   277
qed "elab_var";
clasohm@969
   278
wenzelm@5069
   279
Goalw [elab_def, elab_rel_def] 
paulson@5148
   280
  "te + {x |=> ty1} |- e ===> ty2 ==> te |- fn x => e ===> ty1->ty2";
clasohm@969
   281
by (rtac lfp_intro2 1);
clasohm@969
   282
by (rtac elab_fun_mono 1);
clasohm@969
   283
by (rewtac elab_fun_def);
wenzelm@4089
   284
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   285
qed "elab_fn";
clasohm@969
   286
wenzelm@5069
   287
Goalw [elab_def, elab_rel_def]
paulson@5148
   288
  "te + {f |=> ty1->ty2} + {x |=> ty1} |- e ===> ty2 ==> \
paulson@2935
   289
\        te |- fix f(x) = e ===> ty1->ty2";
clasohm@969
   290
by (rtac lfp_intro2 1);
clasohm@969
   291
by (rtac elab_fun_mono 1);
clasohm@969
   292
by (rewtac elab_fun_def);
wenzelm@4089
   293
by (blast_tac (claset() addSIs [exI]) 1);
clasohm@969
   294
qed "elab_fix";
clasohm@969
   295
wenzelm@5069
   296
Goalw [elab_def, elab_rel_def] 
paulson@5148
   297
  "[| te |- e1 ===> ty1->ty2; te |- e2 ===> ty1 |] ==> \
paulson@2935
   298
\        te |- e1 @ e2 ===> ty2";
clasohm@969
   299
by (rtac lfp_intro2 1);
clasohm@969
   300
by (rtac elab_fun_mono 1);
clasohm@969
   301
by (rewtac elab_fun_def);
wenzelm@4089
   302
by (blast_tac (claset() addSIs [disjI2]) 1);
clasohm@969
   303
qed "elab_app";
clasohm@969
   304
clasohm@969
   305
(* Strong elimination, induction on elaborations *)
clasohm@969
   306
clasohm@969
   307
val prems = goalw MT.thy [elab_def, elab_rel_def]
clasohm@969
   308
  " [| te |- e ===> t; \
clasohm@972
   309
\      !!te c t. c isof t ==> P(((te,e_const(c)),t)); \
clasohm@972
   310
\      !!te x. x:te_dom(te) ==> P(((te,e_var(x)),te_app te x)); \
clasohm@969
   311
\      !!te x e t1 t2. \
clasohm@972
   312
\        [| te + {x |=> t1} |- e ===> t2; P(((te + {x |=> t1},e),t2)) |] ==> \
clasohm@972
   313
\        P(((te,fn x => e),t1->t2)); \
clasohm@969
   314
\      !!te f x e t1 t2. \
clasohm@969
   315
\        [| te + {f |=> t1->t2} + {x |=> t1} |- e ===> t2; \
clasohm@972
   316
\           P(((te + {f |=> t1->t2} + {x |=> t1},e),t2)) \
clasohm@969
   317
\        |] ==> \
clasohm@972
   318
\        P(((te,fix f(x) = e),t1->t2)); \
clasohm@969
   319
\      !!te e1 e2 t1 t2. \
clasohm@972
   320
\        [| te |- e1 ===> t1->t2; P(((te,e1),t1->t2)); \
clasohm@972
   321
\           te |- e2 ===> t1; P(((te,e2),t1)) \
clasohm@969
   322
\        |] ==> \
clasohm@972
   323
\        P(((te,e1 @ e2),t2)) \
clasohm@969
   324
\   |] ==> \
clasohm@972
   325
\   P(((te,e),t))";
clasohm@969
   326
by (resolve_tac (prems RL [lfp_ind2]) 1);
clasohm@969
   327
by (rtac elab_fun_mono 1);
clasohm@969
   328
by (rewtac elab_fun_def);
clasohm@969
   329
by (dtac CollectD 1);
paulson@4153
   330
by Safe_tac;
clasohm@969
   331
by (ALLGOALS (resolve_tac prems));
paulson@2935
   332
by (ALLGOALS (Blast_tac));
clasohm@969
   333
qed "elab_ind0";
clasohm@969
   334
clasohm@969
   335
val prems = goal MT.thy
clasohm@969
   336
  " [| te |- e ===> t; \
clasohm@969
   337
\       !!te c t. c isof t ==> P te (e_const c) t; \
clasohm@969
   338
\      !!te x. x:te_dom(te) ==> P te (e_var x) (te_app te x); \
clasohm@969
   339
\      !!te x e t1 t2. \
clasohm@969
   340
\        [| te + {x |=> t1} |- e ===> t2; P (te + {x |=> t1}) e t2 |] ==> \
clasohm@969
   341
\        P te (fn x => e) (t1->t2); \
clasohm@969
   342
\      !!te f x e t1 t2. \
clasohm@969
   343
\        [| te + {f |=> t1->t2} + {x |=> t1} |- e ===> t2; \
clasohm@969
   344
\           P (te + {f |=> t1->t2} + {x |=> t1}) e t2 \
clasohm@969
   345
\        |] ==> \
clasohm@969
   346
\        P te (fix f(x) = e) (t1->t2); \
clasohm@969
   347
\      !!te e1 e2 t1 t2. \
clasohm@969
   348
\        [| te |- e1 ===> t1->t2; P te e1 (t1->t2); \
clasohm@969
   349
\           te |- e2 ===> t1; P te e2 t1 \
clasohm@969
   350
\        |] ==> \
clasohm@969
   351
\        P te (e1 @ e2) t2 \ 
clasohm@969
   352
\   |] ==> \
clasohm@969
   353
\   P te e t";
clasohm@969
   354
by (res_inst_tac [("P","P")] infsys_pp2 1);
clasohm@969
   355
by (rtac elab_ind0 1);
clasohm@969
   356
by (ALLGOALS (rtac infsys_pp1));
clasohm@969
   357
by (ALLGOALS (resolve_tac prems));
clasohm@969
   358
by (REPEAT ((assume_tac 1) ORELSE (dtac infsys_pp2 1)));
clasohm@969
   359
qed "elab_ind";
clasohm@969
   360
clasohm@969
   361
(* Weak elimination, case analysis on elaborations *)
clasohm@969
   362
clasohm@969
   363
val prems = goalw MT.thy [elab_def, elab_rel_def]
clasohm@969
   364
  " [| te |- e ===> t; \
clasohm@972
   365
\      !!te c t. c isof t ==> P(((te,e_const(c)),t)); \
clasohm@972
   366
\      !!te x. x:te_dom(te) ==> P(((te,e_var(x)),te_app te x)); \
clasohm@969
   367
\      !!te x e t1 t2. \
clasohm@972
   368
\        te + {x |=> t1} |- e ===> t2 ==> P(((te,fn x => e),t1->t2)); \
clasohm@969
   369
\      !!te f x e t1 t2. \
clasohm@969
   370
\        te + {f |=> t1->t2} + {x |=> t1} |- e ===> t2 ==> \
clasohm@972
   371
\        P(((te,fix f(x) = e),t1->t2)); \
clasohm@969
   372
\      !!te e1 e2 t1 t2. \
clasohm@969
   373
\        [| te |- e1 ===> t1->t2; te |- e2 ===> t1 |] ==> \
clasohm@972
   374
\        P(((te,e1 @ e2),t2)) \
clasohm@969
   375
\   |] ==> \
clasohm@972
   376
\   P(((te,e),t))";
clasohm@969
   377
by (resolve_tac (prems RL [lfp_elim2]) 1);
clasohm@969
   378
by (rtac elab_fun_mono 1);
clasohm@969
   379
by (rewtac elab_fun_def);
clasohm@969
   380
by (dtac CollectD 1);
paulson@4153
   381
by Safe_tac;
clasohm@969
   382
by (ALLGOALS (resolve_tac prems));
paulson@2935
   383
by (ALLGOALS (Blast_tac));
clasohm@969
   384
qed "elab_elim0";
clasohm@969
   385
clasohm@969
   386
val prems = goal MT.thy
clasohm@969
   387
  " [| te |- e ===> t; \
clasohm@969
   388
\       !!te c t. c isof t ==> P te (e_const c) t; \
clasohm@969
   389
\      !!te x. x:te_dom(te) ==> P te (e_var x) (te_app te x); \
clasohm@969
   390
\      !!te x e t1 t2. \
clasohm@969
   391
\        te + {x |=> t1} |- e ===> t2 ==> P te (fn x => e) (t1->t2); \
clasohm@969
   392
\      !!te f x e t1 t2. \
clasohm@969
   393
\        te + {f |=> t1->t2} + {x |=> t1} |- e ===> t2 ==> \
clasohm@969
   394
\        P te (fix f(x) = e) (t1->t2); \
clasohm@969
   395
\      !!te e1 e2 t1 t2. \
clasohm@969
   396
\        [| te |- e1 ===> t1->t2; te |- e2 ===> t1 |] ==> \
clasohm@969
   397
\        P te (e1 @ e2) t2 \ 
clasohm@969
   398
\   |] ==> \
clasohm@969
   399
\   P te e t";
clasohm@969
   400
by (res_inst_tac [("P","P")] infsys_pp2 1);
clasohm@969
   401
by (rtac elab_elim0 1);
clasohm@969
   402
by (ALLGOALS (rtac infsys_pp1));
clasohm@969
   403
by (ALLGOALS (resolve_tac prems));
clasohm@969
   404
by (REPEAT ((assume_tac 1) ORELSE (dtac infsys_pp2 1)));
clasohm@969
   405
qed "elab_elim";
clasohm@969
   406
clasohm@969
   407
(* Elimination rules for each expression *)
clasohm@969
   408
clasohm@969
   409
fun elab_e_elim_tac p = 
clasohm@969
   410
  ( (rtac elab_elim 1) THEN 
clasohm@969
   411
    (resolve_tac p 1) THEN 
paulson@4353
   412
    (REPEAT (fast_tac (e_ext_cs HOL_cs) 1))
clasohm@969
   413
  );
clasohm@969
   414
clasohm@969
   415
val prems = goal MT.thy "te |- e ===> t ==> (e = e_const(c) --> c isof t)";
clasohm@969
   416
by (elab_e_elim_tac prems);
clasohm@969
   417
qed "elab_const_elim_lem";
clasohm@969
   418
paulson@5148
   419
Goal "te |- e_const(c) ===> t ==> c isof t";
clasohm@969
   420
by (dtac elab_const_elim_lem 1);
paulson@2935
   421
by (Blast_tac 1);
clasohm@969
   422
qed "elab_const_elim";
clasohm@969
   423
clasohm@969
   424
val prems = goal MT.thy 
clasohm@969
   425
  "te |- e ===> t ==> (e = e_var(x) --> t=te_app te x & x:te_dom(te))";
clasohm@969
   426
by (elab_e_elim_tac prems);
clasohm@969
   427
qed "elab_var_elim_lem";
clasohm@969
   428
paulson@5148
   429
Goal "te |- e_var(ev) ===> t ==> t=te_app te ev & ev : te_dom(te)";
clasohm@969
   430
by (dtac elab_var_elim_lem 1);
paulson@2935
   431
by (Blast_tac 1);
clasohm@969
   432
qed "elab_var_elim";
clasohm@969
   433
clasohm@969
   434
val prems = goal MT.thy 
clasohm@969
   435
  " te |- e ===> t ==> \
clasohm@969
   436
\   ( e = fn x1 => e1 --> \
wenzelm@3842
   437
\     (? t1 t2. t=t_fun t1 t2 & te + {x1 |=> t1} |- e1 ===> t2) \
clasohm@969
   438
\   )";
clasohm@969
   439
by (elab_e_elim_tac prems);
clasohm@969
   440
qed "elab_fn_elim_lem";
clasohm@969
   441
paulson@5148
   442
Goal 
clasohm@969
   443
  " te |- fn x1 => e1 ===> t ==> \
clasohm@969
   444
\   (? t1 t2. t=t1->t2 & te + {x1 |=> t1} |- e1 ===> t2)";
clasohm@969
   445
by (dtac elab_fn_elim_lem 1);
paulson@2935
   446
by (Blast_tac 1);
clasohm@969
   447
qed "elab_fn_elim";
clasohm@969
   448
clasohm@969
   449
val prems = goal MT.thy 
clasohm@969
   450
  " te |- e ===> t ==> \
clasohm@969
   451
\   (e = fix f(x) = e1 --> \
clasohm@969
   452
\   (? t1 t2. t=t1->t2 & te + {f |=> t1->t2} + {x |=> t1} |- e1 ===> t2))"; 
clasohm@969
   453
by (elab_e_elim_tac prems);
clasohm@969
   454
qed "elab_fix_elim_lem";
clasohm@969
   455
paulson@5148
   456
Goal 
clasohm@969
   457
  " te |- fix ev1(ev2) = e1 ===> t ==> \
clasohm@969
   458
\   (? t1 t2. t=t1->t2 & te + {ev1 |=> t1->t2} + {ev2 |=> t1} |- e1 ===> t2)";
clasohm@969
   459
by (dtac elab_fix_elim_lem 1);
paulson@2935
   460
by (Blast_tac 1);
clasohm@969
   461
qed "elab_fix_elim";
clasohm@969
   462
clasohm@969
   463
val prems = goal MT.thy 
clasohm@969
   464
  " te |- e ===> t2 ==> \
clasohm@969
   465
\   (e = e1 @ e2 --> (? t1 . te |- e1 ===> t1->t2 & te |- e2 ===> t1))"; 
clasohm@969
   466
by (elab_e_elim_tac prems);
clasohm@969
   467
qed "elab_app_elim_lem";
clasohm@969
   468
paulson@5148
   469
Goal
clasohm@1266
   470
 "te |- e1 @ e2 ===> t2 ==> (? t1 . te |- e1 ===> t1->t2 & te |- e2 ===> t1)"; 
clasohm@969
   471
by (dtac elab_app_elim_lem 1);
paulson@2935
   472
by (Blast_tac 1);
clasohm@969
   473
qed "elab_app_elim";
clasohm@969
   474
clasohm@969
   475
(* ############################################################ *)
clasohm@969
   476
(* The extended correspondence relation                       *)
clasohm@969
   477
(* ############################################################ *)
clasohm@969
   478
clasohm@969
   479
(* Monotonicity of hasty_fun *)
clasohm@969
   480
wenzelm@5069
   481
Goalw [mono_def,MT.hasty_fun_def] "mono(hasty_fun)";
clasohm@969
   482
by infsys_mono_tac;
paulson@2935
   483
by (Blast_tac 1);
paulson@2935
   484
qed "mono_hasty_fun";
clasohm@969
   485
clasohm@969
   486
(* 
clasohm@969
   487
  Because hasty_rel has been defined as the greatest fixpoint of hasty_fun it 
clasohm@969
   488
  enjoys two strong indtroduction (co-induction) rules and an elimination rule.
clasohm@969
   489
*)
clasohm@969
   490
clasohm@969
   491
(* First strong indtroduction (co-induction) rule for hasty_rel *)
clasohm@969
   492
wenzelm@5069
   493
Goalw [hasty_rel_def] "c isof t ==> (v_const(c),t) : hasty_rel";
clasohm@969
   494
by (rtac gfp_coind2 1);
clasohm@969
   495
by (rewtac MT.hasty_fun_def);
lcp@1047
   496
by (rtac CollectI 1);
lcp@1047
   497
by (rtac disjI1 1);
paulson@2935
   498
by (Blast_tac 1);
clasohm@969
   499
by (rtac mono_hasty_fun 1);
clasohm@969
   500
qed "hasty_rel_const_coind";
clasohm@969
   501
clasohm@969
   502
(* Second strong introduction (co-induction) rule for hasty_rel *)
clasohm@969
   503
paulson@5148
   504
Goalw [hasty_rel_def]
clasohm@969
   505
  " [|  te |- fn ev => e ===> t; \
clasohm@969
   506
\       ve_dom(ve) = te_dom(te); \
clasohm@969
   507
\       ! ev1. \
clasohm@969
   508
\         ev1:ve_dom(ve) --> \
clasohm@972
   509
\         (ve_app ve ev1,te_app te ev1) : {(v_clos(<|ev,e,ve|>),t)} Un hasty_rel \
clasohm@969
   510
\   |] ==> \
clasohm@972
   511
\   (v_clos(<|ev,e,ve|>),t) : hasty_rel";
clasohm@969
   512
by (rtac gfp_coind2 1);
clasohm@969
   513
by (rewtac hasty_fun_def);
lcp@1047
   514
by (rtac CollectI 1);
lcp@1047
   515
by (rtac disjI2 1);
paulson@2935
   516
by (blast_tac HOL_cs 1);
clasohm@969
   517
by (rtac mono_hasty_fun 1);
clasohm@969
   518
qed "hasty_rel_clos_coind";
clasohm@969
   519
clasohm@969
   520
(* Elimination rule for hasty_rel *)
clasohm@969
   521
clasohm@969
   522
val prems = goalw MT.thy [hasty_rel_def]
wenzelm@3842
   523
  " [| !! c t. c isof t ==> P((v_const(c),t)); \
clasohm@969
   524
\      !! te ev e t ve. \
clasohm@969
   525
\        [| te |- fn ev => e ===> t; \
clasohm@969
   526
\           ve_dom(ve) = te_dom(te); \
wenzelm@3842
   527
\           !ev1. ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
clasohm@972
   528
\        |] ==> P((v_clos(<|ev,e,ve|>),t)); \
clasohm@972
   529
\      (v,t) : hasty_rel \
clasohm@972
   530
\   |] ==> P((v,t))";
clasohm@969
   531
by (cut_facts_tac prems 1);
clasohm@969
   532
by (etac gfp_elim2 1);
clasohm@969
   533
by (rtac mono_hasty_fun 1);
clasohm@969
   534
by (rewtac hasty_fun_def);
clasohm@969
   535
by (dtac CollectD 1);
clasohm@969
   536
by (fold_goals_tac [hasty_fun_def]);
paulson@4153
   537
by Safe_tac;
paulson@2935
   538
by (REPEAT (ares_tac prems 1));
clasohm@969
   539
qed "hasty_rel_elim0";
clasohm@969
   540
clasohm@969
   541
val prems = goal MT.thy 
clasohm@972
   542
  " [| (v,t) : hasty_rel; \
wenzelm@3842
   543
\      !! c t. c isof t ==> P (v_const c) t; \
clasohm@969
   544
\      !! te ev e t ve. \
clasohm@969
   545
\        [| te |- fn ev => e ===> t; \
clasohm@969
   546
\           ve_dom(ve) = te_dom(te); \
wenzelm@3842
   547
\           !ev1. ev1:ve_dom(ve) --> (ve_app ve ev1,te_app te ev1) : hasty_rel \
clasohm@969
   548
\        |] ==> P (v_clos <|ev,e,ve|>) t \
clasohm@969
   549
\   |] ==> P v t";
clasohm@969
   550
by (res_inst_tac [("P","P")] infsys_p2 1);
clasohm@969
   551
by (rtac hasty_rel_elim0 1);
clasohm@969
   552
by (ALLGOALS (rtac infsys_p1));
clasohm@969
   553
by (ALLGOALS (resolve_tac prems));
clasohm@969
   554
by (REPEAT ((assume_tac 1) ORELSE (dtac infsys_p2 1)));
clasohm@969
   555
qed "hasty_rel_elim";
clasohm@969
   556
clasohm@969
   557
(* Introduction rules for hasty *)
clasohm@969
   558
paulson@5143
   559
Goalw [hasty_def] "c isof t ==> v_const(c) hasty t";
paulson@2935
   560
by (etac hasty_rel_const_coind 1);
clasohm@969
   561
qed "hasty_const";
clasohm@969
   562
wenzelm@5069
   563
Goalw [hasty_def,hasty_env_def] 
paulson@5148
   564
 "te |- fn ev => e ===> t & ve hastyenv te ==> v_clos(<|ev,e,ve|>) hasty t";
clasohm@969
   565
by (rtac hasty_rel_clos_coind 1);
wenzelm@4089
   566
by (ALLGOALS (blast_tac (claset() delrules [equalityI])));
clasohm@969
   567
qed "hasty_clos";
clasohm@969
   568
clasohm@969
   569
(* Elimination on constants for hasty *)
clasohm@969
   570
wenzelm@5069
   571
Goalw [hasty_def] 
paulson@5148
   572
  "v hasty t ==> (!c.(v = v_const(c) --> c isof t))";  
clasohm@969
   573
by (rtac hasty_rel_elim 1);
paulson@2935
   574
by (ALLGOALS (blast_tac (v_ext_cs HOL_cs)));
clasohm@969
   575
qed "hasty_elim_const_lem";
clasohm@969
   576
paulson@5143
   577
Goal "v_const(c) hasty t ==> c isof t";
paulson@2935
   578
by (dtac hasty_elim_const_lem 1);
paulson@2935
   579
by (Blast_tac 1);
clasohm@969
   580
qed "hasty_elim_const";
clasohm@969
   581
clasohm@969
   582
(* Elimination on closures for hasty *)
clasohm@969
   583
paulson@5148
   584
Goalw [hasty_env_def,hasty_def] 
clasohm@969
   585
  " v hasty t ==> \
clasohm@969
   586
\   ! x e ve. \
wenzelm@3842
   587
\     v=v_clos(<|x,e,ve|>) --> (? te. te |- fn x => e ===> t & ve hastyenv te)";
clasohm@969
   588
by (rtac hasty_rel_elim 1);
paulson@2935
   589
by (ALLGOALS (blast_tac (v_ext_cs HOL_cs)));
clasohm@969
   590
qed "hasty_elim_clos_lem";
clasohm@969
   591
wenzelm@5069
   592
Goal 
paulson@5148
   593
  "v_clos(<|ev,e,ve|>) hasty t ==>  \
wenzelm@3842
   594
\       ? te. te |- fn ev => e ===> t & ve hastyenv te ";
paulson@2935
   595
by (dtac hasty_elim_clos_lem 1);
paulson@2935
   596
by (Blast_tac 1);
clasohm@969
   597
qed "hasty_elim_clos";
clasohm@969
   598
clasohm@969
   599
(* ############################################################ *)
clasohm@969
   600
(* The pointwise extension of hasty to environments             *)
clasohm@969
   601
(* ############################################################ *)
clasohm@969
   602
wenzelm@5069
   603
Goal
paulson@5148
   604
  "[| ve hastyenv te; v hasty t |] ==> \
lcp@1047
   605
\        ve + {ev |-> v} hastyenv te + {ev |=> t}";
lcp@1047
   606
by (rewtac hasty_env_def);
wenzelm@4089
   607
by (asm_full_simp_tac (simpset() delsimps mem_simps
clasohm@1266
   608
                                addsimps [ve_dom_owr, te_dom_owr]) 1);
paulson@2935
   609
by (safe_tac HOL_cs);
lcp@1047
   610
by (excluded_middle_tac "ev=x" 1);
wenzelm@4089
   611
by (asm_full_simp_tac (simpset() addsimps [ve_app_owr2, te_app_owr2]) 1);
paulson@2935
   612
by (Blast_tac 1);
wenzelm@4089
   613
by (asm_simp_tac (simpset() addsimps [ve_app_owr1, te_app_owr1]) 1);
clasohm@969
   614
qed "hasty_env1";
clasohm@969
   615
clasohm@969
   616
(* ############################################################ *)
clasohm@969
   617
(* The Consistency theorem                                      *)
clasohm@969
   618
(* ############################################################ *)
clasohm@969
   619
wenzelm@5069
   620
Goal 
paulson@5148
   621
  "[| ve hastyenv te ; te |- e_const(c) ===> t |] ==> v_const(c) hasty t";
clasohm@969
   622
by (dtac elab_const_elim 1);
clasohm@969
   623
by (etac hasty_const 1);
clasohm@969
   624
qed "consistency_const";
clasohm@969
   625
wenzelm@5069
   626
Goalw [hasty_env_def]
paulson@5148
   627
  "[| ev : ve_dom(ve); ve hastyenv te ; te |- e_var(ev) ===> t |] ==> \
paulson@2935
   628
\       ve_app ve ev hasty t";
clasohm@969
   629
by (dtac elab_var_elim 1);
paulson@2935
   630
by (Blast_tac 1);
clasohm@969
   631
qed "consistency_var";
clasohm@969
   632
wenzelm@5069
   633
Goal
paulson@5148
   634
  "[| ve hastyenv te ; te |- fn ev => e ===> t |] ==> \
paulson@2935
   635
\       v_clos(<| ev, e, ve |>) hasty t";
clasohm@969
   636
by (rtac hasty_clos 1);
paulson@2935
   637
by (Blast_tac 1);
clasohm@969
   638
qed "consistency_fn";
clasohm@969
   639
wenzelm@5069
   640
Goalw [hasty_env_def,hasty_def]
paulson@5148
   641
  "[| cl = <| ev1, e, ve + { ev2 |-> v_clos(cl) } |>; \
clasohm@969
   642
\      ve hastyenv te ; \
clasohm@969
   643
\      te |- fix ev2  ev1  = e ===> t \
clasohm@969
   644
\   |] ==> \
clasohm@969
   645
\   v_clos(cl) hasty t";
clasohm@969
   646
by (dtac elab_fix_elim 1);
paulson@2935
   647
by (safe_tac HOL_cs);
lcp@1047
   648
(*Do a single unfolding of cl*)
lcp@1047
   649
by ((forward_tac [ssubst] 1) THEN (assume_tac 2));
lcp@1047
   650
by (rtac hasty_rel_clos_coind 1);
clasohm@969
   651
by (etac elab_fn 1);
wenzelm@4089
   652
by (asm_simp_tac (simpset() addsimps [ve_dom_owr, te_dom_owr]) 1);
clasohm@969
   653
wenzelm@4089
   654
by (asm_simp_tac (simpset() delsimps mem_simps addsimps [ve_dom_owr]) 1);
paulson@2935
   655
by (safe_tac HOL_cs);
lcp@1047
   656
by (excluded_middle_tac "ev2=ev1a" 1);
wenzelm@4089
   657
by (asm_full_simp_tac (simpset() addsimps [ve_app_owr2, te_app_owr2]) 1);
paulson@2935
   658
by (Blast_tac 1);
clasohm@969
   659
wenzelm@4089
   660
by (asm_simp_tac (simpset() delsimps mem_simps
clasohm@1266
   661
                           addsimps [ve_app_owr1, te_app_owr1]) 1);
clasohm@969
   662
by (hyp_subst_tac 1);
clasohm@969
   663
by (etac subst 1);
paulson@2935
   664
by (Blast_tac 1);
clasohm@969
   665
qed "consistency_fix";
clasohm@969
   666
wenzelm@5069
   667
Goal 
paulson@5148
   668
  "[| ! t te. ve hastyenv te --> te |- e1 ===> t --> v_const(c1) hasty t;\
clasohm@969
   669
\      ! t te. ve hastyenv te  --> te |- e2 ===> t --> v_const(c2) hasty t; \
clasohm@969
   670
\      ve hastyenv te ; te |- e1 @ e2 ===> t \
clasohm@969
   671
\   |] ==> \
clasohm@969
   672
\   v_const(c_app c1 c2) hasty t";
clasohm@969
   673
by (dtac elab_app_elim 1);
paulson@4153
   674
by Safe_tac;
clasohm@969
   675
by (rtac hasty_const 1);
clasohm@969
   676
by (rtac isof_app 1);
clasohm@969
   677
by (rtac hasty_elim_const 1);
paulson@2935
   678
by (Blast_tac 1);
clasohm@969
   679
by (rtac hasty_elim_const 1);
paulson@2935
   680
by (Blast_tac 1);
clasohm@969
   681
qed "consistency_app1";
clasohm@969
   682
wenzelm@5069
   683
Goal 
paulson@5148
   684
  "[| ! t te. \
clasohm@969
   685
\        ve hastyenv te  --> \
clasohm@969
   686
\        te |- e1 ===> t --> v_clos(<|evm, em, vem|>) hasty t; \
clasohm@969
   687
\      ! t te. ve hastyenv te  --> te |- e2 ===> t --> v2 hasty t; \
clasohm@969
   688
\      ! t te. \
clasohm@969
   689
\        vem + { evm |-> v2 } hastyenv te  --> te |- em ===> t --> v hasty t; \
clasohm@969
   690
\      ve hastyenv te ; \
clasohm@969
   691
\      te |- e1 @ e2 ===> t \
clasohm@969
   692
\   |] ==> \
clasohm@969
   693
\   v hasty t";
clasohm@969
   694
by (dtac elab_app_elim 1);
paulson@4153
   695
by Safe_tac;
lcp@1047
   696
by ((etac allE 1) THEN (etac allE 1) THEN (etac impE 1));
lcp@1047
   697
by (assume_tac 1);
lcp@1047
   698
by (etac impE 1);
lcp@1047
   699
by (assume_tac 1);
lcp@1047
   700
by ((etac allE 1) THEN (etac allE 1) THEN (etac impE 1));
lcp@1047
   701
by (assume_tac 1);
lcp@1047
   702
by (etac impE 1);
lcp@1047
   703
by (assume_tac 1);
clasohm@969
   704
by (dtac hasty_elim_clos 1);
paulson@4153
   705
by Safe_tac;
clasohm@969
   706
by (dtac elab_fn_elim 1);
wenzelm@4089
   707
by (blast_tac (claset() addIs [hasty_env1] addSDs [t_fun_inj]) 1);
clasohm@969
   708
qed "consistency_app2";
clasohm@969
   709
paulson@5148
   710
Goal
lcp@1047
   711
  "ve |- e ---> v ==> \
lcp@1047
   712
\  (! t te. ve hastyenv te --> te |- e ===> t --> v hasty t)";
clasohm@969
   713
clasohm@969
   714
(* Proof by induction on the structure of evaluations *)
clasohm@969
   715
paulson@5148
   716
by (etac eval_ind 1);
paulson@4153
   717
by Safe_tac;
lcp@1047
   718
by (DEPTH_SOLVE 
lcp@1047
   719
    (ares_tac [consistency_const, consistency_var, consistency_fn,
clasohm@1465
   720
               consistency_fix, consistency_app1, consistency_app2] 1));
clasohm@969
   721
qed "consistency";
clasohm@969
   722
clasohm@969
   723
(* ############################################################ *)
clasohm@969
   724
(* The Basic Consistency theorem                                *)
clasohm@969
   725
(* ############################################################ *)
clasohm@969
   726
paulson@5148
   727
Goalw [isof_env_def,hasty_env_def] 
clasohm@969
   728
  "ve isofenv te ==> ve hastyenv te";
paulson@4153
   729
by Safe_tac;
lcp@1047
   730
by (etac allE 1);
lcp@1047
   731
by (etac impE 1);
lcp@1047
   732
by (assume_tac 1);
lcp@1047
   733
by (etac exE 1);
lcp@1047
   734
by (etac conjE 1);
clasohm@969
   735
by (dtac hasty_const 1);
clasohm@1266
   736
by (Asm_simp_tac 1);
clasohm@969
   737
qed "basic_consistency_lem";
clasohm@969
   738
paulson@5148
   739
Goal
clasohm@969
   740
  "[| ve isofenv te; ve |- e ---> v_const(c); te |- e ===> t |] ==> c isof t";
clasohm@969
   741
by (rtac hasty_elim_const 1);
clasohm@969
   742
by (dtac consistency 1);
wenzelm@4089
   743
by (blast_tac (claset() addSIs [basic_consistency_lem]) 1);
clasohm@969
   744
qed "basic_consistency";
paulson@1584
   745
paulson@1584
   746
writeln"Reached end of file.";