src/HOL/UNITY/UNITY_tactics.ML
author paulson
Thu Jan 30 10:35:56 2003 +0100 (2003-01-30)
changeset 13796 19f50fa807ae
parent 13792 d1811693899c
child 13797 baefae13ad37
permissions -rw-r--r--
converting more UNITY theories to new-style
paulson@13786
     1
(*  Title:      HOL/UNITY/UNITY_tactics.ML
paulson@13786
     2
    ID:         $Id$
paulson@13786
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@13786
     4
    Copyright   2003  University of Cambridge
paulson@13786
     5
paulson@13786
     6
Specialized UNITY tactics, and ML bindings of theorems
paulson@13786
     7
*)
paulson@13786
     8
paulson@13796
     9
(*FP*)
paulson@13796
    10
val stable_FP_Orig_Int = thm "stable_FP_Orig_Int";
paulson@13796
    11
val FP_Orig_weakest = thm "FP_Orig_weakest";
paulson@13796
    12
val stable_FP_Int = thm "stable_FP_Int";
paulson@13796
    13
val FP_equivalence = thm "FP_equivalence";
paulson@13796
    14
val FP_weakest = thm "FP_weakest";
paulson@13796
    15
val Compl_FP = thm "Compl_FP";
paulson@13796
    16
val Diff_FP = thm "Diff_FP";
paulson@13796
    17
paulson@13796
    18
(*SubstAx*)
paulson@13796
    19
val LeadsTo_eq_leadsTo = thm "LeadsTo_eq_leadsTo";
paulson@13796
    20
val Always_LeadsTo_pre = thm "Always_LeadsTo_pre";
paulson@13796
    21
val Always_LeadsTo_post = thm "Always_LeadsTo_post";
paulson@13796
    22
val Always_LeadsToI = thm "Always_LeadsToI";
paulson@13796
    23
val Always_LeadsToD = thm "Always_LeadsToD";
paulson@13796
    24
val leadsTo_imp_LeadsTo = thm "leadsTo_imp_LeadsTo";
paulson@13796
    25
val LeadsTo_Trans = thm "LeadsTo_Trans";
paulson@13796
    26
val LeadsTo_Union = thm "LeadsTo_Union";
paulson@13796
    27
val LeadsTo_UNIV = thm "LeadsTo_UNIV";
paulson@13796
    28
val LeadsTo_Un_duplicate = thm "LeadsTo_Un_duplicate";
paulson@13796
    29
val LeadsTo_Un_duplicate2 = thm "LeadsTo_Un_duplicate2";
paulson@13796
    30
val LeadsTo_UN = thm "LeadsTo_UN";
paulson@13796
    31
val LeadsTo_Un = thm "LeadsTo_Un";
paulson@13796
    32
val single_LeadsTo_I = thm "single_LeadsTo_I";
paulson@13796
    33
val subset_imp_LeadsTo = thm "subset_imp_LeadsTo";
paulson@13796
    34
val empty_LeadsTo = thm "empty_LeadsTo";
paulson@13796
    35
val LeadsTo_weaken_R = thm "LeadsTo_weaken_R";
paulson@13796
    36
val LeadsTo_weaken_L = thm "LeadsTo_weaken_L";
paulson@13796
    37
val LeadsTo_weaken = thm "LeadsTo_weaken";
paulson@13796
    38
val Always_LeadsTo_weaken = thm "Always_LeadsTo_weaken";
paulson@13796
    39
val LeadsTo_Un_post = thm "LeadsTo_Un_post";
paulson@13796
    40
val LeadsTo_Trans_Un = thm "LeadsTo_Trans_Un";
paulson@13796
    41
val LeadsTo_Un_distrib = thm "LeadsTo_Un_distrib";
paulson@13796
    42
val LeadsTo_UN_distrib = thm "LeadsTo_UN_distrib";
paulson@13796
    43
val LeadsTo_Union_distrib = thm "LeadsTo_Union_distrib";
paulson@13796
    44
val LeadsTo_Basis = thm "LeadsTo_Basis";
paulson@13796
    45
val EnsuresI = thm "EnsuresI";
paulson@13796
    46
val Always_LeadsTo_Basis = thm "Always_LeadsTo_Basis";
paulson@13796
    47
val LeadsTo_Diff = thm "LeadsTo_Diff";
paulson@13796
    48
val LeadsTo_UN_UN = thm "LeadsTo_UN_UN";
paulson@13796
    49
val LeadsTo_UN_UN_noindex = thm "LeadsTo_UN_UN_noindex";
paulson@13796
    50
val all_LeadsTo_UN_UN = thm "all_LeadsTo_UN_UN";
paulson@13796
    51
val LeadsTo_Un_Un = thm "LeadsTo_Un_Un";
paulson@13796
    52
val LeadsTo_cancel2 = thm "LeadsTo_cancel2";
paulson@13796
    53
val LeadsTo_cancel_Diff2 = thm "LeadsTo_cancel_Diff2";
paulson@13796
    54
val LeadsTo_cancel1 = thm "LeadsTo_cancel1";
paulson@13796
    55
val LeadsTo_cancel_Diff1 = thm "LeadsTo_cancel_Diff1";
paulson@13796
    56
val LeadsTo_empty = thm "LeadsTo_empty";
paulson@13796
    57
