src/ZF/Coind/Values.ML
author clasohm
Tue Feb 06 12:27:17 1996 +0100 (1996-02-06)
changeset 1478 2b8c2a7547ab
parent 1461 6bcb44e4d6e5
child 2034 5079fdf938dd
permissions -rw-r--r--
expanded tabs
clasohm@1461
     1
(*  Title:      ZF/Coind/Values.ML
lcp@916
     2
    ID:         $Id$
clasohm@1461
     3
    Author:     Jacob Frost, Cambridge University Computer Laboratory
lcp@916
     4
    Copyright   1995  University of Cambridge
lcp@916
     5
*)
lcp@916
     6
lcp@916
     7
open Values;
lcp@916
     8
lcp@916
     9
(* Elimination rules *)
lcp@916
    10
lcp@916
    11
val prems = goalw Values.thy (Part_def::(tl (tl Val_ValEnv.defs)))
lcp@916
    12
  "[| ve:ValEnv; !!m.[| ve=ve_mk(m); m:PMap(ExVar,Val) |] ==> Q |] ==> Q";
lcp@916
    13
by (cut_facts_tac prems 1);
lcp@916
    14
by (etac CollectE 1);
lcp@916
    15
by (etac exE 1);
lcp@916
    16
by (etac Val_ValEnv.elim 1);
lcp@916
    17
by (eresolve_tac prems 3);
lcp@916
    18
by (rewrite_tac Val_ValEnv.con_defs);
lcp@916
    19
by (ALLGOALS (fast_tac qsum_cs));
lcp@916
    20
qed "ValEnvE";
lcp@916
    21
lcp@916
    22
val prems = goalw Values.thy (Part_def::[hd (tl Val_ValEnv.defs)])
lcp@916
    23
  "[| v:Val; \
lcp@916
    24
\     !!c. [| v = v_const(c); c:Const |] ==> Q;\
lcp@916
    25
\     !!e ve x. \
lcp@916
    26
\       [| v = v_clos(x,e,ve); x:ExVar; e:Exp; ve:ValEnv |] ==> Q \
lcp@916
    27
\  |] ==> \
lcp@916
    28
\  Q";
lcp@916
    29
by (cut_facts_tac prems 1);
lcp@916
    30
by (etac CollectE 1);
lcp@916
    31
by (etac exE 1);
lcp@916
    32
by (etac Val_ValEnv.elim 1);
lcp@916
    33
by (eresolve_tac prems 1);
lcp@916
    34
by (assume_tac 1);
lcp@916
    35
by (eresolve_tac prems 1);
lcp@916
    36
by (assume_tac 1);
lcp@916
    37
by (assume_tac 1);
lcp@916
    38
by (assume_tac 1);
lcp@916
    39
by (rewrite_tac Val_ValEnv.con_defs);
lcp@916
    40
by (fast_tac qsum_cs 1);
lcp@916
    41
qed "ValE";
lcp@916
    42
lcp@916
    43
(* Nonempty sets *)
lcp@916
    44
lcp@916
    45
val prems = goal Values.thy "A ~= 0 ==> EX a.a:A";
lcp@916
    46
by (cut_facts_tac prems 1);
lcp@916
    47
by (rtac (foundation RS disjE) 1);
lcp@916
    48
by (fast_tac ZF_cs 1);
lcp@916
    49
by (fast_tac ZF_cs 1);
lcp@916
    50
qed "set_notemptyE";
lcp@916
    51
lcp@916
    52
goalw Values.thy (sum_def::QPair_def::QInl_def::QInr_def::Val_ValEnv.con_defs)
lcp@916
    53
  "v_clos(x,e,ve) ~= 0";
lcp@916
    54
by (rtac not_emptyI 1);
lcp@916
    55
by (rtac UnI2 1);
lcp@916
    56
by (rtac SigmaI 1);
lcp@916
    57
by (rtac singletonI 1);
lcp@916
    58
by (rtac UnI1 1);
lcp@916
    59
by (fast_tac ZF_cs 1);
lcp@916
    60
qed "v_closNE";
lcp@916
    61
lcp@916
    62
goalw Values.thy (sum_def::QPair_def::QInl_def::QInr_def::Val_ValEnv.con_defs)
lcp@916
    63
  "!!c.c:Const ==> v_const(c) ~= 0";
lcp@916
    64
by (dtac constNEE 1);
lcp@916
    65
by (etac not_emptyE 1);
lcp@916
    66
by (rtac not_emptyI 1);
lcp@916
    67
by (rtac UnI2 1);
lcp@916
    68
by (rtac SigmaI 1);
lcp@916
    69
by (rtac singletonI 1);
lcp@916
    70
by (rtac UnI2 1);
lcp@916
    71
by (rtac SigmaI 1);
lcp@916
    72
