src/HOL/UNITY/UNITY.thy
author paulson
Thu, 30 Jan 2003 18:08:09 +0100
changeset 13797 baefae13ad37
parent 10834 a7897aebbffc
child 13798 4c1a53627500
permissions -rw-r--r--
conversion of UNITY theories to new-style
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/UNITY
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
The basic UNITY theory (revised version, based upon the "co" operator)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     9
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
13797
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    11
theory UNITY = Main:
6535
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    12
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    13
typedef (Program)
10064
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    14
  'a program = "{(init:: 'a set, acts :: ('a * 'a)set set,
13797
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    15
		   allowed :: ('a * 'a)set set). Id:acts & Id: allowed}" 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    16
  by blast
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
    17
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
constdefs
13797
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    19
  constrains :: "['a set, 'a set] => 'a program set"  (infixl "co"     60)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    20
    "A co B == {F. ALL act: Acts F. act``A <= B}"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    21
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    22
  unless  :: "['a set, 'a set] => 'a program set"  (infixl "unless" 60)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    23
    "A unless B == (A-B) co (A Un B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    24
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    25
  mk_program :: "('a set * ('a * 'a)set set * ('a * 'a)set set)
10064
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    26
		   => 'a program"
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    27
    "mk_program == %(init, acts, allowed).
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    28
                      Abs_Program (init, insert Id acts, insert Id allowed)"
6535
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    29
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    30
  Init :: "'a program => 'a set"
10064
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    31
    "Init F == (%(init, acts, allowed). init) (Rep_Program F)"
6535
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    32
880f31a62784 eliminated theory UNITY/Traces
paulson
parents: 5804
diff changeset
    33
  Acts :: "'a program => ('a * 'a)set set"
10064
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    34
    "Acts F == (%(init, acts, allowed). acts) (Rep_Program F)"
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    35
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    36
  AllowedActs :: "'a program => ('a * 'a)set set"
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    37
    "AllowedActs F == (%(init, acts, allowed). allowed) (Rep_Program F)"
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    38
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    39
  Allowed :: "'a program => 'a program set"
1a77667b21ef added compatibility relation: AllowedActs, Allowed, ok,
paulson
parents: 8948
diff changeset
    40
    "Allowed F == {G. Acts G <= AllowedActs F}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    42
  stable     :: "'a set => 'a program set"
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
    43
    "stable A == A co A"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    45
  strongest_rhs :: "['a program, 'a set] => 'a set"
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
    46
    "strongest_rhs F A == Inter {B. F : A co B}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    48
  invariant :: "'a set => 'a program set"
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    49
    "invariant A == {F. Init F <= A} Int stable A"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    51
  (*Polymorphic in both states and the meaning of <= *)
6713
614a76ce9bc6 increasing makes sense only for partial orderings
paulson
parents: 6536
diff changeset
    52
  increasing :: "['a => 'b::{order}] => 'a program set"
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5253
diff changeset
    53
    "increasing f == INT z. stable {s. z <= f s}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    54
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
    55
