src/HOL/UNITY/WFair.ML
author paulson
Tue, 13 Oct 1998 11:05:34 +0200
changeset 5640 4a59d99b5ca3
parent 5620 3ac11c4af76a
child 5648 fe887910e32e
permissions -rw-r--r--
new theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/WFair
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
Weak Fairness versions of transient, ensures, leadsTo.
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     9
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    11
5340
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    12
(*Map its type, [('a * 'a)set set] => ('a set * 'a set) set, to just 'a*)
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    13
Blast.overloaded ("WFair.leadsto", 
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    14
		  #1 o HOLogic.dest_prodT o 
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    15
		  HOLogic.dest_setT o HOLogic.dest_setT o domain_type);
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    16
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    17
overload_2nd_set "WFair.transient";
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    18
overload_2nd_set "WFair.ensures";
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    19
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
(*** transient ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    22
Goalw [stable_def, constrains_def, transient_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    23
    "[| stable acts A; transient acts A |] ==> A = {}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    24
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
qed "stable_transient_empty";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    27
Goalw [transient_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    28
    "[| transient acts A; B<=A |] ==> transient acts B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
by (rtac bexI 1 THEN assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    32
qed "transient_strengthen";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    33
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    34
Goalw [transient_def]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5479
diff changeset
    35
    "[| act:acts;  A <= Domain act;  act^^A <= -A |] ==> transient acts A";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    36
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    37
qed "transient_mem";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
(*** ensures ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    42
Goalw [ensures_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    43
    "[| constrains acts (A-B) (A Un B); transient acts (A-B) |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    44
\    ==> ensures acts A B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
qed "ensuresI";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    48
Goalw [ensures_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    49
    "ensures acts A B  \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    50
\    ==> constrains acts (A-B) (A Un B) & transient acts (A-B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    51
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    52
qed "ensuresD";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    53
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    54
(*The L-version (precondition strengthening) doesn't hold for ENSURES*)
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    55
Goalw [ensures_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    56
    "[| ensures acts A A'; A'<=B' |] ==> ensures acts A B'";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    57
by (blast_tac (claset() addIs [constrains_weaken, transient_strengthen]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
qed "ensures_weaken_R";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    59
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    60
Goalw [ensures_def, constrains_def, transient_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    61
    "acts ~= {} ==> ensures acts A UNIV";
5340
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
    62
by Auto_tac;
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    63
qed "ensures_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    64
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    65
Goalw [ensures_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    66
    "[| stable acts C; \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    67
\       constrains acts (C Int (A - A')) (A Un A'); \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    68
\       transient  acts (C Int (A-A')) |]   \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    69
\   ==> ensures acts (C Int A) (C Int A')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    70
by (asm_simp_tac (simpset() addsimps [Int_Un_distrib RS sym,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    71
				      Diff_Int_distrib RS sym,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    72
				      stable_constrains_Int]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    73
qed "stable_ensures_Int";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    74
5640
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    75
Goal "[| stable acts A;  transient acts C;  A <= B Un C |] \
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    76
\     ==> ensures acts A B";
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    77
by (asm_full_simp_tac (simpset() addsimps [ensures_def, stable_def]) 1);
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    78
by (blast_tac (claset() addIs [constrains_weaken, transient_strengthen]) 1);
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    79
qed "stable_transient_ensures";
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    80
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    81
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    82
(*** leadsTo ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    83
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    84
(*Synonyms for the theorems produced by the inductive defn package*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    85
bind_thm ("leadsTo_Basis", leadsto.Basis);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    86
bind_thm ("leadsTo_Trans", leadsto.Trans);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    87
5640
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    88
Goal "transient acts A ==> leadsTo acts A (-A)";
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    89
by (asm_simp_tac 
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    90
    (simpset() addsimps [leadsTo_Basis, ensuresI, Compl_partition]) 1);
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    91
qed "transient_imp_leadsTo";
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
    92
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    93
Goal "act: acts ==> leadsTo acts A UNIV";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    94
by (blast_tac (claset() addIs [ensures_UNIV RS leadsTo_Basis]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    95
qed "leadsTo_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    96
Addsimps [leadsTo_UNIV];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    97
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    98
(*Useful with cancellation, disjunction*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
    99
Goal "leadsTo acts A (A' Un A') ==> leadsTo acts A A'";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   100
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   101
qed "leadsTo_Un_duplicate";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   102
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   103
Goal "leadsTo acts A (A' Un C Un C) ==> leadsTo acts A (A' Un C)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   104
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   105
qed "leadsTo_Un_duplicate2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   106
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   107
(*The Union introduction rule as we should have liked to state it*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   108
val prems = goal thy
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   109
    "(!!A. A : S ==> leadsTo acts A B) ==> leadsTo acts (Union S) B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   110
by (blast_tac (claset() addIs (leadsto.Union::prems)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   111
qed "leadsTo_Union";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   112
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   113
val prems = goal thy
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   114
    "(!!i. i : I ==> leadsTo acts (A i) B) ==> leadsTo acts (UN i:I. A i) B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   115
by (simp_tac (simpset() addsimps [Union_image_eq RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   116
by (blast_tac (claset() addIs (leadsto.Union::prems)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   117
qed "leadsTo_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   118
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   119
(*Binary union introduction rule*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   120
Goal "[| leadsTo acts A C; leadsTo acts B C |] ==> leadsTo acts (A Un B) C";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   121
by (stac Un_eq_Union 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   122
by (blast_tac (claset() addIs [leadsTo_Union]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   123
qed "leadsTo_Un";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   124
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   125
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   126
(*The INDUCTION rule as we should have liked to state it*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   127
val major::prems = goal thy
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   128
  "[| leadsTo acts za zb;  \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   129
\     !!A B. ensures acts A B ==> P A B; \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   130
\     !!A B C. [| leadsTo acts A B; P A B; leadsTo acts B C; P B C |] \
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   131
\              ==> P A C; \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   132
\     !!B S. ALL A:S. leadsTo acts A B & P A B ==> P (Union S) B \
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   133
\  |] ==> P za zb";
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5111
diff changeset
   134
by (rtac (major RS leadsto.induct) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   135
by (REPEAT (blast_tac (claset() addIs prems) 1));
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   136
qed "leadsTo_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   137
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   138
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   139
Goal "[| A<=B;  Id: acts |] ==> leadsTo acts A B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   140
by (rtac leadsTo_Basis 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   141
by (rewrite_goals_tac [ensures_def, constrains_def, transient_def]);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   142
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   143
qed "subset_imp_leadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   144
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   145
bind_thm ("empty_leadsTo", empty_subsetI RS subset_imp_leadsTo);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   146
Addsimps [empty_leadsTo];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   147
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   148
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   149
(*There's a direct proof by leadsTo_Trans and subset_imp_leadsTo, but it
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   150
  needs the extra premise Id:acts*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   151
Goal "leadsTo acts A A' ==> A'<=B' --> leadsTo acts A B'";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   152
by (etac leadsTo_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   153
by (Clarify_tac 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   154
by (blast_tac (claset() addIs [leadsTo_Union]) 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   155
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   156
by (blast_tac (claset() addIs [leadsTo_Basis, ensures_weaken_R]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   157
qed_spec_mp "leadsTo_weaken_R";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   158
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   159
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   160
Goal "[| leadsTo acts A A'; B<=A; Id: acts |] ==>  \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   161
\         leadsTo acts B A'";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   162
by (blast_tac (claset() addIs [leadsTo_Basis, leadsTo_Trans, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   163
			       subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   164
qed_spec_mp "leadsTo_weaken_L";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   165
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   166
(*Distributes over binary unions*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   167
Goal "Id: acts ==> \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   168
\       leadsTo acts (A Un B) C  =  (leadsTo acts A C & leadsTo acts B C)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   169
by (blast_tac (claset() addIs [leadsTo_Un, leadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   170
qed "leadsTo_Un_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   171
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   172
Goal "Id: acts ==> \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   173
\       leadsTo acts (UN i:I. A i) B  =  (ALL i : I. leadsTo acts (A i) B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   174
by (blast_tac (claset() addIs [leadsTo_UN, leadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   175
qed "leadsTo_UN_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   176
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   177
Goal "Id: acts ==> \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   178
\       leadsTo acts (Union S) B  =  (ALL A : S. leadsTo acts A B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   179
by (blast_tac (claset() addIs [leadsTo_Union, leadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   180
qed "leadsTo_Union_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   181
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   182
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   183
Goal "[| leadsTo acts A A'; Id: acts; B<=A; A'<=B' |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   184
\   ==> leadsTo acts B B'";
5340
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
   185
by (blast_tac (claset() addIs [leadsTo_weaken_R, leadsTo_weaken_L,
d75c03cf77b5 Misc changes
paulson
parents: 5277
diff changeset
   186
			       leadsTo_Trans]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   187
qed "leadsTo_weaken";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   188
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   189
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   190
(*Set difference: maybe combine with leadsTo_weaken_L??*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   191
Goal "[| leadsTo acts (A-B) C; leadsTo acts B C; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   192
\       ==> leadsTo acts A C";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   193
by (blast_tac (claset() addIs [leadsTo_Un, leadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   194
qed "leadsTo_Diff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   195
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   196
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   197
(** Meta or object quantifier ???
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   198
    see ball_constrains_UN in UNITY.ML***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   199
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   200
val prems = goal thy
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   201
   "(!! i. i:I ==> leadsTo acts (A i) (A' i)) \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   202
\   ==> leadsTo acts (UN i:I. A i) (UN i:I. A' i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   203
by (simp_tac (simpset() addsimps [Union_image_eq RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   204
by (blast_tac (claset() addIs [leadsTo_Union, leadsTo_weaken_R] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   205
                        addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   206
qed "leadsTo_UN_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   207
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   208
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   209
(*Version with no index set*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   210
val prems = goal thy
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   211
   "(!! i. leadsTo acts (A i) (A' i)) \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   212
\   ==> leadsTo acts (UN i. A i) (UN i. A' i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   213
by (blast_tac (claset() addIs [leadsTo_UN_UN] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   214
                        addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   215
qed "leadsTo_UN_UN_noindex";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   216
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   217
(*Version with no index set*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   218
Goal "ALL i. leadsTo acts (A i) (A' i) \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   219
\   ==> leadsTo acts (UN i. A i) (UN i. A' i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   220
by (blast_tac (claset() addIs [leadsTo_UN_UN]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   221
qed "all_leadsTo_UN_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   222
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   223
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   224
(*Binary union version*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   225
Goal "[| leadsTo acts A A'; leadsTo acts B B' |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   226
\         ==> leadsTo acts (A Un B) (A' Un B')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   227
by (blast_tac (claset() addIs [leadsTo_Un, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   228
			       leadsTo_weaken_R]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   229
qed "leadsTo_Un_Un";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   230
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   231
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   232
(** The cancellation law **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   233
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   234
Goal "[| leadsTo acts A (A' Un B); leadsTo acts B B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   235
\   ==> leadsTo acts A (A' Un B')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   236
by (blast_tac (claset() addIs [leadsTo_Un_Un, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   237
			       subset_imp_leadsTo, leadsTo_Trans]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   238
qed "leadsTo_cancel2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   239
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   240
Goal "[| leadsTo acts A (A' Un B); leadsTo acts (B-A') B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   241
\   ==> leadsTo acts A (A' Un B')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   242
by (rtac leadsTo_cancel2 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   243
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   244
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   245
qed "leadsTo_cancel_Diff2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   246
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   247
Goal "[| leadsTo acts A (B Un A'); leadsTo acts B B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   248
\   ==> leadsTo acts A (B' Un A')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   249
by (asm_full_simp_tac (simpset() addsimps [Un_commute]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   250
by (blast_tac (claset() addSIs [leadsTo_cancel2]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   251
qed "leadsTo_cancel1";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   252
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   253
Goal "[| leadsTo acts A (B Un A'); leadsTo acts (B-A') B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   254
\   ==> leadsTo acts A (B' Un A')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   255
by (rtac leadsTo_cancel1 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   256
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   257
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   258
qed "leadsTo_cancel_Diff1";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   259
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   260
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   261
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   262
(** The impossibility law **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   263
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   264
Goal "leadsTo acts A B ==> B={} --> A={}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   265
by (etac leadsTo_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   266
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   267
by (rewrite_goals_tac [ensures_def, constrains_def, transient_def]);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   268
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   269
val lemma = result() RS mp;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   270
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   271
Goal "leadsTo acts A {} ==> A={}";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   272
by (blast_tac (claset() addSIs [lemma]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   273
qed "leadsTo_empty";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   274
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   275
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   276
(** PSP: Progress-Safety-Progress **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   277
5640
4a59d99b5ca3 new theorems
paulson
parents: 5620
diff changeset
   278
(*Special case of PSP: Misra's "stable conjunction"*)
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   279
Goalw [stable_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   280
   "[| leadsTo acts A A'; stable acts B |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   281
\   ==> leadsTo acts (A Int B) (A' Int B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   282
by (etac leadsTo_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   283
by (simp_tac (simpset() addsimps [Int_Union_Union]) 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   284
by (blast_tac (claset() addIs [leadsTo_Union]) 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   285
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   286
by (rtac leadsTo_Basis 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   287
by (asm_full_simp_tac
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   288
    (simpset() addsimps [ensures_def, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   289
			 Diff_Int_distrib2 RS sym, Int_Un_distrib2 RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   290
by (blast_tac (claset() addIs [transient_strengthen, constrains_Int]) 1);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   291
qed "psp_stable";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   292
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   293
Goal "[| leadsTo acts A A'; stable acts B |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   294
\   ==> leadsTo acts (B Int A) (B Int A')";
5536
130f3d891fb2 tidying and deleting needless parentheses
paulson
parents: 5521
diff changeset
   295
by (asm_simp_tac (simpset() addsimps psp_stable::Int_ac) 1);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   296
qed "psp_stable2";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   297
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   298
Goalw [ensures_def, constrains_def]
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   299
   "[| ensures acts A A'; constrains acts B B' |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   300
\   ==> ensures acts (A Int B) ((A' Int B) Un (B' - B))";
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   301
by (blast_tac (claset() addIs [transient_strengthen]) 1);
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   302
qed "psp_ensures";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   303
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   304
Goal "[| leadsTo acts A A'; constrains acts B B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   305
\           ==> leadsTo acts (A Int B) ((A' Int B) Un (B' - B))";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   306
by (etac leadsTo_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   307
by (simp_tac (simpset() addsimps [Int_Union_Union]) 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   308
by (blast_tac (claset() addIs [leadsTo_Union]) 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   309
(*Transitivity case has a delicate argument involving "cancellation"*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   310
by (rtac leadsTo_Un_duplicate2 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   311
by (etac leadsTo_cancel_Diff1 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   312
by (assume_tac 3);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   313
by (asm_full_simp_tac (simpset() addsimps [Int_Diff, Diff_triv]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   314
(*Basis case*)
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   315
by (blast_tac (claset() addIs [leadsTo_Basis, psp_ensures]) 1);
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   316
qed "psp";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   317
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   318
Goal "[| leadsTo acts A A'; constrains acts B B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   319
\   ==> leadsTo acts (B Int A) ((B Int A') Un (B' - B))";
5536
130f3d891fb2 tidying and deleting needless parentheses
paulson
parents: 5521
diff changeset
   320
by (asm_simp_tac (simpset() addsimps psp::Int_ac) 1);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   321
qed "psp2";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   322
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   323
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   324
Goalw [unless_def]
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   325
   "[| leadsTo acts A A'; unless acts B B'; Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   326
\   ==> leadsTo acts (A Int B) ((A' Int B) Un B')";
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   327
by (dtac psp 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   328
by (assume_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   329
by (asm_full_simp_tac (simpset() addsimps [Un_Diff_Diff, Int_Diff_Un]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   330
by (asm_full_simp_tac (simpset() addsimps [Diff_Int_distrib]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   331
by (etac leadsTo_Diff 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   332
by (blast_tac (claset() addIs [subset_imp_leadsTo]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   333
by Auto_tac;
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   334
qed "psp_unless";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   335
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   336
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   337
(*** Proving the induction rules ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   338
5257
c03e3ba9cbcc Indentation, comments
paulson
parents: 5253
diff changeset
   339
(** The most general rule: r is any wf relation; f is any variant function **)
c03e3ba9cbcc Indentation, comments
paulson
parents: 5253
diff changeset
   340
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   341
Goal "[| wf r;     \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   342
\        ALL m. leadsTo acts (A Int f-``{m})                     \
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   343
\                            ((A Int f-``(r^-1 ^^ {m})) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   344
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   345
\     ==> leadsTo acts (A Int f-``{m}) B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   346
by (eres_inst_tac [("a","m")] wf_induct 1);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   347
by (subgoal_tac "leadsTo acts (A Int (f -`` (r^-1 ^^ {x}))) B" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   348
by (stac vimage_eq_UN 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   349
by (asm_simp_tac (HOL_ss addsimps (UN_simps RL [sym])) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   350
by (blast_tac (claset() addIs [leadsTo_UN]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   351
by (blast_tac (claset() addIs [leadsTo_cancel1, leadsTo_Un_duplicate]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   352
val lemma = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   353
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   354
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   355
(** Meta or object quantifier ????? **)
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   356
Goal "[| wf r;     \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   357
\        ALL m. leadsTo acts (A Int f-``{m})                     \
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   358
\                            ((A Int f-``(r^-1 ^^ {m})) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   359
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   360
\     ==> leadsTo acts A B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   361
by (res_inst_tac [("t", "A")] subst 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   362
by (rtac leadsTo_UN 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   363
by (etac lemma 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   364
by (REPEAT (assume_tac 2));
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   365
by (Fast_tac 1);    (*Blast_tac: Function unknown's argument not a parameter*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   366
qed "leadsTo_wf_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   367
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   368
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   369
Goal "[| wf r;     \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   370
\        ALL m:I. leadsTo acts (A Int f-``{m})                   \
5257
c03e3ba9cbcc Indentation, comments
paulson
parents: 5253
diff changeset
   371
\                              ((A Int f-``(r^-1 ^^ {m})) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   372
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   373
\     ==> leadsTo acts A ((A - (f-``I)) Un B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   374
by (etac leadsTo_wf_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   375
by Safe_tac;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   376
by (case_tac "m:I" 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   377
by (blast_tac (claset() addIs [leadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   378
by (blast_tac (claset() addIs [subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   379
qed "bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   380
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   381
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   382
(*Alternative proof is via the lemma leadsTo acts (A Int f-``(lessThan m)) B*)
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   383
Goal "[| ALL m. leadsTo acts (A Int f-``{m})                     \
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   384
\                            ((A Int f-``(lessThan m)) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   385
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   386
\     ==> leadsTo acts A B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   387
by (rtac (wf_less_than RS leadsTo_wf_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   388
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   389
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   390
qed "lessThan_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   391
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   392
Goal "[| ALL m:(greaterThan l). leadsTo acts (A Int f-``{m})   \
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   393
\                                  ((A Int f-``(lessThan m)) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   394
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   395
\     ==> leadsTo acts A ((A Int (f-``(atMost l))) Un B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   396
by (simp_tac (HOL_ss addsimps [Diff_eq RS sym, vimage_Compl, Compl_greaterThan RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   397
by (rtac (wf_less_than RS bounded_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   398
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   399
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   400
qed "lessThan_bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   401
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   402
Goal "[| ALL m:(lessThan l). leadsTo acts (A Int f-``{m})   \
5239
2fd94efb9d64 Tidying
paulson
parents: 5232
diff changeset
   403
\                              ((A Int f-``(greaterThan m)) Un B);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   404
\        Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   405
\     ==> leadsTo acts A ((A Int (f-``(atLeast l))) Un B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   406
by (res_inst_tac [("f","f"),("f1", "%k. l - k")]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   407
    (wf_less_than RS wf_inv_image RS leadsTo_wf_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   408
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   409
by (simp_tac (simpset() addsimps [inv_image_def, Image_singleton]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   410
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   411
by (case_tac "m<l" 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   412
by (blast_tac (claset() addIs [not_leE, subset_imp_leadsTo]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   413
by (blast_tac (claset() addIs [leadsTo_weaken_R, diff_less_mono2]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   414
qed "greaterThan_bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   415
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   416
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   417
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   418
(*** wlt ****)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   419
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   420
(*Misra's property W3*)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   421
Goalw [wlt_def] "leadsTo acts (wlt acts B) B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   422
by (blast_tac (claset() addSIs [leadsTo_Union]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   423
qed "wlt_leadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   424
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   425
Goalw [wlt_def] "leadsTo acts A B ==> A <= wlt acts B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   426
by (blast_tac (claset() addSIs [leadsTo_Union]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   427
qed "leadsTo_subset";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   428
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   429
(*Misra's property W2*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   430
Goal "Id: acts ==> leadsTo acts A B = (A <= wlt acts B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   431
by (blast_tac (claset() addSIs [leadsTo_subset, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   432
				wlt_leadsTo RS leadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   433
qed "leadsTo_eq_subset_wlt";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   434
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   435
(*Misra's property W4*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   436
Goal "Id: acts ==> B <= wlt acts B";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   437
by (asm_simp_tac (simpset() addsimps [leadsTo_eq_subset_wlt RS sym,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   438
				      subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   439
qed "wlt_increasing";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   440
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   441
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   442
(*Used in the Trans case below*)
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
   443
Goalw [constrains_def]
5111
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
   444
   "[| B <= A2;  \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   445
\      constrains acts (A1 - B) (A1 Un B); \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   446
\      constrains acts (A2 - C) (A2 Un C) |] \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   447
\   ==> constrains acts (A1 Un A2 - C) (A1 Un A2 Un C)";
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5608
diff changeset
   448
by (Blast_tac 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   449
val lemma1 = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   450
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   451
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   452
(*Lemma (1,2,3) of Misra's draft book, Chapter 4, "Progress"*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   453
Goal "[| leadsTo acts A A';  Id: acts |] ==> \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   454
\      EX B. A<=B & leadsTo acts B A' & constrains acts (B-A') (B Un A')";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   455
by (etac leadsTo_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   456
(*Basis*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   457
by (blast_tac (claset() addIs [leadsTo_Basis]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   458
                        addDs [ensuresD]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   459
(*Trans*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   460
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   461
by (res_inst_tac [("x", "Ba Un Bb")] exI 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   462
by (blast_tac (claset() addIs [lemma1, leadsTo_Un_Un, leadsTo_cancel1,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   463
			       leadsTo_Un_duplicate]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   464
(*Union*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   465
by (clarify_tac (claset() addSDs [ball_conj_distrib RS iffD1,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   466
				  bchoice, ball_constrains_UN]) 1);;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   467
by (res_inst_tac [("x", "UN A:S. f A")] exI 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   468
by (blast_tac (claset() addIs [leadsTo_UN, constrains_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   469
qed "leadsTo_123";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   470
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   471
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   472
(*Misra's property W5*)
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   473
Goal "Id: acts ==> constrains acts (wlt acts B - B) (wlt acts B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   474
by (forward_tac [wlt_leadsTo RS leadsTo_123] 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   475
by (Clarify_tac 1);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   476
by (subgoal_tac "Ba = wlt acts B" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   477
by (blast_tac (claset() addDs [leadsTo_eq_subset_wlt]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   478
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   479
by (asm_full_simp_tac (simpset() addsimps [wlt_increasing, Un_absorb2]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   480
qed "wlt_constrains_wlt";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   481
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   482
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   483
(*** Completion: Binary and General Finite versions ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   484
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   485
Goal "[| leadsTo acts A A';  stable acts A';   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   486
\        leadsTo acts B B';  stable acts B';  Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   487
\   ==> leadsTo acts (A Int B) (A' Int B')";
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   488
by (subgoal_tac "stable acts (wlt acts B')" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   489
by (asm_full_simp_tac (simpset() addsimps [stable_def]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   490
by (EVERY [etac (constrains_Un RS constrains_weaken) 2,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   491
	   etac wlt_constrains_wlt 2,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   492
	   fast_tac (claset() addEs [wlt_increasing RSN (2,rev_subsetD)]) 3,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   493
	   Blast_tac 2]);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   494
by (subgoal_tac "leadsTo acts (A Int wlt acts B') (A' Int wlt acts B')" 1);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   495
by (blast_tac (claset() addIs [psp_stable]) 2);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   496
by (subgoal_tac "leadsTo acts (A' Int wlt acts B') (A' Int B')" 1);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   497
by (blast_tac (claset() addIs [wlt_leadsTo, psp_stable2]) 2);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   498
by (subgoal_tac "leadsTo acts (A Int B) (A Int wlt acts B')" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   499
by (blast_tac (claset() addIs [leadsTo_subset RS subsetD, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   500
			       subset_imp_leadsTo]) 2);
5479
5a5dfb0f0d7d fixed PROOF FAILED
paulson
parents: 5456
diff changeset
   501
by (blast_tac (claset() addIs [leadsTo_Trans]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   502
qed "stable_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   503
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   504
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   505
Goal "[| finite I;  Id: acts |]                     \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   506
\   ==> (ALL i:I. leadsTo acts (A i) (A' i)) -->  \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   507
\       (ALL i:I. stable acts (A' i)) -->         \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   508
\       leadsTo acts (INT i:I. A i) (INT i:I. A' i)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   509
by (etac finite_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   510
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   511
by (asm_simp_tac 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   512
    (simpset() addsimps [stable_completion, stable_def, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   513
			 ball_constrains_INT]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   514
qed_spec_mp "finite_stable_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   515
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   516
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   517
Goal "[| W = wlt acts (B' Un C);     \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   518
\      leadsTo acts A (A' Un C);  constrains acts A' (A' Un C);   \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   519
\      leadsTo acts B (B' Un C);  constrains acts B' (B' Un C);   \
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   520
\      Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   521
\   ==> leadsTo acts (A Int B) ((A' Int B') Un C)";
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   522
by (subgoal_tac "constrains acts (W-C) (W Un B' Un C)" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   523
by (blast_tac (claset() addIs [[asm_rl, wlt_constrains_wlt] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   524
			       MRS constrains_Un RS constrains_weaken]) 2);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   525
by (subgoal_tac "constrains acts (W-C) W" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   526
by (asm_full_simp_tac 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   527
    (simpset() addsimps [wlt_increasing, Un_assoc, Un_absorb2]) 2);
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   528
by (subgoal_tac "leadsTo acts (A Int W - C) (A' Int W Un C)" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   529
by (simp_tac (simpset() addsimps [Int_Diff]) 2);
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   530
by (blast_tac (claset() addIs [wlt_leadsTo, psp RS leadsTo_weaken_R]) 2);
5456
paulson
parents: 5340
diff changeset
   531
(** LEVEL 7 **)
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   532
by (subgoal_tac "leadsTo acts (A' Int W Un C) (A' Int B' Un C)" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   533
by (blast_tac (claset() addIs [wlt_leadsTo, leadsTo_Un_Un, 
5277
e4297d03e5d2 A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents: 5257
diff changeset
   534
                               psp2 RS leadsTo_weaken_R, 
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   535
			       subset_refl RS subset_imp_leadsTo, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   536
			       leadsTo_Un_duplicate2]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   537
by (dtac leadsTo_Diff 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   538
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   539
by (blast_tac (claset() addIs [subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   540
by (subgoal_tac "A Int B <= A Int W" 1);
5456
paulson
parents: 5340
diff changeset
   541
by (blast_tac (claset() addSDs [leadsTo_subset]
paulson
parents: 5340
diff changeset
   542
			addSIs [subset_refl RS Int_mono]) 2);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   543
by (blast_tac (claset() addIs [leadsTo_Trans, subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   544
bind_thm("completion", refl RS result());
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   545
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   546
5608
a82a038a3e7a id <-> Id
nipkow
parents: 5536
diff changeset
   547
Goal "[| finite I;  Id: acts |] \
5253
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   548
\   ==> (ALL i:I. leadsTo acts (A i) (A' i Un C)) -->  \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   549
\       (ALL i:I. constrains acts (A' i) (A' i Un C)) --> \
82a5ca6290aa New record type of programs
paulson
parents: 5239
diff changeset
   550
\       leadsTo acts (INT i:I. A i) ((INT i:I. A' i) Un C)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   551
by (etac finite_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   552
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   553
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   554
by (dtac ball_constrains_INT 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   555
by (asm_full_simp_tac (simpset() addsimps [completion]) 1); 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   556
qed "finite_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   557