val PSP_Stable = thm "PSP_Stable";
paulson@13796
    58
val PSP_Stable2 = thm "PSP_Stable2";
paulson@13796
    59
val PSP = thm "PSP";
paulson@13796
    60
val PSP2 = thm "PSP2";
paulson@13796
    61
val PSP_Unless = thm "PSP_Unless";
paulson@13796
    62
val Stable_transient_Always_LeadsTo = thm "Stable_transient_Always_LeadsTo";
paulson@13796
    63
val LeadsTo_wf_induct = thm "LeadsTo_wf_induct";
paulson@13796
    64
val Bounded_induct = thm "Bounded_induct";
paulson@13796
    65
val LessThan_induct = thm "LessThan_induct";
paulson@13796
    66
val integ_0_le_induct = thm "integ_0_le_induct";
paulson@13796
    67
val LessThan_bounded_induct = thm "LessThan_bounded_induct";
paulson@13796
    68
val GreaterThan_bounded_induct = thm "GreaterThan_bounded_induct";
paulson@13796
    69
val Completion = thm "Completion";
paulson@13796
    70
val Finite_completion_lemma = thm "Finite_completion_lemma";
paulson@13796
    71
val Finite_completion = thm "Finite_completion";
paulson@13796
    72
val Stable_completion = thm "Stable_completion";
paulson@13796
    73
val Finite_stable_completion = thm "Finite_stable_completion";
paulson@13796
    74
paulson@13792
    75
(*Union*)
paulson@13792
    76
val Init_SKIP = thm "Init_SKIP";
paulson@13792
    77
val Acts_SKIP = thm "Acts_SKIP";
paulson@13792
    78
val AllowedActs_SKIP = thm "AllowedActs_SKIP";
paulson@13792
    79
val reachable_SKIP = thm "reachable_SKIP";
paulson@13792
    80
val SKIP_in_constrains_iff = thm "SKIP_in_constrains_iff";
paulson@13792
    81
val SKIP_in_Constrains_iff = thm "SKIP_in_Constrains_iff";
paulson@13792
    82
val SKIP_in_stable = thm "SKIP_in_stable";
paulson@13792
    83
val Init_Join = thm "Init_Join";
paulson@13792
    84
val Acts_Join = thm "Acts_Join";
paulson@13792
    85
val AllowedActs_Join = thm "AllowedActs_Join";
paulson@13792
    86
val JN_empty = thm "JN_empty";
paulson@13792
    87
val JN_insert = thm "JN_insert";
paulson@13792
    88
val Init_JN = thm "Init_JN";
paulson@13792
    89
val Acts_JN = thm "Acts_JN";
paulson@13792
    90
val AllowedActs_JN = thm "AllowedActs_JN";
paulson@13792
    91
val JN_cong = thm "JN_cong";
paulson@13792
    92
val Join_commute = thm "Join_commute";
paulson@13792
    93
val Join_assoc = thm "Join_assoc";
paulson@13792
    94
val Join_left_commute = thm "Join_left_commute";
paulson@13792
    95
val Join_SKIP_left = thm "Join_SKIP_left";
paulson@13792
    96
val Join_SKIP_right = thm "Join_SKIP_right";
paulson@13792
    97
val Join_absorb = thm "Join_absorb";
paulson@13792
    98
val Join_left_absorb = thm "Join_left_absorb";
paulson@13792
    99
val Join_ac = thms "Join_ac";
paulson@13792
   100
val JN_absorb = thm "JN_absorb";
paulson@13792
   101
val JN_Un = thm "JN_Un";
paulson@13792
   102
val JN_constant = thm "JN_constant";
paulson@13792
   103
val JN_Join_distrib = thm "JN_Join_distrib";
paulson@13792
   104
val JN_Join_miniscope = thm "JN_Join_miniscope";
paulson@13792
   105
val JN_Join_diff = thm "JN_Join_diff";
paulson@13792
   106
val JN_constrains = thm "JN_constrains";
paulson@13792
   107
val Join_constrains = thm "Join_constrains";
paulson@13792
   108
val Join_unless = thm "Join_unless";
paulson@13792
   109
val Join_constrains_weaken = thm "Join_constrains_weaken";
paulson@13792
   110
val JN_constrains_weaken = thm "JN_constrains_weaken";
paulson@13792
   111
val JN_stable = thm "JN_stable";
paulson@13792
   112
val invariant_JN_I = thm "invariant_JN_I";
paulson@13792
   113
val Join_stable = thm "Join_stable";
paulson@13792
   114
val Join_increasing = thm "Join_increasing";
paulson@13792
   115
val invariant_JoinI = thm "invariant_JoinI";
paulson@13792
   116
val FP_JN = thm "FP_JN";
paulson@13792
   117
val JN_transient = thm "JN_transient";
paulson@13792
   118
val Join_transient = thm "Join_transient";
paulson@13792
   119
val Join_transient_I1 = thm "Join_transient_I1";
paulson@13792
   120
val Join_transient_I2 = thm "Join_transient_I2";
paulson@13792
   121
val JN_ensures = thm "JN_ensures";
paulson@13792
   122
val Join_ensures = thm "Join_ensures";
paulson@13792
   123
