src/ZF/UNITY/UNITY.thy
author obua
Sun, 09 May 2004 23:04:36 +0200
changeset 14722 8e739a6eaf11
parent 14077 37c964462747
child 16183 052d9aba392d
permissions -rw-r--r--
replaced apply-style proof for instance Multiset :: plus_ac0 by recommended Isar proof style
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.thy
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
Theory ported from HOL.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    10
*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    11
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    12
header {*The Basic UNITY Theory*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    13
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    14
theory UNITY = State:
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    15
consts
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    16
  constrains :: "[i, i] => i"  (infixl "co"     60)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    17
  op_unless  :: "[i, i] => i"  (infixl "unless" 60)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    18
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    19
constdefs
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    20
   program  :: i
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    21
  "program == {<init, acts, allowed>:
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    22
	       Pow(state) * Pow(Pow(state*state)) * Pow(Pow(state*state)).
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    23
	       id(state) \<in> acts & id(state) \<in> allowed}"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    24
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    25
  mk_program :: "[i,i,i]=>i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    26
  --{* The definition yields a program thanks to the coercions
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    27
       init \<inter> state, acts \<inter> Pow(state*state), etc. *}
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    28
  "mk_program(init, acts, allowed) ==
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    29
    <init \<inter> state, cons(id(state), acts \<inter> Pow(state*state)),
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    30
              cons(id(state), allowed \<inter> Pow(state*state))>"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    31
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    32
  SKIP :: i
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    33
  "SKIP == mk_program(state, 0, Pow(state*state))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    34
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    35
  (* Coercion from anything to program *)
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    36
  programify :: "i=>i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    37
  "programify(F) == if F \<in> program then F else SKIP"
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    38
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    39
  RawInit :: "i=>i"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    40
  "RawInit(F) == fst(F)"
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    41
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    42
  Init :: "i=>i"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    43
  "Init(F) == RawInit(programify(F))"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    44
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    45
  RawActs :: "i=>i"
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    46
  "RawActs(F) == cons(id(state), fst(snd(F)))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    47
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    48
  Acts :: "i=>i"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    49
  "Acts(F) == RawActs(programify(F))"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    50
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    51
  RawAllowedActs :: "i=>i"
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    52
  "RawAllowedActs(F) == cons(id(state), snd(snd(F)))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    53
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    54
  AllowedActs :: "i=>i"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    55
  "AllowedActs(F) == RawAllowedActs(programify(F))"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    56
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    57
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    58
  Allowed :: "i =>i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    59
  "Allowed(F) == {G \<in> program. Acts(G) \<subseteq> AllowedActs(F)}"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    60
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    61
  initially :: "i=>i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    62
  "initially(A) == {F \<in> program. Init(F)\<subseteq>A}"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    63
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    64
  stable     :: "i=>i"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    65
   "stable(A) == A co A"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    66
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    67
  strongest_rhs :: "[i, i] => i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    68
  "strongest_rhs(F, A) == Inter({B \<in> Pow(state). F \<in> A co B})"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    69
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    70
  invariant :: "i => i"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    71
  "invariant(A) == initially(A) \<inter> stable(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    72
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 12195
diff changeset
    73
  (* meta-function composition *)
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    74
  metacomp :: "[i=>i, i=>i] => (i=>i)" (infixl "comp" 65)
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 12195
diff changeset
    75
  "f comp g == %x. f(g(x))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    76
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 12195
diff changeset
    77
  pg_compl :: "i=>i"
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 12195
diff changeset
    78
  "pg_compl(X)== program - X"
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    79
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    80
defs
14077
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    81
  constrains_def:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    82
     "A co B == {F \<in> program. (\<forall>act \<in> Acts(F). act``A\<subseteq>B) & st_set(A)}"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    83
    --{* the condition @{term "st_set(A)"} makes the definition slightly
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    84
         stronger than the HOL one *}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    85
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    86
  unless_def:    "A unless B == (A - B) co (A Un B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    87
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    88
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    89
(** SKIP **)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    90
lemma SKIP_in_program [iff,TC]: "SKIP \<in> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    91
by (force simp add: SKIP_def program_def mk_program_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    92
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    93
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    94
subsection{*The function @{term programify}, the coercion from anything to
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    95
 program*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    96
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    97
lemma programify_program [simp]: "F \<in> program ==> programify(F)=F"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    98
by (force simp add: programify_def) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
    99
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   100
lemma programify_in_program [iff,TC]: "programify(F) \<in> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   101
by (force simp add: programify_def) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   102
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   103
(** Collapsing rules: to remove programify from expressions **)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   104
lemma programify_idem [simp]: "programify(programify(F))=programify(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   105
by (force simp add: programify_def) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   106
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   107
lemma Init_programify [simp]: "Init(programify(F)) = Init(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   108
by (simp add: Init_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   109
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   110
lemma Acts_programify [simp]: "Acts(programify(F)) = Acts(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   111
by (simp add: Acts_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   112
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   113
lemma AllowedActs_programify [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   114
     "AllowedActs(programify(F)) = AllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   115
by (simp add: AllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   116
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   117
subsection{*The Inspectors for Programs*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   118
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   119
lemma id_in_RawActs: "F \<in> program ==>id(state) \<in> RawActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   120
by (auto simp add: program_def RawActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   121
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   122
lemma id_in_Acts [iff,TC]: "id(state) \<in> Acts(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   123
by (simp add: id_in_RawActs Acts_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   124
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   125
lemma id_in_RawAllowedActs: "F \<in> program ==>id(state) \<in> RawAllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   126
by (auto simp add: program_def RawAllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   127
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   128
lemma id_in_AllowedActs [iff,TC]: "id(state) \<in> AllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   129
by (simp add: id_in_RawAllowedActs AllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   130
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   131
lemma cons_id_Acts [simp]: "cons(id(state), Acts(F)) = Acts(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   132
by (simp add: cons_absorb)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   133
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   134
lemma cons_id_AllowedActs [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   135
     "cons(id(state), AllowedActs(F)) = AllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   136
by (simp add: cons_absorb)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   137
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   138
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   139
subsection{*Types of the Inspectors*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   140
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   141
lemma RawInit_type: "F \<in> program ==> RawInit(F)\<subseteq>state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   142
by (auto simp add: program_def RawInit_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   143
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   144
lemma RawActs_type: "F \<in> program ==> RawActs(F)\<subseteq>Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   145
by (auto simp add: program_def RawActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   146
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   147
lemma RawAllowedActs_type:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   148
     "F \<in> program ==> RawAllowedActs(F)\<subseteq>Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   149
by (auto simp add: program_def RawAllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   150
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   151
lemma Init_type: "Init(F)\<subseteq>state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   152
by (simp add: RawInit_type Init_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   153
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   154
lemmas InitD = Init_type [THEN subsetD, standard]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   155
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   156
lemma st_set_Init [iff]: "st_set(Init(F))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   157
apply (unfold st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   158
apply (rule Init_type)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   159
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   160
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   161
lemma Acts_type: "Acts(F)\<subseteq>Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   162
by (simp add: RawActs_type Acts_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   163
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   164
lemma AllowedActs_type: "AllowedActs(F) \<subseteq> Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   165
by (simp add: RawAllowedActs_type AllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   166
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   167
(* Needed in Behaviors *)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   168
lemma ActsD: "[| act \<in> Acts(F); <s,s'> \<in> act |] ==> s \<in> state & s' \<in> state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   169
by (blast dest: Acts_type [THEN subsetD])
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   170
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   171
lemma AllowedActsD:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   172
     "[| act \<in> AllowedActs(F); <s,s'> \<in> act |] ==> s \<in> state & s' \<in> state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   173
by (blast dest: AllowedActs_type [THEN subsetD])
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   174
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   175
subsection{*Simplification rules involving @{term state}, @{term Init}, 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   176
  @{term Acts}, and @{term AllowedActs}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   177
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   178
text{*But are they really needed?*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   179
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   180
lemma state_subset_is_Init_iff [iff]: "state \<subseteq> Init(F) <-> Init(F)=state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   181
by (cut_tac F = F in Init_type, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   182
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   183
lemma Pow_state_times_state_is_subset_Acts_iff [iff]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   184
     "Pow(state*state) \<subseteq> Acts(F) <-> Acts(F)=Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   185
by (cut_tac F = F in Acts_type, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   186
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   187
lemma Pow_state_times_state_is_subset_AllowedActs_iff [iff]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   188
     "Pow(state*state) \<subseteq> AllowedActs(F) <-> AllowedActs(F)=Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   189
by (cut_tac F = F in AllowedActs_type, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   190
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   191
subsubsection{*Eliminating @{text "\<inter> state"} from expressions*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   192
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   193
lemma Init_Int_state [simp]: "Init(F) \<inter> state = Init(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   194
by (cut_tac F = F in Init_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   195
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   196
lemma state_Int_Init [simp]: "state \<inter> Init(F) = Init(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   197
by (cut_tac F = F in Init_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   198
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   199
lemma Acts_Int_Pow_state_times_state [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   200
     "Acts(F) \<inter> Pow(state*state) = Acts(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   201
by (cut_tac F = F in Acts_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   202
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   203
lemma state_times_state_Int_Acts [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   204
     "Pow(state*state) \<inter> Acts(F) = Acts(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   205
by (cut_tac F = F in Acts_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   206
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   207
lemma AllowedActs_Int_Pow_state_times_state [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   208
     "AllowedActs(F) \<inter> Pow(state*state) = AllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   209
by (cut_tac F = F in AllowedActs_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   210
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   211
lemma state_times_state_Int_AllowedActs [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   212
     "Pow(state*state) \<inter> AllowedActs(F) = AllowedActs(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   213
by (cut_tac F = F in AllowedActs_type, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   214
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   215
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   216
subsubsection{*The Opoerator @{term mk_program}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   217
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   218
lemma mk_program_in_program [iff,TC]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   219
     "mk_program(init, acts, allowed) \<in> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   220
by (auto simp add: mk_program_def program_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   221
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   222
lemma RawInit_eq [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   223
     "RawInit(mk_program(init, acts, allowed)) = init \<inter> state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   224
by (auto simp add: mk_program_def RawInit_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   225
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   226
lemma RawActs_eq [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   227
     "RawActs(mk_program(init, acts, allowed)) = 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   228
      cons(id(state), acts \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   229
by (auto simp add: mk_program_def RawActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   230
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   231
lemma RawAllowedActs_eq [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   232
     "RawAllowedActs(mk_program(init, acts, allowed)) =
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   233
      cons(id(state), allowed \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   234
by (auto simp add: mk_program_def RawAllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   235
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   236
lemma Init_eq [simp]: "Init(mk_program(init, acts, allowed)) = init \<inter> state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   237
by (simp add: Init_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   238
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   239
lemma Acts_eq [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   240
     "Acts(mk_program(init, acts, allowed)) = 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   241
      cons(id(state), acts  \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   242
by (simp add: Acts_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   243
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   244
lemma AllowedActs_eq [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   245
     "AllowedActs(mk_program(init, acts, allowed))=
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   246
      cons(id(state), allowed \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   247
by (simp add: AllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   248
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   249
(**Init, Acts, and AlowedActs  of SKIP **)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   250
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   251
lemma RawInit_SKIP [simp]: "RawInit(SKIP) = state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   252
by (simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   253
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   254
lemma RawAllowedActs_SKIP [simp]: "RawAllowedActs(SKIP) = Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   255
by (force simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   256
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   257
lemma RawActs_SKIP [simp]: "RawActs(SKIP) = {id(state)}"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   258
by (force simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   259
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   260
lemma Init_SKIP [simp]: "Init(SKIP) = state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   261
by (force simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   262
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   263
lemma Acts_SKIP [simp]: "Acts(SKIP) = {id(state)}"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   264
by (force simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   265
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   266
lemma AllowedActs_SKIP [simp]: "AllowedActs(SKIP) = Pow(state*state)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   267
by (force simp add: SKIP_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   268
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   269
(** Equality of UNITY programs **)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   270
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   271
lemma raw_surjective_mk_program:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   272
     "F \<in> program ==> mk_program(RawInit(F), RawActs(F), RawAllowedActs(F))=F"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   273
apply (auto simp add: program_def mk_program_def RawInit_def RawActs_def
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   274
            RawAllowedActs_def, blast+)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   275
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   276
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   277
lemma surjective_mk_program [simp]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   278
  "mk_program(Init(F), Acts(F), AllowedActs(F)) = programify(F)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   279
by (auto simp add: raw_surjective_mk_program Init_def Acts_def AllowedActs_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   280
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   281
lemma program_equalityI:                             
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   282
    "[|Init(F) = Init(G); Acts(F) = Acts(G);
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   283
       AllowedActs(F) = AllowedActs(G); F \<in> program; G \<in> program |] ==> F = G"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   284
apply (subgoal_tac "programify(F) = programify(G)") 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   285
apply simp 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   286
apply (simp only: surjective_mk_program [symmetric]) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   287
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   288
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   289
lemma program_equalityE:                             
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   290
 "[|F = G;
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   291
    [|Init(F) = Init(G); Acts(F) = Acts(G); AllowedActs(F) = AllowedActs(G) |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   292
    ==> P |] 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   293
  ==> P"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   294
by force
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   295
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   296
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   297
lemma program_equality_iff:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   298
    "[| F \<in> program; G \<in> program |] ==>(F=G)  <->
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   299
     (Init(F) = Init(G) & Acts(F) = Acts(G) & AllowedActs(F) = AllowedActs(G))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   300
by (blast intro: program_equalityI program_equalityE)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   301
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   302
subsection{*These rules allow "lazy" definition expansion*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   303
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   304
lemma def_prg_Init:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   305
     "F == mk_program (init,acts,allowed) ==> Init(F) = init \<inter> state"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   306
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   307
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   308
lemma def_prg_Acts:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   309
     "F == mk_program (init,acts,allowed)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   310
      ==> Acts(F) = cons(id(state), acts \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   311
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   312
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   313
lemma def_prg_AllowedActs:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   314
     "F == mk_program (init,acts,allowed)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   315
      ==> AllowedActs(F) = cons(id(state), allowed \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   316
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   317
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   318
lemma def_prg_simps:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   319
    "[| F == mk_program (init,acts,allowed) |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   320
     ==> Init(F) = init \<inter> state & 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   321
         Acts(F) = cons(id(state), acts \<inter> Pow(state*state)) &
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   322
         AllowedActs(F) = cons(id(state), allowed \<inter> Pow(state*state))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   323
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   324
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   325
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   326
(*An action is expanded only if a pair of states is being tested against it*)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   327
lemma def_act_simp:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   328
     "[| act == {<s,s'> \<in> A*B. P(s, s')} |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   329
      ==> (<s,s'> \<in> act) <-> (<s,s'> \<in> A*B & P(s, s'))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   330
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   331
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   332
(*A set is expanded only if an element is being tested against it*)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   333
lemma def_set_simp: "A == B ==> (x \<in> A) <-> (x \<in> B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   334
by auto
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   335
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   336
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   337
subsection{*The Constrains Operator*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   338
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   339
lemma constrains_type: "A co B \<subseteq> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   340
by (force simp add: constrains_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   341
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   342
lemma constrainsI:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   343
    "[|(!!act s s'. [| act: Acts(F);  <s,s'> \<in> act; s \<in> A|] ==> s' \<in> A');
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   344
        F \<in> program; st_set(A) |]  ==> F \<in> A co A'"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   345
by (force simp add: constrains_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   346
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   347
lemma constrainsD:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   348
   "F \<in> A co B ==> \<forall>act \<in> Acts(F). act``A\<subseteq>B"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   349
by (force simp add: constrains_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   350
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   351
lemma constrainsD2: "F \<in> A co B ==> F \<in> program & st_set(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   352
by (force simp add: constrains_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   353
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   354
lemma constrains_empty [iff]: "F \<in> 0 co B <-> F \<in> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   355
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   356
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   357
lemma constrains_empty2 [iff]: "(F \<in> A co 0) <-> (A=0 & F \<in> program)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   358
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   359
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   360
lemma constrains_state [iff]: "(F \<in> state co B) <-> (state\<subseteq>B & F \<in> program)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   361
apply (cut_tac F = F in Acts_type)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   362
apply (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   363
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   364
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   365
lemma constrains_state2 [iff]: "F \<in> A co state <-> (F \<in> program & st_set(A))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   366
apply (cut_tac F = F in Acts_type)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   367
apply (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   368
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   369
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   370
(*monotonic in 2nd argument*)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   371
lemma constrains_weaken_R:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   372
    "[| F \<in> A co A'; A'\<subseteq>B' |] ==> F \<in> A co B'"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   373
apply (unfold constrains_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   374
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   375
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   376
(*anti-monotonic in 1st argument*)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   377
lemma constrains_weaken_L:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   378
    "[| F \<in> A co A'; B\<subseteq>A |] ==> F \<in> B co A'"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   379
apply (unfold constrains_def st_set_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   380
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   381
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   382
lemma constrains_weaken:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   383
   "[| F \<in> A co A'; B\<subseteq>A; A'\<subseteq>B' |] ==> F \<in> B co B'"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   384
apply (drule constrains_weaken_R)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   385
apply (drule_tac [2] constrains_weaken_L, blast+)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   386
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   387
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   388
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   389
subsection{*Constrains and Union*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   390
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   391
lemma constrains_Un:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   392
    "[| F \<in> A co A'; F \<in> B co B' |] ==> F \<in> (A Un B) co (A' Un B')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   393
by (auto simp add: constrains_def st_set_def, force)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   394
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   395
lemma constrains_UN:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   396
     "[|!!i. i \<in> I ==> F \<in> A(i) co A'(i); F \<in> program |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   397
      ==> F \<in> (\<Union>i \<in> I. A(i)) co (\<Union>i \<in> I. A'(i))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   398
by (force simp add: constrains_def st_set_def) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   399
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   400
lemma constrains_Un_distrib:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   401
     "(A Un B) co C = (A co C) \<inter> (B co C)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   402
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   403
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   404
lemma constrains_UN_distrib:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   405
   "i \<in> I ==> (\<Union>i \<in> I. A(i)) co B = (\<Inter>i \<in> I. A(i) co B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   406
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   407
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   408
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   409
subsection{*Constrains and Intersection*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   410
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   411
lemma constrains_Int_distrib: "C co (A \<inter> B) = (C co A) \<inter> (C co B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   412
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   413
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   414
lemma constrains_INT_distrib:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   415
     "x \<in> I ==> A co (\<Inter>i \<in> I. B(i)) = (\<Inter>i \<in> I. A co B(i))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   416
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   417
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   418
lemma constrains_Int:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   419
    "[| F \<in> A co A'; F \<in> B co B' |] ==> F \<in> (A \<inter> B) co (A' \<inter> B')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   420
by (force simp add: constrains_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   421
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   422
lemma constrains_INT [rule_format]:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   423
     "[| \<forall>i \<in> I. F \<in> A(i) co A'(i); F \<in> program|]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   424
      ==> F \<in> (\<Inter>i \<in> I. A(i)) co (\<Inter>i \<in> I. A'(i))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   425
apply (case_tac "I=0")
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   426
 apply (simp add: Inter_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   427
apply (erule not_emptyE)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   428
apply (auto simp add: constrains_def st_set_def, blast) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   429
apply (drule bspec, assumption, force) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   430
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   431
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   432
(* The rule below simulates the HOL's one for (\<Inter>z. A i) co (\<Inter>z. B i) *)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   433
lemma constrains_All:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   434
"[| \<forall>z. F:{s \<in> state. P(s, z)} co {s \<in> state. Q(s, z)}; F \<in> program |]==>
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   435
    F:{s \<in> state. \<forall>z. P(s, z)} co {s \<in> state. \<forall>z. Q(s, z)}"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   436
by (unfold constrains_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   437
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   438
lemma constrains_imp_subset:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   439
  "[| F \<in> A co A' |] ==> A \<subseteq> A'"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   440
by (unfold constrains_def st_set_def, force)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   441
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   442
(*The reasoning is by subsets since "co" refers to single actions
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   443
  only.  So this rule isn't that useful.*)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   444
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   445
lemma constrains_trans: "[| F \<in> A co B; F \<in> B co C |] ==> F \<in> A co C"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   446
by (unfold constrains_def st_set_def, auto, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   447
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   448
lemma constrains_cancel:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   449
"[| F \<in> A co (A' Un B); F \<in> B co B' |] ==> F \<in> A co (A' Un B')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   450
apply (drule_tac A = B in constrains_imp_subset)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   451
apply (blast intro: constrains_weaken_R)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   452
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   453
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   454
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   455
subsection{*The Unless Operator*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   456
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   457
lemma unless_type: "A unless B \<subseteq> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   458
by (force simp add: unless_def constrains_def) 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   459
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   460
lemma unlessI: "[| F \<in> (A-B) co (A Un B) |] ==> F \<in> A unless B"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   461
apply (unfold unless_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   462
apply (blast dest: constrainsD2)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   463
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   464
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   465
lemma unlessD: "F :A unless B ==> F \<in> (A-B) co (A Un B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   466
by (unfold unless_def, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   467
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   468
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   469
subsection{*The Operator @{term initially}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   470
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   471
lemma initially_type: "initially(A) \<subseteq> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   472
by (unfold initially_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   473
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   474
lemma initiallyI: "[| F \<in> program; Init(F)\<subseteq>A |] ==> F \<in> initially(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   475
by (unfold initially_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   476
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   477
lemma initiallyD: "F \<in> initially(A) ==> Init(F)\<subseteq>A"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   478
by (unfold initially_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   479
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   480
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   481
subsection{*The Operator @{term stable}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   482
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   483
lemma stable_type: "stable(A)\<subseteq>program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   484
by (unfold stable_def constrains_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   485
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   486
lemma stableI: "F \<in> A co A ==> F \<in> stable(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   487
by (unfold stable_def, assumption)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   488
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   489
lemma stableD: "F \<in> stable(A) ==> F \<in> A co A"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   490
by (unfold stable_def, assumption)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   491
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   492
lemma stableD2: "F \<in> stable(A) ==> F \<in> program & st_set(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   493
by (unfold stable_def constrains_def, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   494
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   495
lemma stable_state [simp]: "stable(state) = program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   496
by (auto simp add: stable_def constrains_def dest: Acts_type [THEN subsetD])
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   497
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   498
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   499
lemma stable_unless: "stable(A)= A unless 0"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   500
by (auto simp add: unless_def stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   501
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   502
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   503
subsection{*Union and Intersection with @{term stable}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   504
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   505
lemma stable_Un:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   506
    "[| F \<in> stable(A); F \<in> stable(A') |] ==> F \<in> stable(A Un A')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   507
apply (unfold stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   508
apply (blast intro: constrains_Un)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   509
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   510
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   511
lemma stable_UN:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   512
     "[|!!i. i\<in>I ==> F \<in> stable(A(i)); F \<in> program |] 
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   513
      ==> F \<in> stable (\<Union>i \<in> I. A(i))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   514
apply (unfold stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   515
apply (blast intro: constrains_UN)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   516
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   517
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   518
lemma stable_Int:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   519
    "[| F \<in> stable(A);  F \<in> stable(A') |] ==> F \<in> stable (A \<inter> A')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   520
apply (unfold stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   521
apply (blast intro: constrains_Int)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   522
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   523
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   524
lemma stable_INT:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   525
     "[| !!i. i \<in> I ==> F \<in> stable(A(i)); F \<in> program |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   526
      ==> F \<in> stable (\<Inter>i \<in> I. A(i))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   527
apply (unfold stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   528
apply (blast intro: constrains_INT)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   529
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   530
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   531
lemma stable_All:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   532
    "[|\<forall>z. F \<in> stable({s \<in> state. P(s, z)}); F \<in> program|]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   533
     ==> F \<in> stable({s \<in> state. \<forall>z. P(s, z)})"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   534
apply (unfold stable_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   535
apply (rule constrains_All, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   536
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   537
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   538
lemma stable_constrains_Un:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   539
     "[| F \<in> stable(C); F \<in> A co (C Un A') |] ==> F \<in> (C Un A) co (C Un A')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   540
apply (unfold stable_def constrains_def st_set_def, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   541
apply (blast dest!: bspec)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   542
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   543
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   544
lemma stable_constrains_Int:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   545
     "[| F \<in> stable(C); F \<in>  (C \<inter> A) co A' |] ==> F \<in> (C \<inter> A) co (C \<inter> A')"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   546
by (unfold stable_def constrains_def st_set_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   547
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   548
(* [| F \<in> stable(C); F  \<in> (C \<inter> A) co A |] ==> F \<in> stable(C \<inter> A) *)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   549
lemmas stable_constrains_stable = stable_constrains_Int [THEN stableI, standard]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   550
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   551
subsection{*The Operator @{term invariant}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   552
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   553
lemma invariant_type: "invariant(A) \<subseteq> program"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   554
apply (unfold invariant_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   555
apply (blast dest: stable_type [THEN subsetD])
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   556
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   557
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   558
lemma invariantI: "[| Init(F)\<subseteq>A;  F \<in> stable(A) |] ==> F \<in> invariant(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   559
apply (unfold invariant_def initially_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   560
apply (frule stable_type [THEN subsetD], auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   561
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   562
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   563
lemma invariantD: "F \<in> invariant(A) ==> Init(F)\<subseteq>A & F \<in> stable(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   564
by (unfold invariant_def initially_def, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   565
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   566
lemma invariantD2: "F \<in> invariant(A) ==> F \<in> program & st_set(A)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   567
apply (unfold invariant_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   568
apply (blast dest: stableD2)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   569
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   570
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   571
text{*Could also say
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   572
      @{term "invariant(A) \<inter> invariant(B) \<subseteq> invariant (A \<inter> B)"}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   573
lemma invariant_Int:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   574
  "[| F \<in> invariant(A);  F \<in> invariant(B) |] ==> F \<in> invariant(A \<inter> B)"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   575
apply (unfold invariant_def initially_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   576
apply (simp add: stable_Int, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   577
done
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   578
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   579
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   580
subsection{*The Elimination Theorem*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   581
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   582
(** The "free" m has become universally quantified!
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   583
 Should the premise be !!m instead of \<forall>m ? Would make it harder
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   584
 to use in forward proof. **)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   585
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   586
(* The general case easier to prove that le special case! *)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   587
lemma "elimination":
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   588
    "[| \<forall>m \<in> M. F \<in> {s \<in> A. x(s) = m} co B(m); F \<in> program  |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   589
     ==> F \<in> {s \<in> A. x(s) \<in> M} co (\<Union>m \<in> M. B(m))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   590
by (auto simp add: constrains_def st_set_def, blast)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   591
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   592
(* As above, but for the special case of A=state *)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   593
lemma elimination2:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   594
     "[| \<forall>m \<in> M. F \<in> {s \<in> state. x(s) = m} co B(m); F \<in> program  |]
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   595
     ==> F:{s \<in> state. x(s) \<in> M} co (\<Union>m \<in> M. B(m))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   596
by (rule UNITY.elimination, auto)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   597
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   598
subsection{*The Operator @{term strongest_rhs}*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   599
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   600
lemma constrains_strongest_rhs:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   601
    "[| F \<in> program; st_set(A) |] ==> F \<in> A co (strongest_rhs(F,A))"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   602
by (auto simp add: constrains_def strongest_rhs_def st_set_def
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   603
              dest: Acts_type [THEN subsetD])
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   604
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   605
lemma strongest_rhs_is_strongest:
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   606
     "[| F \<in> A co B; st_set(B) |] ==> strongest_rhs(F,A) \<subseteq> B"
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   607
by (auto simp add: constrains_def strongest_rhs_def st_set_def)
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   608
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   609
ML
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   610
{*
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   611
val constrains_def = thm "constrains_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   612
val stable_def = thm "stable_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   613
val invariant_def = thm "invariant_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   614
val unless_def = thm "unless_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   615
val initially_def = thm "initially_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   616
val SKIP_def = thm "SKIP_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   617
val Allowed_def = thm "Allowed_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   618
val programify_def = thm "programify_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   619
val metacomp_def = thm "metacomp_def";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   620
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   621
val id_in_Acts = thm "id_in_Acts";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   622
val id_in_RawAllowedActs = thm "id_in_RawAllowedActs";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   623
val id_in_AllowedActs = thm "id_in_AllowedActs";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   624
val cons_id_Acts = thm "cons_id_Acts";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   625
val cons_id_AllowedActs = thm "cons_id_AllowedActs";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   626
val Init_type = thm "Init_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   627
val st_set_Init = thm "st_set_Init";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   628
val Acts_type = thm "Acts_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   629
val AllowedActs_type = thm "AllowedActs_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   630
val ActsD = thm "ActsD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   631
val AllowedActsD = thm "AllowedActsD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   632
val mk_program_in_program = thm "mk_program_in_program";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   633
val Init_eq = thm "Init_eq";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   634
val Acts_eq = thm "Acts_eq";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   635
val AllowedActs_eq = thm "AllowedActs_eq";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   636
val Init_SKIP = thm "Init_SKIP";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   637
val Acts_SKIP = thm "Acts_SKIP";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   638
val AllowedActs_SKIP = thm "AllowedActs_SKIP";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   639
val raw_surjective_mk_program = thm "raw_surjective_mk_program";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   640
val surjective_mk_program = thm "surjective_mk_program";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   641
val program_equalityI = thm "program_equalityI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   642
val program_equalityE = thm "program_equalityE";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   643
val program_equality_iff = thm "program_equality_iff";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   644
val def_prg_Init = thm "def_prg_Init";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   645
val def_prg_Acts = thm "def_prg_Acts";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   646
val def_prg_AllowedActs = thm "def_prg_AllowedActs";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   647
val def_prg_simps = thm "def_prg_simps";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   648
val def_act_simp = thm "def_act_simp";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   649
val def_set_simp = thm "def_set_simp";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   650
val constrains_type = thm "constrains_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   651
val constrainsI = thm "constrainsI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   652
val constrainsD = thm "constrainsD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   653
val constrainsD2 = thm "constrainsD2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   654
val constrains_empty = thm "constrains_empty";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   655
val constrains_empty2 = thm "constrains_empty2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   656
val constrains_state = thm "constrains_state";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   657
val constrains_state2 = thm "constrains_state2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   658
val constrains_weaken_R = thm "constrains_weaken_R";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   659
val constrains_weaken_L = thm "constrains_weaken_L";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   660
val constrains_weaken = thm "constrains_weaken";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   661
val constrains_Un = thm "constrains_Un";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   662
val constrains_UN = thm "constrains_UN";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   663
val constrains_Un_distrib = thm "constrains_Un_distrib";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   664
val constrains_UN_distrib = thm "constrains_UN_distrib";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   665
val constrains_Int_distrib = thm "constrains_Int_distrib";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   666
val constrains_INT_distrib = thm "constrains_INT_distrib";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   667
val constrains_Int = thm "constrains_Int";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   668
val constrains_INT = thm "constrains_INT";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   669
val constrains_All = thm "constrains_All";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   670
val constrains_imp_subset = thm "constrains_imp_subset";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   671
val constrains_trans = thm "constrains_trans";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   672
val constrains_cancel = thm "constrains_cancel";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   673
val unless_type = thm "unless_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   674
val unlessI = thm "unlessI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   675
val unlessD = thm "unlessD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   676
val initially_type = thm "initially_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   677
val initiallyI = thm "initiallyI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   678
val initiallyD = thm "initiallyD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   679
val stable_type = thm "stable_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   680
val stableI = thm "stableI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   681
val stableD = thm "stableD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   682
val stableD2 = thm "stableD2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   683
val stable_state = thm "stable_state";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   684
val stable_unless = thm "stable_unless";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   685
val stable_Un = thm "stable_Un";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   686
val stable_UN = thm "stable_UN";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   687
val stable_Int = thm "stable_Int";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   688
val stable_INT = thm "stable_INT";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   689
val stable_All = thm "stable_All";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   690
val stable_constrains_Un = thm "stable_constrains_Un";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   691
val stable_constrains_Int = thm "stable_constrains_Int";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   692
val invariant_type = thm "invariant_type";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   693
val invariantI = thm "invariantI";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   694
val invariantD = thm "invariantD";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   695
val invariantD2 = thm "invariantD2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   696
val invariant_Int = thm "invariant_Int";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   697
val elimination = thm "elimination";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   698
val elimination2 = thm "elimination2";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   699
val constrains_strongest_rhs = thm "constrains_strongest_rhs";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   700
val strongest_rhs_is_strongest = thm "strongest_rhs_is_strongest";
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   701
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   702
fun simp_of_act def = def RS def_act_simp;
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   703
fun simp_of_set def = def RS def_set_simp;
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   704
*}
37c964462747 Conversion of theory UNITY to Isar script
paulson
parents: 14046
diff changeset
   705
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
   706
end