src/HOL/UNITY/Extend.ML
author paulson
Mon, 17 May 1999 10:38:47 +0200
changeset 6647 9ec7b9723f43
parent 6536 281d44905cab
child 6822 8932f33259d4
permissions -rw-r--r--
new thm extend_JN; renamed extend_leadsto
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"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     9
*)
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
Open_locale "Extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    12
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    13
val slice_def = thm "slice_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    14
val f_act_def = thm "f_act_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    15
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    16
(*** Trivial properties of f, g, h ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    17
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    18
val inj_h = thm "inj_h";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    19
val surj_h = thm "surj_h";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    20
Addsimps [inj_h, inj_h RS inj_eq, surj_h];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    21
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    22
val f_def = thm "f_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    23
val g_def = thm "g_def";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    24
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    25
Goal "f(h(x,y)) = x";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    26
by (simp_tac (simpset() addsimps [f_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    27
qed "f_h_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    28
Addsimps [f_h_eq];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    29
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    30
Goal "g(h(x,y)) = y";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    31
by (simp_tac (simpset() addsimps [g_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    32
qed "g_h_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    33
Addsimps [g_h_eq];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    34
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    35
Goal "h(f z, g z) = z";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    36
by (cut_inst_tac [("y", "z")] (surj_h RS surjD) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    37
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    38
qed "h_f_g_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    39
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
(*** extend_set: basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    42
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    43
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    44
     "(h(x,y)) : extend_set h A = (x : A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    45
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    46
qed "mem_extend_set_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    47
AddIffs [mem_extend_set_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    48
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    49
Goal "inj (extend_set h)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    50
by (rtac injI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    51
by (rewtac extend_set_def);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    52
by (etac equalityE 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    53
by (blast_tac (claset() addSDs [inj_h RS inj_image_mem_iff RS iffD1]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    54
qed "inj_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    55
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    56
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    57
    "extend_set h (A Un B) = extend_set h A Un extend_set h B";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    58
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    59
qed "extend_set_Un_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    60
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    61
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    62
    "extend_set h (A Int B) = extend_set h A Int extend_set h B";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    63
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    64
qed "extend_set_Int_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    65
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    66
Goalw [extend_set_def]
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    67
    "extend_set h (INTER A B) = (INT x:A. extend_set h (B x))";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    68
by (force_tac (claset() addIs  [h_f_g_eq RS sym], simpset()) 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    69
qed "extend_set_INTER_distrib";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    70
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
    71
Goalw [extend_set_def]
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    72
    "extend_set h (A - B) = extend_set h A - extend_set h B";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    73
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    74
qed "extend_set_Diff_distrib";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    75
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    76
Goalw [extend_set_def] "extend_set h (Union A) = (UN X:A. extend_set h X)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    77
by (Blast_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    78
qed "extend_set_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    79
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    80
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    81
     "(extend_set h A <= - extend_set h B) = (A <= - B)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    82
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    83
qed "extend_set_subset_Compl_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    84
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    85
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    86
Goalw [extend_set_def] "f `` extend_set h A = A";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    87
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    88
by (blast_tac (claset() addIs [f_h_eq RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    89
qed "f_image_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    90
Addsimps [f_image_extend_set];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    91
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    92
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    93
(*** extend_act ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    94
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    95
Goalw [extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    96
     "((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
    97
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    98
qed "mem_extend_act_iff";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    99
AddIffs [mem_extend_act_iff]; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   100
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   101
Goal "inj (extend_act h)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   102
by (rtac injI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   103
by (rewtac extend_act_def);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   104
by (force_tac (claset() addSEs [equalityE]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   105
			addIs  [h_f_g_eq RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   106
	       simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   107
qed "inj_extend_act";
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
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   110
     "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
   111
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   112
qed "extend_act_Image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   113
Addsimps [extend_act_Image];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   114
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   115
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   116
    "(extend_set h A <= extend_set h B) = (A <= B)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   117
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   118
qed "extend_set_strict_mono";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   119
Addsimps [extend_set_strict_mono];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   120
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   121
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   122
    "Domain (extend_act h act) = extend_set h (Domain act)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   123
by (Force_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   124
qed "Domain_extend_act"; 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   125
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   126
Goalw [extend_set_def, extend_act_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   127
    "extend_act h Id = Id";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   128
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
   129
qed "extend_act_Id";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   130
Addsimps [extend_act_Id];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   131
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   132
Goal "Id : extend_act h `` Acts F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   133
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   134
	      simpset() addsimps [image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   135
qed "Id_mem_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   136
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   137
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   138
(**** extend ****)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   139
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   140
(*** Basic properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   141
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   142
Goalw [extend_set_def, extend_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   143
     "Init (extend h F) = extend_set h (Init F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   144
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   145
qed "Init_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   146
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   147
Goal "Acts (extend h F) = (extend_act h `` Acts F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   148
by (auto_tac (claset() addSIs [extend_act_Id RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   149
	      simpset() addsimps [extend_def, image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   150
qed "Acts_extend";
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
Addsimps [Init_extend, Acts_extend];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   153
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   154
Goalw [SKIP_def] "extend h SKIP = SKIP";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   155
by (rtac program_equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   156
by (auto_tac (claset() addIs  [h_f_g_eq RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   157
	      simpset() addsimps [extend_set_def]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   158
qed "extend_SKIP";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   159
Addsimps [extend_SKIP];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   160
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   161
Goal "inj (extend h)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   162
by (rtac injI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   163
by (rewtac extend_def);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   164
by (etac program_equalityE 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   165
by (full_simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   166
    (simpset() addsimps [inj_extend_set RS inj_eq,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   167
			 inj_extend_act RS inj_image_eq_iff,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   168
			 Id_mem_extend_act RS insert_absorb]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   169
by (blast_tac (claset() addIs [program_equalityI]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   170
qed "inj_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   171
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   172
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
   173
by (rtac program_equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   174
by (simp_tac (simpset() addsimps [image_Un, Acts_Join]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   175
by (simp_tac (simpset() addsimps [extend_set_Int_distrib]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   176
qed "extend_Join";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   177
Addsimps [extend_Join];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   178
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   179
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
   180
by (rtac program_equalityI 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   181
by (simp_tac (simpset() addsimps [image_UNION, Acts_JN]) 2);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   182
by (simp_tac (simpset() addsimps [extend_set_INTER_distrib]) 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   183
qed "extend_JN";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   184
Addsimps [extend_JN];
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   185
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   186
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   187
(*** Safety: co, stable ***)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   188
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   189
Goal "(extend h F : (extend_set h A) co (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   190
\     (F : A co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   191
by (simp_tac (simpset() addsimps [constrains_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   192
qed "extend_constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   193
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   194
Goal "(extend h F : stable (extend_set h A)) = (F : stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   195
by (asm_simp_tac (simpset() addsimps [stable_def, extend_constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   196
qed "extend_stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   197
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   198
Goal "(extend h F : invariant (extend_set h A)) = (F : invariant A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   199
by (asm_simp_tac (simpset() addsimps [invariant_def, extend_stable]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   200
qed "extend_invariant";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   201
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   202
(** Substitution Axiom versions: Co, Stable **)
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   203
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   204
Goal "p : reachable (extend h F) ==> f p : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   205
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   206
by (auto_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   207
    (claset() addIs reachable.intrs,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   208
     simpset() addsimps [extend_set_def, extend_act_def, image_iff]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   209
qed "reachable_extend_f";
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
Goal "h(s,y) : reachable (extend h F) ==> s : reachable F";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   212
by (force_tac (claset() addSDs [reachable_extend_f], simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   213
qed "h_reachable_extend";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   214
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   215
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   216
     "reachable (extend h F) = extend_set h (reachable F)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   217
by (rtac equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   218
by (force_tac (claset() addIs  [h_f_g_eq RS sym]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   219
			addSDs [reachable_extend_f], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   220
	       simpset()) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   221
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   222
by (etac reachable.induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   223
by (ALLGOALS (force_tac (claset() addIs reachable.intrs, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   224
			 simpset())));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   225
qed "reachable_extend_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   226
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   227
Goal "(extend h F : (extend_set h A) Co (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   228
\     (F : A Co B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   229
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   230
    (simpset() addsimps [Constrains_def, reachable_extend_eq, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   231
			 extend_constrains, extend_set_Int_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   232
qed "extend_Constrains";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   233
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   234
Goal "(extend h F : Stable (extend_set h A)) = (F : Stable A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   235
by (simp_tac (simpset() addsimps [Stable_def, extend_Constrains]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   236
qed "extend_Stable";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   237
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   238
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
   239
by (asm_simp_tac (simpset() addsimps [Always_def, extend_Stable]) 1);
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   240
qed "extend_Always";
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   241
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   242
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   243
(*** Progress: transient, ensures ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   244
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   245
Goal "(extend h F : transient (extend_set h A)) = (F : transient A)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   246
by (auto_tac (claset(),
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   247
	      simpset() addsimps [transient_def, extend_set_subset_Compl_eq,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   248
				  Domain_extend_act]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   249
qed "extend_transient";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   250
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   251
Goal "(extend h F : (extend_set h A) ensures (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   252
\     (F : A ensures B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   253
by (simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   254
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   255
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   256
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   257
qed "extend_ensures";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   258
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   259
Goal "F : A leadsTo B \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   260
\     ==> 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
   261
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   262
by (asm_simp_tac (simpset() addsimps [leadsTo_UN, extend_set_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   263
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   264
by (asm_simp_tac (simpset() addsimps [leadsTo_Basis, extend_ensures]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   265
qed "leadsTo_imp_extend_leadsTo";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   266
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   267
(*** Proving the converse takes some doing! ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   268
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   269
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
   270
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   271
qed "slice_Union";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   272
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   273
Goalw [slice_def] "slice (extend_set h A) y = A";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   274
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   275
qed "slice_extend_set";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   276
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   277
Goalw [slice_def] "f``A = (UN y. slice A y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   278
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   279
by (blast_tac (claset() addIs [f_h_eq RS sym]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   280
by (best_tac (claset() addIs [h_f_g_eq RS ssubst]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   281
qed "image_is_UN_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   282
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   283
Goalw [slice_def, transient_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   284
    "extend h F : transient A ==> F : transient (slice A y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   285
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   286
by (rtac bexI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   287
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   288
by (force_tac (claset(), simpset() addsimps [extend_act_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   289
qed "extend_transient_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   290
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   291
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
   292
by (full_simp_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   293
    (simpset() addsimps [ensures_def, extend_constrains, extend_transient, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   294
			 image_Un RS sym,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   295
			 extend_set_Un_distrib RS sym, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   296
			 extend_set_Diff_distrib RS sym]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   297
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   298
by (full_simp_tac (simpset() addsimps [constrains_def, extend_act_def, 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   299
				       extend_set_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   300
by (Clarify_tac 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   301
by (ball_tac 1); 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   302
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
   303
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
   304
(*transient*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   305
by (dtac extend_transient_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   306
by (etac transient_strengthen 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   307
by (force_tac (claset() addIs [f_h_eq RS sym], 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   308
	       simpset() addsimps [slice_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   309
qed "extend_ensures_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   310
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   311
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
   312
by (simp_tac (simpset() addsimps [image_is_UN_slice]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   313
by (blast_tac (claset() addIs [leadsTo_UN]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   314
qed "leadsTo_slice_image";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   315
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 : AU leadsTo BU \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   318
\     ==> ALL y. F : (slice AU y) leadsTo (f `` BU)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   319
by (etac leadsTo_induct 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   320
by (full_simp_tac (simpset() addsimps [slice_Union]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   321
by (blast_tac (claset() addIs [leadsTo_UN]) 3);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   322
by (blast_tac (claset() addIs [leadsTo_slice_image, leadsTo_Trans]) 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   323
by (blast_tac (claset() addIs [extend_ensures_slice, leadsTo_Basis]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   324
qed_spec_mp "extend_leadsTo_slice";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   325
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   326
Goal "(extend h F : (extend_set h A) leadsTo (extend_set h B)) = \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   327
\     (F : A leadsTo B)";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   328
by Safe_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   329
by (etac leadsTo_imp_extend_leadsTo 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   330
by (dtac extend_leadsTo_slice 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   331
by (full_simp_tac (simpset() addsimps [slice_extend_set]) 1);
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   332
qed "extend_leadsto";
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   333
6536
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   334
Goal "(extend h F : (extend_set h A) LeadsTo (extend_set h B)) =  \
281d44905cab made many specification operators infix
paulson
parents: 6454
diff changeset
   335
\     (F : A LeadsTo B)";
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   336
by (simp_tac
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   337
    (simpset() addsimps [LeadsTo_def, reachable_extend_eq, 
6647
9ec7b9723f43 new thm extend_JN; renamed extend_leadsto
paulson
parents: 6536
diff changeset
   338
			 extend_leadsto, extend_set_Int_distrib RS sym]) 1);
6454
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   339
qed "extend_LeadsTo";
1c8f48966033 new result extend_LeadsTo
paulson
parents: 6309
diff changeset
   340
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   341
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   342
(*** guarantees properties ***)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   343
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   344
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
   345
by (force_tac
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   346
    (claset() addSIs [rev_bexI],
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   347
     simpset() addsimps [image_iff]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   348
qed "f_act_extend_act";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   349
Addsimps [f_act_extend_act];
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   350
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   351
Goalw [extend_set_def]
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   352
     "f `` (extend_set h A Int B) = (f `` extend_set h A) Int (f``B)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   353
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
   354
qed "image_extend_set_Int_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   355
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   356
Goal "(extend h F) Join G = extend h H ==> EX J. H = F Join J";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   357
by (etac program_equalityE 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   358
by (auto_tac (claset(), simpset() addsimps [Acts_Join]));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   359
by (res_inst_tac [("x", "mk_program(f``(Init G), f_act``Acts G)")] exI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   360
by (rtac program_equalityI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   361
(*Init*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   362
by (REPEAT (dres_inst_tac [("f", "op `` f")] arg_cong 1));
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   363
by (asm_full_simp_tac (simpset() addsimps [image_extend_set_Int_eq]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   364
(*Now for the Actions*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   365
by (dres_inst_tac [("f", "op `` f_act")] arg_cong 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   366
by (asm_full_simp_tac 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   367
    (simpset() addsimps [Acts_Join, image_Un, image_compose RS sym, o_def]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   368
qed "extend_Join_eq_extend_D";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   369
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   370
Goal "F : X guarantees Y \
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   371
\     ==> extend h F : (extend h `` X) guarantees (extend h `` Y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   372
by (rtac guaranteesI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   373
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   374
by (blast_tac (claset() addDs [extend_Join_eq_extend_D, guaranteesD]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   375
qed "guarantees_imp_extend_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   376
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   377
Goal "extend h F : (extend h `` X) guarantees (extend h `` Y) \
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   378
\     ==> F : X guarantees Y";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   379
by (rtac guaranteesI 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   380
by (rewrite_goals_tac [guarantees_def, component_def]);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   381
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   382
by (dtac spec 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   383
by (dtac (mp RS mp) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   384
by (Blast_tac 2);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   385
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
   386
by Auto_tac;
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   387
qed "extend_guarantees_imp_guarantees";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   388
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   389
Goal "(extend h F : (extend h `` X) guarantees (extend h `` Y)) \
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   390
\     = (F : X guarantees Y)";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   391
by (blast_tac (claset() addIs [guarantees_imp_extend_guarantees,
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   392
			       extend_guarantees_imp_guarantees]) 1);
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   393
qed "extend_guarantees_eq";
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   394
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   395
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
   396
Close_locale "Extend";