src/HOL/UNITY/UNITY_tactics.ML
author paulson
Thu Jan 30 18:08:09 2003 +0100 (2003-01-30)
changeset 13797 baefae13ad37
parent 13796 19f50fa807ae
child 13798 4c1a53627500
permissions -rw-r--r--
conversion of UNITY theories to new-style
     1 (*  Title:      HOL/UNITY/UNITY_tactics.ML
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   2003  University of Cambridge
     5 
     6 Specialized UNITY tactics, and ML bindings of theorems
     7 *)
     8 
     9 (*UNITY*)
    10 val constrains_def = thm "constrains_def";
    11 val stable_def = thm "stable_def";
    12 val invariant_def = thm "invariant_def";
    13 val increasing_def = thm "increasing_def";
    14 val Allowed_def = thm "Allowed_def";
    15 val Id_in_Acts = thm "Id_in_Acts";
    16 val insert_Id_Acts = thm "insert_Id_Acts";
    17 val Id_in_AllowedActs = thm "Id_in_AllowedActs";
    18 val insert_Id_AllowedActs = thm "insert_Id_AllowedActs";
    19 val Init_eq = thm "Init_eq";
    20 val Acts_eq = thm "Acts_eq";
    21 val AllowedActs_eq = thm "AllowedActs_eq";
    22 val surjective_mk_program = thm "surjective_mk_program";
    23 val program_equalityI = thm "program_equalityI";
    24 val program_equalityE = thm "program_equalityE";
    25 val program_equality_iff = thm "program_equality_iff";
    26 val def_prg_Init = thm "def_prg_Init";
    27 val def_prg_Acts = thm "def_prg_Acts";
    28 val def_prg_AllowedActs = thm "def_prg_AllowedActs";
    29 val def_prg_simps = thm "def_prg_simps";
    30 val def_act_simp = thm "def_act_simp";
    31 val def_set_simp = thm "def_set_simp";
    32 val constrainsI = thm "constrainsI";
    33 val constrainsD = thm "constrainsD";
    34 val constrains_empty = thm "constrains_empty";
    35 val constrains_empty2 = thm "constrains_empty2";
    36 val constrains_UNIV = thm "constrains_UNIV";
    37 val constrains_UNIV2 = thm "constrains_UNIV2";
    38 val constrains_weaken_R = thm "constrains_weaken_R";
    39 val constrains_weaken_L = thm "constrains_weaken_L";
    40 val constrains_weaken = thm "constrains_weaken";
    41 val constrains_Un = thm "constrains_Un";
    42 val constrains_UN = thm "constrains_UN";
    43 val constrains_Un_distrib = thm "constrains_Un_distrib";
    44 val constrains_UN_distrib = thm "constrains_UN_distrib";
    45 val constrains_Int_distrib = thm "constrains_Int_distrib";
    46 val constrains_INT_distrib = thm "constrains_INT_distrib";
    47 val constrains_Int = thm "constrains_Int";
    48 val constrains_INT = thm "constrains_INT";
    49 val constrains_imp_subset = thm "constrains_imp_subset";
    50 val constrains_trans = thm "constrains_trans";
    51 val constrains_cancel = thm "constrains_cancel";
    52 val unlessI = thm "unlessI";
    53 val unlessD = thm "unlessD";
    54 val stableI = thm "stableI";
    55 val stableD = thm "stableD";
    56 val stable_UNIV = thm "stable_UNIV";
    57 val stable_Un = thm "stable_Un";
    58 val stable_UN = thm "stable_UN";
    59 val stable_Int = thm "stable_Int";
    60 val stable_INT = thm "stable_INT";
    61 val stable_constrains_Un = thm "stable_constrains_Un";
    62 val stable_constrains_Int = thm "stable_constrains_Int";
    63 val stable_constrains_stable = thm "stable_constrains_stable";
    64 val invariantI = thm "invariantI";
    65 val invariant_Int = thm "invariant_Int";
    66 val increasingD = thm "increasingD";
    67 val increasing_constant = thm "increasing_constant";
    68 val mono_increasing_o = thm "mono_increasing_o";
    69 val strict_increasingD = thm "strict_increasingD";
    70 val elimination = thm "elimination";
    71 val elimination_sing = thm "elimination_sing";
    72 val constrains_strongest_rhs = thm "constrains_strongest_rhs";
    73 val strongest_rhs_is_strongest = thm "strongest_rhs_is_strongest";
    74 val Un_Diff_Diff = thm "Un_Diff_Diff";
    75 val Int_Union_Union = thm "Int_Union_Union";
    76 val Image_less_than = thm "Image_less_than";
    77 val Image_inverse_less_than = thm "Image_inverse_less_than";
    78 
    79 (*WFair*)
    80 val stable_transient_empty = thm "stable_transient_empty";
    81 val transient_strengthen = thm "transient_strengthen";
    82 val transientI = thm "transientI";
    83 val transientE = thm "transientE";
    84 val transient_UNIV = thm "transient_UNIV";
    85 val transient_empty = thm "transient_empty";
    86 val ensuresI = thm "ensuresI";
    87 val ensuresD = thm "ensuresD";
    88 val ensures_weaken_R = thm "ensures_weaken_R";
    89 val stable_ensures_Int = thm "stable_ensures_Int";
    90 val stable_transient_ensures = thm "stable_transient_ensures";
    91 val ensures_eq = thm "ensures_eq";
    92 val leadsTo_Basis = thm "leadsTo_Basis";
    93 val leadsTo_Trans = thm "leadsTo_Trans";
    94 val transient_imp_leadsTo = thm "transient_imp_leadsTo";
    95 val leadsTo_Un_duplicate = thm "leadsTo_Un_duplicate";
    96 val leadsTo_Un_duplicate2 = thm "leadsTo_Un_duplicate2";
    97 val leadsTo_Union = thm "leadsTo_Union";
    98 val leadsTo_Union_Int = thm "leadsTo_Union_Int";
    99 val leadsTo_UN = thm "leadsTo_UN";
   100 val leadsTo_Un = thm "leadsTo_Un";
   101 val single_leadsTo_I = thm "single_leadsTo_I";
   102 val leadsTo_induct = thm "leadsTo_induct";
   103 val subset_imp_ensures = thm "subset_imp_ensures";
   104 val subset_imp_leadsTo = thm "subset_imp_leadsTo";
   105 val leadsTo_refl = thm "leadsTo_refl";
   106 val empty_leadsTo = thm "empty_leadsTo";
   107 val leadsTo_UNIV = thm "leadsTo_UNIV";
   108 val leadsTo_induct_pre_lemma = thm "leadsTo_induct_pre_lemma";
   109 val leadsTo_induct_pre = thm "leadsTo_induct_pre";
   110 val leadsTo_weaken_R = thm "leadsTo_weaken_R";
   111 val leadsTo_weaken_L = thm "leadsTo_weaken_L";
   112 val leadsTo_Un_distrib = thm "leadsTo_Un_distrib";
   113 val leadsTo_UN_distrib = thm "leadsTo_UN_distrib";
   114 val leadsTo_Union_distrib = thm "leadsTo_Union_distrib";
   115 val leadsTo_weaken = thm "leadsTo_weaken";
   116 val leadsTo_Diff = thm "leadsTo_Diff";
   117 val leadsTo_UN_UN = thm "leadsTo_UN_UN";
   118 val leadsTo_Un_Un = thm "leadsTo_Un_Un";
   119 val leadsTo_cancel2 = thm "leadsTo_cancel2";
   120 val leadsTo_cancel_Diff2 = thm "leadsTo_cancel_Diff2";
   121 val leadsTo_cancel1 = thm "leadsTo_cancel1";
   122 val leadsTo_cancel_Diff1 = thm "leadsTo_cancel_Diff1";
   123 val leadsTo_empty = thm "leadsTo_empty";
   124 val psp_stable = thm "psp_stable";
   125 val psp_stable2 = thm "psp_stable2";
   126 val psp_ensures = thm "psp_ensures";
   127 val psp = thm "psp";
   128 val psp2 = thm "psp2";
   129 val psp_unless = thm "psp_unless";
   130 val leadsTo_wf_induct_lemma = thm "leadsTo_wf_induct_lemma";
   131 val leadsTo_wf_induct = thm "leadsTo_wf_induct";
   132 val bounded_induct = thm "bounded_induct";
   133 val lessThan_induct = thm "lessThan_induct";
   134 val lessThan_bounded_induct = thm "lessThan_bounded_induct";
   135 val greaterThan_bounded_induct = thm "greaterThan_bounded_induct";
   136 val wlt_leadsTo = thm "wlt_leadsTo";
   137 val leadsTo_subset = thm "leadsTo_subset";
   138 val leadsTo_eq_subset_wlt = thm "leadsTo_eq_subset_wlt";
   139 val wlt_increasing = thm "wlt_increasing";
   140 val lemma1 = thm "lemma1";
   141 val leadsTo_123 = thm "leadsTo_123";
   142 val wlt_constrains_wlt = thm "wlt_constrains_wlt";
   143 val completion_lemma = thm "completion_lemma";
   144 val completion = thm "completion";
   145 val finite_completion_lemma = thm "finite_completion_lemma";
   146 val finite_completion = thm "finite_completion";
   147 val stable_completion = thm "stable_completion";
   148 val finite_stable_completion = thm "finite_stable_completion";
   149 
   150 (*Constrains*)
   151 val Increasing_def = thm "Increasing_def";
   152 val reachable_Init = thm "reachable.Init";
   153 val reachable_Acts = thm "reachable.Acts";
   154 val reachable_equiv_traces = thm "reachable_equiv_traces";
   155 val Init_subset_reachable = thm "Init_subset_reachable";
   156 val stable_reachable = thm "stable_reachable";
   157 val invariant_reachable = thm "invariant_reachable";
   158 val invariant_includes_reachable = thm "invariant_includes_reachable";
   159 val constrains_reachable_Int = thm "constrains_reachable_Int";
   160 val Constrains_eq_constrains = thm "Constrains_eq_constrains";
   161 val constrains_imp_Constrains = thm "constrains_imp_Constrains";
   162 val stable_imp_Stable = thm "stable_imp_Stable";
   163 val ConstrainsI = thm "ConstrainsI";
   164 val Constrains_empty = thm "Constrains_empty";
   165 val Constrains_UNIV = thm "Constrains_UNIV";
   166 val Constrains_weaken_R = thm "Constrains_weaken_R";
   167 val Constrains_weaken_L = thm "Constrains_weaken_L";
   168 val Constrains_weaken = thm "Constrains_weaken";
   169 val Constrains_Un = thm "Constrains_Un";
   170 val Constrains_UN = thm "Constrains_UN";
   171 val Constrains_Int = thm "Constrains_Int";
   172 val Constrains_INT = thm "Constrains_INT";
   173 val Constrains_imp_subset = thm "Constrains_imp_subset";
   174 val Constrains_trans = thm "Constrains_trans";
   175 val Constrains_cancel = thm "Constrains_cancel";
   176 val Stable_eq = thm "Stable_eq";
   177 val Stable_eq_stable = thm "Stable_eq_stable";
   178 val StableI = thm "StableI";
   179 val StableD = thm "StableD";
   180 val Stable_Un = thm "Stable_Un";
   181 val Stable_Int = thm "Stable_Int";
   182 val Stable_Constrains_Un = thm "Stable_Constrains_Un";
   183 val Stable_Constrains_Int = thm "Stable_Constrains_Int";
   184 val Stable_UN = thm "Stable_UN";
   185 val Stable_INT = thm "Stable_INT";
   186 val Stable_reachable = thm "Stable_reachable";
   187 val IncreasingD = thm "IncreasingD";
   188 val mono_Increasing_o = thm "mono_Increasing_o";
   189 val strict_IncreasingD = thm "strict_IncreasingD";
   190 val increasing_imp_Increasing = thm "increasing_imp_Increasing";
   191 val Increasing_constant = thm "Increasing_constant";
   192 val Elimination = thm "Elimination";
   193 val Elimination_sing = thm "Elimination_sing";
   194 val AlwaysI = thm "AlwaysI";
   195 val AlwaysD = thm "AlwaysD";
   196 val AlwaysE = thm "AlwaysE";
   197 val Always_imp_Stable = thm "Always_imp_Stable";
   198 val Always_includes_reachable = thm "Always_includes_reachable";
   199 val invariant_imp_Always = thm "invariant_imp_Always";
   200 val Always_reachable = thm "Always_reachable";
   201 val Always_eq_invariant_reachable = thm "Always_eq_invariant_reachable";
   202 val Always_eq_includes_reachable = thm "Always_eq_includes_reachable";
   203 val Always_UNIV_eq = thm "Always_UNIV_eq";
   204 val UNIV_AlwaysI = thm "UNIV_AlwaysI";
   205 val Always_eq_UN_invariant = thm "Always_eq_UN_invariant";
   206 val Always_weaken = thm "Always_weaken";
   207 val Always_Constrains_pre = thm "Always_Constrains_pre";
   208 val Always_Constrains_post = thm "Always_Constrains_post";
   209 val Always_ConstrainsI = thm "Always_ConstrainsI";
   210 val Always_ConstrainsD = thm "Always_ConstrainsD";
   211 val Always_Constrains_weaken = thm "Always_Constrains_weaken";
   212 val Always_Int_distrib = thm "Always_Int_distrib";
   213 val Always_INT_distrib = thm "Always_INT_distrib";
   214 val Always_Int_I = thm "Always_Int_I";
   215 val Always_Compl_Un_eq = thm "Always_Compl_Un_eq";
   216 val Always_thin = thm "Always_thin";
   217 
   218 (*FP*)
   219 val stable_FP_Orig_Int = thm "stable_FP_Orig_Int";
   220 val FP_Orig_weakest = thm "FP_Orig_weakest";
   221 val stable_FP_Int = thm "stable_FP_Int";
   222 val FP_equivalence = thm "FP_equivalence";
   223 val FP_weakest = thm "FP_weakest";
   224 val Compl_FP = thm "Compl_FP";
   225 val Diff_FP = thm "Diff_FP";
   226 
   227 (*SubstAx*)
   228 val LeadsTo_eq_leadsTo = thm "LeadsTo_eq_leadsTo";
   229 val Always_LeadsTo_pre = thm "Always_LeadsTo_pre";
   230 val Always_LeadsTo_post = thm "Always_LeadsTo_post";
   231 val Always_LeadsToI = thm "Always_LeadsToI";
   232 val Always_LeadsToD = thm "Always_LeadsToD";
   233 val leadsTo_imp_LeadsTo = thm "leadsTo_imp_LeadsTo";
   234 val LeadsTo_Trans = thm "LeadsTo_Trans";
   235 val LeadsTo_Union = thm "LeadsTo_Union";
   236 val LeadsTo_UNIV = thm "LeadsTo_UNIV";
   237 val LeadsTo_Un_duplicate = thm "LeadsTo_Un_duplicate";
   238 val LeadsTo_Un_duplicate2 = thm "LeadsTo_Un_duplicate2";
   239 val LeadsTo_UN = thm "LeadsTo_UN";
   240 val LeadsTo_Un = thm "LeadsTo_Un";
   241 val single_LeadsTo_I = thm "single_LeadsTo_I";
   242 val subset_imp_LeadsTo = thm "subset_imp_LeadsTo";
   243 val empty_LeadsTo = thm "empty_LeadsTo";
   244 val LeadsTo_weaken_R = thm "LeadsTo_weaken_R";
   245 val LeadsTo_weaken_L = thm "LeadsTo_weaken_L";
   246 val LeadsTo_weaken = thm "LeadsTo_weaken";
   247 val Always_LeadsTo_weaken = thm "Always_LeadsTo_weaken";
   248 val LeadsTo_Un_post = thm "LeadsTo_Un_post";
   249 val LeadsTo_Trans_Un = thm "LeadsTo_Trans_Un";
   250 val LeadsTo_Un_distrib = thm "LeadsTo_Un_distrib";
   251 val LeadsTo_UN_distrib = thm "LeadsTo_UN_distrib";
   252 val LeadsTo_Union_distrib = thm "LeadsTo_Union_distrib";
   253 val LeadsTo_Basis = thm "LeadsTo_Basis";
   254 val EnsuresI = thm "EnsuresI";
   255 val Always_LeadsTo_Basis = thm "Always_LeadsTo_Basis";
   256 val LeadsTo_Diff = thm "LeadsTo_Diff";
   257 val LeadsTo_UN_UN = thm "LeadsTo_UN_UN";
   258 val LeadsTo_UN_UN_noindex = thm "LeadsTo_UN_UN_noindex";
   259 val all_LeadsTo_UN_UN = thm "all_LeadsTo_UN_UN";
   260 val LeadsTo_Un_Un = thm "LeadsTo_Un_Un";
   261 val LeadsTo_cancel2 = thm "LeadsTo_cancel2";
   262 val LeadsTo_cancel_Diff2 = thm "LeadsTo_cancel_Diff2";
   263 val LeadsTo_cancel1 = thm "LeadsTo_cancel1";
   264 val LeadsTo_cancel_Diff1 = thm "LeadsTo_cancel_Diff1";
   265 val LeadsTo_empty = thm "LeadsTo_empty";
   266 val PSP_Stable = thm "PSP_Stable";
   267 val PSP_Stable2 = thm "PSP_Stable2";
   268 val PSP = thm "PSP";
   269 val PSP2 = thm "PSP2";
   270 val PSP_Unless = thm "PSP_Unless";
   271 val Stable_transient_Always_LeadsTo = thm "Stable_transient_Always_LeadsTo";
   272 val LeadsTo_wf_induct = thm "LeadsTo_wf_induct";
   273 val Bounded_induct = thm "Bounded_induct";
   274 val LessThan_induct = thm "LessThan_induct";
   275 val integ_0_le_induct = thm "integ_0_le_induct";
   276 val LessThan_bounded_induct = thm "LessThan_bounded_induct";
   277 val GreaterThan_bounded_induct = thm "GreaterThan_bounded_induct";
   278 val Completion = thm "Completion";
   279 val Finite_completion_lemma = thm "Finite_completion_lemma";
   280 val Finite_completion = thm "Finite_completion";
   281 val Stable_completion = thm "Stable_completion";
   282 val Finite_stable_completion = thm "Finite_stable_completion";
   283 
   284 (*Union*)
   285 val Init_SKIP = thm "Init_SKIP";
   286 val Acts_SKIP = thm "Acts_SKIP";
   287 val AllowedActs_SKIP = thm "AllowedActs_SKIP";
   288 val reachable_SKIP = thm "reachable_SKIP";
   289 val SKIP_in_constrains_iff = thm "SKIP_in_constrains_iff";
   290 val SKIP_in_Constrains_iff = thm "SKIP_in_Constrains_iff";
   291 val SKIP_in_stable = thm "SKIP_in_stable";
   292 val Init_Join = thm "Init_Join";
   293 val Acts_Join = thm "Acts_Join";
   294 val AllowedActs_Join = thm "AllowedActs_Join";
   295 val JN_empty = thm "JN_empty";
   296 val JN_insert = thm "JN_insert";
   297 val Init_JN = thm "Init_JN";
   298 val Acts_JN = thm "Acts_JN";
   299 val AllowedActs_JN = thm "AllowedActs_JN";
   300 val JN_cong = thm "JN_cong";
   301 val Join_commute = thm "Join_commute";
   302 val Join_assoc = thm "Join_assoc";
   303 val Join_left_commute = thm "Join_left_commute";
   304 val Join_SKIP_left = thm "Join_SKIP_left";
   305 val Join_SKIP_right = thm "Join_SKIP_right";
   306 val Join_absorb = thm "Join_absorb";
   307 val Join_left_absorb = thm "Join_left_absorb";
   308 val Join_ac = thms "Join_ac";
   309 val JN_absorb = thm "JN_absorb";
   310 val JN_Un = thm "JN_Un";
   311 val JN_constant = thm "JN_constant";
   312 val JN_Join_distrib = thm "JN_Join_distrib";
   313 val JN_Join_miniscope = thm "JN_Join_miniscope";
   314 val JN_Join_diff = thm "JN_Join_diff";
   315 val JN_constrains = thm "JN_constrains";
   316 val Join_constrains = thm "Join_constrains";
   317 val Join_unless = thm "Join_unless";
   318 val Join_constrains_weaken = thm "Join_constrains_weaken";
   319 val JN_constrains_weaken = thm "JN_constrains_weaken";
   320 val JN_stable = thm "JN_stable";
   321 val invariant_JN_I = thm "invariant_JN_I";
   322 val Join_stable = thm "Join_stable";
   323 val Join_increasing = thm "Join_increasing";
   324 val invariant_JoinI = thm "invariant_JoinI";
   325 val FP_JN = thm "FP_JN";
   326 val JN_transient = thm "JN_transient";
   327 val Join_transient = thm "Join_transient";
   328 val Join_transient_I1 = thm "Join_transient_I1";
   329 val Join_transient_I2 = thm "Join_transient_I2";
   330 val JN_ensures = thm "JN_ensures";
   331 val Join_ensures = thm "Join_ensures";
   332 val stable_Join_constrains = thm "stable_Join_constrains";
   333 val stable_Join_Always1 = thm "stable_Join_Always1";
   334 val stable_Join_Always2 = thm "stable_Join_Always2";
   335 val stable_Join_ensures1 = thm "stable_Join_ensures1";
   336 val stable_Join_ensures2 = thm "stable_Join_ensures2";
   337 val ok_SKIP1 = thm "ok_SKIP1";
   338 val ok_SKIP2 = thm "ok_SKIP2";
   339 val ok_Join_commute = thm "ok_Join_commute";
   340 val ok_commute = thm "ok_commute";
   341 val ok_sym = thm "ok_sym";
   342 val ok_iff_OK = thm "ok_iff_OK";
   343 val ok_Join_iff1 = thm "ok_Join_iff1";
   344 val ok_Join_iff2 = thm "ok_Join_iff2";
   345 val ok_Join_commute_I = thm "ok_Join_commute_I";
   346 val ok_JN_iff1 = thm "ok_JN_iff1";
   347 val ok_JN_iff2 = thm "ok_JN_iff2";
   348 val OK_iff_ok = thm "OK_iff_ok";
   349 val OK_imp_ok = thm "OK_imp_ok";
   350 val Allowed_SKIP = thm "Allowed_SKIP";
   351 val Allowed_Join = thm "Allowed_Join";
   352 val Allowed_JN = thm "Allowed_JN";
   353 val ok_iff_Allowed = thm "ok_iff_Allowed";
   354 val OK_iff_Allowed = thm "OK_iff_Allowed";
   355 val safety_prop_Acts_iff = thm "safety_prop_Acts_iff";
   356 val safety_prop_AllowedActs_iff_Allowed = thm "safety_prop_AllowedActs_iff_Allowed";
   357 val Allowed_eq = thm "Allowed_eq";
   358 val def_prg_Allowed = thm "def_prg_Allowed";
   359 val safety_prop_constrains = thm "safety_prop_constrains";
   360 val safety_prop_stable = thm "safety_prop_stable";
   361 val safety_prop_Int = thm "safety_prop_Int";
   362 val safety_prop_INTER1 = thm "safety_prop_INTER1";
   363 val safety_prop_INTER = thm "safety_prop_INTER";
   364 val def_UNION_ok_iff = thm "def_UNION_ok_iff";
   365 
   366 (*Comp*)
   367 val preserves_def = thm "preserves_def";
   368 val funPair_def = thm "funPair_def";
   369 val componentI = thm "componentI";
   370 val component_eq_subset = thm "component_eq_subset";
   371 val component_SKIP = thm "component_SKIP";
   372 val component_refl = thm "component_refl";
   373 val SKIP_minimal = thm "SKIP_minimal";
   374 val component_Join1 = thm "component_Join1";
   375 val component_Join2 = thm "component_Join2";
   376 val Join_absorb1 = thm "Join_absorb1";
   377 val Join_absorb2 = thm "Join_absorb2";
   378 val JN_component_iff = thm "JN_component_iff";
   379 val component_JN = thm "component_JN";
   380 val component_trans = thm "component_trans";
   381 val component_antisym = thm "component_antisym";
   382 val Join_component_iff = thm "Join_component_iff";
   383 val component_constrains = thm "component_constrains";
   384 val program_less_le = thm "program_less_le";
   385 val preservesI = thm "preservesI";
   386 val preserves_imp_eq = thm "preserves_imp_eq";
   387 val Join_preserves = thm "Join_preserves";
   388 val JN_preserves = thm "JN_preserves";
   389 val SKIP_preserves = thm "SKIP_preserves";
   390 val funPair_apply = thm "funPair_apply";
   391 val preserves_funPair = thm "preserves_funPair";
   392 val funPair_o_distrib = thm "funPair_o_distrib";
   393 val fst_o_funPair = thm "fst_o_funPair";
   394 val snd_o_funPair = thm "snd_o_funPair";
   395 val subset_preserves_o = thm "subset_preserves_o";
   396 val preserves_subset_stable = thm "preserves_subset_stable";
   397 val preserves_subset_increasing = thm "preserves_subset_increasing";
   398 val preserves_id_subset_stable = thm "preserves_id_subset_stable";
   399 val safety_prop_preserves = thm "safety_prop_preserves";
   400 val stable_localTo_stable2 = thm "stable_localTo_stable2";
   401 val Increasing_preserves_Stable = thm "Increasing_preserves_Stable";
   402 val component_of_imp_component = thm "component_of_imp_component";
   403 val component_of_refl = thm "component_of_refl";
   404 val component_of_SKIP = thm "component_of_SKIP";
   405 val component_of_trans = thm "component_of_trans";
   406 val strict_component_of_eq = thm "strict_component_of_eq";
   407 val localize_Init_eq = thm "localize_Init_eq";
   408 val localize_Acts_eq = thm "localize_Acts_eq";
   409 val localize_AllowedActs_eq = thm "localize_AllowedActs_eq";
   410 
   411 (*Guar*)
   412 val guar_def = thm "guar_def";
   413 val OK_insert_iff = thm "OK_insert_iff";
   414 val ex1 = thm "ex1";
   415 val ex2 = thm "ex2";
   416 val ex_prop_finite = thm "ex_prop_finite";
   417 val ex_prop_equiv = thm "ex_prop_equiv";
   418 val uv1 = thm "uv1";
   419 val uv2 = thm "uv2";
   420 val uv_prop_finite = thm "uv_prop_finite";
   421 val guaranteesI = thm "guaranteesI";
   422 val guaranteesD = thm "guaranteesD";
   423 val component_guaranteesD = thm "component_guaranteesD";
   424 val guarantees_weaken = thm "guarantees_weaken";
   425 val subset_imp_guarantees_UNIV = thm "subset_imp_guarantees_UNIV";
   426 val subset_imp_guarantees = thm "subset_imp_guarantees";
   427 val ex_prop_imp = thm "ex_prop_imp";
   428 val guarantees_imp = thm "guarantees_imp";
   429 val ex_prop_equiv2 = thm "ex_prop_equiv2";
   430 val guarantees_UN_left = thm "guarantees_UN_left";
   431 val guarantees_Un_left = thm "guarantees_Un_left";
   432 val guarantees_INT_right = thm "guarantees_INT_right";
   433 val guarantees_Int_right = thm "guarantees_Int_right";
   434 val guarantees_Int_right_I = thm "guarantees_Int_right_I";
   435 val guarantees_INT_right_iff = thm "guarantees_INT_right_iff";
   436 val shunting = thm "shunting";
   437 val contrapositive = thm "contrapositive";
   438 val combining1 = thm "combining1";
   439 val combining2 = thm "combining2";
   440 val all_guarantees = thm "all_guarantees";
   441 val ex_guarantees = thm "ex_guarantees";
   442 val guarantees_Join_Int = thm "guarantees_Join_Int";
   443 val guarantees_Join_Un = thm "guarantees_Join_Un";
   444 val guarantees_JN_INT = thm "guarantees_JN_INT";
   445 val guarantees_JN_UN = thm "guarantees_JN_UN";
   446 val guarantees_Join_I1 = thm "guarantees_Join_I1";
   447 val guarantees_Join_I2 = thm "guarantees_Join_I2";
   448 val guarantees_JN_I = thm "guarantees_JN_I";
   449 val Join_welldef_D1 = thm "Join_welldef_D1";
   450 val Join_welldef_D2 = thm "Join_welldef_D2";
   451 val refines_refl = thm "refines_refl";
   452 val ex_refinement_thm = thm "ex_refinement_thm";
   453 val uv_refinement_thm = thm "uv_refinement_thm";
   454 val guarantees_equiv = thm "guarantees_equiv";
   455 val wg_weakest = thm "wg_weakest";
   456 val wg_guarantees = thm "wg_guarantees";
   457 val wg_equiv = thm "wg_equiv";
   458 val component_of_wg = thm "component_of_wg";
   459 val wg_finite = thm "wg_finite";
   460 val wg_ex_prop = thm "wg_ex_prop";
   461 val wx_subset = thm "wx_subset";
   462 val wx_ex_prop = thm "wx_ex_prop";
   463 val wx_weakest = thm "wx_weakest";
   464 val wx'_ex_prop = thm "wx'_ex_prop";
   465 val wx_equiv = thm "wx_equiv";
   466 val guarantees_wx_eq = thm "guarantees_wx_eq";
   467 val stable_guarantees_Always = thm "stable_guarantees_Always";
   468 val leadsTo_Basis = thm "leadsTo_Basis";
   469 val constrains_guarantees_leadsTo = thm "constrains_guarantees_leadsTo";
   470 
   471 (*Extend*)
   472 val Restrict_iff = thm "Restrict_iff";
   473 val Restrict_UNIV = thm "Restrict_UNIV";
   474 val Restrict_empty = thm "Restrict_empty";
   475 val Restrict_Int = thm "Restrict_Int";
   476 val Restrict_triv = thm "Restrict_triv";
   477 val Restrict_subset = thm "Restrict_subset";
   478 val Restrict_eq_mono = thm "Restrict_eq_mono";
   479 val Restrict_imageI = thm "Restrict_imageI";
   480 val Domain_Restrict = thm "Domain_Restrict";
   481 val Image_Restrict = thm "Image_Restrict";
   482 val insert_Id_image_Acts = thm "insert_Id_image_Acts";
   483 val good_mapI = thm "good_mapI";
   484 val good_map_is_surj = thm "good_map_is_surj";
   485 val fst_inv_equalityI = thm "fst_inv_equalityI";
   486 val project_set_iff = thm "project_set_iff";
   487 val extend_set_mono = thm "extend_set_mono";
   488 val extend_set_empty = thm "extend_set_empty";
   489 val project_set_Int_subset = thm "project_set_Int_subset";
   490 val Init_extend = thm "Init_extend";
   491 val Init_project = thm "Init_project";
   492 val Acts_project = thm "Acts_project";
   493 val project_set_UNIV = thm "project_set_UNIV";
   494 val project_set_Union = thm "project_set_Union";
   495 val project_act_mono = thm "project_act_mono";
   496 val project_constrains_project_set = thm "project_constrains_project_set";
   497 val project_stable_project_set = thm "project_stable_project_set";
   498 
   499 
   500 (*Rename*)
   501 val good_map_bij = thm "good_map_bij";
   502 val fst_o_inv_eq_inv = thm "fst_o_inv_eq_inv";
   503 val mem_rename_set_iff = thm "mem_rename_set_iff";
   504 val extend_set_eq_image = thm "extend_set_eq_image";
   505 val Init_rename = thm "Init_rename";
   506 val extend_set_inv = thm "extend_set_inv";
   507 val bij_extend_act_eq_project_act = thm "bij_extend_act_eq_project_act";
   508 val bij_extend_act = thm "bij_extend_act";
   509 val bij_project_act = thm "bij_project_act";
   510 val bij_inv_project_act_eq = thm "bij_inv_project_act_eq";
   511 val Acts_project = thm "Acts_project";
   512 val extend_inv = thm "extend_inv";
   513 val rename_inv_rename = thm "rename_inv_rename";
   514 val rename_rename_inv = thm "rename_rename_inv";
   515 val rename_inv_eq = thm "rename_inv_eq";
   516 val bij_extend = thm "bij_extend";
   517 val bij_project = thm "bij_project";
   518 val inv_project_eq = thm "inv_project_eq";
   519 val Allowed_rename = thm "Allowed_rename";
   520 val bij_rename = thm "bij_rename";
   521 val surj_rename = thm "surj_rename";
   522 val inj_rename_imp_inj = thm "inj_rename_imp_inj";
   523 val surj_rename_imp_surj = thm "surj_rename_imp_surj";
   524 val bij_rename_imp_bij = thm "bij_rename_imp_bij";
   525 val bij_rename_iff = thm "bij_rename_iff";
   526 val rename_SKIP = thm "rename_SKIP";
   527 val rename_Join = thm "rename_Join";
   528 val rename_JN = thm "rename_JN";
   529 val rename_constrains = thm "rename_constrains";
   530 val rename_stable = thm "rename_stable";
   531 val rename_invariant = thm "rename_invariant";
   532 val rename_increasing = thm "rename_increasing";
   533 val reachable_rename_eq = thm "reachable_rename_eq";
   534 val rename_Constrains = thm "rename_Constrains";
   535 val rename_Stable = thm "rename_Stable";
   536 val rename_Always = thm "rename_Always";
   537 val rename_Increasing = thm "rename_Increasing";
   538 val rename_transient = thm "rename_transient";
   539 val rename_ensures = thm "rename_ensures";
   540 val rename_leadsTo = thm "rename_leadsTo";
   541 val rename_LeadsTo = thm "rename_LeadsTo";
   542 val rename_rename_guarantees_eq = thm "rename_rename_guarantees_eq";
   543 val rename_guarantees_eq_rename_inv = thm "rename_guarantees_eq_rename_inv";
   544 val rename_preserves = thm "rename_preserves";
   545 val ok_rename_iff = thm "ok_rename_iff";
   546 val OK_rename_iff = thm "OK_rename_iff";
   547 val bij_eq_rename = thm "bij_eq_rename";
   548 val rename_image_constrains = thm "rename_image_constrains";
   549 val rename_image_stable = thm "rename_image_stable";
   550 val rename_image_increasing = thm "rename_image_increasing";
   551 val rename_image_invariant = thm "rename_image_invariant";
   552 val rename_image_Constrains = thm "rename_image_Constrains";
   553 val rename_image_preserves = thm "rename_image_preserves";
   554 val rename_image_Stable = thm "rename_image_Stable";
   555 val rename_image_Increasing = thm "rename_image_Increasing";
   556 val rename_image_Always = thm "rename_image_Always";
   557 val rename_image_leadsTo = thm "rename_image_leadsTo";
   558 val rename_image_LeadsTo = thm "rename_image_LeadsTo";
   559 
   560 
   561 
   562 (*Lift_prog*)
   563 val sub_def = thm "sub_def";
   564 val lift_map_def = thm "lift_map_def";
   565 val drop_map_def = thm "drop_map_def";
   566 val insert_map_inverse = thm "insert_map_inverse";
   567 val insert_map_delete_map_eq = thm "insert_map_delete_map_eq";
   568 val insert_map_inject1 = thm "insert_map_inject1";
   569 val insert_map_inject2 = thm "insert_map_inject2";
   570 val insert_map_inject = thm "insert_map_inject";
   571 val insert_map_inject = thm "insert_map_inject";
   572 val lift_map_eq_iff = thm "lift_map_eq_iff";
   573 val drop_map_lift_map_eq = thm "drop_map_lift_map_eq";
   574 val inj_lift_map = thm "inj_lift_map";
   575 val lift_map_drop_map_eq = thm "lift_map_drop_map_eq";
   576 val drop_map_inject = thm "drop_map_inject";
   577 val surj_lift_map = thm "surj_lift_map";
   578 val bij_lift_map = thm "bij_lift_map";
   579 val inv_lift_map_eq = thm "inv_lift_map_eq";
   580 val inv_drop_map_eq = thm "inv_drop_map_eq";
   581 val bij_drop_map = thm "bij_drop_map";
   582 val sub_apply = thm "sub_apply";
   583 val lift_set_empty = thm "lift_set_empty";
   584 val lift_set_iff = thm "lift_set_iff";
   585 val lift_set_iff2 = thm "lift_set_iff2";
   586 val lift_set_mono = thm "lift_set_mono";
   587 val lift_set_Un_distrib = thm "lift_set_Un_distrib";
   588 val lift_set_Diff_distrib = thm "lift_set_Diff_distrib";
   589 val bij_lift = thm "bij_lift";
   590 val lift_SKIP = thm "lift_SKIP";
   591 val lift_Join = thm "lift_Join";
   592 val lift_JN = thm "lift_JN";
   593 val lift_constrains = thm "lift_constrains";
   594 val lift_stable = thm "lift_stable";
   595 val lift_invariant = thm "lift_invariant";
   596 val lift_Constrains = thm "lift_Constrains";
   597 val lift_Stable = thm "lift_Stable";
   598 val lift_Always = thm "lift_Always";
   599 val lift_transient = thm "lift_transient";
   600 val lift_ensures = thm "lift_ensures";
   601 val lift_leadsTo = thm "lift_leadsTo";
   602 val lift_LeadsTo = thm "lift_LeadsTo";
   603 val lift_lift_guarantees_eq = thm "lift_lift_guarantees_eq";
   604 val lift_guarantees_eq_lift_inv = thm "lift_guarantees_eq_lift_inv";
   605 val lift_preserves_snd_I = thm "lift_preserves_snd_I";
   606 val delete_map_eqE = thm "delete_map_eqE";
   607 val delete_map_eqE = thm "delete_map_eqE";
   608 val delete_map_neq_apply = thm "delete_map_neq_apply";
   609 val vimage_o_fst_eq = thm "vimage_o_fst_eq";
   610 val vimage_sub_eq_lift_set = thm "vimage_sub_eq_lift_set";
   611 val mem_lift_act_iff = thm "mem_lift_act_iff";
   612 val preserves_snd_lift_stable = thm "preserves_snd_lift_stable";
   613 val constrains_imp_lift_constrains = thm "constrains_imp_lift_constrains";
   614 val insert_map_upd_same = thm "insert_map_upd_same";
   615 val insert_map_upd = thm "insert_map_upd";
   616 val insert_map_eq_diff = thm "insert_map_eq_diff";
   617 val lift_map_eq_diff = thm "lift_map_eq_diff";
   618 val lift_transient_eq_disj = thm "lift_transient_eq_disj";
   619 val lift_map_image_Times = thm "lift_map_image_Times";
   620 val lift_preserves_eq = thm "lift_preserves_eq";
   621 val lift_preserves_sub = thm "lift_preserves_sub";
   622 val o_equiv_assoc = thm "o_equiv_assoc";
   623 val o_equiv_apply = thm "o_equiv_apply";
   624 val fst_o_lift_map = thm "fst_o_lift_map";
   625 val snd_o_lift_map = thm "snd_o_lift_map";
   626 val extend_act_extend_act = thm "extend_act_extend_act";
   627 val project_act_project_act = thm "project_act_project_act";
   628 val project_act_extend_act = thm "project_act_extend_act";
   629 val act_in_UNION_preserves_fst = thm "act_in_UNION_preserves_fst";
   630 val UNION_OK_lift_I = thm "UNION_OK_lift_I";
   631 val OK_lift_I = thm "OK_lift_I";
   632 val Allowed_lift = thm "Allowed_lift";
   633 val lift_image_preserves = thm "lift_image_preserves";
   634 
   635 
   636 (*PPROD*)
   637 val Init_PLam = thm "Init_PLam";
   638 val PLam_empty = thm "PLam_empty";
   639 val PLam_SKIP = thm "PLam_SKIP";
   640 val PLam_insert = thm "PLam_insert";
   641 val PLam_component_iff = thm "PLam_component_iff";
   642 val component_PLam = thm "component_PLam";
   643 val PLam_constrains = thm "PLam_constrains";
   644 val PLam_stable = thm "PLam_stable";
   645 val PLam_transient = thm "PLam_transient";
   646 val PLam_ensures = thm "PLam_ensures";
   647 val PLam_leadsTo_Basis = thm "PLam_leadsTo_Basis";
   648 val invariant_imp_PLam_invariant = thm "invariant_imp_PLam_invariant";
   649 val PLam_preserves_fst = thm "PLam_preserves_fst";
   650 val PLam_preserves_snd = thm "PLam_preserves_snd";
   651 val guarantees_PLam_I = thm "guarantees_PLam_I";
   652 val Allowed_PLam = thm "Allowed_PLam";
   653 val PLam_preserves = thm "PLam_preserves";
   654 
   655 (*Follows*)
   656 val mono_Always_o = thm "mono_Always_o";
   657 val mono_LeadsTo_o = thm "mono_LeadsTo_o";
   658 val Follows_constant = thm "Follows_constant";
   659 val mono_Follows_o = thm "mono_Follows_o";
   660 val mono_Follows_apply = thm "mono_Follows_apply";
   661 val Follows_trans = thm "Follows_trans";
   662 val Follows_Increasing1 = thm "Follows_Increasing1";
   663 val Follows_Increasing2 = thm "Follows_Increasing2";
   664 val Follows_Bounded = thm "Follows_Bounded";
   665 val Follows_LeadsTo = thm "Follows_LeadsTo";
   666 val Follows_LeadsTo_pfixLe = thm "Follows_LeadsTo_pfixLe";
   667 val Follows_LeadsTo_pfixGe = thm "Follows_LeadsTo_pfixGe";
   668 val Always_Follows1 = thm "Always_Follows1";
   669 val Always_Follows2 = thm "Always_Follows2";
   670 val increasing_Un = thm "increasing_Un";
   671 val Increasing_Un = thm "Increasing_Un";
   672 val Always_Un = thm "Always_Un";
   673 val Follows_Un_lemma = thm "Follows_Un_lemma";
   674 val Follows_Un = thm "Follows_Un";
   675 val increasing_union = thm "increasing_union";
   676 val Increasing_union = thm "Increasing_union";
   677 val Always_union = thm "Always_union";
   678 val Follows_union_lemma = thm "Follows_union_lemma";
   679 val Follows_union = thm "Follows_union";
   680 val Follows_setsum = thm "Follows_setsum";
   681 val Increasing_imp_Stable_pfixGe = thm "Increasing_imp_Stable_pfixGe";
   682 val LeadsTo_le_imp_pfixGe = thm "LeadsTo_le_imp_pfixGe";
   683 
   684 
   685 (*Lazy unfolding of actions or of sets*)
   686 fun simp_of_act def = def RS def_act_simp;
   687 
   688 fun simp_of_set def = def RS def_set_simp;
   689 
   690 
   691 (*Combines two invariance ASSUMPTIONS into one.  USEFUL??*)
   692 val Always_Int_tac = dtac Always_Int_I THEN' assume_tac THEN' etac Always_thin
   693 
   694 (*Combines a list of invariance THEOREMS into one.*)
   695 val Always_Int_rule = foldr1 (fn (th1,th2) => [th1,th2] MRS Always_Int_I)
   696 
   697 (*proves "co" properties when the program is specified*)
   698 fun gen_constrains_tac(cs,ss) i = 
   699    SELECT_GOAL
   700       (EVERY [REPEAT (Always_Int_tac 1),
   701 	      REPEAT (etac Always_ConstrainsI 1
   702 		      ORELSE
   703 		      resolve_tac [StableI, stableI,
   704 				   constrains_imp_Constrains] 1),
   705 	      rtac constrainsI 1,
   706 	      full_simp_tac ss 1,
   707 	      REPEAT (FIRSTGOAL (etac disjE)),
   708 	      ALLGOALS (clarify_tac cs),
   709 	      ALLGOALS (asm_lr_simp_tac ss)]) i;
   710 
   711 (*proves "ensures/leadsTo" properties when the program is specified*)
   712 fun gen_ensures_tac(cs,ss) sact = 
   713     SELECT_GOAL
   714       (EVERY [REPEAT (Always_Int_tac 1),
   715 	      etac Always_LeadsTo_Basis 1 
   716 	          ORELSE   (*subgoal may involve LeadsTo, leadsTo or ensures*)
   717 		  REPEAT (ares_tac [LeadsTo_Basis, leadsTo_Basis,
   718 				    EnsuresI, ensuresI] 1),
   719 	      (*now there are two subgoals: co & transient*)
   720 	      simp_tac ss 2,
   721 	      res_inst_tac [("act", sact)] transientI 2,
   722                  (*simplify the command's domain*)
   723 	      simp_tac (ss addsimps [Domain_def]) 3,
   724 	      gen_constrains_tac (cs,ss) 1,
   725 	      ALLGOALS (clarify_tac cs),
   726 	      ALLGOALS (asm_lr_simp_tac ss)]);
   727 
   728 fun constrains_tac st = gen_constrains_tac (claset(), simpset()) st;
   729 
   730 fun ensures_tac sact = gen_ensures_tac (claset(), simpset()) sact;
   731 
   732 
   733 (*Composition equivalences, from Lift_prog*)
   734 
   735 fun make_o_equivs th =
   736     [th,
   737      th RS o_equiv_assoc |> simplify (HOL_ss addsimps [o_assoc]),
   738      th RS o_equiv_apply |> simplify (HOL_ss addsimps [o_def, sub_def])];
   739 
   740 Addsimps (make_o_equivs fst_o_funPair @ make_o_equivs snd_o_funPair);
   741 
   742 Addsimps (make_o_equivs fst_o_lift_map @ make_o_equivs snd_o_lift_map);