by (rtac singletonI 1);
lcp@916
    73
by (assume_tac 1);
lcp@916
    74
qed "v_constNE";
lcp@916
    75
lcp@916
    76
(* Proving that the empty set is not a value *)
lcp@916
    77
lcp@916
    78
goal Values.thy "!!v.v:Val ==> v ~= 0";
lcp@916
    79
by (etac ValE 1);
lcp@916
    80
by (ALLGOALS hyp_subst_tac);
lcp@916
    81
by (etac v_constNE 1);
lcp@916
    82
by (rtac v_closNE 1);
lcp@916
    83
qed "ValNEE";
lcp@916
    84
lcp@916
    85
(* Equalities for value environments *)
lcp@916
    86
lcp@916
    87
val prems = goalw Values.thy [ve_dom_def,ve_owr_def]
lcp@916
    88
  "[| ve:ValEnv; v ~=0 |] ==> ve_dom(ve_owr(ve,x,v)) = ve_dom(ve) Un {x}";
lcp@916
    89
by (cut_facts_tac prems 1);
lcp@916
    90
by (etac ValEnvE 1);
lcp@916
    91
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
    92
by (rtac (map_domain_owr RS ssubst) 1);
lcp@916
    93
by (assume_tac 1);
lcp@916
    94
by (rtac Un_commute 1);
lcp@916
    95
qed "ve_dom_owr";
lcp@916
    96
lcp@916
    97
goalw Values.thy [ve_app_def,ve_owr_def]
lcp@916
    98
"!!ve. ve:ValEnv ==> ve_app(ve_owr(ve,x,v),x) = v"; 
lcp@916
    99
by (etac ValEnvE 1);
lcp@916
   100
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
   101
by (rtac map_app_owr1 1);
lcp@916
   102
qed "ve_app_owr1";
lcp@916
   103
lcp@916
   104
goalw Values.thy [ve_app_def,ve_owr_def]
lcp@916
   105
 "!!ve.ve:ValEnv ==> x ~= y ==> ve_app(ve_owr(ve,x,v),y) = ve_app(ve,y)";
lcp@916
   106
by (etac ValEnvE 1);
lcp@916
   107
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
   108
by (rtac map_app_owr2 1);
lcp@916
   109
by (fast_tac ZF_cs 1);
lcp@916
   110
qed "ve_app_owr2";
lcp@916
   111
lcp@916
   112
(* Introduction rules for operators on value environments *)
lcp@916
   113
lcp@916
   114
goalw Values.thy [ve_app_def,ve_owr_def,ve_dom_def]
lcp@916
   115
  "!!ve.[| ve:ValEnv; x:ve_dom(ve) |] ==> ve_app(ve,x):Val";
lcp@916
   116
by (etac ValEnvE 1);
lcp@916
   117
by (hyp_subst_tac 1);
lcp@916
   118
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
   119
by (rtac pmap_appI 1);
lcp@916
   120
by (assume_tac 1);
lcp@916
   121
by (assume_tac 1);
lcp@916
   122
qed "ve_appI";
lcp@916
   123
lcp@916
   124
goalw Values.thy [ve_dom_def]
lcp@916
   125
  "!!ve.[| ve:ValEnv; x:ve_dom(ve) |] ==> x:ExVar";
lcp@916
   126
by (etac ValEnvE 1);
lcp@916
   127
by (hyp_subst_tac 1);
lcp@916
   128
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
   129
by (rtac pmap_domainD 1);
lcp@916
   130
by (assume_tac 1);
lcp@916
   131
by (assume_tac 1);
lcp@916
   132
qed "ve_domI";
lcp@916
   133
lcp@916
   134
goalw Values.thy [ve_emp_def] "ve_emp:ValEnv";
lcp@916
   135
by (rtac Val_ValEnv.ve_mk_I 1);
lcp@916
   136
by (rtac pmap_empI 1);
lcp@916
   137
qed "ve_empI";
lcp@916
   138
lcp@916
   139
goalw Values.thy [ve_owr_def] 
lcp@916
   140
  "!!ve.[|ve:ValEnv; x:ExVar; v:Val |] ==> ve_owr(ve,x,v):ValEnv";
lcp@916
   141
by (etac ValEnvE 1);
lcp@916
   142
by (hyp_subst_tac 1);
lcp@916
   143
by (asm_full_simp_tac (ZF_ss addsimps Val_ValEnv.case_eqns) 1);
lcp@916
   144
by (rtac Val_ValEnv.ve_mk_I 1);
lcp@916
   145
by (etac pmap_owrI 1);
lcp@916
   146
by (assume_tac 1);
lcp@916
   147
by (assume_tac 1);
lcp@916
   148
qed "ve_owrI";
lcp@916
   149
lcp@916
   150
lcp@916
   151