src/ZF/UNITY/UNITY.ML
author berghofe
Mon, 12 Nov 2001 10:37:36 +0100
changeset 12152 46f128d8133c
parent 11479 697dcaaf478f
child 12195 ed2893765a08
permissions -rw-r--r--
Renamed some bound variables due to changes in simplifier.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      ZF/UNITY/UNITY.ML
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Sidi O Ehmety, Computer Laboratory
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   2001  University of Cambridge
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     5
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     6
The basic UNITY theory (revised version, based upon the "co" operator)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     7
From Misra, "A Logic for Concurrent Programming", 1994
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     8
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     9
Proofs ported from HOL
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    10
*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    11
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    12
(** SKIP **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    13
Goal "SKIP:program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    14
by (auto_tac (claset(), simpset() addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    15
    [SKIP_def, program_def, mk_program_def, actionSet_def, cons_absorb]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    16
qed "SKIP_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    17
AddIffs [SKIP_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    18
AddTCs  [SKIP_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    19
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    20
(** programify: coersion from anything to program **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    21
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    22
Goalw [programify_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    23
"F:program ==> programify(F)=F";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    24
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    25
qed "programify_program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    26
Addsimps [programify_program];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    27
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    28
Goalw [programify_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    29
"programify(F):program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    30
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    31
qed "programify_in_program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    32
AddIffs [programify_in_program];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    33
AddTCs  [programify_in_program];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    34
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    35
(** Collapsing rules: to remove programify from expressions **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    36
Goalw [programify_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    37
"programify(programify(F))=programify(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    38
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    39
qed "programify_idem";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    40
Addsimps [programify_idem];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    41
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    42
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    43
"Init(programify(F)) = Init(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    44
by (simp_tac (simpset() addsimps [Init_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    45
qed "Init_programify";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    46
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    47
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    48
"Acts(programify(F)) = Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    49
by (simp_tac (simpset() addsimps [Acts_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    50
qed "Acts_programify";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    51
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    52
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    53
"AllowedActs(programify(F)) = AllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    54
by (simp_tac (simpset() addsimps [AllowedActs_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    55
qed "AllowedActs_programify";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    56
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    57
Addsimps [Init_programify,Acts_programify,AllowedActs_programify];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    58
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    59
(** program inspectors **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    60
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    61
Goal  "F:program ==>Id:RawActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    62
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    63
        addsimps [program_def, RawActs_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    64
qed "Id_in_RawActs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    65
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    66
Goal "Id:Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    67
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    68
      addsimps [Id_in_RawActs, Acts_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    69
qed "Id_in_Acts";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    70
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    71
Goal  "F:program ==>Id:RawAllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    72
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    73
         addsimps [program_def, RawAllowedActs_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    74
qed "Id_in_RawAllowedActs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    75
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    76
Goal   "Id:AllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    77
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    78
     addsimps [Id_in_RawAllowedActs, AllowedActs_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    79
qed "Id_in_AllowedActs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    80
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    81
AddIffs [Id_in_Acts, Id_in_AllowedActs];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    82
AddTCs [Id_in_Acts, Id_in_AllowedActs];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    83
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    84
Goal "cons(Id, Acts(F)) = Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    85
by (simp_tac (simpset() addsimps [cons_absorb]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    86
qed "cons_Id_Acts";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    87
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    88
Goal "cons(Id, AllowedActs(F)) = AllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    89
by (simp_tac (simpset() addsimps [cons_absorb]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    90
qed "cons_Id_AllowedActs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    91
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    92
Addsimps [cons_Id_Acts, cons_Id_AllowedActs];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    93
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    94
(** inspectors's types **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    95
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    96
"F:program ==> RawInit(F):condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    97
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    98
        addsimps [program_def, RawInit_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    99
qed "RawInit_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   100
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   101
Goal "Init(F):condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   102
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   103
    addsimps [RawInit_type, Init_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   104
qed "Init_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   105
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   106
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   107
"F:program ==> RawActs(F):actionSet";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   108
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   109
       addsimps [program_def, RawActs_def, actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   110
qed "RawActs_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   111
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   112
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   113
"Acts(F):actionSet";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   114
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   115
    addsimps [RawActs_type, Acts_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   116
qed "Acts_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   117
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   118
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   119
"F:program ==> RawAllowedActs(F):actionSet";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   120
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   121
         addsimps [program_def, RawAllowedActs_def, actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   122
qed "RawAllowedActs_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   123
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   124
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   125
"AllowedActs(F): actionSet";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   126
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   127
     addsimps [RawAllowedActs_type, AllowedActs_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   128
qed "AllowedActs_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   129
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   130
AddIffs [Init_type, Acts_type, AllowedActs_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   131
AddTCs  [Init_type, Acts_type, AllowedActs_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   132
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   133
Goal "x:Init(F) ==> x:state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   134
by (cut_inst_tac [("F", "F")] Init_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   135
by (auto_tac (claset(), simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   136
qed "InitD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   137
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   138
Goal "act:Acts(F) ==> act<=state*state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   139
by (cut_inst_tac [("F", "F")] Acts_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   140
by (rewrite_goals_tac [actionSet_def]);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   141
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   142
qed "ActsD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   143
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   144
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   145
Goal "act:AllowedActs(F) ==> act<=state*state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   146
by (cut_inst_tac [("F", "F")] AllowedActs_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   147
by (rewrite_goals_tac [actionSet_def]);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   148
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   149
qed "AllowedActsD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   150
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   151
(** More simplification rules involving state 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   152
    and Init, Acts, and AllowedActs **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   153
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   154
Goal "state <= Init(F) <-> Init(F)=state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   155
by (cut_inst_tac [("F", "F")] Init_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   156
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   157
      simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   158
qed "Init_state_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   159
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   160
Goal "action <= Acts(F) <-> Acts(F)=action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   161
by (cut_inst_tac [("F", "F")] Acts_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   162
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   163
      simpset() addsimps [actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   164
qed "Acts_action_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   165
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   166
Goal "action <= AllowedActs(F) <-> AllowedActs(F)=action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   167
by (cut_inst_tac [("F", "F")] AllowedActs_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   168
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   169
      simpset() addsimps [actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   170
qed "AllowedActs_action_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   171
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   172
(** Eliminating `Int state' from expressions  **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   173
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   174
"Init(F) Int state = Init(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   175
by (cut_inst_tac [("F", "F")] Init_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   176
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   177
      simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   178
qed "Init_Int_state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   179
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   180
Goal 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   181
"state Int Init(F) = Init(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   182
by (stac (Int_commute) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   183
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   184
      addsimps [Init_Int_state]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   185
qed "Init_Int_state2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   186
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   187
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   188
"Acts(F) Int action = Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   189
by (cut_inst_tac [("F", "F")] Acts_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   190
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   191
      simpset() addsimps [actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   192
qed "Acts_Int_action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   193
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   194
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   195
"action Int Acts(F) = Acts(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   196
by (simp_tac (simpset() addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   197
         [Int_commute, Acts_Int_action]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   198
qed "Acts_Int_action2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   199
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   200
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   201
"AllowedActs(F) Int action = AllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   202
by (cut_inst_tac [("F", "F")] AllowedActs_type 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   203
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   204
      simpset() addsimps [actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   205
qed "AllowedActs_Int_action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   206
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   207
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   208
"action Int AllowedActs(F) = AllowedActs(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   209
by (simp_tac (simpset() addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   210
         [Int_commute, AllowedActs_Int_action]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   211
qed  "AllowedActs_Int_action2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   212
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   213
Addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   214
[Init_state_eq, Acts_action_eq, AllowedActs_action_eq,
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   215
 Init_Int_state, Init_Int_state2, Acts_Int_action, Acts_Int_action2,
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   216
 AllowedActs_Int_action,AllowedActs_Int_action2];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   217
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   218
(** mk_program **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   219
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   220
Goal "mk_program(init, acts, allowed):program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   221
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   222
  addsimps [program_def, mk_program_def, condition_def, actionSet_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   223
qed "mk_program_type";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   224
AddIffs [mk_program_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   225
AddTCs [mk_program_type];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   226
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   227
Goal "RawInit(mk_program(init, acts, allowed)) = init Int state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   228
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   229
       addsimps [RawInit_def, mk_program_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   230
qed "RawInit_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   231
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   232
Goal "Init(mk_program(init, acts, allowed)) = init Int state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   233
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   234
        addsimps [Init_def, RawInit_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   235
qed "Init_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   236
Addsimps [Init_eq];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   237
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   238
Goalw [RawActs_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   239
"RawActs(mk_program(init, acts, allowed)) \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   240
\  = cons(Id, acts Int Pow(state*state))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   241
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   242
      addsimps [mk_program_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   243
qed "RawActs_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   244
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   245
Goalw [Acts_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   246
"Acts(mk_program(init, acts, allowed))  \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   247
 \ = cons(Id, acts  Int Pow(state*state))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   248
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   249
      simpset() addsimps [RawActs_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   250
qed "Acts_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   251
Addsimps [Acts_eq];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   252
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   253
Goalw [RawAllowedActs_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   254
"RawAllowedActs(mk_program(init, acts, allowed)) \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   255
\  = cons(Id, allowed Int action)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   256
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   257
       simpset() addsimps [mk_program_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   258
qed "RawAllowedActs_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   259
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   260
Goalw [AllowedActs_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   261
"AllowedActs(mk_program(init, acts, allowed)) \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   262
\  = cons(Id, allowed Int action)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   263
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   264
      simpset() addsimps [RawAllowedActs_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   265
qed "AllowedActs_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   266
Addsimps [AllowedActs_eq];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   267
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   268
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   269
(**Init, Acts, and AlowedActs  of SKIP **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   270
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   271
Goal "RawInit(SKIP) = state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   272
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   273
             addsimps [SKIP_def, RawInit_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   274
qed "RawInit_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   275
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   276
Goal "Init(SKIP) = state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   277
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   278
   addsimps [Init_def, RawInit_SKIP]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   279
qed "Init_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   280
Addsimps [Init_SKIP];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   281
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   282
Goal "RawActs(SKIP) = {Id}";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   283
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   284
      addsimps [SKIP_def, RawActs_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   285
qed "RawActs_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   286
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   287
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   288
Goal "Acts(SKIP) = {Id}";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   289
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   290
    addsimps [Acts_def, RawActs_SKIP]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   291
qed "Acts_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   292
Addsimps [Acts_SKIP];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   293
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   294
Goal "RawAllowedActs(SKIP) = action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   295
by (auto_tac (claset(), simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   296
    addsimps [SKIP_def, RawAllowedActs_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   297
qed "RawAllowedActs_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   298
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   299
Goal "AllowedActs(SKIP) = action";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   300
by (simp_tac (simpset() 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   301
    addsimps [AllowedActs_def, RawAllowedActs_SKIP]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   302
qed "AllowedActs_SKIP";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   303
Addsimps [AllowedActs_SKIP];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   304
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   305
(** Equality for UNITY programs **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   306
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   307
Goal 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   308
"F:program ==> mk_program(RawInit(F), RawActs(F), RawAllowedActs(F))=F";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   309
by (auto_tac (claset(), simpset() addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   310
                   [program_def, mk_program_def, RawInit_def,
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   311
                    RawActs_def, RawAllowedActs_def, actionSet_def, condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   312
by (REPEAT(Blast_tac 1));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   313
qed "raw_surjective_mk_program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   314
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   315
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   316
  "mk_program(Init(F), Acts(F), AllowedActs(F)) = programify(F)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   317
by (auto_tac (claset(), simpset() addsimps 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   318
                        [Init_def, Acts_def, AllowedActs_def,
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   319
                         raw_surjective_mk_program]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   320
qed "surjective_mk_program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   321
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   322
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   323
Goal "[|Init(F) = Init(G); Acts(F) = Acts(G); \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   324
\ AllowedActs(F) = AllowedActs(G); F:program; G:program |] ==> F = G";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   325
by (stac (programify_program RS sym) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   326
by (rtac sym 2);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   327
by (stac  (programify_program RS sym) 2);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   328
by (stac (surjective_mk_program RS sym) 3);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   329
by (stac (surjective_mk_program RS sym) 3);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   330
by (ALLGOALS(Asm_simp_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   331
qed "program_equalityI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   332
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   333
val [major,minor] =
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   334
Goal "[| F = G; \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   335
\        [| Init(F) = Init(G); Acts(F) = Acts(G); AllowedActs(F) = AllowedActs(G) |]\
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   336
\        ==> P |] ==> P";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   337
by (rtac minor 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   338
by (auto_tac (claset(), simpset() addsimps [major]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   339
qed "program_equalityE";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   340
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   341
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   342
Goal "[| F:program; G:program |] ==>(F=G)  <->  \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   343
\     (Init(F) = Init(G) & Acts(F) = Acts(G) & AllowedActs(F) = AllowedActs(G))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   344
by (blast_tac (claset() addIs [program_equalityI, program_equalityE]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   345
qed "program_equality_iff";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   346
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   347
Addsimps [surjective_mk_program];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   348
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   349
(*** These rules allow "lazy" definition expansion 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   350
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   351
...skipping 1 line
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   352
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   353
***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   354
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   355
Goal "F == mk_program (init,acts,allowed) ==> Init(F) = init Int state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   356
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   357
qed "def_prg_Init";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   358
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   359
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   360
Goal "F == mk_program (init,acts,allowed) ==> Acts(F) = cons(Id, acts Int action)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   361
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   362
qed "def_prg_Acts";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   363
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   364
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   365
Goal "F == mk_program (init,acts,allowed) ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   366
\    AllowedActs(F) = cons(Id, allowed Int action)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   367
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   368
qed "def_prg_AllowedActs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   369
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   370
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   371
val [rew] = goal thy
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   372
    "[| F == mk_program (init,acts,allowed) |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   373
\    ==> Init(F) = init Int state & Acts(F) = cons(Id, acts Int action)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   374
by (rewtac rew);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   375
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   376
qed "def_prg_simps";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   377
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   378
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   379
(*An action is expanded only if a pair of states is being tested against it*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   380
Goal "[| act == {<s,s'>:A*B. P(s, s')} |] ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   381
\ (<s,s'>:act) <-> (<s,s'>:A*B & P(s, s'))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   382
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   383
qed "def_act_simp";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   384
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   385
fun simp_of_act def = def RS def_act_simp;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   386
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   387
(*A set is expanded only if an element is being tested against it*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   388
Goal "A == B ==> (x : A) <-> (x : B)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   389
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   390
qed "def_set_simp";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   391
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   392
fun simp_of_set def = def RS def_set_simp;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   393
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   394
(*** co ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   395
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   396
val prems = Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   397
    "[|(!!act s s'. [| act: Acts(F);  <s,s'>:act; s:A|] ==> s':A'); \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   398
    \   F:program; A:condition; A':condition |]  ==> F:A co A'";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   399
by (blast_tac(claset() addIs prems) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   400
qed "constrainsI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   401
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   402
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   403
   "F:A co B ==> ALL act:Acts(F). act``A<=B";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   404
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   405
qed "constrainsD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   406
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   407
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   408
  "F:A co B ==> F:program & A:condition & B:condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   409
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   410
qed "constrainsD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   411
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   412
Goalw [constrains_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   413
     "[| F:program; B:condition |] ==> F : 0 co B";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   414
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   415
qed "constrains_empty";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   416
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   417
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   418
    "[| F:program; A:condition |] ==>(F : A co 0) <-> (A=0)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   419
by (auto_tac (claset() addSDs [bspec], 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   420
              simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   421
qed "constrains_empty2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   422
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   423
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   424
"[| F:program; B:condition |] ==> (F: state co B) <-> (B = state)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   425
by (auto_tac (claset() addSDs [bspec] addDs [ActsD], 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   426
              simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   427
qed "constrains_state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   428
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   429
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   430
Goalw [constrains_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   431
          "[| F:program; A:condition |] ==> F : A co state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   432
by (auto_tac (claset() addDs [ActsD], simpset()));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   433
qed "constrains_state2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   434
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   435
Addsimps [constrains_empty, constrains_empty2, 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   436
         constrains_state, constrains_state2];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   437
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   438
(*monotonic in 2nd argument*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   439
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   440
    "[| F:A co A'; A'<=B'; B':condition |] ==> F : A co B'";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   441
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   442
qed "constrains_weaken_R";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   443
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   444
(*anti-monotonic in 1st argument*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   445
Goalw [constrains_def, condition_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   446
    "[| F : A co A'; B<=A |] ==> F : B co A'";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   447
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   448
qed "constrains_weaken_L";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   449
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   450
Goal
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   451
   "[| F : A co A'; B<=A; A'<=B'; B':condition |] ==> F : B co B'";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   452
by (dtac constrains_weaken_R 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   453
by (dtac constrains_weaken_L 3);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   454
by (REPEAT(Blast_tac 1));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   455
qed "constrains_weaken";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   456
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   457
(** Union **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   458
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   459
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   460
    "[| F : A co A'; F:B co B' |] ==> F:(A Un B) co (A' Un B')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   461
by (Asm_full_simp_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   462
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   463
qed "constrains_Un";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   464
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   465
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   466
    "[| F : A co A'; F:B co B' |] ==> F:(A Un B) co (A' Un B')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   467
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   468
by (asm_full_simp_tac 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   469
        (simpset() addsimps [condition_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   470
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   471
qed "constrains_Un";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   472
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   473
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   474
    "[| ALL i:I. F:A(i) co A'(i); F:program |] ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   475
\  F:(UN i:I. A(i)) co (UN i:I. A'(i))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   476
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   477
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   478
bind_thm ("constrains_UN", ballI RS result());
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   480
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   481
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   482
     "(A Un B) co C = (A co C) Int (B co C)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   483
by (rtac equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   484
by (ALLGOALS(Asm_full_simp_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   485
by (ALLGOALS(Blast_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   486
qed "constrains_Un_distrib";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   487
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   488
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   489
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   490
   "i:I ==> (UN i:I. A(i)) co B = (INT i:I. A(i) co B)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   491
by (rtac equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   492
by Safe_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   493
by (ALLGOALS(Asm_full_simp_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   494
by (ALLGOALS(Blast_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   495
qed "constrains_UN_distrib";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   496
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   497
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   498
 "[| A:condition; B:condition |] \ 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   499
\  ==> C co (A Int B) = (C co A) Int (C co B)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   500
by (rtac equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   501
by (ALLGOALS(Clarify_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   502
by (ALLGOALS(Blast_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   503
qed "constrains_Int_distrib";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   504
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   505
Goalw [constrains_def] "[| i:I; ALL i:I. B(i):condition |] ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   506
\  A co (INT i:I. B(i)) = (INT i:I. A co B(i))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   507
by (rtac equalityI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   508
by Safe_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   509
by (ALLGOALS(Blast_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   510
qed "constrains_INT_distrib";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   511
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   512
(** Intersection **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   513
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   514
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   515
    "[| F : A co A'; F : B co B' |] ==> F : (A Int B) co (A' Int B')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   516
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   517
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   518
qed "constrains_Int";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   519
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   520
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   521
    "[| ALL i:I. F : A(i) co A'(i); F:program |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   522
\     ==> F : (INT i:I. A(i)) co (INT i:I. A'(i))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   523
by (case_tac "I=0" 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   524
by (asm_full_simp_tac (simpset() addsimps [Inter_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   525
by (etac not_emptyE 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   526
by Safe_tac; 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   527
by (dres_inst_tac [("x", "xd")]  bspec 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   528
by (ALLGOALS(Blast_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   529
bind_thm ("constrains_INT", ballI RS result());
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   530
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   531
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   532
(* This rule simulates the HOL's one for (INT z. A i) co (INT z. B i)  *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   533
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   534
Goalw [constrains_def, condition_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   535
 "[| ALL z. F: {s:state. P(s, z)} co {s:state. Q(s, z)}; F:program |] ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   536
\  F: {s:state. ALL z. P(s, z)} co {s:state. ALL z. Q(s, z)}";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   537
by (auto_tac (claset() addSDs [bspec] addDs [ActsD], 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   538
              simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   539
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   540
bind_thm ("constrains_All", allI RS result());
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   541
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   542
Goalw [constrains_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   543
      "F : A co A' ==> A <= A'";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   544
by (auto_tac (claset() addSDs [bspec], simpset()));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   545
qed "constrains_imp_subset";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   546
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   547
(*The reasoning is by subsets since "co" refers to single actions
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   548
  only.  So this rule isn't that useful.*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   549
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   550
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   551
    "[| F : A co B; F : B co C |] ==> F : A co C";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   552
by Auto_tac;
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   553
by (dres_inst_tac [("x", "act")] bspec 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   554
by (dres_inst_tac [("x", "Id")] bspec 2);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   555
by (auto_tac (claset() addDs [ActsD], 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   556
              simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   557
qed "constrains_trans";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   558
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   559
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   560
   "[| F : A co (A' Un B); F : B co B' |] ==> F : A co (A' Un B')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   561
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   562
by (dres_inst_tac [("x", "Id")] bspec 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   563
by (dres_inst_tac [("x", "act")] bspec 2);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   564
by (auto_tac (claset(), simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   565
qed "constrains_cancel";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   566
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   567
(*** unless ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   568
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   569
Goalw [unless_def] "F : (A-B) co (A Un B) ==> F : A unless B";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   570
by (assume_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   571
qed "unlessI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   572
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   573
Goalw [unless_def] "F :A unless B ==> F : (A-B) co (A Un B)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   574
by (assume_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   575
qed "unlessD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   576
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   577
Goalw [unless_def, constrains_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   578
     "F: A unless B ==> F:program & A:condition & B:condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   579
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   580
qed "unlessD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   581
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   582
(*** initially ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   583
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   584
Goalw [initially_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   585
"[| Init(F)<=A; F:program; A:condition |] ==> F:initially(A)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   586
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   587
qed "initiallyI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   588
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   589
Goalw [initially_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   590
"F:initially(A) ==> Init(F)<=A";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   591
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   592
qed "initiallyD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   593
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   594
Goalw [initially_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   595
"F:initially(A) ==> F:program & A:condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   596
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   597
qed "initiallyD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   598
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   599
(*** stable ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   600
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   601
Goalw [stable_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   602
    "F : A co A ==> F : stable(A)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   603
by (assume_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   604
qed "stableI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   605
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   606
Goalw [stable_def] "F : stable(A) ==> F : A co A";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   607
by (assume_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   608
qed "stableD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   609
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   610
Goalw [stable_def, constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   611
   "F:stable(A)==> F:program & A:condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   612
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   613
qed "stableD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   614
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   615
Goalw [stable_def, constrains_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   616
      "stable(state) = program";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   617
by (auto_tac (claset() addDs [ActsD], simpset()));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   618
qed "stable_state";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   619
Addsimps [stable_state];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   620
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   621
(** Union **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   622
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   623
Goalw [stable_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   624
    "[| F : stable(A); F : stable(A') |] ==> F : stable(A Un A')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   625
by (blast_tac (claset() addIs [constrains_Un]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   626
qed "stable_Un";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   627
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   628
val [major, minor] = Goalw [stable_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   629
    "[| (!!i. i:I ==> F : stable(A(i))); F:program |] ==> F:stable (UN i:I. A(i))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   630
by (cut_facts_tac [minor] 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   631
by (blast_tac (claset() addIs [constrains_UN, major]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   632
qed "stable_UN";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   633
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   634
Goalw [stable_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   635
    "[| F : stable(A);  F : stable(A') |] ==> F : stable (A Int A')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   636
by (blast_tac (claset() addIs [constrains_Int]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   637
qed "stable_Int";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   638
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   639
val [major, minor] = Goalw [stable_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   640
    "[| (!!i. i:I ==> F : stable(A(i))); F:program |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   641
\  ==> F : stable (INT i:I. A(i))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   642
by (cut_facts_tac [minor] 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   643
by (blast_tac (claset() addIs [constrains_INT, major]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   644
qed "stable_INT";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   645
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   646
Goalw [stable_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   647
 "[| ALL z. F: stable({s:state. P(s, z)}); F:program |] ==> \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   648
\ F: stable({s:state. ALL z. P(s, z)})";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   649
by (rtac constrains_All 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   650
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   651
bind_thm("stable_All", allI RS result());
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   652
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   653
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   654
Goalw [stable_def, constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   655
    "[| F : stable(C); F : A co (C Un A') |] ==> F : (C Un A) co (C Un A')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   656
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   657
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   658
qed "stable_constrains_Un";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   659
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   660
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   661
Goalw [stable_def, constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   662
  "[| F : stable(C); F :  (C Int A) co A' |] ==> F : (C Int A) co (C Int A')";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   663
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   664
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   665
qed "stable_constrains_Int";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   666
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   667
(*[| F : stable(C); F :  (C Int A) co A |] ==> F : stable (C Int A) *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   668
bind_thm ("stable_constrains_stable", stable_constrains_Int RS stableI);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   669
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   670
(** invariant **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   671
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   672
Goalw [invariant_def, initially_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   673
"invariant(A) = initially(A) Int stable(A)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   674
by (blast_tac (claset() addDs [stableD2]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   675
qed "invariant_eq";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   676
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   677
val invariant_def2 = invariant_eq RS eq_reflection;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   678
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   679
Goalw [invariant_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   680
 "[| Init(F)<=A;  F:stable(A) |] ==> F : invariant(A)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   681
by (blast_tac (claset() addDs [stableD2]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   682
qed "invariantI";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   683
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   684
Goalw [invariant_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   685
"F:invariant(A) ==> Init(F)<=A & F:stable(A)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   686
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   687
qed "invariantD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   688
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   689
Goalw [invariant_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   690
  "F:invariant(A) ==> F:program & A:condition";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   691
by (blast_tac (claset() addDs [stableD2]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   692
qed "invariantD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   693
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   694
(*Could also say "invariant A Int invariant B <= invariant (A Int B)"*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   695
Goalw [invariant_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   696
  "[| F : invariant(A);  F : invariant(B) |] ==> F : invariant(A Int B)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   697
by (asm_full_simp_tac (simpset() addsimps [stable_Int]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   698
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   699
qed "invariant_Int";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   700
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   701
(** The Elimination Theorem.  The "free" m has become universally quantified!
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   702
    Should the premise be !!m instead of ALL m ?  Would make it harder to use
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   703
    in forward proof. **)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   704
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   705
Goalw [constrains_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   706
    "[| ALL m:M. F : {s:S. x(s) = m} co B(m); F:program  |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   707
\    ==> F:{s:S. x(s):M} co (UN m:M. B(m))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   708
by Safe_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   709
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   710
by (auto_tac (claset(), simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   711
qed "elimination";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   712
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   713
(* As above, but for the special case of S=state *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   714
Goal "[| ALL m:M. F : {s:state. x(s) = m} co B(m); F:program  |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   715
\    ==> F:{s:state. x(s):M} co (UN m:M. B(m))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   716
by (rtac elimination  1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   717
by (ALLGOALS(Clarify_tac));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   718
qed "eliminiation2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   719
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   720
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   721
Goalw [constrains_def, strongest_rhs_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   722
    "[| F:program; A:condition |] ==>F : A co (strongest_rhs(F,A))";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   723
by (auto_tac (claset() addDs [ActsD], simpset()));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   724
qed "constrains_strongest_rhs";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   725
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   726
Goalw [constrains_def, strongest_rhs_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   727
    "F : A co B ==> strongest_rhs(F,A) <=B";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   728
by Safe_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   729
by (dtac InterD 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   730
by (auto_tac (claset(), 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   731
              simpset() addsimps [condition_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   732
qed "strongest_rhs_is_strongest";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   733
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   734
(*** increasing ***)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   735
Goalw [increasing_on_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   736
   "[| F:increasing[A](f, r); z:A |] ==> F:stable({s:state. <z, f`s>:r})";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   737
by (Blast_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   738
qed "increasing_onD";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   739
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   740
Goalw [increasing_on_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   741
"F:increasing[A](f, r) ==> F:program & f:state->A & part_order(A,r)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   742
by (auto_tac (claset(), simpset() addsimps [INT_iff]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   743
qed "increasing_onD2";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   744
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   745
Goalw [increasing_on_def, stable_def] 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   746
"[| part_order(A,r); c:A; F:program |] ==> F : increasing[A](lam s:state. c, r)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   747
by (auto_tac (claset(), simpset() addsimps [INT_iff]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   748
by (force_tac (claset() addSDs [bspec, ActsD], 
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   749
              simpset() addsimps [constrains_def, condition_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   750
qed "increasing_on_constant";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   751
Addsimps [increasing_on_constant];
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   752
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   753
Goalw [increasing_on_def, stable_def, constrains_def, part_order_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   754
     "!!f. g:mono_map(A,r,A,r) \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   755
\  ==> increasing[A](f, r) <= increasing[A](g O f, r)";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   756
by (asm_full_simp_tac (simpset() addsimps [INT_iff,condition_def, mono_map_def]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   757
by (auto_tac (claset() addIs [comp_fun], simpset() addsimps [mono_map_def]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   758
by (force_tac (claset() addSDs [bspec, ActsD],  simpset()) 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   759
by (subgoal_tac "xc:state" 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   760
by (force_tac (claset() addSDs [ActsD], simpset()) 2);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   761
by (subgoal_tac "f`xd:A & f`xc:A" 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   762
by (blast_tac (claset() addDs [apply_type]) 2);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   763
by (rotate_tac 3 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   764
by (dres_inst_tac [("x", "f`xd")] bspec 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   765
by (Asm_simp_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   766
by (REPEAT(etac conjE 1));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   767
by (rotate_tac ~2 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   768
by (dres_inst_tac [("x", "act")] bspec 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   769
by (Asm_simp_tac 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   770
by (dres_inst_tac [("c", "xc")] subsetD 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   771
by (rtac imageI 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   772
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   773
by (asm_full_simp_tac (simpset() addsimps [refl_def]) 1);
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   774
by (dres_inst_tac [("x", "f`xd")] bspec 1);
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   775
by (dres_inst_tac [("x", "f`xc")] bspec 2);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   776
by (ALLGOALS(Asm_simp_tac));
12152
46f128d8133c Renamed some bound variables due to changes in simplifier.
berghofe
parents: 11479
diff changeset
   777
by (dres_inst_tac [("b", "g`(f`xd)")] trans_onD 1);
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   778
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   779
qed "mono_increasing_on_comp";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   780
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   781
(*Holds by the theorem (succ(m) le n) = (m < n) *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   782
Goalw [increasing_on_def, nat_order_def]
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   783
     "[| F:increasing[nat](f, nat_order); z:nat |] \
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   784
\  ==> F: stable({s:state. z < f`s})";
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   785
by (Clarify_tac 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   786
by (asm_full_simp_tac (simpset() addsimps [INT_iff]) 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   787
by Safe_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   788
by (dres_inst_tac [("x", "succ(z)")] bspec 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   789
by (auto_tac (claset(), simpset() addsimps [apply_type, Collect_conj_eq]));
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   790
by (subgoal_tac "{x: state . f ` x : nat} = state" 1);
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   791
by Auto_tac;
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   792
qed "strict_increasing_onD";