val stable_Join_constrains = thm "stable_Join_constrains";
paulson@13792
   124
val stable_Join_Always1 = thm "stable_Join_Always1";
paulson@13792
   125
val stable_Join_Always2 = thm "stable_Join_Always2";
paulson@13792
   126
val stable_Join_ensures1 = thm "stable_Join_ensures1";
paulson@13792
   127
val stable_Join_ensures2 = thm "stable_Join_ensures2";
paulson@13792
   128
val ok_SKIP1 = thm "ok_SKIP1";
paulson@13792
   129
val ok_SKIP2 = thm "ok_SKIP2";
paulson@13792
   130
val ok_Join_commute = thm "ok_Join_commute";
paulson@13792
   131
val ok_commute = thm "ok_commute";
paulson@13792
   132
val ok_sym = thm "ok_sym";
paulson@13792
   133
val ok_iff_OK = thm "ok_iff_OK";
paulson@13792
   134
val ok_Join_iff1 = thm "ok_Join_iff1";
paulson@13792
   135
val ok_Join_iff2 = thm "ok_Join_iff2";
paulson@13792
   136
val ok_Join_commute_I = thm "ok_Join_commute_I";
paulson@13792
   137
val ok_JN_iff1 = thm "ok_JN_iff1";
paulson@13792
   138
val ok_JN_iff2 = thm "ok_JN_iff2";
paulson@13792
   139
val OK_iff_ok = thm "OK_iff_ok";
paulson@13792
   140
val OK_imp_ok = thm "OK_imp_ok";
paulson@13792
   141
val Allowed_SKIP = thm "Allowed_SKIP";
paulson@13792
   142
val Allowed_Join = thm "Allowed_Join";
paulson@13792
   143
val Allowed_JN = thm "Allowed_JN";
paulson@13792
   144
val ok_iff_Allowed = thm "ok_iff_Allowed";
paulson@13792
   145
val OK_iff_Allowed = thm "OK_iff_Allowed";
paulson@13792
   146
val safety_prop_Acts_iff = thm "safety_prop_Acts_iff";
paulson@13792
   147
val safety_prop_AllowedActs_iff_Allowed = thm "safety_prop_AllowedActs_iff_Allowed";
paulson@13792
   148
val Allowed_eq = thm "Allowed_eq";
paulson@13792
   149
val def_prg_Allowed = thm "def_prg_Allowed";
paulson@13792
   150
val safety_prop_constrains = thm "safety_prop_constrains";
paulson@13792
   151
val safety_prop_stable = thm "safety_prop_stable";
paulson@13792
   152
val safety_prop_Int = thm "safety_prop_Int";
paulson@13792
   153
val safety_prop_INTER1 = thm "safety_prop_INTER1";
paulson@13792
   154
val safety_prop_INTER = thm "safety_prop_INTER";
paulson@13792
   155
val def_UNION_ok_iff = thm "def_UNION_ok_iff";
paulson@13792
   156
paulson@13792
   157
(*Comp*)
paulson@13792
   158
val preserves_def = thm "preserves_def";
paulson@13792
   159
val funPair_def = thm "funPair_def";
paulson@13792
   160
val componentI = thm "componentI";
paulson@13792
   161
val component_eq_subset = thm "component_eq_subset";
paulson@13792
   162
val component_SKIP = thm "component_SKIP";
paulson@13792
   163
val component_refl = thm "component_refl";
paulson@13792
   164
val SKIP_minimal = thm "SKIP_minimal";
paulson@13792
   165
val component_Join1 = thm "component_Join1";
paulson@13792
   166
val component_Join2 = thm "component_Join2";
paulson@13792
   167
val Join_absorb1 = thm "Join_absorb1";
paulson@13792
   168
val Join_absorb2 = thm "Join_absorb2";
paulson@13792
   169
val JN_component_iff = thm "JN_component_iff";
paulson@13792
   170
val component_JN = thm "component_JN";
paulson@13792
   171
val component_trans = thm "component_trans";
paulson@13792
   172
val component_antisym = thm "component_antisym";
paulson@13792
   173
val Join_component_iff = thm "Join_component_iff";
paulson@13792
   174
val component_constrains = thm "component_constrains";
paulson@13792
   175
val program_less_le = thm "program_less_le";
paulson@13792
   176
val preservesI = thm "preservesI";
paulson@13792
   177
val preserves_imp_eq = thm "preserves_imp_eq";
paulson@13792
   178
val Join_preserves = thm "Join_preserves";
paulson@13792
   179
val JN_preserves = thm "JN_preserves";
paulson@13792
   180
val SKIP_preserves = thm "SKIP_preserves";
paulson@13792
   181
val funPair_apply = thm "funPair_apply";
paulson@13792
   182
val preserves_funPair = thm "preserves_funPair";
paulson@13792
   183
val funPair_o_distrib = thm "funPair_o_distrib";
paulson@13792
   184
val fst_o_funPair = thm "fst_o_funPair";
paulson@13792
   185
val snd_o_funPair = thm "snd_o_funPair";
paulson@13792
   186
val subset_preserves_o = thm "subset_preserves_o";
paulson@13792
   187
val preserves_subset_stable = thm "preserves_subset_stable";
paulson@13792
   188
