src/HOL/UNITY/Extend.ML
author paulson
Mon, 30 Aug 1999 11:20:42 +0200
changeset 7387 5e74c23063de
parent 7378 ed9230a0a700
child 7399 cf780c2bcccf
permissions -rw-r--r--
new results for localTo
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"
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
     9
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    10
*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    11
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    12
Open_locale "Extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    13
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    14
val slice_def = thm "slice_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    15
val f_act_def = thm "f_act_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    16
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    17
(*** Trivial properties of f, g, h ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    18
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    19
val inj_h  = thm "bij_h" RS bij_is_inj;
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    20
val surj_h = thm "bij_h" RS bij_is_surj;
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    21
Addsimps [inj_h, inj_h RS inj_eq, surj_h];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    22
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    23
val f_def = thm "f_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    24
val g_def = thm "g_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    25
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    26
Goal "f(h(x,y)) = x";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    27
by (simp_tac (simpset() addsimps [f_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    28
qed "f_h_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    29
Addsimps [f_h_eq];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    30
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    31
Goal "g(h(x,y)) = y";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    32
by (simp_tac (simpset() addsimps [g_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    33
qed "g_h_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    34
Addsimps [g_h_eq];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    35
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    36
Goal "h(f z, g z) = z";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    37
by (cut_inst_tac [("y", "z")] (surj_h RS surjD) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    38
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    39
qed "h_f_g_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    40
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    41
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    42
(*** extend_set: basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    43
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    44
Goalw [extend_set_def]
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    45
     "z : extend_set h A = (f z : A)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    46
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
    47
qed "mem_extend_set_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    48
AddIffs [mem_extend_set_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    49
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    50
Goal "{s. P (f s)} = extend_set h {s. P s}";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    51
by Auto_tac;
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    52
qed "Collect_eq_extend_set";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
    53
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    54
(*Converse appears to fail*)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    55
Goalw [project_set_def] "z : C ==> f z : project_set h C";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    56
by (auto_tac (claset() addIs [h_f_g_eq RS ssubst], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    57
	      simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    58
qed "project_set_I";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    59
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    60
Goalw [extend_set_def, project_set_def] "project_set h (extend_set h F) = F";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    61
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    62
qed "extend_set_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    63
Addsimps [extend_set_inverse];
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    64
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    65
Goal "inj (extend_set h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    66
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    67
by (rtac extend_set_inverse 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    68
qed "inj_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    69
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    70
(*Because A and B could differ on the "other" part of the state, 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    71
   cannot generalize result to 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    72
      project_set h (A Int B) = project_set h A Int project_set h B
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    73
*)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    74
Goalw [project_set_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    75
     "project_set h ((extend_set h A) Int B) = A Int (project_set h B)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    76
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    77
qed "project_set_extend_set_Int";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    78
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    79
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
    80
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    81
qed "extend_set_Un_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    82
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    83
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
    84
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    85
qed "extend_set_Int_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    86
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    87
Goal "extend_set h (INTER A B) = (INT x:A. extend_set h (B x))";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    88
by Auto_tac;
6834
44da4a2a9ef3 renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents: 6822
diff changeset
    89
qed "extend_set_INT_distrib";
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    90
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    91
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
    92
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    93
qed "extend_set_Diff_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    94
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    95
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
    96
by (Blast_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    97
qed "extend_set_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    98
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
    99
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
   100
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   101
qed "extend_set_subset_Compl_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   102
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   103
Goalw [extend_set_def] "f `` extend_set h A = A";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   104
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   105
by (blast_tac (claset() addIs [f_h_eq RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   106
qed "f_image_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   107
Addsimps [f_image_extend_set];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   108
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   109
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   110
(*** project_set: basic properties ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   111
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   112
Goalw [project_set_def] "project_set h C = f `` C";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   113
by (auto_tac (claset() addIs [f_h_eq RS sym, h_f_g_eq RS ssubst], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   114
	      simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   115
qed "project_set_eq";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   116
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   117
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   118
(*** extend_act ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   119
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   120
(*Actions could affect the g-part, so result Cannot be strengthened to
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   121
   ((z, z') : extend_act h act) = ((f z, f z') : act)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   122
*)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   123
Goalw [extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   124
     "((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
   125
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   126
qed "mem_extend_act_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   127
AddIffs [mem_extend_act_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   128
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   129
Goalw [extend_act_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   130
     "(z, z') : extend_act h act ==> (f z, f z') : act";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   131
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   132
qed "extend_act_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   133
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   134
Goalw [extend_act_def, project_act_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   135
     "project_act h (extend_act h act) = act";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   136
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   137
by (Blast_tac 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   138
qed "extend_act_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   139
Addsimps [extend_act_inverse];
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   140
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   141
Goal "inj (extend_act h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   142
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   143
by (rtac extend_act_inverse 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   144
qed "inj_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   145
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   146
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   147
     "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
   148
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   149
qed "extend_act_Image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   150
Addsimps [extend_act_Image];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   151
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   152
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   153
    "(extend_set h A <= extend_set h B) = (A <= B)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   154
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   155
qed "extend_set_strict_mono";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   156
Addsimps [extend_set_strict_mono];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   157
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   158
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   159
    "Domain (extend_act h act) = extend_set h (Domain act)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   160
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   161
qed "Domain_extend_act"; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   162
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   163
Goalw [extend_act_def]
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   164
    "extend_act h Id = Id";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   165
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
   166
qed "extend_act_Id";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   167
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   168
Goalw [project_act_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   169
     "(z, z') : act ==> (f z, f z') : project_act h act";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   170
by (auto_tac (claset() addSIs [exI] addIs [h_f_g_eq RS ssubst], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   171
	      simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   172
qed "project_act_I";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   173
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   174
Goalw [project_set_def, project_act_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   175
    "project_act h Id = Id";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   176
by (Force_tac 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   177
qed "project_act_Id";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   178
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   179
Addsimps [extend_act_Id, project_act_Id];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   180
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   181
Goal "Id : extend_act h `` Acts F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   182
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   183
	      simpset() addsimps [image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   184
qed "Id_mem_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   185
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   186
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   187
(**** extend ****)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   188
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   189
(*** Basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   190
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   191
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
   192
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   193
qed "Init_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   194
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   195
Goalw [project_def] "Init (project h F) = project_set h (Init F)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   196
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   197
qed "Init_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   198
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   199
Goal "Acts (extend h F) = (extend_act h `` Acts F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   200
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   201
	      simpset() addsimps [extend_def, image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   202
qed "Acts_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   203
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   204
Goal "Acts (project h F) = (project_act h `` Acts F)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   205
by (auto_tac (claset() addSIs [project_act_Id RS sym], 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   206
	      simpset() addsimps [project_def, image_iff]));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   207
qed "Acts_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   208
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   209
Addsimps [Init_extend, Init_project, Acts_extend, Acts_project];
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   210
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   211
Goalw [SKIP_def] "extend h SKIP = SKIP";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   212
by (rtac program_equalityI 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   213
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   214
qed "extend_SKIP";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   215
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   216
Goalw [SKIP_def] "project h SKIP = SKIP";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   217
by (rtac program_equalityI 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   218
by (auto_tac (claset() addIs  [h_f_g_eq RS sym], 
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   219
	      simpset() addsimps [project_set_def]));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   220
qed "project_SKIP";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   221
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   222
Goal "project h (extend h F) = F";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   223
by (simp_tac (simpset() addsimps [extend_def, project_def]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   224
by (rtac program_equalityI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   225
by (simp_tac (simpset() addsimps [image_compose RS sym, o_def]) 2);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   226
by (Simp_tac 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   227
qed "extend_inverse";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   228
Addsimps [extend_inverse];
6297
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
Goal "inj (extend h)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   231
by (rtac inj_on_inverseI 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   232
by (rtac extend_inverse 1);
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   233
qed "inj_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   234
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   235
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
   236
by (rtac program_equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   237
by (simp_tac (simpset() addsimps [image_Un, Acts_Join]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   238
by (simp_tac (simpset() addsimps [extend_set_Int_distrib]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   239
qed "extend_Join";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   240
Addsimps [extend_Join];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   241
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   242
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
   243
by (rtac program_equalityI 1);
6834
44da4a2a9ef3 renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents: 6822
diff changeset
   244
by (simp_tac (simpset() addsimps [image_UN, Acts_JN]) 2);
44da4a2a9ef3 renamed UNION_... to UN_..., INTER_... to INT_... (to fit the convention)
paulson
parents: 6822
diff changeset
   245
by (simp_tac (simpset() addsimps [extend_set_INT_distrib]) 1);
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   246
qed "extend_JN";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   247
Addsimps [extend_JN];
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   248
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   249
Goal "project h ((extend h F) Join G) = F Join (project h G)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   250
by (rtac program_equalityI 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   251
by (simp_tac (simpset() addsimps [Acts_Join, image_Un,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   252
				  image_compose RS sym, o_def]) 2);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   253
by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   254
qed "project_extend_Join";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   255
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   256
Goal "(extend h F) Join G = extend h H ==> H = F Join (project h G)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   257
by (dres_inst_tac [("f", "project h")] arg_cong 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   258
by (full_simp_tac (simpset() addsimps [project_extend_Join]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   259
by (etac sym 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   260
qed "extend_Join_eq_extend_D";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   261
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   262
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   263
(*** Safety: co, stable ***)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   264
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   265
Goal "(extend h F : (extend_set h A) co (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   266
\     (F : A co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   267
by (simp_tac (simpset() addsimps [constrains_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   268
qed "extend_constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   269
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   270
Goal "(extend h F : stable (extend_set h A)) = (F : stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   271
by (asm_simp_tac (simpset() addsimps [stable_def, extend_constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   272
qed "extend_stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   273
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   274
Goal "(extend h F : invariant (extend_set h A)) = (F : invariant A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   275
by (asm_simp_tac (simpset() addsimps [invariant_def, extend_stable]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   276
qed "extend_invariant";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   277
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   278
(** Safety and project **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   279
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   280
Goalw [constrains_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   281
     "(project h F : A co B)  =  (F : (extend_set h A) co (extend_set h B))";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   282
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   283
by (force_tac (claset(), simpset() addsimps [project_act_def]) 2);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   284
by (auto_tac (claset() addSIs [project_act_I], simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   285
qed "project_constrains";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   286
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   287
Goal "(project h F : stable A)  =  (F : stable (extend_set h A))";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   288
by (simp_tac (simpset() addsimps [stable_def, project_constrains]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   289
qed "project_stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   290
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   291
Goal "(project h F : increasing func)  =  (F : increasing (func o f))";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   292
by (simp_tac (simpset() addsimps [increasing_def, project_stable,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   293
				  Collect_eq_extend_set RS sym]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   294
qed "project_increasing";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   295
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   296
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   297
(*** Diff, needed for localTo ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   298
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   299
(** project versions **)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   300
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   301
(*Opposite direction fails because Diff in the extended state may remove
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   302
  fewer actions, i.e. those that affect other state variables.*)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   303
Goal "Diff (project h G) acts  component  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   304
\     project h (Diff G (extend_act h `` acts))";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   305
by (force_tac (claset(), 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   306
	       simpset() addsimps [component_eq_subset, Diff_def]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   307
qed "Diff_project_component_project_Diff";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   308
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   309
Goal "Diff G (extend_act h `` acts) : (extend_set h A) co (extend_set h B)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   310
\     ==> Diff (project h G) acts : A co B";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   311
br (Diff_project_component_project_Diff RS component_constrains) 1;
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   312
be (project_constrains RS iffD2) 1;
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   313
qed "Diff_project_co";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   314
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   315
Goalw [stable_def]
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   316
     "Diff G (extend_act h `` acts) : stable (extend_set h A)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   317
\     ==> Diff (project h G) acts : stable A";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   318
by (etac Diff_project_co 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   319
qed "Diff_project_stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   320
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   321
(** extend versions **)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   322
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   323
Goal "(Diff (extend h G) (extend_act h `` acts)) = extend h (Diff G acts)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   324
by (auto_tac (claset() addSIs [program_equalityI],
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   325
	      simpset() addsimps [Diff_def,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   326
				  inj_extend_act RS image_set_diff RS sym,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   327
				  image_compose RS sym, o_def]));
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   328
qed "Diff_extend_eq";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   329
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   330
Goal "(Diff (extend h G) (extend_act h `` acts) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   331
\         : (extend_set h A) co (extend_set h B)) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   332
\     = (Diff G acts : A co B)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   333
by (simp_tac (simpset() addsimps [Diff_extend_eq, extend_constrains]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   334
qed "Diff_extend_co";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   335
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   336
Goal "(Diff (extend h G) (extend_act h `` acts) : stable (extend_set h A)) \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   337
\     = (Diff G acts : stable A)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   338
by (simp_tac (simpset() addsimps [Diff_extend_co, stable_def]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   339
qed "Diff_extend_stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   340
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   341
(*Converse appears to fail*)
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   342
Goal "(H : (func o f) localTo extend h G) ==> (project h H : func localTo G)";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   343
by (asm_full_simp_tac 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   344
    (simpset() addsimps [localTo_def, 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   345
			 project_extend_Join RS sym,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   346
			 Diff_project_stable,
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   347
			 Collect_eq_extend_set RS sym]) 1);
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   348
qed "project_localTo_I";
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   349
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   350
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   351
(*** Weak safety primitives: Co, Stable ***)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   352
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   353
Goal "p : reachable (extend h F) ==> f p : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   354
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   355
by (auto_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   356
    (claset() addIs reachable.intrs,
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   357
     simpset() addsimps [extend_act_def, image_iff]));
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   358
qed "reachable_extend_f";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   359
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   360
Goal "h(s,y) : reachable (extend h F) ==> s : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   361
by (force_tac (claset() addSDs [reachable_extend_f], simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   362
qed "h_reachable_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   363
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   364
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   365
     "reachable (extend h F) = extend_set h (reachable F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   366
by (rtac equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   367
by (force_tac (claset() addIs  [h_f_g_eq RS sym]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   368
			addSDs [reachable_extend_f], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   369
	       simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   370
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   371
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   372
by (ALLGOALS (force_tac (claset() addIs reachable.intrs, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   373
			 simpset())));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   374
qed "reachable_extend_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   375
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   376
Goal "(extend h F : (extend_set h A) Co (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   377
\     (F : A Co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   378
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   379
    (simpset() addsimps [Constrains_def, reachable_extend_eq, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   380
			 extend_constrains, extend_set_Int_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   381
qed "extend_Constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   382
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   383
Goal "(extend h F : Stable (extend_set h A)) = (F : Stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   384
by (simp_tac (simpset() addsimps [Stable_def, extend_Constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   385
qed "extend_Stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   386
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   387
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
   388
by (asm_simp_tac (simpset() addsimps [Always_def, extend_Stable]) 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   389
qed "extend_Always";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   390
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   391
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   392
(** Reachability and project **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   393
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   394
Goal "z : reachable F ==> f z : reachable (project h F)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   395
by (etac reachable.induct 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   396
by (force_tac (claset() addIs [reachable.Acts, project_act_I],
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   397
	       simpset()) 2);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   398
by (force_tac (claset() addIs [reachable.Init, project_set_I],
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   399
	       simpset()) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   400
qed "reachable_imp_reachable_project";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   401
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   402
(*Converse fails (?) *)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   403
Goalw [Constrains_def]
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   404
     "project h F : A Co B ==> F : (extend_set h A) Co (extend_set h B)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   405
by (full_simp_tac (simpset() addsimps [project_constrains]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   406
by (etac constrains_weaken_L 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   407
by (auto_tac (claset() addDs [reachable_imp_reachable_project], simpset()));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   408
qed "project_Constrains_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   409
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   410
Goalw [Stable_def] "project h F : Stable A ==> F : Stable (extend_set h A)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   411
by (asm_simp_tac (simpset() addsimps [project_Constrains_D]) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   412
qed "project_Stable_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   413
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   414
Goalw [Always_def] "project h F : Always A ==> F : Always (extend_set h A)";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   415
by (force_tac (claset() addIs [reachable.Init, project_set_I],
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   416
	       simpset() addsimps [project_Stable_D]) 1);
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   417
qed "project_Always_D";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   418
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   419
Goalw [Increasing_def]
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   420
     "project h F : Increasing func ==> F : Increasing (func o f)";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   421
by Auto_tac;
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   422
by (stac Collect_eq_extend_set 1);
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   423
by (asm_simp_tac (simpset() addsimps [project_Stable_D]) 1); 
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   424
qed "project_Increasing_D";
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   425
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   426
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   427
(*** Programs of the form  ((extend h F) Join G)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   428
     in other words programs containing an extended component ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   429
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   430
Goal "z : reachable (extend h F Join G)  \
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   431
\     ==> f z : reachable (F Join project h G)";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   432
by (etac reachable.induct 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   433
by (force_tac (claset() addIs [reachable.Init, project_set_I], simpset()) 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   434
(*By case analysis on whether the action is of extend h F  or  G*)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   435
by (rtac reachable.Acts 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   436
by (etac project_act_I 3);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   437
by (auto_tac (claset(), simpset() addsimps [Acts_Join]));
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   438
qed "reachable_extend_Join_D";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   439
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   440
(*Opposite inclusion fails, even for the initial state: extend_set h includes
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   441
  ALL functions determined only by their value at h.*)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   442
Goal "reachable (extend h F Join G) <= \
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   443
\     extend_set h (reachable (F Join project h G))";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   444
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   445
by (etac reachable_extend_Join_D 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   446
qed "reachable_extend_Join_subset";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   447
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   448
Goalw [Constrains_def]
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   449
     "F Join project h G : A Co B    \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   450
\     ==> extend h F Join G : (extend_set h A) Co (extend_set h B)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   451
by (subgoal_tac 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   452
    "extend h F Join G : extend_set h (reachable (F Join project h G)) Int \
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   453
\                           extend_set h A \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   454
\    co extend_set h B" 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   455
by (asm_full_simp_tac 
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   456
    (simpset() addsimps [extend_set_Int_distrib RS sym,
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   457
			 extend_constrains,
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   458
			 project_constrains RS sym,
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   459
			 project_extend_Join]) 2);
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   460
by (blast_tac (claset() addIs [constrains_weaken, reachable_extend_Join_D]) 1);
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   461
qed "extend_Join_Constrains";
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   462
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   463
Goal "F Join project h G : Stable A    \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   464
\     ==> extend h F Join G : Stable (extend_set h A)";
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   465
by (asm_full_simp_tac (simpset() addsimps [Stable_def, 
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   466
					   extend_Join_Constrains]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   467
qed "extend_Join_Stable";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   468
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   469
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   470
(*** Progress: transient, ensures ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   471
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   472
Goal "(extend h F : transient (extend_set h A)) = (F : transient A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   473
by (auto_tac (claset(),
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   474
	      simpset() addsimps [transient_def, extend_set_subset_Compl_eq,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   475
				  Domain_extend_act]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   476
qed "extend_transient";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   477
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   478
Goal "(extend h F : (extend_set h A) ensures (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   479
\     (F : A ensures B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   480
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   481
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   482
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   483
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   484
qed "extend_ensures";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   485
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   486
Goal "F : A leadsTo B \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   487
\     ==> 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
   488
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   489
by (asm_simp_tac (simpset() addsimps [leadsTo_UN, extend_set_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   490
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   491
by (asm_simp_tac (simpset() addsimps [leadsTo_Basis, extend_ensures]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   492
qed "leadsTo_imp_extend_leadsTo";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   493
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   494
(*** Proving the converse takes some doing! ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   495
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   496
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
   497
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   498
qed "slice_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   499
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   500
Goalw [slice_def] "slice (extend_set h A) y = A";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   501
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   502
qed "slice_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   503
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   504
Goalw [slice_def] "f``A = (UN y. slice A y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   505
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   506
by (blast_tac (claset() addIs [f_h_eq RS sym]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   507
by (best_tac (claset() addIs [h_f_g_eq RS ssubst]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   508
qed "image_is_UN_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   509
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   510
Goalw [slice_def, transient_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   511
    "extend h F : transient A ==> F : transient (slice A y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   512
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   513
by (rtac bexI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   514
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   515
by (force_tac (claset(), simpset() addsimps [extend_act_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   516
qed "extend_transient_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   517
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   518
Goal "extend h F : A ensures B ==> F : (slice A y) ensures (f `` B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   519
by (full_simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   520
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   521
			 image_Un RS sym,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   522
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   523
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   524
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   525
by (full_simp_tac (simpset() addsimps [constrains_def, extend_act_def, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   526
				       extend_set_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   527
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   528
by (ball_tac 1); 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   529
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
   530
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
   531
(*transient*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   532
by (dtac extend_transient_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   533
by (etac transient_strengthen 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   534
by (force_tac (claset() addIs [f_h_eq RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   535
	       simpset() addsimps [slice_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   536
qed "extend_ensures_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   537
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   538
Goal "ALL y. F : (slice B y) leadsTo CU ==> F : (f `` B) leadsTo CU";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   539
by (simp_tac (simpset() addsimps [image_is_UN_slice]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   540
by (blast_tac (claset() addIs [leadsTo_UN]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   541
qed "leadsTo_slice_image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   542
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   543
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   544
Goal "extend h F : AU leadsTo BU \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   545
\     ==> ALL y. F : (slice AU y) leadsTo (f `` BU)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   546
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   547
by (full_simp_tac (simpset() addsimps [slice_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   548
by (blast_tac (claset() addIs [leadsTo_UN]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   549
by (blast_tac (claset() addIs [leadsTo_slice_image, leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   550
by (blast_tac (claset() addIs [extend_ensures_slice, leadsTo_Basis]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   551
qed_spec_mp "extend_leadsTo_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   552
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   553
Goal "(extend h F : (extend_set h A) leadsTo (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   554
\     (F : A leadsTo B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   555
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   556
by (etac leadsTo_imp_extend_leadsTo 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   557
by (dtac extend_leadsTo_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   558
by (full_simp_tac (simpset() addsimps [slice_extend_set]) 1);
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   559
qed "extend_leadsto";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   560
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   561
Goal "(extend h F : (extend_set h A) LeadsTo (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   562
\     (F : A LeadsTo B)";
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   563
by (simp_tac
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   564
    (simpset() addsimps [LeadsTo_def, reachable_extend_eq, 
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   565
			 extend_leadsto, extend_set_Int_distrib RS sym]) 1);
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   566
qed "extend_LeadsTo";
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   567
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   568
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   569
(*** guarantees properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   570
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   571
Goalw [f_act_def, extend_act_def] "f_act (extend_act h act1) = act1";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   572
by (force_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   573
    (claset() addSIs [rev_bexI],
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   574
     simpset() addsimps [image_iff]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   575
qed "f_act_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   576
Addsimps [f_act_extend_act];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   577
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   578
(** Strong precondition and postcondition; doesn't seem very useful. **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   579
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   580
Goal "F : X guarantees Y ==> \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   581
\     extend h F : (extend h `` X) guarantees (extend h `` Y)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   582
by (rtac guaranteesI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   583
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   584
by (blast_tac (claset() addDs [extend_Join_eq_extend_D, guaranteesD]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   585
qed "guarantees_imp_extend_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   586
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   587
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
   588
\    ==> F : X guarantees Y";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   589
by (rtac guaranteesI 1);
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   590
by (auto_tac (claset(), simpset() addsimps [guar_def, component_def]));
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   591
by (dtac spec 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   592
by (dtac (mp RS mp) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   593
by (Blast_tac 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   594
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
   595
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   596
qed "extend_guarantees_imp_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   597
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   598
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
   599
\    (F : X guarantees Y)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   600
by (blast_tac (claset() addIs [guarantees_imp_extend_guarantees,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   601
			       extend_guarantees_imp_guarantees]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   602
qed "extend_guarantees_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   603
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   604
(*Weak precondition and postcondition; this is the good one!
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   605
  Not clear that it has a converse [or that we want one!] *)
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   606
val [xguary,project,extend] =
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   607
Goal "[| F : X guarantees Y;  \
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   608
\        !!G. extend h F Join G : XX ==> F Join project h G : X;  \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   609
\        !!G. F Join project h G : Y ==> extend h F Join G : YY |] \
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   610
\     ==> extend h F : XX guarantees YY";
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   611
by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1);
7378
ed9230a0a700 use of bij, new theorems, etc.
paulson
parents: 7362
diff changeset
   612
by (etac project 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   613
qed "project_guarantees";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   614
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   615
(** It seems that neither "guarantees" law can be proved from the other. **)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   616
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   617
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   618
(*** guarantees corollaries ***)
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   619
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   620
Goal "F : UNIV guarantees increasing func \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   621
\     ==> extend h F : UNIV guarantees increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   622
by (etac project_guarantees 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   623
by (asm_simp_tac
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   624
    (simpset() addsimps [project_extend_Join, project_increasing RS sym]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   625
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   626
qed "extend_guar_increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   627
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   628
Goal "F : UNIV guarantees Increasing func \
7362
f08fade5ea0d new laws; changed "guar" back to "guarantees" (sorry)
paulson
parents: 7341
diff changeset
   629
\     ==> extend h F : UNIV guarantees Increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   630
by (etac project_guarantees 1);
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   631
by (asm_simp_tac
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   632
    (simpset() addsimps [project_extend_Join, project_Increasing_D]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   633
by Auto_tac;
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   634
qed "extend_guar_Increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   635
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   636
Goal "F : (func localTo G) guarantees increasing func  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   637
\     ==> extend h F : (func o f) localTo (extend h G)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   638
\                      guarantees increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   639
by (etac project_guarantees 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   640
(*the "increasing" guarantee*)
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   641
by (asm_simp_tac
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   642
    (simpset() addsimps [project_extend_Join, project_increasing RS sym]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   643
(*the "localTo" requirement*)
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   644
by (asm_simp_tac 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   645
    (simpset() addsimps [project_localTo_I, project_extend_Join RS sym]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   646
qed "extend_localTo_guar_increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   647
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   648
Goal "F : (func localTo G) guarantees Increasing func  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   649
\     ==> extend h F : (func o f) localTo (extend h G)  \
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   650
\                      guarantees Increasing (func o f)";
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   651
by (etac project_guarantees 1);
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   652
(*the "Increasing" guarantee*)
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   653
by (asm_simp_tac
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   654
    (simpset() addsimps [project_extend_Join, project_Increasing_D]) 2);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   655
(*the "localTo" requirement*)
7387
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   656
by (asm_simp_tac 
5e74c23063de new results for localTo
paulson
parents: 7378
diff changeset
   657
    (simpset() addsimps [project_localTo_I, project_extend_Join RS sym]) 1);
7341
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   658
qed "extend_localTo_guar_Increasing";
d15bfea7c943 many "project" laws
paulson
parents: 6834
diff changeset
   659
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   660
Close_locale "Extend";