src/HOL/UNITY/Union.ML
author paulson
Tue, 04 May 1999 10:26:00 +0200
changeset 6570 a7d7985050a9
parent 6536 281d44905cab
child 6633 2ed30ebd7e31
permissions -rw-r--r--
Invariant -> Always and other tidying
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Union.ML
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     2
    ID:         $Id$
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     5
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     6
Unions of programs
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     7
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     8
From Misra's Chapter 5: Asynchronous Compositions of Programs
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
     9
*)
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    10
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    11
Addcongs [UN_cong, INT_cong];
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    12
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    13
5867
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    14
(** SKIP **)
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    15
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    16
Goal "Init SKIP = UNIV";
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
    17
by (simp_tac (simpset() addsimps [SKIP_def]) 1);
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    18
qed "Init_SKIP";
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    19
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    20
Goal "Acts SKIP = {Id}";
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
    21
by (simp_tac (simpset() addsimps [SKIP_def]) 1);
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
    22
qed "Acts_SKIP";
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
    23
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    24
Addsimps [Init_SKIP, Acts_SKIP];
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
    25
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    26
Goal "reachable SKIP = UNIV";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    27
by (force_tac (claset() addEs [reachable.induct]
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    28
			addIs reachable.intrs, simpset()) 1);
5867
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    29
qed "reachable_SKIP";
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    30
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    31
Addsimps [reachable_SKIP];
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    32
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    33
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    34
(** Join **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    35
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    36
Goal "Init (F Join G) = Init F Int Init G";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    37
by (simp_tac (simpset() addsimps [Join_def]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
    38
qed "Init_Join";
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    39
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    40
Goal "Acts (F Join G) = Acts F Un Acts G";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    41
by (auto_tac (claset(), simpset() addsimps [Join_def]));
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
    42
qed "Acts_Join";
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    43
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    44
Addsimps [Init_Join];
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    45
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    46
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    47
(** JN **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    48
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    49
Goalw [JOIN_def, SKIP_def] "(JN i:{}. F i) = SKIP";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    50
by Auto_tac;
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    51
qed "JN_empty";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    52
Addsimps [JN_empty];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    53
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    54
Goal "(JN x:insert a A. B x) = (B a) Join (JN x:A. B x)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    55
by (rtac program_equalityI 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    56
by (ALLGOALS (simp_tac (simpset() addsimps [JOIN_def, Join_def])));
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    57
qed "JN_insert";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    58
Addsimps[JN_empty, JN_insert];
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    59
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    60
Goal "Init (JN i:I. F i) = (INT i:I. Init (F i))";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    61
by (simp_tac (simpset() addsimps [JOIN_def]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
    62
qed "Init_JN";
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    63
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    64
Goal "Acts (JN i:I. F i) = insert Id (UN i:I. Acts (F i))";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    65
by (auto_tac (claset(), simpset() addsimps [JOIN_def]));
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
    66
qed "Acts_JN";
5252
1b0f14d11142 Union primitives and examples
paulson
parents:
diff changeset
    67
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    68
Addsimps [Init_JN];
5867
1c4806b4bf43 generalized JN_empty and added reachable_SKIP
paulson
parents: 5804
diff changeset
    69
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    70
val prems = Goalw [JOIN_def]
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    71
    "[| A=B;  !!x. x:B ==> F(x) = G(x) |] ==> \
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    72
\    (JN x:A. F(x)) = (JN x:B. G(x))";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    73
by (asm_simp_tac (simpset() addsimps prems) 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    74
qed "JN_cong";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
    75
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    76
Addcongs [JN_cong];
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
    77
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
    78
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    79
(** Algebraic laws **)
5259
86d80749453f Null program and a few new results
paulson
parents: 5252
diff changeset
    80
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    81
Goal "F Join G = G Join F";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
    82
by (simp_tac (simpset() addsimps [Join_def, Un_commute, Int_commute]) 1);
5259
86d80749453f Null program and a few new results
paulson
parents: 5252
diff changeset
    83
qed "Join_commute";
86d80749453f Null program and a few new results
paulson
parents: 5252
diff changeset
    84
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    85
Goal "(F Join G) Join H = F Join (G Join H)";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    86
by (simp_tac (simpset() addsimps Un_ac@[Join_def, Int_assoc]) 1);
5259
86d80749453f Null program and a few new results
paulson
parents: 5252
diff changeset
    87
qed "Join_assoc";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    88
 
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    89
Goalw [Join_def, SKIP_def] "SKIP Join F = F";
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    90
by (rtac program_equalityI 1);
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    91
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb])));
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    92
qed "Join_SKIP_left";
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
    93
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    94
Goalw [Join_def, SKIP_def] "F Join SKIP = F";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    95
by (rtac program_equalityI 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
    96
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb])));
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    97
qed "Join_SKIP_right";
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    98
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
    99
Addsimps [Join_SKIP_left, Join_SKIP_right];
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
   100
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
   101
Goalw [Join_def] "F Join F = F";
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
   102
by (rtac program_equalityI 1);
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   103
by Auto_tac;
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   104
qed "Join_absorb";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   105
5611
6957f124ca97 Join now an infix operator
paulson
parents: 5608
diff changeset
   106
Addsimps [Join_absorb];
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   107
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   108
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   109
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   110
(*** JN laws ***)
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   111
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   112
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   113
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   114
Goal "i : I ==> (JN i:I. A i Join B) = ((JN i:I. A i) Join B)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   115
by (auto_tac (claset() addSIs [program_equalityI],
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   116
	      simpset() addsimps [Acts_JN, Acts_Join]));
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   117
qed "JN_Join_miniscope";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   118
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   119
Goal "k:I ==> A k Join (JN i:I. A i) = (JN i:I. A i)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   120
by (auto_tac (claset() addSIs [program_equalityI],
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   121
	      simpset() addsimps [Acts_JN, Acts_Join]));
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   122
qed "JN_absorb";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   123
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   124
Goal "(JN i: I Un J. A i) = ((JN i: I. A i) Join (JN i:J. A i))";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   125
by (auto_tac (claset() addSIs [program_equalityI],
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   126
	      simpset() addsimps [Acts_JN, Acts_Join]));
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   127
qed "JN_Join";
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   128
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   129
Goal "i: I ==> (JN i:I. c) = c";
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   130
by (auto_tac (claset() addSIs [program_equalityI],
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   131
	      simpset() addsimps [Acts_JN]));
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   132
qed "JN_constant";
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   133
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   134
Goal "(JN i:I. A i Join B i) = (JN i:I. A i)  Join  (JN i:I. B i)";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   135
by (auto_tac (claset() addSIs [program_equalityI],
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   136
	      simpset() addsimps [Acts_JN, Acts_Join]));
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   137
qed "JN_Join_distrib";
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
   138
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
   139
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   140
(*** Safety: co, stable, FP ***)
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   141
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   142
Goalw [constrains_def, JOIN_def]
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   143
    "i : I ==> \
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   144
\    (JN i:I. F i) : A co B = (ALL i:I. F i : A co B)";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   145
by (Simp_tac 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   146
by (Blast_tac 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   147
qed "constrains_JN";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   148
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   149
Goal "F Join G : A co B =  \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   150
\     (F : A co B & G : A co B)";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   151
by (auto_tac
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   152
    (claset(),
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   153
     simpset() addsimps [constrains_def, Join_def]));
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5611
diff changeset
   154
qed "constrains_Join";
3ac11c4af76a tidying and renaming
paulson
parents: 5611
diff changeset
   155
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   156
Goal "[| i : I;  ALL i:I. F i : A co B |] \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   157
\     ==> (JN i:I. F i) : A co B";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   158
by (full_simp_tac (simpset() addsimps [constrains_def, Acts_JN]) 1);
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   159
by (Blast_tac 1);
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   160
qed "constrains_imp_JN_constrains";
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5611
diff changeset
   161
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   162
    (**FAILS, I think; see 5.4.1, Substitution Axiom.
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   163
       The problem is to relate reachable (F Join G) with 
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   164
       reachable F and reachable G
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   165
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   166
    Goalw [Constrains_def]
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   167
	"(JN i:I. F i) : A Co B = (ALL i:I. F i : A Co B)";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   168
    by (simp_tac (simpset() addsimps [constrains_JN]) 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   169
    by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   170
    qed "Constrains_JN";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   171
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   172
    Goal "F Join G : A Co B = (F Co A B & G Co A B)";
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   173
    by (auto_tac
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   174
	(claset(),
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   175
	 simpset() addsimps [Constrains_def, constrains_Join]));
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   176
    qed "Constrains_Join";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   177
    **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5970
diff changeset
   178
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   179
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   180
Goal "[| F : A co A';  G : B co B' |] \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   181
\     ==> F Join G : (A Int B) co (A' Un B')";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   182
by (simp_tac (simpset() addsimps [constrains_Join]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   183
by (blast_tac (claset() addIs [constrains_weaken]) 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   184
qed "constrains_Join_weaken";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   185
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   186
Goal "i : I ==> \
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   187
\     (JN i:I. F i) : stable A = (ALL i:I. F i : stable A)";
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
   188
by (asm_simp_tac (simpset() addsimps [stable_def, constrains_JN]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   189
qed "stable_JN";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   190
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   191
Goal "[| ALL i:I. F i : invariant A;  i : I |]  \
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   192
\      ==> (JN i:I. F i) : invariant A";
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   193
by (asm_full_simp_tac (simpset() addsimps [invariant_def, stable_JN]) 1);
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   194
by (Blast_tac 1);
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   195
bind_thm ("invariant_JN_I", ballI RS result());
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   196
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   197
Goal "F Join G : stable A = \
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   198
\     (F : stable A & G : stable A)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   199
by (simp_tac (simpset() addsimps [stable_def, constrains_Join]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   200
qed "stable_Join";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   201
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   202
Goal "[| F : invariant A; G : invariant A |]  \
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   203
\     ==> F Join G : invariant A";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   204
by (full_simp_tac (simpset() addsimps [invariant_def, stable_Join]) 1);
5970
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   205
by (Blast_tac 1);
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   206
qed "invariant_JoinI";
44ff61e1fe82 new thms for invariant
paulson
parents: 5898
diff changeset
   207
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   208
Goal "i : I ==> FP (JN i:I. F i) = (INT i:I. FP (F i))";
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
   209
by (asm_simp_tac (simpset() addsimps [FP_def, stable_JN, INTER_def]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   210
qed "FP_JN";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   211
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   212
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   213
(*** Progress: transient, ensures ***)
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   214
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   215
Goal "i : I ==> \
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   216
\   (JN i:I. F i) : transient A = (EX i:I. F i : transient A)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   217
by (auto_tac (claset(),
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   218
	      simpset() addsimps [transient_def, JOIN_def]));
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   219
qed "transient_JN";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   220
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   221
Goal "F Join G : transient A = \
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   222
\     (F : transient A | G : transient A)";
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   223
by (auto_tac (claset(),
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   224
	      simpset() addsimps [bex_Un, transient_def,
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   225
				  Join_def]));
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   226
qed "transient_Join";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   227
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   228
Goal "i : I ==> \
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   229
\     (JN i:I. F i) : A ensures B = \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   230
\     ((ALL i:I. F i : (A-B) co (A Un B)) & \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   231
\      (EX i:I. F i : A ensures B))";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   232
by (auto_tac (claset(),
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
   233
	      simpset() addsimps [ensures_def, constrains_JN, transient_JN]));
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   234
qed "ensures_JN";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   235
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   236
Goalw [ensures_def]
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   237
     "F Join G : A ensures B =     \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   238
\     (F : (A-B) co (A Un B) & \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   239
\      G : (A-B) co (A Un B) & \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   240
\      (F : A ensures B | G : A ensures B))";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   241
by (auto_tac (claset(),
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   242
	      simpset() addsimps [constrains_Join, transient_Join]));
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   243
qed "ensures_Join";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   244
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   245
Goalw [stable_def, constrains_def, Join_def]
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   246
    "[| F : stable A;  G : A co A' |] \
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   247
\    ==> F Join G : A co A'";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   248
by (asm_full_simp_tac (simpset() addsimps [ball_Un]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   249
by (Blast_tac 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   250
qed "stable_constrains_Join";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   251
6570
a7d7985050a9 Invariant -> Always and other tidying
paulson
parents: 6536
diff changeset
   252
(*Premise for G cannot use Always because  Stable F A  is weaker than
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   253
  G : stable A *)
6570
a7d7985050a9 Invariant -> Always and other tidying
paulson
parents: 6536
diff changeset
   254
Goal "[| F : stable A;  G : invariant A |] ==> F Join G : Always A";
a7d7985050a9 Invariant -> Always and other tidying
paulson
parents: 6536
diff changeset
   255
by (full_simp_tac (simpset() addsimps [Always_def, invariant_def, 
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   256
				       Stable_eq_stable, stable_Join]) 1);
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   257
by (force_tac(claset() addIs [stable_reachable, stable_Int],
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   258
	      simpset() addsimps [Acts_Join]) 1);
6570
a7d7985050a9 Invariant -> Always and other tidying
paulson
parents: 6536
diff changeset
   259
qed "stable_Join_Always";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   260
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   261
Goal "[| F : stable A;  G : A ensures B |] ==> F Join G : A ensures B";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   262
by (asm_simp_tac (simpset() addsimps [ensures_Join]) 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   263
by (asm_full_simp_tac (simpset() addsimps [stable_def, ensures_def]) 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   264
by (etac constrains_weaken 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   265
by Auto_tac;
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   266
qed "ensures_stable_Join1";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   267
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   268
(*As above, but exchanging the roles of F and G*)
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   269
Goal "[| F : A ensures B;  G : stable A |] ==> F Join G : A ensures B";
5313
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   270
by (stac Join_commute 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   271
by (blast_tac (claset() addIs [ensures_stable_Join1]) 1);
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   272
qed "ensures_stable_Join2";
1861a564d7e2 Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents: 5259
diff changeset
   273
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   274
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   275
(** Diff and localTo **)
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   276
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   277
Goalw [Join_def, Diff_def] "F Join (Diff G (Acts F)) = F Join G";
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   278
by (rtac program_equalityI 1);
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   279
by Auto_tac;
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   280
qed "Join_Diff2";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   281
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   282
Goalw [Diff_def, Disjoint_def] "Disjoint F (Diff G (Acts F))";
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   283
by Auto_tac;
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   284
qed "Diff_Disjoint";
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   285
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   286
Goal "[| F Join G : v localTo F;  Disjoint F G |] \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   287
\     ==> G : (INT z. stable {s. v s = z})";
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   288
by (asm_full_simp_tac 
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   289
    (simpset() addsimps [localTo_def, Diff_def, Disjoint_def,
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   290
			 Acts_Join, stable_def, constrains_def]) 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   291
by (Blast_tac 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   292
qed "localTo_imp_stable";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   293
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   294
Goal "[| F Join G : v localTo F;  (s,s') : act;  \
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   295
\        act : Acts G;  Disjoint F G |] ==> v s' = v s";
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   296
by (asm_full_simp_tac 
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   297
    (simpset() addsimps [localTo_def, Diff_def, Disjoint_def,
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   298
			 Acts_Join, stable_def, constrains_def]) 1);
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   299
by (Blast_tac 1);
fe887910e32e specifications as sets of programs
paulson
parents: 5639
diff changeset
   300
qed "localTo_imp_equals";
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   301
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   302
Goalw [localTo_def, stable_def, constrains_def]
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   303
     "v localTo F <= (f o v) localTo F";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   304
by (Clarify_tac 1);
5898
3e34e7aa7479 a faster proof
paulson
parents: 5867
diff changeset
   305
by (force_tac (claset() addSEs [allE, ballE], simpset()) 1);
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   306
qed "localTo_imp_o_localTo";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   307
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   308
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   309
(*** Higher-level rules involving localTo and Join ***)
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   310
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   311
Goal "[| F : {s. P (v s) (w s)} co {s. P' (v s) (w s)};   \
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   312
\        F Join G : v localTo F;       \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   313
\        F Join G : w localTo F;       \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   314
\        Disjoint F G |]               \
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   315
\     ==> F Join G : {s. P (v s) (w s)} co {s. P' (v s) (w s)}";
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   316
by (auto_tac (claset(), simpset() addsimps [constrains_def, Acts_Join]));
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   317
by (REPEAT_FIRST (dtac localTo_imp_equals THEN' REPEAT1 o atac));
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   318
by Auto_tac;
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   319
qed "constrains_localTo_constrains2";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   320
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   321
Goalw [stable_def]
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   322
     "[| F : stable {s. P (v s) (w s)};   \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   323
\        F Join G : v localTo F;       \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   324
\        F Join G : w localTo F;       \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   325
\        Disjoint F G |]               \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   326
\     ==> F Join G : stable {s. P (v s) (w s)}";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   327
by (blast_tac (claset() addIs [constrains_localTo_constrains2]) 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   328
qed "stable_localTo_stable2";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   329
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   330
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   331
Goal "(UN k. {s. f s = k}) = UNIV";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   332
by (Blast_tac 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   333
qed "UN_eq_UNIV";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   334
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   335
Goal "[| F : stable {s. v s <= w s};   \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   336
\        F Join G : v localTo F;       \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   337
\        F Join G : Increasing w;      \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   338
\        Disjoint F G |]               \
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   339
\     ==> F Join G : Stable {s. v s <= w s}";
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   340
by (safe_tac (claset() addSDs [localTo_imp_stable]));
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   341
by (rewrite_goals_tac [stable_def, Stable_def, Increasing_def]);
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   342
by (subgoal_tac "ALL k: UNIV. ?H : ({s. v s = k} Int ?AA) Co ?AA" 1);
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   343
by (dtac ball_Constrains_UN 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   344
by (full_simp_tac (simpset() addsimps [UN_eq_UNIV]) 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   345
by (rtac ballI 1);
6536
281d44905cab made many specification operators infix
paulson
parents: 6309
diff changeset
   346
by (subgoal_tac "F Join G : ({s. v s = k} Int {s. v s <= w s}) co \
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   347
\                                      ({s. v s = k} Un {s. v s <= w s})" 1);
6295
351b3c2b0d83 removed the infernal States, eqStates, compatible, etc.
paulson
parents: 6019
diff changeset
   348
by (asm_simp_tac (simpset() addsimps [constrains_Join]) 2);
5804
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   349
by (blast_tac (claset() addIs [constrains_weaken]) 2);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   350
by (dtac (constrains_imp_Constrains RS Constrains_Int) 1 THEN etac INT_D 1);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   351
by (etac Constrains_weaken 2);
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   352
by Auto_tac;
8e0a4c4fd67b Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents: 5785
diff changeset
   353
qed "Increasing_localTo_Stable";