val preserves_subset_increasing = thm "preserves_subset_increasing";
paulson@13792
   189
val preserves_id_subset_stable = thm "preserves_id_subset_stable";
paulson@13792
   190
val safety_prop_preserves = thm "safety_prop_preserves";
paulson@13792
   191
val stable_localTo_stable2 = thm "stable_localTo_stable2";
paulson@13792
   192
val Increasing_preserves_Stable = thm "Increasing_preserves_Stable";
paulson@13792
   193
val component_of_imp_component = thm "component_of_imp_component";
paulson@13792
   194
val component_of_refl = thm "component_of_refl";
paulson@13792
   195
val component_of_SKIP = thm "component_of_SKIP";
paulson@13792
   196
val component_of_trans = thm "component_of_trans";
paulson@13792
   197
val strict_component_of_eq = thm "strict_component_of_eq";
paulson@13792
   198
val localize_Init_eq = thm "localize_Init_eq";
paulson@13792
   199
val localize_Acts_eq = thm "localize_Acts_eq";
paulson@13792
   200
val localize_AllowedActs_eq = thm "localize_AllowedActs_eq";
paulson@13792
   201
paulson@13792
   202
(*Guar*)
paulson@13792
   203
val guar_def = thm "guar_def";
paulson@13792
   204
val OK_insert_iff = thm "OK_insert_iff";
paulson@13792
   205
val ex1 = thm "ex1";
paulson@13792
   206
val ex2 = thm "ex2";
paulson@13792
   207
val ex_prop_finite = thm "ex_prop_finite";
paulson@13792
   208
val ex_prop_equiv = thm "ex_prop_equiv";
paulson@13792
   209
val uv1 = thm "uv1";
paulson@13792
   210
val uv2 = thm "uv2";
paulson@13792
   211
val uv_prop_finite = thm "uv_prop_finite";
paulson@13792
   212
val guaranteesI = thm "guaranteesI";
paulson@13792
   213
val guaranteesD = thm "guaranteesD";
paulson@13792
   214
val component_guaranteesD = thm "component_guaranteesD";
paulson@13792
   215
val guarantees_weaken = thm "guarantees_weaken";
paulson@13792
   216
val subset_imp_guarantees_UNIV = thm "subset_imp_guarantees_UNIV";
paulson@13792
   217
val subset_imp_guarantees = thm "subset_imp_guarantees";
paulson@13792
   218
val ex_prop_imp = thm "ex_prop_imp";
paulson@13792
   219
val guarantees_imp = thm "guarantees_imp";
paulson@13792
   220
val ex_prop_equiv2 = thm "ex_prop_equiv2";
paulson@13792
   221
val guarantees_UN_left = thm "guarantees_UN_left";
paulson@13792
   222
val guarantees_Un_left = thm "guarantees_Un_left";
paulson@13792
   223
val guarantees_INT_right = thm "guarantees_INT_right";
paulson@13792
   224
val guarantees_Int_right = thm "guarantees_Int_right";
paulson@13792
   225
val guarantees_Int_right_I = thm "guarantees_Int_right_I";
paulson@13792
   226
val guarantees_INT_right_iff = thm "guarantees_INT_right_iff";
paulson@13792
   227
val shunting = thm "shunting";
paulson@13792
   228
val contrapositive = thm "contrapositive";
paulson@13792
   229
val combining1 = thm "combining1";
paulson@13792
   230
val combining2 = thm "combining2";
paulson@13792
   231
val all_guarantees = thm "all_guarantees";
paulson@13792
   232
val ex_guarantees = thm "ex_guarantees";
paulson@13792
   233
val guarantees_Join_Int = thm "guarantees_Join_Int";
paulson@13792
   234
val guarantees_Join_Un = thm "guarantees_Join_Un";
paulson@13792
   235
val guarantees_JN_INT = thm "guarantees_JN_INT";
paulson@13792
   236
val guarantees_JN_UN = thm "guarantees_JN_UN";
paulson@13792
   237
val guarantees_Join_I1 = thm "guarantees_Join_I1";
paulson@13792
   238
val guarantees_Join_I2 = thm "guarantees_Join_I2";
paulson@13792
   239
val guarantees_JN_I = thm "guarantees_JN_I";
paulson@13792
   240
val Join_welldef_D1 = thm "Join_welldef_D1";
paulson@13792
   241
val Join_welldef_D2 = thm "Join_welldef_D2";
paulson@13792
   242
val refines_refl = thm "refines_refl";
paulson@13792
   243
val ex_refinement_thm = thm "ex_refinement_thm";
paulson@13792
   244
val uv_refinement_thm = thm "uv_refinement_thm";
paulson@13792
   245
val guarantees_equiv = thm "guarantees_equiv";
paulson@13792
   246
val wg_weakest = thm "wg_weakest";
paulson@13792
   247
val wg_guarantees = thm "wg_guarantees";
paulson@13792
   248
val wg_equiv = thm "wg_equiv";
paulson@13792
   249
val component_of_wg = thm "component_of_wg";
paulson@13792
   250
val wg_finite = thm "wg_finite";
paulson@13792
   251
val wg_ex_prop = thm "wg_ex_prop";
paulson@13792
   252
val wx_subset = thm "wx_subset";
paulson@13792
   253
