src/HOL/UNITY/SubstAx.ML
author paulson
Fri, 03 Apr 1998 12:34:33 +0200
changeset 4776 1f9362e769c1
child 5069 3ea049f7979d
permissions -rw-r--r--
New UNITY theory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/SubstAx
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
open SubstAx;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    12
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
(*constrains Acts B B' ==> constrains Acts (reachable Init Acts Int B)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
                                           (reachable Init Acts Int B') *)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    15
bind_thm ("constrains_reachable",
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    16
	  rewrite_rule [stable_def] stable_reachable RS constrains_Int);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
(*** Introduction rules: Basis, Trans, Union ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    22
    "!!Acts. leadsTo Acts A B ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    23
by (blast_tac (claset() addIs [PSP_stable2, stable_reachable]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    24
qed "leadsTo_imp_LeadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    27
    "!!Acts. [| constrains Acts (reachable Init Acts Int (A - A'))   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    28
\                               (A Un A'); \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
\               transient  Acts (reachable Init Acts Int (A-A')) |]   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
\           ==> LeadsTo Init Acts A A'";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
by (rtac (stable_reachable RS stable_ensures_Int RS leadsTo_Basis) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    32
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    33
by (asm_simp_tac 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    34
    (simpset() addsimps [Int_Un_distrib RS sym, Diff_Int_distrib RS sym,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    35
			 stable_constrains_Int]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    36
qed "LeadsTo_Basis";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    37
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
    "!!Acts. [| LeadsTo Init Acts A B;  LeadsTo Init Acts B C |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
\            ==> LeadsTo Init Acts A C";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
by (blast_tac (claset() addIs [leadsTo_Trans]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    42
qed "LeadsTo_Trans";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    43
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
val prems = goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
 "(!!A. A : S ==> LeadsTo Init Acts A B) ==> LeadsTo Init Acts (Union S) B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
by (stac Int_Union 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
by (blast_tac (claset() addIs (leadsTo_UN::prems)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    48
qed "LeadsTo_Union";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    49
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    51
(*** Derived rules ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    52
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    53
goal thy "!!Acts. id: Acts ==> LeadsTo Init Acts A UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    54
by (asm_simp_tac (simpset() addsimps [LeadsTo_def, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    55
				      Int_lower1 RS subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    56
qed "LeadsTo_UNIV";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    57
Addsimps [LeadsTo_UNIV];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    59
(*Useful with cancellation, disjunction*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    60
goal thy "!!Acts. LeadsTo Init Acts A (A' Un A') ==> LeadsTo Init Acts A A'";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    61
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    62
qed "LeadsTo_Un_duplicate";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    63
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    64
goal thy "!!Acts. LeadsTo Init Acts A (A' Un C Un C) ==> LeadsTo Init Acts A (A' Un C)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    65
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    66
qed "LeadsTo_Un_duplicate2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    67
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    68
val prems = goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    69
   "(!!i. i : I ==> LeadsTo Init Acts (A i) B) \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    70
\   ==> LeadsTo Init Acts (UN i:I. A i) B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    71
by (simp_tac (simpset() addsimps [Union_image_eq RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    72
by (blast_tac (claset() addIs (LeadsTo_Union::prems)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    73
qed "LeadsTo_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    74
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    75
(*Binary union introduction rule*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    76
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    77
  "!!C. [| LeadsTo Init Acts A C; LeadsTo Init Acts B C |] ==> LeadsTo Init Acts (A Un B) C";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    78
by (stac Un_eq_Union 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    79
by (blast_tac (claset() addIs [LeadsTo_Union]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    80
qed "LeadsTo_Un";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    81
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    82
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    83
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    84
    "!!A B. [| reachable Init Acts Int A <= B;  id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    85
\           ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    86
by (blast_tac (claset() addIs [subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    87
qed "Int_subset_imp_LeadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    88
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    89
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    90
    "!!A B. [| A <= B;  id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    91
\           ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    92
by (blast_tac (claset() addIs [subset_imp_leadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    93
qed "subset_imp_LeadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    94
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    95
bind_thm ("empty_LeadsTo", empty_subsetI RS subset_imp_LeadsTo);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    96
Addsimps [empty_LeadsTo];
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    97
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    98
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    99
    "!!A B. [| reachable Init Acts Int A = {};  id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   100
\           ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   101
by (asm_simp_tac (simpset() addsimps [Int_subset_imp_LeadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   102
qed "Int_empty_LeadsTo";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   103
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   104
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   105
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   106
    "!!Acts. [| LeadsTo Init Acts A A';   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   107
\               reachable Init Acts Int A' <= B' |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   108
\            ==> LeadsTo Init Acts A B'";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   109
by (blast_tac (claset() addIs [leadsTo_weaken_R]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   110
qed_spec_mp "LeadsTo_weaken_R";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   111
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   112
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   113
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   114
    "!!Acts. [| LeadsTo Init Acts A A'; \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   115
     \               reachable Init Acts Int B <= A; id: Acts |]  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   116
\            ==> LeadsTo Init Acts B A'";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   117
by (blast_tac (claset() addIs [leadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   118
qed_spec_mp "LeadsTo_weaken_L";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   119
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   120
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   121
(*Distributes over binary unions*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   122
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   123
  "!!C. id: Acts ==> \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   124
\       LeadsTo Init Acts (A Un B) C  =  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   125
\       (LeadsTo Init Acts A C & LeadsTo Init Acts B C)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   126
by (blast_tac (claset() addIs [LeadsTo_Un, LeadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   127
qed "LeadsTo_Un_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   128
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   129
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   130
  "!!C. id: Acts ==> \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   131
\       LeadsTo Init Acts (UN i:I. A i) B  =  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   132
\       (ALL i : I. LeadsTo Init Acts (A i) B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   133
by (blast_tac (claset() addIs [LeadsTo_UN, LeadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   134
qed "LeadsTo_UN_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   135
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   136
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   137
  "!!C. id: Acts ==> \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   138
\       LeadsTo Init Acts (Union S) B  =  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   139
\       (ALL A : S. LeadsTo Init Acts A B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   140
by (blast_tac (claset() addIs [LeadsTo_Union, LeadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   141
qed "LeadsTo_Union_distrib";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   142
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   143
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   144
goal thy 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   145
   "!!Acts. [| LeadsTo Init Acts A A'; id: Acts;   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   146
\               reachable Init Acts Int B  <= A;     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   147
\               reachable Init Acts Int A' <= B' |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   148
\           ==> LeadsTo Init Acts B B'";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   149
(*PROOF FAILED: why?*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   150
by (blast_tac (claset() addIs [LeadsTo_Trans, LeadsTo_weaken_R,
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   151
			       LeadsTo_weaken_L]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   152
qed "LeadsTo_weaken";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   153
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   154
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   155
(*Set difference: maybe combine with leadsTo_weaken_L??*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   156
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   157
  "!!C. [| LeadsTo Init Acts (A-B) C; LeadsTo Init Acts B C; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   158
\       ==> LeadsTo Init Acts A C";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   159
by (blast_tac (claset() addIs [LeadsTo_Un, LeadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   160
qed "LeadsTo_Diff";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   161
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   162
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   163
(** Meta or object quantifier ???????????????????
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   164
    see ball_constrains_UN in UNITY.ML***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   165
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   166
val prems = goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   167
   "(!! i. i:I ==> LeadsTo Init Acts (A i) (A' i)) \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   168
\   ==> LeadsTo Init Acts (UN i:I. A i) (UN i:I. A' i)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   169
by (simp_tac (simpset() addsimps [Union_image_eq RS sym]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   170
by (blast_tac (claset() addIs [LeadsTo_Union, LeadsTo_weaken_R] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   171
                        addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   172
qed "LeadsTo_UN_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   173
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   174
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   175
(*Version with no index set*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   176
val prems = goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   177
   "(!! i. LeadsTo Init Acts (A i) (A' i)) \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   178
\   ==> LeadsTo Init Acts (UN i. A i) (UN i. A' i)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   179
by (blast_tac (claset() addIs [LeadsTo_UN_UN] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   180
                        addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   181
qed "LeadsTo_UN_UN_noindex";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   182
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   183
(*Version with no index set*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   184
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   185
   "!!Acts. ALL i. LeadsTo Init Acts (A i) (A' i) \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   186
\           ==> LeadsTo Init Acts (UN i. A i) (UN i. A' i)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   187
by (blast_tac (claset() addIs [LeadsTo_UN_UN]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   188
qed "all_LeadsTo_UN_UN";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   189
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   190
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   191
(*Binary union version*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   192
goal thy "!!Acts. [| LeadsTo Init Acts A A'; LeadsTo Init Acts B B' |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   193
\                 ==> LeadsTo Init Acts (A Un B) (A' Un B')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   194
by (blast_tac (claset() addIs [LeadsTo_Un, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   195
			       LeadsTo_weaken_R]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   196
qed "LeadsTo_Un_Un";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   197
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   198
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   199
(** The cancellation law **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   200
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   201
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   202
   "!!Acts. [| LeadsTo Init Acts A (A' Un B); LeadsTo Init Acts B B'; \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   203
\              id: Acts |]    \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   204
\           ==> LeadsTo Init Acts A (A' Un B')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   205
by (blast_tac (claset() addIs [LeadsTo_Un_Un, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   206
			       subset_imp_LeadsTo, LeadsTo_Trans]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   207
qed "LeadsTo_cancel2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   208
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   209
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   210
   "!!Acts. [| LeadsTo Init Acts A (A' Un B); LeadsTo Init Acts (B-A') B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   211
\           ==> LeadsTo Init Acts A (A' Un B')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   212
by (rtac LeadsTo_cancel2 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   213
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   214
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   215
qed "LeadsTo_cancel_Diff2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   216
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   217
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   218
   "!!Acts. [| LeadsTo Init Acts A (B Un A'); LeadsTo Init Acts B B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   219
\           ==> LeadsTo Init Acts A (B' Un A')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   220
by (asm_full_simp_tac (simpset() addsimps [Un_commute]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   221
by (blast_tac (claset() addSIs [LeadsTo_cancel2]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   222
qed "LeadsTo_cancel1";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   223
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   224
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   225
   "!!Acts. [| LeadsTo Init Acts A (B Un A'); LeadsTo Init Acts (B-A') B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   226
\           ==> LeadsTo Init Acts A (B' Un A')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   227
by (rtac LeadsTo_cancel1 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   228
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   229
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   230
qed "LeadsTo_cancel_Diff1";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   231
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   232
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   233
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   234
(** The impossibility law **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   235
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   236
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   237
    "!!Acts. LeadsTo Init Acts A {} ==> reachable Init Acts Int A  = {}";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   238
by (Full_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   239
by (etac leadsTo_empty 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   240
qed "LeadsTo_empty";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   241
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   242
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   243
(** PSP: Progress-Safety-Progress **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   244
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   245
(*Special case of PSP: Misra's "stable conjunction".  Doesn't need id:Acts. *)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   246
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   247
   "!!Acts. [| LeadsTo Init Acts A A'; stable Acts B |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   248
\           ==> LeadsTo Init Acts (A Int B) (A' Int B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   249
by (asm_simp_tac (simpset() addsimps [Int_assoc RS sym, PSP_stable]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   250
qed "R_PSP_stable";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   251
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   252
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   253
   "!!Acts. [| LeadsTo Init Acts A A'; stable Acts B |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   254
\           ==> LeadsTo Init Acts (B Int A) (B Int A')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   255
by (asm_simp_tac (simpset() addsimps (R_PSP_stable::Int_ac)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   256
qed "R_PSP_stable2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   257
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   258
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   259
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   260
   "!!Acts. [| LeadsTo Init Acts A A'; constrains Acts B B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   261
\           ==> LeadsTo Init Acts (A Int B) ((A' Int B) Un (B' - B))";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   262
by (dtac PSP 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   263
by (etac constrains_reachable 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   264
by (etac leadsTo_weaken 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   265
by (ALLGOALS Blast_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   266
qed "R_PSP";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   267
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   268
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   269
   "!!Acts. [| LeadsTo Init Acts A A'; constrains Acts B B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   270
\           ==> LeadsTo Init Acts (B Int A) ((B Int A') Un (B' - B))";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   271
by (asm_simp_tac (simpset() addsimps (R_PSP::Int_ac)) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   272
qed "R_PSP2";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   273
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   274
goalw thy [unless_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   275
   "!!Acts. [| LeadsTo Init Acts A A'; unless Acts B B'; id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   276
\           ==> LeadsTo Init Acts (A Int B) ((A' Int B) Un B')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   277
by (dtac R_PSP 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   278
by (assume_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   279
by (asm_full_simp_tac (simpset() addsimps [Un_Diff_Diff, Int_Diff_Un]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   280
by (asm_full_simp_tac (simpset() addsimps [Diff_Int_distrib]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   281
by (etac LeadsTo_Diff 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   282
by (blast_tac (claset() addIs [subset_imp_LeadsTo]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   283
by Auto_tac;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   284
qed "R_PSP_unless";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   285
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   286
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   287
(*** Induction rules ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   288
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   289
(** Meta or object quantifier ????? **)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   290
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   291
   "!!Acts. [| wf r;     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   292
\              ALL m. LeadsTo Init Acts (A Int f-``{m})                     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   293
\                                       ((A Int f-``(r^-1 ^^ {m})) Un B);   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   294
\              id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   295
\           ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   296
by (etac leadsTo_wf_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   297
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   298
by (blast_tac (claset() addIs [leadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   299
qed "LeadsTo_wf_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   300
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   301
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   302
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   303
   "!!Acts. [| wf r;     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   304
\              ALL m:I. LeadsTo Init Acts (A Int f-``{m})                   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   305
\                                  ((A Int f-``(r^-1 ^^ {m})) Un B);   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   306
\              id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   307
\           ==> LeadsTo Init Acts A ((A - (f-``I)) Un B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   308
by (etac LeadsTo_wf_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   309
by Safe_tac;
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   310
by (case_tac "m:I" 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   311
by (blast_tac (claset() addIs [LeadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   312
by (blast_tac (claset() addIs [subset_imp_LeadsTo]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   313
qed "R_bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   314
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   315
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   316
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   317
   "!!Acts. [| ALL m. LeadsTo Init Acts (A Int f-``{m})                     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   318
\                                  ((A Int f-``(lessThan m)) Un B);   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   319
\              id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   320
\           ==> LeadsTo Init Acts A B";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   321
by (rtac (wf_less_than RS LeadsTo_wf_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   322
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   323
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   324
qed "R_lessThan_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   325
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   326
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   327
   "!!Acts. [| ALL m:(greaterThan l). LeadsTo Init Acts (A Int f-``{m})   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   328
\                                        ((A Int f-``(lessThan m)) Un B);   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   329
\              id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   330
\           ==> LeadsTo Init Acts A ((A Int (f-``(atMost l))) Un B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   331
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
   332
by (rtac (wf_less_than RS R_bounded_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   333
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   334
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   335
qed "R_lessThan_bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   336
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   337
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   338
   "!!Acts. [| ALL m:(lessThan l). LeadsTo Init Acts (A Int f-``{m})   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   339
\                                    ((A Int f-``(greaterThan m)) Un B);   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   340
\              id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   341
\           ==> LeadsTo Init Acts A ((A Int (f-``(atLeast l))) Un B)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   342
by (res_inst_tac [("f","f"),("f1", "%k. l - k")]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   343
    (wf_less_than RS wf_inv_image RS LeadsTo_wf_induct) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   344
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   345
by (simp_tac (simpset() addsimps [inv_image_def, Image_singleton]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   346
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   347
by (case_tac "m<l" 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   348
by (blast_tac (claset() addIs [not_leE, subset_imp_LeadsTo]) 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   349
by (blast_tac (claset() addIs [LeadsTo_weaken_R, diff_less_mono2]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   350
qed "R_greaterThan_bounded_induct";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   351
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   352
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   353
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   354
(*** Completion: Binary and General Finite versions ***)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   355
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   356
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   357
   "!!Acts. [| LeadsTo Init Acts A A';  stable Acts A';   \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   358
\              LeadsTo Init Acts B B';  stable Acts B';  id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   359
\           ==> LeadsTo Init Acts (A Int B) (A' Int B')";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   360
by (blast_tac (claset() addIs [stable_completion RS leadsTo_weaken] 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   361
                        addSIs [stable_Int, stable_reachable]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   362
qed "R_stable_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   363
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   364
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   365
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   366
   "!!Acts. [| finite I;  id: Acts |]                     \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   367
\           ==> (ALL i:I. LeadsTo Init Acts (A i) (A' i)) -->  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   368
\               (ALL i:I. stable Acts (A' i)) -->         \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   369
\               LeadsTo Init Acts (INT i:I. A i) (INT i:I. A' i)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   370
by (etac finite_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   371
by (Asm_simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   372
by (asm_simp_tac 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   373
    (simpset() addsimps [R_stable_completion, stable_def, 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   374
			 ball_constrains_INT]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   375
qed_spec_mp "R_finite_stable_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   376
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   377
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   378
goalw thy [LeadsTo_def]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   379
 "!!Acts. [| LeadsTo Init Acts A (A' Un C);  constrains Acts A' (A' Un C); \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   380
\            LeadsTo Init Acts B (B' Un C);  constrains Acts B' (B' Un C); \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   381
\            id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   382
\         ==> LeadsTo Init Acts (A Int B) ((A' Int B') Un C)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   383
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   384
by (full_simp_tac (simpset() addsimps [Int_Un_distrib]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   385
by (dtac completion 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   386
by (assume_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   387
by (ALLGOALS 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   388
    (asm_simp_tac 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   389
     (simpset() addsimps [constrains_reachable, Int_Un_distrib RS sym])));
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   390
by (blast_tac (claset() addIs [leadsTo_weaken]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   391
qed "R_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   392
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   393
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   394
goal thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   395
   "!!Acts. [| finite I;  id: Acts |] \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   396
\           ==> (ALL i:I. LeadsTo Init Acts (A i) (A' i Un C)) -->  \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   397
\               (ALL i:I. constrains Acts (A' i) (A' i Un C)) --> \
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   398
\               LeadsTo Init Acts (INT i:I. A i) ((INT i:I. A' i) Un C)";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   399
by (etac finite_induct 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   400
by (ALLGOALS Asm_simp_tac);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   401
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   402
by (dtac ball_constrains_INT 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   403
by (asm_full_simp_tac (simpset() addsimps [R_completion]) 1); 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   404
qed "R_finite_completion";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   405