13797
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    56
(*Perhaps equalities.ML shouldn't add this in the first place!*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    57
declare image_Collect [simp del]
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    58
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    59
(*** The abstract type of programs ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    60
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    61
lemmas program_typedef =
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    62
     Rep_Program Rep_Program_inverse Abs_Program_inverse 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    63
     Program_def Init_def Acts_def AllowedActs_def mk_program_def
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    64
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    65
lemma Id_in_Acts [iff]: "Id : Acts F"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    66
apply (cut_tac x = F in Rep_Program)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    67
apply (auto simp add: program_typedef) 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    68
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    69
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    70
lemma insert_Id_Acts [iff]: "insert Id (Acts F) = Acts F"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    71
by (simp add: insert_absorb Id_in_Acts)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    72
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    73
lemma Id_in_AllowedActs [iff]: "Id : AllowedActs F"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    74
apply (cut_tac x = F in Rep_Program)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    75
apply (auto simp add: program_typedef) 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    76
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    77
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    78
lemma insert_Id_AllowedActs [iff]: "insert Id (AllowedActs F) = AllowedActs F"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    79
by (simp add: insert_absorb Id_in_AllowedActs)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    80
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    81
(** Inspectors for type "program" **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    82
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    83
lemma Init_eq [simp]: "Init (mk_program (init,acts,allowed)) = init"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    84
by (auto simp add: program_typedef)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    85
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    86
lemma Acts_eq [simp]: "Acts (mk_program (init,acts,allowed)) = insert Id acts"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    87
by (auto simp add: program_typedef)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    88
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    89
lemma AllowedActs_eq [simp]:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    90
     "AllowedActs (mk_program (init,acts,allowed)) = insert Id allowed"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    91
by (auto simp add: program_typedef)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    92
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    93
(** Equality for UNITY programs **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    94
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    95
lemma surjective_mk_program [simp]:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    96
     "mk_program (Init F, Acts F, AllowedActs F) = F"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    97
apply (cut_tac x = F in Rep_Program)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    98
apply (auto simp add: program_typedef)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
    99
apply (drule_tac f = Abs_Program in arg_cong)+
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   100
apply (simp add: program_typedef insert_absorb)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   101
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   102
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   103
lemma program_equalityI:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   104
     "[| Init F = Init G; Acts F = Acts G; AllowedActs F = AllowedActs G |]  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   105
      ==> F = G"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   106
apply (rule_tac t = F in surjective_mk_program [THEN subst])
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   107
apply (rule_tac t = G in surjective_mk_program [THEN subst], simp)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   108
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   109
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   110
lemma program_equalityE:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   111
     "[| F = G;  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   112
         [| Init F = Init G; Acts F = Acts G; AllowedActs F = AllowedActs G |] 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   113
         ==> P |] ==> P"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   114
by simp 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   115
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   116
lemma program_equality_iff:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   117
     "(F=G) =   
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   118
      (Init F = Init G & Acts F = Acts G &AllowedActs F = AllowedActs G)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   119
by (blast intro: program_equalityI program_equalityE)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   120
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   121
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   122
(*** These rules allow "lazy" definition expansion 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   123
     They avoid expanding the full program, which is a large expression
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   124
***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   125
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   126
lemma def_prg_Init: "F == mk_program (init,acts,allowed) ==> Init F = init"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   127
by auto
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   128
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   129
lemma def_prg_Acts:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   130
     "F == mk_program (init,acts,allowed) ==> Acts F = insert Id acts"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   131
by auto
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   132
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   133
lemma def_prg_AllowedActs:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   134
     "F == mk_program (init,acts,allowed)  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   135
      ==> AllowedActs F = insert Id allowed"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   136
by auto
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   137
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   138
(*The program is not expanded, but its Init and Acts are*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   139
lemma def_prg_simps:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   140
    "[| F == mk_program (init,acts,allowed) |]  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   141
     ==> Init F = init & Acts F = insert Id acts"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   142
by simp
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   143
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   144
(*An action is expanded only if a pair of states is being tested against it*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   145
lemma def_act_simp:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   146
     "[| act == {(s,s'). P s s'} |] ==> ((s,s') : act) = P s s'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   147
by auto
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   148
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   149
(*A set is expanded only if an element is being tested against it*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   150
lemma def_set_simp: "A == B ==> (x : A) = (x : B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   151
by auto
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   152
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   153
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   154
(*** co ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   155
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   156
lemma constrainsI: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   157
    "(!!act s s'. [| act: Acts F;  (s,s') : act;  s: A |] ==> s': A')  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   158
     ==> F : A co A'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   159
by (simp add: constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   160
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   161
lemma constrainsD: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   162
    "[| F : A co A'; act: Acts F;  (s,s'): act;  s: A |] ==> s': A'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   163
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   164
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   165
lemma constrains_empty [iff]: "F : {} co B"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   166
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   167
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   168
lemma constrains_empty2 [iff]: "(F : A co {}) = (A={})"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   169
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   170
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   171
lemma constrains_UNIV [iff]: "(F : UNIV co B) = (B = UNIV)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   172
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   173
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   174
lemma constrains_UNIV2 [iff]: "F : A co UNIV"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   175
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   176
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   177
(*monotonic in 2nd argument*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   178
lemma constrains_weaken_R: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   179
    "[| F : A co A'; A'<=B' |] ==> F : A co B'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   180
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   181
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   182
(*anti-monotonic in 1st argument*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   183
lemma constrains_weaken_L: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   184
    "[| F : A co A'; B<=A |] ==> F : B co A'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   185
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   186
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   187
lemma constrains_weaken: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   188
   "[| F : A co A'; B<=A; A'<=B' |] ==> F : B co B'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   189
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   190
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   191
(** Union **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   192
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   193
lemma constrains_Un: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   194
    "[| F : A co A'; F : B co B' |] ==> F : (A Un B) co (A' Un B')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   195
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   196
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   197
lemma constrains_UN: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   198
    "(!!i. i:I ==> F : (A i) co (A' i)) 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   199
     ==> F : (UN i:I. A i) co (UN i:I. A' i)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   200
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   201
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   202
lemma constrains_Un_distrib: "(A Un B) co C = (A co C) Int (B co C)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   203
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   204
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   205
lemma constrains_UN_distrib: "(UN i:I. A i) co B = (INT i:I. A i co B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   206
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   207
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   208
lemma constrains_Int_distrib: "C co (A Int B) = (C co A) Int (C co B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   209
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   210
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   211
lemma constrains_INT_distrib: "A co (INT i:I. B i) = (INT i:I. A co B i)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   212
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   213
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   214
(** Intersection **)
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
   215
13797
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   216
lemma constrains_Int: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   217
    "[| F : A co A'; F : B co B' |] ==> F : (A Int B) co (A' Int B')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   218
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   219
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   220
lemma constrains_INT: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   221
    "(!!i. i:I ==> F : (A i) co (A' i)) 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   222
     ==> F : (INT i:I. A i) co (INT i:I. A' i)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   223
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   224
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   225
lemma constrains_imp_subset: "F : A co A' ==> A <= A'"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   226
by (unfold constrains_def, auto)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   227
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   228
(*The reasoning is by subsets since "co" refers to single actions
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   229
  only.  So this rule isn't that useful.*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   230
lemma constrains_trans: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   231
    "[| F : A co B; F : B co C |] ==> F : A co C"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   232
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   233
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   234
lemma constrains_cancel: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   235
   "[| F : A co (A' Un B); F : B co B' |] ==> F : A co (A' Un B')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   236
by (unfold constrains_def, clarify, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   237
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   238
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   239
(*** unless ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   240
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   241
lemma unlessI: "F : (A-B) co (A Un B) ==> F : A unless B"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   242
by (unfold unless_def, assumption)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   243
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   244
lemma unlessD: "F : A unless B ==> F : (A-B) co (A Un B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   245
by (unfold unless_def, assumption)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   246
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   247
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   248
(*** stable ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   249
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   250
lemma stableI: "F : A co A ==> F : stable A"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   251
by (unfold stable_def, assumption)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   252
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   253
lemma stableD: "F : stable A ==> F : A co A"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   254
by (unfold stable_def, assumption)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   255
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   256
lemma stable_UNIV [simp]: "stable UNIV = UNIV"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   257
by (unfold stable_def constrains_def, auto)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   258
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   259
(** Union **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   260
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   261
lemma stable_Un: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   262
    "[| F : stable A; F : stable A' |] ==> F : stable (A Un A')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   263
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   264
apply (unfold stable_def)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   265
apply (blast intro: constrains_Un)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   266
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   267
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   268
lemma stable_UN: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   269
    "(!!i. i:I ==> F : stable (A i)) ==> F : stable (UN i:I. A i)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   270
apply (unfold stable_def)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   271
apply (blast intro: constrains_UN)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   272
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   273
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   274
(** Intersection **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   275
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   276
lemma stable_Int: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   277
    "[| F : stable A;  F : stable A' |] ==> F : stable (A Int A')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   278
apply (unfold stable_def)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   279
apply (blast intro: constrains_Int)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   280
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   281
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   282
lemma stable_INT: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   283
    "(!!i. i:I ==> F : stable (A i)) ==> F : stable (INT i:I. A i)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   284
apply (unfold stable_def)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   285
apply (blast intro: constrains_INT)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   286
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   287
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   288
lemma stable_constrains_Un: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   289
    "[| F : stable C; F : A co (C Un A') |] ==> F : (C Un A) co (C Un A')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   290
by (unfold stable_def constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   291
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   292
lemma stable_constrains_Int: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   293
  "[| F : stable C; F :  (C Int A) co A' |] ==> F : (C Int A) co (C Int A')"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   294
by (unfold stable_def constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   295
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   296
(*[| F : stable C; F :  (C Int A) co A |] ==> F : stable (C Int A) *)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   297
lemmas stable_constrains_stable = stable_constrains_Int [THEN stableI, standard]
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   298
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   299
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   300
(*** invariant ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   301
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   302
lemma invariantI: "[| Init F<=A;  F: stable A |] ==> F : invariant A"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   303
by (simp add: invariant_def)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   304
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   305
(*Could also say "invariant A Int invariant B <= invariant (A Int B)"*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   306
lemma invariant_Int:
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   307
     "[| F : invariant A;  F : invariant B |] ==> F : invariant (A Int B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   308
by (auto simp add: invariant_def stable_Int)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   309
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   310
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   311
(*** increasing ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   312
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   313
lemma increasingD: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   314
     "F : increasing f ==> F : stable {s. z <= f s}"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   315
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   316
by (unfold increasing_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   317
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   318
lemma increasing_constant [iff]: "F : increasing (%s. c)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   319
by (unfold increasing_def stable_def, auto)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   320
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   321
lemma mono_increasing_o: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   322
     "mono g ==> increasing f <= increasing (g o f)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   323
apply (unfold increasing_def stable_def constrains_def, auto)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   324
apply (blast intro: monoD order_trans)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   325
done
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   326
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   327
(*Holds by the theorem (Suc m <= n) = (m < n) *)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   328
lemma strict_increasingD: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   329
     "!!z::nat. F : increasing f ==> F: stable {s. z < f s}"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   330
by (simp add: increasing_def Suc_le_eq [symmetric])
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   331
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   332
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   333
(** The Elimination Theorem.  The "free" m has become universally quantified!
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   334
    Should the premise be !!m instead of ALL m ?  Would make it harder to use
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   335
    in forward proof. **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   336
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   337
lemma elimination: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   338
    "[| ALL m:M. F : {s. s x = m} co (B m) |]  
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   339
     ==> F : {s. s x : M} co (UN m:M. B m)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   340
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   341
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   342
(*As above, but for the trivial case of a one-variable state, in which the
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   343
  state is identified with its one variable.*)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   344
lemma elimination_sing: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   345
    "(ALL m:M. F : {m} co (B m)) ==> F : M co (UN m:M. B m)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   346
by (unfold constrains_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   347
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   348
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   349
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   350
(*** Theoretical Results from Section 6 ***)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   351
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   352
lemma constrains_strongest_rhs: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   353
    "F : A co (strongest_rhs F A )"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   354
by (unfold constrains_def strongest_rhs_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   355
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   356
lemma strongest_rhs_is_strongest: 
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   357
    "F : A co B ==> strongest_rhs F A <= B"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   358
by (unfold constrains_def strongest_rhs_def, blast)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   359
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   360
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   361
(** Ad-hoc set-theory rules **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   362
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   363
lemma Un_Diff_Diff [simp]: "A Un B - (A - B) = B"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   364
by blast
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   365
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   366
lemma Int_Union_Union: "Union(B) Int A = Union((%C. C Int A)`B)"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   367
by blast
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   368
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   369
(** Needed for WF reasoning in WFair.ML **)
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   370
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   371
lemma Image_less_than [simp]: "less_than `` {k} = greaterThan k"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   372
by blast
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   373
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   374
lemma Image_inverse_less_than [simp]: "less_than^-1 `` {k} = lessThan k"
baefae13ad37 conversion of UNITY theories to new-style
paulson
parents: 10834
diff changeset
   375
by blast
6536
281d44905cab made many specification operators infix
paulson
parents: 6535
diff changeset
   376
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   377
end