val wx_ex_prop = thm "wx_ex_prop";
paulson@13792
   254
val wx_weakest = thm "wx_weakest";
paulson@13792
   255
val wx'_ex_prop = thm "wx'_ex_prop";
paulson@13792
   256
val wx_equiv = thm "wx_equiv";
paulson@13792
   257
val guarantees_wx_eq = thm "guarantees_wx_eq";
paulson@13792
   258
val stable_guarantees_Always = thm "stable_guarantees_Always";
paulson@13792
   259
val leadsTo_Basis = thm "leadsTo_Basis";
paulson@13792
   260
val constrains_guarantees_leadsTo = thm "constrains_guarantees_leadsTo";
paulson@13792
   261
paulson@13790
   262
(*Extend*)
paulson@13790
   263
val Restrict_iff = thm "Restrict_iff";
paulson@13790
   264
val Restrict_UNIV = thm "Restrict_UNIV";
paulson@13790
   265
val Restrict_empty = thm "Restrict_empty";
paulson@13790
   266
val Restrict_Int = thm "Restrict_Int";
paulson@13790
   267
val Restrict_triv = thm "Restrict_triv";
paulson@13790
   268
val Restrict_subset = thm "Restrict_subset";
paulson@13790
   269
val Restrict_eq_mono = thm "Restrict_eq_mono";
paulson@13790
   270
val Restrict_imageI = thm "Restrict_imageI";
paulson@13790
   271
val Domain_Restrict = thm "Domain_Restrict";
paulson@13790
   272
val Image_Restrict = thm "Image_Restrict";
paulson@13790
   273
val insert_Id_image_Acts = thm "insert_Id_image_Acts";
paulson@13790
   274
val good_mapI = thm "good_mapI";
paulson@13790
   275
val good_map_is_surj = thm "good_map_is_surj";
paulson@13790
   276
val fst_inv_equalityI = thm "fst_inv_equalityI";
paulson@13790
   277
val project_set_iff = thm "project_set_iff";
paulson@13790
   278
val extend_set_mono = thm "extend_set_mono";
paulson@13790
   279
val extend_set_empty = thm "extend_set_empty";
paulson@13790
   280
val project_set_Int_subset = thm "project_set_Int_subset";
paulson@13790
   281
val Init_extend = thm "Init_extend";
paulson@13790
   282
val Init_project = thm "Init_project";
paulson@13790
   283
val Acts_project = thm "Acts_project";
paulson@13790
   284
val project_set_UNIV = thm "project_set_UNIV";
paulson@13790
   285
val project_set_Union = thm "project_set_Union";
paulson@13790
   286
val project_act_mono = thm "project_act_mono";
paulson@13790
   287
val project_constrains_project_set = thm "project_constrains_project_set";
paulson@13790
   288
val project_stable_project_set = thm "project_stable_project_set";
paulson@13790
   289
paulson@13790
   290
paulson@13790
   291
(*Rename*)
paulson@13790
   292
val good_map_bij = thm "good_map_bij";
paulson@13790
   293
val fst_o_inv_eq_inv = thm "fst_o_inv_eq_inv";
paulson@13790
   294
val mem_rename_set_iff = thm "mem_rename_set_iff";
paulson@13790
   295
val extend_set_eq_image = thm "extend_set_eq_image";
paulson@13790
   296
val Init_rename = thm "Init_rename";
paulson@13790
   297
val extend_set_inv = thm "extend_set_inv";
paulson@13790
   298
val bij_extend_act_eq_project_act = thm "bij_extend_act_eq_project_act";
paulson@13790
   299
val bij_extend_act = thm "bij_extend_act";
paulson@13790
   300
val bij_project_act = thm "bij_project_act";
paulson@13790
   301
val bij_inv_project_act_eq = thm "bij_inv_project_act_eq";
paulson@13790
   302
val Acts_project = thm "Acts_project";
paulson@13790
   303
val extend_inv = thm "extend_inv";
paulson@13790
   304
val rename_inv_rename = thm "rename_inv_rename";
paulson@13790
   305
val rename_rename_inv = thm "rename_rename_inv";
paulson@13790
   306
val rename_inv_eq = thm "rename_inv_eq";
paulson@13790
   307
val bij_extend = thm "bij_extend";
paulson@13790
   308
val bij_project = thm "bij_project";
paulson@13790
   309
val inv_project_eq = thm "inv_project_eq";
paulson@13790
   310
val Allowed_rename = thm "Allowed_rename";
paulson@13790
   311
val bij_rename = thm "bij_rename";
paulson@13790
   312
val surj_rename = thm "surj_rename";
paulson@13790
   313
val inj_rename_imp_inj = thm "inj_rename_imp_inj";
paulson@13790
   314
val surj_rename_imp_surj = thm "surj_rename_imp_surj";
paulson@13790
   315
val bij_rename_imp_bij = thm "bij_rename_imp_bij";
paulson@13790
   316
val bij_rename_iff = thm "bij_rename_iff";
paulson@13790
   317
val rename_SKIP = thm "rename_SKIP";
paulson@13790
   318
val rename_Join = thm "rename_Join";
paulson@13790
   319
val rename_JN = thm "rename_JN";
paulson@13790
   320
val rename_constrains = thm "rename_constrains";
paulson@13790
   321
