src/HOL/UNITY/Extend.ML
author paulson
Fri, 17 Sep 1999 10:31:38 +0200
changeset 7538 357873391561
parent 7537 875754b599df
child 7546 36b26759147e
permissions -rw-r--r--
new rule PLam_ensures
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Extend.ML
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     2
    ID:         $Id$
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     4
    Copyright   1999  University of Cambridge
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     5
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     6
Extending of state sets
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     7
  function f (forget)    maps the extended state to the original state
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     8
  function g (forgotten) maps the extended state to the "extending part"
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
     9
*)
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
    10
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    11
(** These we prove OUTSIDE the locale. **)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    12
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    13
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    14
(****************UNITY.ML****************)
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    15
Goalw [stable_def, constrains_def] "stable UNIV = UNIV";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    16
by Auto_tac;
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    17
qed "stable_UNIV";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    18
Addsimps [stable_UNIV];
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    19
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    20
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    21
(*Possibly easier than reasoning about "inv h"*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    22
val [surj_h,prem] = 
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    23
Goalw [good_map_def]
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    24
     "[| surj h; !! x x' y y'. h(x,y) = h(x',y') ==> x=x' |] ==> good_map h";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    25
by (safe_tac (claset() addSIs [surj_h]));
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    26
by (rtac prem 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    27
by (stac (surjective_pairing RS sym) 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    28
by (stac (surj_h RS surj_f_inv_f) 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    29
by (rtac refl 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    30
qed "good_mapI";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    31
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    32
Goalw [good_map_def] "good_map h ==> surj h";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    33
by Auto_tac;
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    34
qed "good_map_is_surj";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    35
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    36
(*A convenient way of finding a closed form for inv h*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    37
val [surj,prem] = Goalw [inv_def]
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    38
     "[| surj h;  !! x y. g (h(x,y)) = x |] ==> fst (inv h z) = g z";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    39
by (res_inst_tac [("y1", "z")] (surj RS surjD RS exE) 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7482
diff changeset
    40
by (rtac selectI2 1);
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    41
by (dres_inst_tac [("f", "g")] arg_cong 2);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    42
by (auto_tac (claset(), simpset() addsimps [prem]));
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    43
qed "fst_inv_equalityI";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    44
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    45
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    46
Open_locale "Extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    47
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    48
val slice_def = thm "slice_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    49
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    50
(*** Trivial properties of f, g, h ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    51
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    52
val good_h = rewrite_rule [good_map_def] (thm "good_h");
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    53
val surj_h = good_h RS conjunct1;
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    54
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    55
val f_def = thm "f_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    56
val g_def = thm "g_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    57
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    58
Goal "f(h(x,y)) = x";
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    59
by (simp_tac (simpset() addsimps [f_def, good_h RS conjunct2]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    60
qed "f_h_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    61
Addsimps [f_h_eq];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    62
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    63
Goal "h(x,y) = h(x',y') ==> x=x'";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    64
by (dres_inst_tac [("f", "fst o inv h")] arg_cong 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    65
(*FIXME: If locales worked properly we could put just "f" above*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    66
by (full_simp_tac (simpset() addsimps [f_def, good_h RS conjunct2]) 1);
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    67
qed "h_inject1";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    68
AddSDs [h_inject1];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    69
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    70
Goal "h(f z, g z) = z";
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    71
by (simp_tac (simpset() addsimps [f_def, g_def, surjective_pairing RS sym,
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    72
				  surj_h RS surj_f_inv_f]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    73
qed "h_f_g_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    74
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    75
(*** extend_set: basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    76
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    77
Goalw [extend_set_def]
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    78
     "z : extend_set h A = (f z : A)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    79
by (force_tac (claset() addIs  [h_f_g_eq RS sym], simpset()) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    80
qed "mem_extend_set_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    81
AddIffs [mem_extend_set_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    82
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    83
Goal "{s. P (f s)} = extend_set h {s. P s}";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    84
by Auto_tac;
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    85
qed "Collect_eq_extend_set";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    86
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    87
Goalw [extend_set_def, project_set_def]
875754b599df working snapshot
paulson
parents: 7499
diff changeset
    88
     "project_set h (extend_set h F) = F";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    89
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    90
qed "extend_set_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    91
Addsimps [extend_set_inverse];
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    92
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    93
Goal "inj (extend_set h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    94
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    95
by (rtac extend_set_inverse 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    96
qed "inj_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    97
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    98
(*** project_set: basic properties ***)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    99
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   100
(*project_set is simply image!*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   101
Goalw [project_set_def] "project_set h C = f `` C";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   102
by (auto_tac (claset() addIs [f_h_eq RS sym, h_f_g_eq RS ssubst], 
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   103
	      simpset()));
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   104
qed "project_set_eq";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   105
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   106
(*Converse appears to fail*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   107
Goalw [project_set_def] "z : C ==> f z : project_set h C";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   108
by (auto_tac (claset() addIs [h_f_g_eq RS ssubst], 
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   109
	      simpset()));
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   110
qed "project_set_I";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   111
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   112
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   113
(*** More laws ***)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   114
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   115
(*Because A and B could differ on the "other" part of the state, 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   116
   cannot generalize result to 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   117
      project_set h (A Int B) = project_set h A Int project_set h B
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   118
*)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   119
Goalw [project_set_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   120
     "project_set h ((extend_set h A) Int B) = A Int (project_set h B)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   121
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   122
qed "project_set_extend_set_Int";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   123
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   124
Goal "extend_set h (A Un B) = extend_set h A Un extend_set h B";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   125
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   126
qed "extend_set_Un_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   127
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   128
Goal "extend_set h (A Int B) = extend_set h A Int extend_set h B";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   129
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   130
qed "extend_set_Int_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   131
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   132
Goal "extend_set h (INTER A B) = (INT x:A. extend_set h (B x))";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   133
by Auto_tac;
6834
44da4a2a9ef3 renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents: 6822
diff changeset
   134
qed "extend_set_INT_distrib";
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   135
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   136
Goal "extend_set h (A - B) = extend_set h A - extend_set h B";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   137
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   138
qed "extend_set_Diff_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   139
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   140
Goal "extend_set h (Union A) = (UN X:A. extend_set h X)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   141
by (Blast_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   142
qed "extend_set_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   143
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   144
Goalw [extend_set_def] "(extend_set h A <= - extend_set h B) = (A <= - B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   145
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   146
qed "extend_set_subset_Compl_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   147
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   148
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   149
(*** extend_act ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   150
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   151
(*Actions could affect the g-part, so result Cannot be strengthened to
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   152
   ((z, z') : extend_act h act) = ((f z, f z') : act)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   153
*)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   154
Goalw [extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   155
     "((h(s,y), h(s',y)) : extend_act h act) = ((s, s') : act)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   156
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   157
qed "mem_extend_act_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   158
AddIffs [mem_extend_act_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   159
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   160
Goalw [extend_act_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   161
     "(z, z') : extend_act h act ==> (f z, f z') : act";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   162
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   163
qed "extend_act_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   164
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   165
(*Premise is still undesirably strong, since Domain act can include
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   166
  non-reachable states, but it seems necessary for this result.*)
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   167
Goalw [extend_act_def,project_set_def, project_act_def]
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   168
 "Domain act <= project_set h C ==> project_act C h (extend_act h act) = act";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   169
by (Force_tac 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   170
qed "extend_act_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   171
Addsimps [extend_act_inverse];
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   172
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   173
Goal "inj (extend_act h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   174
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   175
by (rtac extend_act_inverse 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   176
by (force_tac (claset(), simpset() addsimps [project_set_def]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   177
qed "inj_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   178
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   179
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   180
     "extend_act h act ^^ (extend_set h A) = extend_set h (act ^^ A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   181
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   182
qed "extend_act_Image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   183
Addsimps [extend_act_Image];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   184
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   185
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   186
    "(extend_set h A <= extend_set h B) = (A <= B)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   187
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   188
qed "extend_set_strict_mono";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   189
Addsimps [extend_set_strict_mono];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   190
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   191
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   192
    "Domain (extend_act h act) = extend_set h (Domain act)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   193
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   194
qed "Domain_extend_act"; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   195
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   196
Goalw [extend_act_def]
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   197
    "extend_act h Id = Id";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   198
by (force_tac (claset() addIs  [h_f_g_eq RS sym], simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   199
qed "extend_act_Id";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   200
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   201
Goalw [project_act_def]
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   202
     "[| (z, z') : act;  f z = f z' | z: C |] \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   203
\     ==> (f z, f z') : project_act C h act";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   204
by (auto_tac (claset() addSIs [exI] addIs [h_f_g_eq RS ssubst], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   205
	      simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   206
qed "project_act_I";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   207
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   208
Goalw [project_set_def, project_act_def]
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   209
    "project_act C h Id = Id";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   210
by (Force_tac 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   211
qed "project_act_Id";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   212
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   213
(*premise can be weakened*)
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   214
Goalw [project_set_def, project_act_def]
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   215
    "Domain act <= C \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   216
\    ==> Domain (project_act C h act) = project_set h (Domain act)";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7482
diff changeset
   217
by Auto_tac;
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   218
by (res_inst_tac [("y1", "ya")] (surj_h RS surjD RS exE) 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7482
diff changeset
   219
by Auto_tac;
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   220
qed "Domain_project_act";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   221
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   222
Addsimps [extend_act_Id, project_act_Id];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   223
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   224
Goal "Id : extend_act h `` Acts F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   225
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   226
	      simpset() addsimps [image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   227
qed "Id_mem_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   228
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   229
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   230
(**** extend ****)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   231
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   232
(*** Basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   233
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   234
Goalw [extend_def] "Init (extend h F) = extend_set h (Init F)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   235
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   236
qed "Init_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   237
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   238
Goalw [project_def] "Init (project C h F) = project_set h (Init F)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   239
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   240
qed "Init_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   241
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   242
Goal "Acts (extend h F) = (extend_act h `` Acts F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   243
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   244
	      simpset() addsimps [extend_def, image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   245
qed "Acts_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   246
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   247
Goal "Acts (project C h F) = (project_act C h `` Acts F)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   248
by (auto_tac (claset() addSIs [project_act_Id RS sym], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   249
	      simpset() addsimps [project_def, image_iff]));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   250
qed "Acts_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   251
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   252
Addsimps [Init_extend, Init_project, Acts_extend, Acts_project];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   253
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   254
Goalw [SKIP_def] "extend h SKIP = SKIP";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   255
by (rtac program_equalityI 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   256
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   257
qed "extend_SKIP";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   258
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   259
Goalw [SKIP_def] "project C h SKIP = SKIP";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   260
by (rtac program_equalityI 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   261
by (auto_tac (claset() addIs  [h_f_g_eq RS sym], 
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   262
	      simpset() addsimps [project_set_def]));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   263
qed "project_SKIP";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   264
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   265
Goalw [project_set_def] "UNIV <= project_set h UNIV";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   266
by Auto_tac;
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   267
qed "project_set_UNIV";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   268
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   269
(*ALL act: Acts F. Domain act is MUCH TOO STRONG since Domain Id = UNIV!*)
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   270
Goal "UNIV <= project_set h C \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   271
\     ==> project C h (extend h F) = F";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   272
by (simp_tac (simpset() addsimps [extend_def, project_def]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   273
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   274
by (asm_simp_tac (simpset() addsimps [image_image_eq_UN,
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   275
                   subset_UNIV RS subset_trans RS extend_act_inverse]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   276
by (Simp_tac 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   277
qed "extend_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   278
Addsimps [extend_inverse];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   279
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   280
Goal "inj (extend h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   281
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   282
by (rtac extend_inverse 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   283
by (force_tac (claset(), simpset() addsimps [project_set_def]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   284
qed "inj_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   285
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   286
Goal "extend h (F Join G) = extend h F Join extend h G";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   287
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   288
by (simp_tac (simpset() addsimps [image_Un]) 2);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   289
by (simp_tac (simpset() addsimps [extend_set_Int_distrib]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   290
qed "extend_Join";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   291
Addsimps [extend_Join];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   292
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   293
Goal "extend h (JOIN I F) = (JN i:I. extend h (F i))";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   294
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   295
by (simp_tac (simpset() addsimps [image_UN]) 2);
6834
44da4a2a9ef3 renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents: 6822
diff changeset
   296
by (simp_tac (simpset() addsimps [extend_set_INT_distrib]) 1);
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   297
qed "extend_JN";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   298
Addsimps [extend_JN];
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   299
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   300
Goal "UNIV <= project_set h C \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   301
\     ==> project C h ((extend h F) Join G) = F Join (project C h G)";
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   302
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   303
by (asm_simp_tac (simpset() addsimps [image_Un, image_image_eq_UN,
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   304
                   subset_UNIV RS subset_trans RS extend_act_inverse]) 2);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   305
by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   306
qed "project_extend_Join";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   307
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   308
Goal "UNIV <= project_set h C \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   309
\     ==> (extend h F) Join G = extend h H ==> H = F Join (project C h G)";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   310
by (dres_inst_tac [("f", "project C h")] arg_cong 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   311
by (asm_full_simp_tac (simpset() addsimps [project_extend_Join]) 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   312
qed "extend_Join_eq_extend_D";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   313
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   314
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   315
(*** Safety: co, stable ***)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   316
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   317
Goal "(extend h F : (extend_set h A) co (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   318
\     (F : A co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   319
by (simp_tac (simpset() addsimps [constrains_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   320
qed "extend_constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   321
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   322
Goal "(extend h F : stable (extend_set h A)) = (F : stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   323
by (asm_simp_tac (simpset() addsimps [stable_def, extend_constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   324
qed "extend_stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   325
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   326
Goal "(extend h F : invariant (extend_set h A)) = (F : invariant A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   327
by (asm_simp_tac (simpset() addsimps [invariant_def, extend_stable]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   328
qed "extend_invariant";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   329
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   330
(** Safety and project **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   331
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   332
Goalw [constrains_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   333
     "(F Join project C h G : A co B)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   334
\       (extend h F Join G : (C Int extend_set h A) co (extend_set h B) &  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   335
\        F : A co B)";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   336
by (auto_tac (claset() addSIs [project_act_I], simpset() addsimps [ball_Un]));
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   337
by (force_tac (claset() addIs [extend_act_D], simpset()) 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   338
by (force_tac (claset() addSIs [project_act_I] addSDs [subsetD], simpset()) 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   339
(*the <== direction*)
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   340
by (ball_tac 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   341
by (rewtac project_act_def);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   342
by Auto_tac;
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   343
by (force_tac (claset() addSDs [Id_in_Acts RSN (2,bspec)], simpset()) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   344
by (force_tac (claset() addSDs [subsetD], simpset()) 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   345
qed "Join_project_constrains";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   346
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   347
(*The condition is required to prove the left-to-right direction;
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   348
  could weaken it to G : (C Int extend_set h A) co C*)
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   349
Goalw [stable_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   350
     "extend h F Join G : stable C \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   351
\     ==> (F Join project C h G : stable A)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   352
\         (extend h F Join G : stable (C Int extend_set h A) &  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   353
\          F : stable A)";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   354
by (simp_tac (simpset() addsimps [Join_project_constrains]) 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   355
by (blast_tac (claset() addIs [constrains_weaken] addDs [constrains_Int]) 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   356
qed "Join_project_stable";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   357
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   358
Goal "(F Join project UNIV h G : increasing func)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   359
\     (extend h F Join G : increasing (func o f))";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   360
by (simp_tac (simpset() addsimps [increasing_def, Join_project_stable]) 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   361
by (auto_tac (claset(),
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   362
	      simpset() addsimps [Join_stable, Collect_eq_extend_set RS sym,
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   363
				  extend_stable RS iffD1]));
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   364
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   365
qed "Join_project_increasing";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   366
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   367
Goal "(project C h F : A co B)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   368
\     (F : (C Int extend_set h A) co (extend_set h B) & A <= B)";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   369
by (cut_inst_tac [("F", "SKIP")] Join_project_constrains 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   370
by (asm_full_simp_tac (simpset() addsimps [extend_SKIP]) 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   371
qed "project_constrains";
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   372
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   373
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   374
(*** Diff, needed for localTo ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   375
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   376
(** project versions **)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   377
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   378
(*Opposite direction fails because Diff in the extended state may remove
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   379
  fewer actions, i.e. those that affect other state variables.*)
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   380
Goal "(UN act:acts. Domain act) <= project_set h C \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   381
\     ==> Diff (project C h G) acts <= \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   382
\         project C h (Diff G (extend_act h `` acts))";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   383
by (asm_full_simp_tac (simpset() addsimps [component_eq_subset, Diff_def,
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   384
					   UN_subset_iff]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   385
by (force_tac (claset() addSIs [image_diff_subset RS subsetD], 
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   386
	       simpset() addsimps [image_image_eq_UN]) 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   387
qed "Diff_project_component_project_Diff";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   388
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   389
Goal
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   390
   "[| (UN act:acts. Domain act) <= project_set h C; \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   391
\      Diff G (extend_act h `` acts) : (extend_set h A) co (extend_set h B) |]\
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   392
\   ==> Diff (project C h G) acts : A co B";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   393
by (etac (Diff_project_component_project_Diff RS component_constrains) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   394
by (rtac (project_constrains RS iffD2) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   395
by (ftac constrains_imp_subset 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   396
by (Asm_full_simp_tac 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   397
by (blast_tac (claset() addIs [constrains_weaken]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   398
qed "Diff_project_co";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   399
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   400
Goalw [stable_def]
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   401
     "[| (UN act:acts. Domain act) <= project_set h C; \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   402
\        Diff G (extend_act h `` acts) : stable (extend_set h A) |] \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   403
\     ==> Diff (project C h G) acts : stable A";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   404
by (etac Diff_project_co 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   405
by (assume_tac 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   406
qed "Diff_project_stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   407
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   408
(** extend versions **)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   409
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   410
Goal "(Diff (extend h G) (extend_act h `` acts)) = extend h (Diff G acts)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   411
by (auto_tac (claset() addSIs [program_equalityI],
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   412
	      simpset() addsimps [Diff_def,
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   413
				  inj_extend_act RS image_set_diff RS sym]));
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   414
qed "Diff_extend_eq";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   415
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   416
Goal "(Diff (extend h G) (extend_act h `` acts) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   417
\         : (extend_set h A) co (extend_set h B)) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   418
\     = (Diff G acts : A co B)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   419
by (simp_tac (simpset() addsimps [Diff_extend_eq, extend_constrains]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   420
qed "Diff_extend_co";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   421
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   422
Goal "(Diff (extend h G) (extend_act h `` acts) : stable (extend_set h A)) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   423
\     = (Diff G acts : stable A)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   424
by (simp_tac (simpset() addsimps [Diff_extend_co, stable_def]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   425
qed "Diff_extend_stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   426
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   427
(*Converse appears to fail*)
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   428
Goal "[| UNIV <= project_set h C;  (H : (func o f) localTo extend h G) |] \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   429
\     ==> (project C h H : func localTo G)";
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   430
by (asm_full_simp_tac 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   431
    (simpset() addsimps [localTo_def, 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   432
			 project_extend_Join RS sym,
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   433
			 subset_UNIV RS subset_trans RS Diff_project_stable,
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   434
			 Collect_eq_extend_set RS sym]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   435
qed "project_localTo_I";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   436
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   437
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   438
(*** Weak safety primitives: Co, Stable ***)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   439
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   440
Goal "p : reachable (extend h F) ==> f p : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   441
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   442
by (auto_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   443
    (claset() addIs reachable.intrs,
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   444
     simpset() addsimps [extend_act_def, image_iff]));
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   445
qed "reachable_extend_f";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   446
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   447
Goal "h(s,y) : reachable (extend h F) ==> s : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   448
by (force_tac (claset() addSDs [reachable_extend_f], simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   449
qed "h_reachable_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   450
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   451
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   452
     "reachable (extend h F) = extend_set h (reachable F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   453
by (rtac equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   454
by (force_tac (claset() addIs  [h_f_g_eq RS sym]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   455
			addSDs [reachable_extend_f], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   456
	       simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   457
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   458
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   459
by (ALLGOALS (force_tac (claset() addIs reachable.intrs, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   460
			 simpset())));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   461
qed "reachable_extend_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   462
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   463
Goal "(extend h F : (extend_set h A) Co (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   464
\     (F : A Co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   465
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   466
    (simpset() addsimps [Constrains_def, reachable_extend_eq, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   467
			 extend_constrains, extend_set_Int_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   468
qed "extend_Constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   469
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   470
Goal "(extend h F : Stable (extend_set h A)) = (F : Stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   471
by (simp_tac (simpset() addsimps [Stable_def, extend_Constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   472
qed "extend_Stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   473
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   474
Goal "(extend h F : Always (extend_set h A)) = (F : Always A)";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   475
by (asm_simp_tac (simpset() addsimps [Always_def, extend_Stable]) 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   476
qed "extend_Always";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   477
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   478
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   479
(** Reachability and project **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   480
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   481
Goal "[| reachable (extend h F Join G) <= C;  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   482
\        z : reachable (extend h F Join G) |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   483
\     ==> f z : reachable (F Join project C h G)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   484
by (etac reachable.induct 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   485
by (force_tac (claset() delrules [Id_in_Acts]
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   486
		        addIs [reachable.Acts, project_act_I, extend_act_D],
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   487
	       simpset()) 2);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   488
by (force_tac (claset() addIs [reachable.Init, project_set_I],
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   489
	       simpset()) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   490
qed "reachable_imp_reachable_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   491
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   492
Goalw [Constrains_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   493
     "[| reachable (extend h F Join G) <= C;    \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   494
\        F Join project C h G : A Co B |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   495
\     ==> extend h F Join G : (extend_set h A) Co (extend_set h B)";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   496
by (full_simp_tac (simpset() addsimps [Join_project_constrains]) 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   497
by (Clarify_tac 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   498
by (etac constrains_weaken 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   499
by (auto_tac (claset() addDs [reachable_imp_reachable_project], simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   500
qed "project_Constrains_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   501
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   502
Goalw [Stable_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   503
     "[| reachable (extend h F Join G) <= C;  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   504
\        F Join project C h G : Stable A |]   \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   505
\     ==> extend h F Join G : Stable (extend_set h A)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   506
by (asm_simp_tac (simpset() addsimps [project_Constrains_D]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   507
qed "project_Stable_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   508
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   509
Goalw [Always_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   510
     "[| reachable (extend h F Join G) <= C;  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   511
\        F Join project C h G : Always A |]   \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   512
\     ==> extend h F Join G : Always (extend_set h A)";
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   513
by (force_tac (claset() addIs [reachable.Init, project_set_I],
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   514
	       simpset() addsimps [project_Stable_D]) 1);
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   515
qed "project_Always_D";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   516
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   517
Goalw [Increasing_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   518
     "[| reachable (extend h F Join G) <= C;  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   519
\        F Join project C h G : Increasing func |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   520
\     ==> extend h F Join G : Increasing (func o f)";
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   521
by Auto_tac;
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   522
by (stac Collect_eq_extend_set 1);
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   523
by (asm_simp_tac (simpset() addsimps [project_Stable_D]) 1); 
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   524
qed "project_Increasing_D";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   525
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   526
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   527
(** Converse results for weak safety: benefits of the argument C *)
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   528
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   529
Goal "[| C <= reachable(extend h F Join G);   \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   530
\        x : reachable (F Join project C h G) |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   531
\     ==> EX y. h(x,y) : reachable (extend h F Join G)";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   532
by (etac reachable.induct 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   533
by (ALLGOALS Asm_full_simp_tac);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   534
(*SLOW: 6.7s*)
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   535
by (force_tac (claset() delrules [Id_in_Acts]
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   536
		        addIs [reachable.Acts, extend_act_D],
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   537
	       simpset() addsimps [project_act_def]) 2);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   538
by (force_tac (claset() addIs [reachable.Init],
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   539
	       simpset() addsimps [project_set_def]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   540
qed "reachable_project_imp_reachable";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   541
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   542
Goalw [Constrains_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   543
     "[| C <= reachable (extend h F Join G);  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   544
\        extend h F Join G : (extend_set h A) Co (extend_set h B) |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   545
\     ==> F Join project C h G : A Co B";
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   546
by (full_simp_tac (simpset() addsimps [Join_project_constrains, 
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   547
				       extend_set_Int_distrib]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   548
by (rtac conjI 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   549
by (etac constrains_weaken 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   550
by Auto_tac;
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   551
by (asm_full_simp_tac (simpset() addsimps [Join_constrains]) 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   552
(*Some generalization of constrains_weaken_L would be better, but what is it?*)
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   553
by (rewtac constrains_def);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   554
by Auto_tac;
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   555
by (thin_tac "ALL act : Acts G. ?P act" 1);
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   556
by (force_tac (claset() addSDs [reachable_project_imp_reachable], 
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   557
	       simpset()) 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   558
qed "project_Constrains_I";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   559
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   560
Goalw [Stable_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   561
     "[| C <= reachable (extend h F Join G);  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   562
\        extend h F Join G : Stable (extend_set h A) |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   563
\     ==> F Join project C h G : Stable A";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   564
by (asm_simp_tac (simpset() addsimps [project_Constrains_I]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   565
qed "project_Stable_I";
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   566
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   567
Goalw [Increasing_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   568
     "[| C <= reachable (extend h F Join G);  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   569
\        extend h F Join G : Increasing (func o f) |] \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   570
\     ==> F Join project C h G : Increasing func";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   571
by Auto_tac;
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   572
by (asm_simp_tac (simpset() addsimps [Collect_eq_extend_set RS sym,
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   573
				      project_Stable_I]) 1); 
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   574
qed "project_Increasing_I";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   575
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   576
Goal "(F Join project (reachable (extend h F Join G)) h G : A Co B)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   577
\     (extend h F Join G : (extend_set h A) Co (extend_set h B))";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   578
by (blast_tac (claset() addIs [project_Constrains_I, project_Constrains_D]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   579
qed "project_Constrains";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   580
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   581
Goalw [Stable_def]
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   582
     "(F Join project (reachable (extend h F Join G)) h G : Stable A)  =  \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   583
\     (extend h F Join G : Stable (extend_set h A))";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   584
by (rtac project_Constrains 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   585
qed "project_Stable";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   586
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   587
Goal
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   588
   "(F Join project (reachable (extend h F Join G)) h G : Increasing func)  = \
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   589
\   (extend h F Join G : Increasing (func o f))";
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   590
by (asm_simp_tac (simpset() addsimps [Increasing_def, project_Stable,
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   591
				      Collect_eq_extend_set RS sym]) 1);
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   592
qed "project_Increasing";
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   593
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   594
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   595
(*** Progress: transient, ensures ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   596
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   597
Goal "(extend h F : transient (extend_set h A)) = (F : transient A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   598
by (auto_tac (claset(),
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   599
	      simpset() addsimps [transient_def, extend_set_subset_Compl_eq,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   600
				  Domain_extend_act]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   601
qed "extend_transient";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   602
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   603
Goal "(extend h F : (extend_set h A) ensures (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   604
\     (F : A ensures B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   605
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   606
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   607
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   608
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   609
qed "extend_ensures";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   610
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   611
Goal "F : A leadsTo B \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   612
\     ==> extend h F : (extend_set h A) leadsTo (extend_set h B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   613
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   614
by (asm_simp_tac (simpset() addsimps [leadsTo_UN, extend_set_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   615
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   616
by (asm_simp_tac (simpset() addsimps [leadsTo_Basis, extend_ensures]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   617
qed "leadsTo_imp_extend_leadsTo";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   618
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   619
(*** Proving the converse takes some doing! ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   620
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   621
Goalw [slice_def] "slice (Union S) y = (UN x:S. slice x y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   622
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   623
qed "slice_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   624
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   625
Goalw [slice_def] "slice (extend_set h A) y = A";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   626
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   627
qed "slice_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   628
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   629
Goalw [slice_def, project_set_def] "project_set h A = (UN y. slice A y)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   630
by Auto_tac;
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   631
qed "project_set_is_UN_slice";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   632
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   633
Goalw [slice_def, transient_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   634
    "extend h F : transient A ==> F : transient (slice A y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   635
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   636
by (rtac bexI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   637
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   638
by (force_tac (claset(), simpset() addsimps [extend_act_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   639
qed "extend_transient_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   640
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   641
Goal "extend h F : A ensures B ==> F : (slice A y) ensures (project_set h B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   642
by (full_simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   643
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   644
			 project_set_eq, image_Un RS sym,
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   645
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   646
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   647
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   648
by (full_simp_tac (simpset() addsimps [constrains_def, extend_act_def, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   649
				       extend_set_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   650
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   651
by (ball_tac 1); 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   652
by (full_simp_tac (simpset() addsimps [slice_def, image_iff, Image_iff]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   653
by (force_tac (claset() addSIs [h_f_g_eq RS sym], simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   654
(*transient*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   655
by (dtac extend_transient_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   656
by (etac transient_strengthen 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   657
by (force_tac (claset() addIs [f_h_eq RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   658
	       simpset() addsimps [slice_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   659
qed "extend_ensures_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   660
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   661
Goal "ALL y. F : (slice B y) leadsTo CU ==> F : (project_set h B) leadsTo CU";
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   662
by (simp_tac (simpset() addsimps [project_set_is_UN_slice]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   663
by (blast_tac (claset() addIs [leadsTo_UN]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   664
qed "leadsTo_slice_image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   665
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   666
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   667
Goal "extend h F : AU leadsTo BU \
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   668
\     ==> ALL y. F : (slice AU y) leadsTo (project_set h BU)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   669
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   670
by (full_simp_tac (simpset() addsimps [slice_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   671
by (blast_tac (claset() addIs [leadsTo_UN]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   672
by (blast_tac (claset() addIs [leadsTo_slice_image, leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   673
by (blast_tac (claset() addIs [extend_ensures_slice, leadsTo_Basis]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   674
qed_spec_mp "extend_leadsTo_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   675
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   676
Goal "(extend h F : (extend_set h A) leadsTo (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   677
\     (F : A leadsTo B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   678
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   679
by (etac leadsTo_imp_extend_leadsTo 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   680
by (dtac extend_leadsTo_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   681
by (full_simp_tac (simpset() addsimps [slice_extend_set]) 1);
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   682
qed "extend_leadsto";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   683
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   684
Goal "(extend h F : (extend_set h A) LeadsTo (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   685
\     (F : A LeadsTo B)";
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   686
by (simp_tac
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   687
    (simpset() addsimps [LeadsTo_def, reachable_extend_eq, 
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   688
			 extend_leadsto, extend_set_Int_distrib RS sym]) 1);
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   689
qed "extend_LeadsTo";
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   690
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   691
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   692
(** Strong precondition and postcondition; doesn't seem very useful. **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   693
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   694
Goal "F : X guarantees Y ==> \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   695
\     extend h F : (extend h `` X) guarantees (extend h `` Y)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   696
by (rtac guaranteesI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   697
by Auto_tac;
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   698
by (blast_tac (claset() addDs [project_set_UNIV RS extend_Join_eq_extend_D, 
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   699
			       guaranteesD]) 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   700
qed "guarantees_imp_extend_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   701
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   702
Goal "extend h F : (extend h `` X) guarantees (extend h `` Y) \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   703
\    ==> F : X guarantees Y";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   704
by (rtac guaranteesI 1);
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   705
by (auto_tac (claset(), simpset() addsimps [guar_def, component_def]));
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   706
by (dtac spec 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   707
by (dtac (mp RS mp) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   708
by (Blast_tac 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   709
by (blast_tac (claset() addSDs [inj_extend RS inj_image_mem_iff RS iffD1]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   710
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   711
qed "extend_guarantees_imp_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   712
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   713
Goal "(extend h F : (extend h `` X) guarantees (extend h `` Y)) = \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   714
\    (F : X guarantees Y)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   715
by (blast_tac (claset() addIs [guarantees_imp_extend_guarantees,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   716
			       extend_guarantees_imp_guarantees]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   717
qed "extend_guarantees_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   718
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   719
(*Weak precondition and postcondition; this is the good one!
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   720
  Not clear that it has a converse [or that we want one!] 
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   721
  Can generalize project (C G) to the function variable "proj"*)
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   722
val [xguary,project,extend] =
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   723
Goal "[| F : X guarantees Y;  \
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   724
\        !!G. extend h F Join G : X' ==> F Join project (C G) h G : X;  \
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   725
\        !!G. F Join project (C G) h G : Y ==> extend h F Join G : Y' |] \
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   726
\     ==> extend h F : X' guarantees Y'";
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   727
by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1);
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   728
by (etac project 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   729
qed "project_guarantees";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   730
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   731
(** It seems that neither "guarantees" law can be proved from the other. **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   732
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   733
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   734
(*** guarantees corollaries ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   735
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   736
Goal "F : UNIV guarantees increasing func \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   737
\     ==> extend h F : UNIV guarantees increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   738
by (etac project_guarantees 1);
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   739
by (ALLGOALS
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   740
    (asm_simp_tac (simpset() addsimps [Join_project_increasing RS sym])));
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   741
qed "extend_guar_increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   742
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   743
Goal "F : UNIV guarantees Increasing func \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   744
\     ==> extend h F : UNIV guarantees Increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   745
by (etac project_guarantees 1);
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   746
by (rtac (subset_UNIV RS project_Increasing_D) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   747
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   748
qed "extend_guar_Increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   749
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   750
Goal "F : (func localTo G) guarantees increasing func  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   751
\     ==> extend h F : (func o f) localTo (extend h G)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   752
\                      guarantees increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   753
by (etac project_guarantees 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   754
(*the "increasing" guarantee*)
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   755
by (asm_simp_tac
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   756
    (simpset() addsimps [Join_project_increasing RS sym]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   757
(*the "localTo" requirement*)
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   758
by (stac (project_set_UNIV RS project_extend_Join RS sym) 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   759
by (asm_simp_tac 
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   760
    (simpset() addsimps [project_set_UNIV RS project_localTo_I]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   761
qed "extend_localTo_guar_increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   762
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   763
Goal "F : (func localTo G) guarantees Increasing func  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   764
\     ==> extend h F : (func o f) localTo (extend h G)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   765
\                      guarantees Increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   766
by (etac project_guarantees 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   767
(*the "Increasing" guarantee*)
7538
357873391561 new rule PLam_ensures
paulson
parents: 7537
diff changeset
   768
by (etac (subset_UNIV RS project_Increasing_D) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   769
(*the "localTo" requirement*)
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   770
by (stac (project_set_UNIV RS project_extend_Join RS sym) 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   771
by (asm_simp_tac 
7537
875754b599df working snapshot
paulson
parents: 7499
diff changeset
   772
    (simpset() addsimps [project_set_UNIV RS project_localTo_I]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   773
qed "extend_localTo_guar_Increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   774
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   775
Close_locale "Extend";
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   776
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   777
(*Close_locale should do this!
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   778
Delsimps [f_h_eq, extend_set_inverse, f_image_extend_set, extend_act_inverse,
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   779
	  extend_act_Image];
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   780
Delrules [make_elim h_inject1];
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   781
*)