src/ZF/UNITY/Comp.ML
author paulson
Tue, 08 Jul 2003 11:44:30 +0200
changeset 14092 68da54626309
parent 14077 37c964462747
permissions -rw-r--r--
Conversion of ZF/UNITY/{FP,Union} to Isar script. Introduction of X-symbols to the ML files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      ZF/UNITY/Comp.ML
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
     2
    ID:         $Id \\<in> Comp.ML,v 1.8 2003/06/27 16:40:25 paulson Exp $
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Sidi O Ehmety, Computer Laboratory
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     5
Composition
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     6
From Chandy and Sanders, "Reasoning About Program Composition"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     7
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     8
Revised by Sidi Ehmety on January 2001
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     9
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    10
*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    11
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    12
(*** component and strict_component relations ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    13
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    14
Goalw [component_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    15
     "H component F | H component G ==> H component (F Join G)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    16
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    17
by (res_inst_tac [("x", "Ga Join G")] exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    18
by (res_inst_tac [("x", "G Join F")] exI 2);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    19
by (auto_tac (claset(), simpset() addsimps Join_ac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    20
qed "componentI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    21
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    22
Goalw [component_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    23
     "G \\<in> program ==> (F component G) <-> \
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    24
\  (Init(G) <= Init(F) & Acts(F) <= Acts(G) & AllowedActs(G) <= AllowedActs(F))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    25
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    26
by (rtac exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    27
by (rtac program_equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    28
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    29
qed "component_eq_subset";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    30
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    31
Goalw [component_def] 
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    32
   "F \\<in> program ==> SKIP component F";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    33
by (res_inst_tac [("x", "F")] exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    34
by (force_tac (claset() addIs [Join_SKIP_left], simpset()) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    35
qed "component_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    36
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    37
Goalw [component_def] 
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    38
"F \\<in> program ==> F component F";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    39
by (res_inst_tac  [("x", "F")] exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    40
by (force_tac (claset() addIs [Join_SKIP_right], simpset()) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    41
qed "component_refl";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    42
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    43
Addsimps [component_SKIP, component_refl];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    44
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    45
Goal "F component SKIP ==> programify(F) = SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    46
by (rtac program_equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    47
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [component_eq_subset])));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    48
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    49
qed "SKIP_minimal";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    50
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    51
Goalw [component_def] "F component (F Join G)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    52
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    53
qed "component_Join1";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    54
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    55
Goalw [component_def] "G component (F Join G)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    56
by (simp_tac (simpset() addsimps [Join_commute]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    57
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    58
qed "component_Join2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    59
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    60
Goal "F component G ==> F Join G = G";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    61
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    62
        addsimps [component_def, Join_left_absorb]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    63
qed "Join_absorb1";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    64
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    65
Goal "G component F ==> F Join G = F";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    66
by (auto_tac (claset(), simpset() addsimps Join_ac@[component_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    67
qed "Join_absorb2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    68
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    69
Goal "H \\<in> program==>(JOIN(I,F) component H) <-> (\\<forall>i \\<in> I. F(i) component H)";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    70
by (case_tac "I=0" 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    71
by (Force_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    72
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    73
by Auto_tac;
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12484
diff changeset
    74
by (Blast_tac 1); 
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12484
diff changeset
    75
by (rename_tac "y" 1);
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12484
diff changeset
    76
by (dres_inst_tac [("c", "y"), ("A", "AllowedActs(H)")] subsetD 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    77
by (REPEAT(blast_tac (claset() addSEs [not_emptyE]) 1));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    78
qed "JN_component_iff";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    79
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    80
Goalw [component_def] "i \\<in> I ==> F(i) component (\\<Squnion>i \\<in> I. (F(i)))";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    81
by (blast_tac (claset() addIs [JN_absorb]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    82
qed "component_JN";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    83
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    84
Goalw [component_def] "[| F component G; G component H |] ==> F component H";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    85
by (blast_tac (claset() addIs [Join_assoc RS sym]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    86
qed "component_trans";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    87
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    88
Goal "[| F \\<in> program; G \\<in> program |] ==>(F component G & G  component F) --> F = G";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    89
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    90
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    91
by (rtac program_equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    92
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    93
qed "component_antisym";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    94
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
    95
Goal "H \\<in> program ==> ((F Join G) component H) <-> (F component H & G component H)";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    96
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    97
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    98
qed "Join_component_iff";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    99
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   100
Goal "[| F component G; G \\<in> A co B; F \\<in> program |] ==> F \\<in> A co B";
12484
7ad150f5fc10 isatool expandshort;
wenzelm
parents: 12220
diff changeset
   101
by (ftac constrainsD2 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   102
by (rotate_tac ~1 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   103
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   104
              simpset() addsimps [constrains_def, component_eq_subset]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   105
qed "component_constrains";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   106
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   107
(* Used in Guar.thy to show that programs are partially ordered*)
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   108
(* bind_thm ("program_less_le", strict_component_def RS meta_eq_to_obj_eq);*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   109
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   110
(*** preserves ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   111
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   112
Goalw [preserves_def, safety_prop_def]
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   113
  "safety_prop(preserves(f))";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   114
by (auto_tac (claset() addDs [ActsD], simpset() addsimps [stable_def, constrains_def]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   115
by (dres_inst_tac [("c", "act")] subsetD 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   116
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   117
qed "preserves_is_safety_prop";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   118
Addsimps [preserves_is_safety_prop];
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   119
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   120
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   121
val prems = Goalw [preserves_def] 
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   122
"\\<forall>z. F \\<in> stable({s \\<in> state. f(s) = z})  ==> F \\<in> preserves(f)";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   123
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   124
by (blast_tac (claset() addDs [stableD2]) 1);
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   125
qed "preserves_aux";
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   126
bind_thm("preservesI", allI RS preserves_aux);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   127
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   128
Goalw [preserves_def, stable_def, constrains_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   129
     "[| F \\<in> preserves(f);  act \\<in> Acts(F);  <s,t> \\<in> act |] ==> f(s) = f(t)";
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   130
by (subgoal_tac "s \\<in> state & t \\<in> state" 1);
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   131
by (blast_tac (claset() addSDs [Acts_type RS subsetD]) 2);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   132
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   133
by (dres_inst_tac [("x", "f(s)")] spec 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   134
by (dres_inst_tac [("x", "act")] bspec 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   135
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   136
qed "preserves_imp_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   137
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   138
Goalw [preserves_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   139
"(F Join G \\<in> preserves(v)) <->  \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   140
\     (programify(F) \\<in> preserves(v) & programify(G) \\<in> preserves(v))";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   141
by (auto_tac (claset(), simpset() addsimps [INT_iff]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   142
qed "Join_preserves";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   143
 
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   144
Goal "(JOIN(I,F): preserves(v)) <-> (\\<forall>i \\<in> I. programify(F(i)):preserves(v))";
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   145
by (auto_tac (claset(), simpset() addsimps [JN_stable, preserves_def, INT_iff]));
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   146
qed "JN_preserves";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   147
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   148
Goal "SKIP \\<in> preserves(v)";
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   149
by (auto_tac (claset(), simpset() addsimps [preserves_def, INT_iff]));
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   150
qed "SKIP_preserves";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   151
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   152
AddIffs [Join_preserves, JN_preserves, SKIP_preserves];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   153
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   154
Goalw [fun_pair_def] "fun_pair(f,g,x) = <f(x), g(x)>";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   155
by (Simp_tac 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   156
qed "fun_pair_apply";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   157
Addsimps [fun_pair_apply];
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   158
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   159
Goal "preserves(fun_pair(v,w)) = preserves(v) Int preserves(w)";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   160
by (rtac equalityI 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   161
by (auto_tac (claset(),
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   162
              simpset() addsimps [preserves_def, stable_def, constrains_def]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   163
by (REPEAT(Blast_tac 1));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   164
qed "preserves_fun_pair";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   165
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   166
Goal "F \\<in> preserves(fun_pair(v, w))  <-> F \\<in> preserves(v) Int preserves(w)";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   167
by (simp_tac (simpset() addsimps [preserves_fun_pair]) 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   168
qed "preserves_fun_pair_iff";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   169
AddIffs [preserves_fun_pair_iff];
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   170
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   171
Goal "(fun_pair(f, g) comp h)(x) = fun_pair(f comp h, g comp h, x)";
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   172
by (simp_tac (simpset() addsimps [fun_pair_def, metacomp_def]) 1);
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   173
qed "fun_pair_comp_distrib";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   174
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   175
Goal "(f comp g)(x) = f(g(x))";
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   176
by (simp_tac (simpset() addsimps [metacomp_def]) 1);
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   177
qed "comp_apply";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   178
Addsimps [comp_apply];
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   179
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   180
Goalw [preserves_def]
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   181
 "preserves(v)<=program";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   182
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   183
qed "preserves_type";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   184
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   185
Goal "F \\<in> preserves(f) ==> F \\<in> program";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   186
by (blast_tac (claset() addIs [preserves_type RS subsetD]) 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   187
qed "preserves_into_program";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   188
AddTCs [preserves_into_program];
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   189
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   190
Goal "preserves(f) <= preserves(g comp f)";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   191
by (auto_tac (claset(),  simpset() 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   192
     addsimps [preserves_def, stable_def, constrains_def]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   193
by (dres_inst_tac [("x", "f(xb)")] spec 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   194
by (dres_inst_tac [("x", "act")] bspec 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   195
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   196
qed "subset_preserves_comp";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   197
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   198
Goal "F \\<in> preserves(f) ==> F \\<in> preserves(g comp f)";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   199
by (blast_tac (claset() addIs [subset_preserves_comp RS subsetD]) 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   200
qed "imp_preserves_comp";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   201
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   202
Goal "preserves(f) <= stable({s \\<in> state. P(f(s))})";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   203
by (auto_tac (claset(),
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   204
              simpset() addsimps [preserves_def, stable_def, constrains_def]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   205
by (rename_tac "s' s" 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   206
by (subgoal_tac "f(s) = f(s')" 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   207
by (ALLGOALS Force_tac);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   208
qed "preserves_subset_stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   209
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   210
Goal "F \\<in> preserves(f) ==> F \\<in> stable({s \\<in> state. P(f(s))})";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   211
by (blast_tac (claset() addIs [preserves_subset_stable RS subsetD]) 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   212
qed "preserves_imp_stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   213
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   214
Goalw  [increasing_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   215
 "[| F \\<in> preserves(f); \\<forall>x \\<in> state. f(x):A |] ==> F \\<in> Increasing.increasing(A, r, f)";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   216
by (auto_tac (claset() addIs [preserves_into_program],
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   217
              simpset()));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   218
by (res_inst_tac [("P", "%x. <k, x>:r")]  preserves_imp_stable 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   219
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   220
qed "preserves_imp_increasing";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   221
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   222
Goalw [preserves_def, stable_def, constrains_def]
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   223
 "st_set(A) ==> preserves(%x. x) <= stable(A)";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   224
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   225
by (dres_inst_tac [("x", "xb")] spec 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   226
by (dres_inst_tac [("x", "act")] bspec 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   227
by (auto_tac (claset() addDs [ActsD], simpset()));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   228
qed "preserves_id_subset_stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   229
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   230
Goal "[| F \\<in> preserves(%x. x); st_set(A) |] ==> F \\<in> stable(A)";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   231
by (blast_tac (claset() addIs [preserves_id_subset_stable RS subsetD]) 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   232
qed "preserves_id_imp_stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   233
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   234
(** Added by Sidi **)
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   235
(** component_of **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   236
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   237
(*  component_of is stronger than component *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   238
Goalw [component_def, component_of_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   239
"F component_of H ==> F component H";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   240
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   241
qed "component_of_imp_component";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   242
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   243
(* component_of satisfies many of component's properties *)
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   244
Goalw [component_of_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   245
"F \\<in> program ==> F component_of F";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   246
by (res_inst_tac [("x", "SKIP")] exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   247
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   248
qed "component_of_refl";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   249
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   250
Goalw [component_of_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   251
"F \\<in> program ==>SKIP component_of F";
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   252
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   253
by (res_inst_tac [("x", "F")] exI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   254
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   255
qed "component_of_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   256
Addsimps [component_of_refl, component_of_SKIP];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   257
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   258
Goalw [component_of_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   259
"[| F component_of G; G component_of H |] ==> F component_of H";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   260
by (blast_tac (claset() addIs [Join_assoc RS sym]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   261
qed "component_of_trans";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   262
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   263
(** localize **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   264
Goalw [localize_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   265
 "Init(localize(v,F)) = Init(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   266
by (Simp_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   267
qed "localize_Init_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   268
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   269
Goalw [localize_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   270
 "Acts(localize(v,F)) = Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   271
by (Simp_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   272
qed "localize_Acts_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   273
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   274
Goalw [localize_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   275
 "AllowedActs(localize(v,F)) = AllowedActs(F) Int (\\<Union>G \\<in> preserves(v). Acts(G))";
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   276
by (rtac equalityI 1);
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   277
by (auto_tac (claset() addDs [Acts_type RS subsetD], simpset()));
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   278
qed "localize_AllowedActs_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   279
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   280
AddIffs [localize_Init_eq, localize_Acts_eq, localize_AllowedActs_eq];
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
   281
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   282
(** Theorems used in ClientImpl **)
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   283
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   284
Goal
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   285
 "[| F \\<in> stable({s \\<in> state. P(f(s), g(s))});  G \\<in> preserves(f);  G \\<in> preserves(g) |] \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   286
\     ==> F Join G \\<in> stable({s \\<in> state. P(f(s), g(s))})";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   287
by (auto_tac (claset() addDs [ActsD, preserves_into_program], 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   288
              simpset() addsimps [stable_def, constrains_def]));
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   289
by (case_tac "act \\<in> Acts(F)" 1);
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   290
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   291
by (dtac preserves_imp_eq 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   292
by (dtac preserves_imp_eq 3);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   293
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   294
qed "stable_localTo_stable2";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   295
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   296
Goal "[| F \\<in> stable({s \\<in> state. <f(s), g(s)>:r});  G \\<in> preserves(f);   \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   297
\        F Join G \\<in> Increasing(A, r, g); \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   298
\        \\<forall>x \\<in> state. f(x):A & g(x):A |]     \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   299
\     ==> F Join G \\<in> Stable({s \\<in> state. <f(s), g(s)>:r})";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   300
by (auto_tac (claset(), 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   301
              simpset() addsimps [stable_def, Stable_def, Increasing_def, 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   302
                                  Constrains_def, all_conj_distrib]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   303
by (ALLGOALS(asm_full_simp_tac (simpset()
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   304
        addsimps [constrains_type RS subsetD, preserves_type RS subsetD])));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   305
by (blast_tac (claset() addIs [constrains_weaken]) 1); 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   306
(*The G case remains*)
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   307
by (auto_tac (claset() addDs [ActsD], 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   308
              simpset() addsimps [preserves_def, stable_def, constrains_def,
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   309
                                  ball_conj_distrib, all_conj_distrib]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   310
(*We have a G-action, so delete assumptions about F-actions*)
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   311
by (thin_tac "\\<forall>act \\<in> Acts(F). ?P(act)" 1);
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   312
by (thin_tac "\\<forall>k\\<in>A. \\<forall>act \\<in> Acts(F). ?P(k,act)" 1);
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   313
by (subgoal_tac "f(x) = f(xa)" 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   314
by (auto_tac (claset() addSDs [bspec], simpset())); 
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   315
qed "Increasing_preserves_Stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   316
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   317
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   318
(** Lemma used in AllocImpl **)
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   319
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   320
Goalw [Constrains_def, constrains_def] 
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   321
"[| \\<forall>x \\<in> I. F \\<in> A(x) Co B; F \\<in> program |] ==> F:(\\<Union>x \\<in> I. A(x)) Co B";
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   322
by Auto_tac;
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   323
qed "Constrains_UN_left";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   324
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   325
Goalw [stable_def, Stable_def, preserves_def]
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   326
 "[| F \\<in> stable({s \\<in> state. P(f(s), g(s))}); \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   327
\    \\<forall>k \\<in> A. F Join G \\<in> Stable({s \\<in> state. P(k, g(s))}); \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   328
\   G \\<in> preserves(f); \\<forall>s \\<in> state. f(s):A|] ==> \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   329
\   F Join G \\<in> Stable({s \\<in> state. P(f(s), g(s))})";
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   330
by (res_inst_tac [("A", "(\\<Union>k \\<in> A. {s \\<in> state. f(s)=k} Int {s \\<in> state. P(f(s), g(s))})")]
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   331
               Constrains_weaken_L 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   332
by (Blast_tac 2);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   333
by (rtac Constrains_UN_left 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   334
by Auto_tac;
14092
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   335
by (res_inst_tac [("A", "{s \\<in> state. f(s)=k} Int {s \\<in> state. P(f(s), g(s))} Int \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   336
\                        {s \\<in> state. P(k, g(s))}"),
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   337
                  ("A'", "({s \\<in> state. f(s)=k} Un {s \\<in> state. P(f(s), g(s))}) \
68da54626309 Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents: 14077
diff changeset
   338
\                           Int {s \\<in> state. P(k, g(s))}")] Constrains_weaken 1);
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   339
by (REPEAT(Blast_tac 2));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   340
by (rtac Constrains_Int 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   341
by (rtac constrains_imp_Constrains 1);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   342
by (auto_tac (claset(), simpset() addsimps [constrains_type RS subsetD]));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   343
by (ALLGOALS(rtac constrains_weaken));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   344
by (rotate_tac ~1 4);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   345
by (dres_inst_tac [("x", "k")] spec 4);
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   346
by (REPEAT(Blast_tac 1));
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   347
qed "stable_Join_Stable";
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13339
diff changeset
   348