val rename_stable = thm "rename_stable";
paulson@13790
   322
val rename_invariant = thm "rename_invariant";
paulson@13790
   323
val rename_increasing = thm "rename_increasing";
paulson@13790
   324
val reachable_rename_eq = thm "reachable_rename_eq";
paulson@13790
   325
val rename_Constrains = thm "rename_Constrains";
paulson@13790
   326
val rename_Stable = thm "rename_Stable";
paulson@13790
   327
val rename_Always = thm "rename_Always";
paulson@13790
   328
val rename_Increasing = thm "rename_Increasing";
paulson@13790
   329
val rename_transient = thm "rename_transient";
paulson@13790
   330
val rename_ensures = thm "rename_ensures";
paulson@13790
   331
val rename_leadsTo = thm "rename_leadsTo";
paulson@13790
   332
val rename_LeadsTo = thm "rename_LeadsTo";
paulson@13790
   333
val rename_rename_guarantees_eq = thm "rename_rename_guarantees_eq";
paulson@13790
   334
val rename_guarantees_eq_rename_inv = thm "rename_guarantees_eq_rename_inv";
paulson@13790
   335
val rename_preserves = thm "rename_preserves";
paulson@13790
   336
val ok_rename_iff = thm "ok_rename_iff";
paulson@13790
   337
val OK_rename_iff = thm "OK_rename_iff";
paulson@13790
   338
val bij_eq_rename = thm "bij_eq_rename";
paulson@13790
   339
val rename_image_constrains = thm "rename_image_constrains";
paulson@13790
   340
val rename_image_stable = thm "rename_image_stable";
paulson@13790
   341
val rename_image_increasing = thm "rename_image_increasing";
paulson@13790
   342
val rename_image_invariant = thm "rename_image_invariant";
paulson@13790
   343
val rename_image_Constrains = thm "rename_image_Constrains";
paulson@13790
   344
val rename_image_preserves = thm "rename_image_preserves";
paulson@13790
   345
val rename_image_Stable = thm "rename_image_Stable";
paulson@13790
   346
val rename_image_Increasing = thm "rename_image_Increasing";
paulson@13790
   347
val rename_image_Always = thm "rename_image_Always";
paulson@13790
   348
val rename_image_leadsTo = thm "rename_image_leadsTo";
paulson@13790
   349
val rename_image_LeadsTo = thm "rename_image_LeadsTo";
paulson@13790
   350
paulson@13790
   351
paulson@13786
   352
paulson@13786
   353
(*Lift_prog*)
paulson@13786
   354
val sub_def = thm "sub_def";
paulson@13786
   355
val lift_map_def = thm "lift_map_def";
paulson@13786
   356
val drop_map_def = thm "drop_map_def";
paulson@13786
   357
val insert_map_inverse = thm "insert_map_inverse";
paulson@13786
   358
val insert_map_delete_map_eq = thm "insert_map_delete_map_eq";
paulson@13786
   359
val insert_map_inject1 = thm "insert_map_inject1";
paulson@13786
   360
val insert_map_inject2 = thm "insert_map_inject2";
paulson@13786
   361
val insert_map_inject = thm "insert_map_inject";
paulson@13786
   362
val insert_map_inject = thm "insert_map_inject";
paulson@13786
   363
val lift_map_eq_iff = thm "lift_map_eq_iff";
paulson@13786
   364
val drop_map_lift_map_eq = thm "drop_map_lift_map_eq";
paulson@13786
   365
val inj_lift_map = thm "inj_lift_map";
paulson@13786
   366
val lift_map_drop_map_eq = thm "lift_map_drop_map_eq";
paulson@13786
   367
val drop_map_inject = thm "drop_map_inject";
paulson@13786
   368
val surj_lift_map = thm "surj_lift_map";
paulson@13786
   369
val bij_lift_map = thm "bij_lift_map";
paulson@13786
   370
val inv_lift_map_eq = thm "inv_lift_map_eq";
paulson@13786
   371
val inv_drop_map_eq = thm "inv_drop_map_eq";
paulson@13786
   372
val bij_drop_map = thm "bij_drop_map";
paulson@13786
   373
val sub_apply = thm "sub_apply";
paulson@13786
   374
val lift_set_empty = thm "lift_set_empty";
paulson@13786
   375
val lift_set_iff = thm "lift_set_iff";
paulson@13786
   376
val lift_set_iff2 = thm "lift_set_iff2";
paulson@13786
   377
val lift_set_mono = thm "lift_set_mono";
paulson@13786
   378
val lift_set_Un_distrib = thm "lift_set_Un_distrib";
paulson@13786
   379
val lift_set_Diff_distrib = thm "lift_set_Diff_distrib";
paulson@13786
   380
val bij_lift = thm "bij_lift";
paulson@13786
   381
val lift_SKIP = thm "lift_SKIP";
paulson@13786
   382
val lift_Join = thm "lift_Join";
paulson@13786
   383
val lift_JN = thm "lift_JN";
paulson@13786
   384
val lift_constrains = thm "lift_constrains";
paulson@13786
   385
val lift_stable = thm "lift_stable";
paulson@13786
   386
val lift_invariant = thm "lift_invariant";
paulson@13786
   387
val lift_Constrains = thm "lift_Constrains";
paulson@13786
   388
val lift_Stable = thm "lift_Stable";
paulson@13786
   389
val lift_Always = thm "lift_Always";
paulson@13786
   390
val lift_transient = thm "lift_transient";
paulson@13786
   391
val lift_ensures = thm "lift_ensures";
paulson@13786
   392
val lift_leadsTo = thm "lift_leadsTo";
paulson@13786
   393
val lift_LeadsTo = thm "lift_LeadsTo";
paulson@13786
   394
val lift_lift_guarantees_eq = thm "lift_lift_guarantees_eq";
paulson@13786
   395
val lift_guarantees_eq_lift_inv = thm "lift_guarantees_eq_lift_inv";
paulson@13786
   396
val lift_preserves_snd_I = thm "lift_preserves_snd_I";
paulson@13786
   397
val delete_map_eqE = thm "delete_map_eqE";
paulson@13786
   398
val delete_map_eqE = thm "delete_map_eqE";
paulson@13786
   399
val delete_map_neq_apply = thm "delete_map_neq_apply";
paulson@13786
   400
val vimage_o_fst_eq = thm "vimage_o_fst_eq";
paulson@13786
   401
val vimage_sub_eq_lift_set = thm "vimage_sub_eq_lift_set";
paulson@13786
   402
val mem_lift_act_iff = thm "mem_lift_act_iff";
paulson@13786
   403
val preserves_snd_lift_stable = thm "preserves_snd_lift_stable";
paulson@13786
   404
val constrains_imp_lift_constrains = thm "constrains_imp_lift_constrains";
paulson@13786
   405
val insert_map_upd_same = thm "insert_map_upd_same";
paulson@13786
   406
val insert_map_upd = thm "insert_map_upd";
paulson@13786
   407
val insert_map_eq_diff = thm "insert_map_eq_diff";
paulson@13786
   408
val lift_map_eq_diff = thm "lift_map_eq_diff";
paulson@13786
   409
val lift_transient_eq_disj = thm "lift_transient_eq_disj";
paulson@13786
   410
val lift_map_image_Times = thm "lift_map_image_Times";
paulson@13786
   411
val lift_preserves_eq = thm "lift_preserves_eq";
paulson@13786
   412
val lift_preserves_sub = thm "lift_preserves_sub";
paulson@13786
   413
val o_equiv_assoc = thm "o_equiv_assoc";
paulson@13786
   414
val o_equiv_apply = thm "o_equiv_apply";
paulson@13786
   415
val fst_o_lift_map = thm "fst_o_lift_map";
paulson@13786
   416
val snd_o_lift_map = thm "snd_o_lift_map";
paulson@13786
   417
val extend_act_extend_act = thm "extend_act_extend_act";
paulson@13786
   418
val project_act_project_act = thm "project_act_project_act";
paulson@13786
   419
val project_act_extend_act = thm "project_act_extend_act";
paulson@13786
   420
val act_in_UNION_preserves_fst = thm "act_in_UNION_preserves_fst";
paulson@13786
   421
val UNION_OK_lift_I = thm "UNION_OK_lift_I";
paulson@13786
   422
val OK_lift_I = thm "OK_lift_I";
paulson@13786
   423
val Allowed_lift = thm "Allowed_lift";
paulson@13786
   424
val lift_image_preserves = thm "lift_image_preserves";
paulson@13786
   425
paulson@13786
   426
paulson@13786
   427
(*PPROD*)
paulson@13786
   428
val Init_PLam = thm "Init_PLam";
paulson@13786
   429
val PLam_empty = thm "PLam_empty";
paulson@13786
   430
val PLam_SKIP = thm "PLam_SKIP";
paulson@13786
   431
val PLam_insert = thm "PLam_insert";
paulson@13786
   432
val PLam_component_iff = thm "PLam_component_iff";
paulson@13786
   433
val component_PLam = thm "component_PLam";
paulson@13786
   434
val PLam_constrains = thm "PLam_constrains";
paulson@13786
   435
val PLam_stable = thm "PLam_stable";
paulson@13786
   436
val PLam_transient = thm "PLam_transient";
paulson@13786
   437
val PLam_ensures = thm "PLam_ensures";
paulson@13786
   438
val PLam_leadsTo_Basis = thm "PLam_leadsTo_Basis";
paulson@13786
   439
val invariant_imp_PLam_invariant = thm "invariant_imp_PLam_invariant";
paulson@13786
   440
val PLam_preserves_fst = thm "PLam_preserves_fst";
paulson@13786
   441
val PLam_preserves_snd = thm "PLam_preserves_snd";
paulson@13786
   442
val guarantees_PLam_I = thm "guarantees_PLam_I";
paulson@13786
   443
val Allowed_PLam = thm "Allowed_PLam";
paulson@13786
   444
val PLam_preserves = thm "PLam_preserves";
paulson@13786
   445
paulson@13796
   446
(*Follows*)
paulson@13796
   447
val mono_Always_o = thm "mono_Always_o";
paulson@13796
   448
val mono_LeadsTo_o = thm "mono_LeadsTo_o";
paulson@13796
   449
val Follows_constant = thm "Follows_constant";
paulson@13796
   450
val mono_Follows_o = thm "mono_Follows_o";
paulson@13796
   451
val mono_Follows_apply = thm "mono_Follows_apply";
paulson@13796
   452
val Follows_trans = thm "Follows_trans";
paulson@13796
   453
val Follows_Increasing1 = thm "Follows_Increasing1";
paulson@13796
   454
val Follows_Increasing2 = thm "Follows_Increasing2";
paulson@13796
   455
val Follows_Bounded = thm "Follows_Bounded";
paulson@13796
   456
val Follows_LeadsTo = thm "Follows_LeadsTo";
paulson@13796
   457
val Follows_LeadsTo_pfixLe = thm "Follows_LeadsTo_pfixLe";
paulson@13796
   458
val Follows_LeadsTo_pfixGe = thm "Follows_LeadsTo_pfixGe";
paulson@13796
   459
val Always_Follows1 = thm "Always_Follows1";
paulson@13796
   460
val Always_Follows2 = thm "Always_Follows2";
paulson@13796
   461
val increasing_Un = thm "increasing_Un";
paulson@13796
   462
val Increasing_Un = thm "Increasing_Un";
paulson@13796
   463
val Always_Un = thm "Always_Un";
paulson@13796
   464
val Follows_Un_lemma = thm "Follows_Un_lemma";
paulson@13796
   465
val Follows_Un = thm "Follows_Un";
paulson@13796
   466
val increasing_union = thm "increasing_union";
paulson@13796
   467
val Increasing_union = thm "Increasing_union";
paulson@13796
   468
val Always_union = thm "Always_union";
paulson@13796
   469
val Follows_union_lemma = thm "Follows_union_lemma";
paulson@13796
   470
val Follows_union = thm "Follows_union";
paulson@13796
   471
val Follows_setsum = thm "Follows_setsum";
paulson@13796
   472
val Increasing_imp_Stable_pfixGe = thm "Increasing_imp_Stable_pfixGe";
paulson@13796
   473
val LeadsTo_le_imp_pfixGe = thm "LeadsTo_le_imp_pfixGe";
paulson@13796
   474
paulson@13786
   475
paulson@13786
   476
(*proves "co" properties when the program is specified*)
paulson@13786
   477
fun gen_constrains_tac(cs,ss) i = 
paulson@13786
   478
   SELECT_GOAL
paulson@13786
   479
      (EVERY [REPEAT (Always_Int_tac 1),
paulson@13786
   480
	      REPEAT (etac Always_ConstrainsI 1
paulson@13786
   481
		      ORELSE
paulson@13786
   482
		      resolve_tac [StableI, stableI,
paulson@13786
   483
				   constrains_imp_Constrains] 1),
paulson@13786
   484
	      rtac constrainsI 1,
paulson@13786
   485
	      full_simp_tac ss 1,
paulson@13786
   486
	      REPEAT (FIRSTGOAL (etac disjE)),
paulson@13786
   487
	      ALLGOALS (clarify_tac cs),
paulson@13786
   488
	      ALLGOALS (asm_lr_simp_tac ss)]) i;
paulson@13786
   489
paulson@13786
   490
(*proves "ensures/leadsTo" properties when the program is specified*)
paulson@13786
   491
fun gen_ensures_tac(cs,ss) sact = 
paulson@13786
   492
    SELECT_GOAL
paulson@13786
   493
      (EVERY [REPEAT (Always_Int_tac 1),
paulson@13786
   494
	      etac Always_LeadsTo_Basis 1 
paulson@13786
   495
	          ORELSE   (*subgoal may involve LeadsTo, leadsTo or ensures*)
paulson@13786
   496
		  REPEAT (ares_tac [LeadsTo_Basis, leadsTo_Basis,
paulson@13786
   497
				    EnsuresI, ensuresI] 1),
paulson@13786
   498
	      (*now there are two subgoals: co & transient*)
paulson@13786
   499
	      simp_tac ss 2,
paulson@13786
   500
	      res_inst_tac [("act", sact)] transientI 2,
paulson@13786
   501
                 (*simplify the command's domain*)
paulson@13786
   502
	      simp_tac (ss addsimps [Domain_def]) 3,
paulson@13786
   503
	      gen_constrains_tac (cs,ss) 1,
paulson@13786
   504
	      ALLGOALS (clarify_tac cs),
paulson@13786
   505
	      ALLGOALS (asm_lr_simp_tac ss)]);
paulson@13786
   506
paulson@13796
   507
fun ensures_tac sact = gen_ensures_tac (claset(), simpset()) sact;
paulson@13796
   508
paulson@13786
   509
paulson@13786
   510
(*Composition equivalences, from Lift_prog*)
paulson@13786
   511
paulson@13786
   512
fun make_o_equivs th =
paulson@13786
   513
    [th,
paulson@13786
   514
     th RS o_equiv_assoc |> simplify (HOL_ss addsimps [o_assoc]),
paulson@13786
   515
     th RS o_equiv_apply |> simplify (HOL_ss addsimps [o_def, sub_def])];
paulson@13786
   516
paulson@13786
   517
Addsimps (make_o_equivs fst_o_funPair @ make_o_equivs snd_o_funPair);
paulson@13786
   518
paulson@13786
   519
Addsimps (make_o_equivs fst_o_lift_map @ make_o_equivs snd_o_lift_map);