src/HOL/IMP/Abs_State.thy
author nipkow
Wed, 26 Sep 2012 02:51:59 +0200
changeset 49577 b199aa1d33fd
parent 49497 860b7c6bd913
child 50995 3371f5ee4ace
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     1
(* Author: Tobias Nipkow *)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     2
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     3
theory Abs_State
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     4
imports Abs_Int0
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     5
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     6
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
     7
subsubsection "Set-based lattices"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     8
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
     9
instantiation com :: vars
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    10
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    11
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    12
fun vars_com :: "com \<Rightarrow> vname set" where
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    13
"vars com.SKIP = {}" |
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    14
"vars (x::=e) = {x} \<union> vars e" |
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    15
"vars (c1;c2) = vars c1 \<union> vars c2" |
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    16
"vars (IF b THEN c1 ELSE c2) = vars b \<union> vars c1 \<union> vars c2" |
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    17
"vars (WHILE b DO c) = vars b \<union> vars c"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    18
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    19
instance ..
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    20
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    21
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    22
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    23
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    24
lemma finite_avars: "finite(vars(a::aexp))"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    25
by(induction a) simp_all
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    26
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    27
lemma finite_bvars: "finite(vars(b::bexp))"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    28
by(induction b) (simp_all add: finite_avars)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    29
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    30
lemma finite_cvars: "finite(vars(c::com))"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    31
by(induction c) (simp_all add: finite_avars finite_bvars)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    32
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    33
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    34
class L =
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    35
fixes L :: "vname set \<Rightarrow> 'a set"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    36
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    37
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    38
instantiation acom :: (L)L
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    39
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    40
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    41
definition L_acom where
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    42
"L X = {C. vars(strip C) \<subseteq> X \<and> (\<forall>a \<in> set(annos C). a \<in> L X)}"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    43
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    44
instance ..
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    45
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    46
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    47
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    48
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    49
instantiation option :: (L)L
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    50
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    51
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    52
definition L_option where
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    53
"L X = {opt. case opt of None \<Rightarrow> True | Some x \<Rightarrow> x \<in> L X}"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    54
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    55
lemma L_option_simps[simp]: "None \<in> L X" "(Some x \<in> L X) = (x \<in> L X)"
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    56
by(simp_all add: L_option_def)
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    57
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    58
instance ..
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    59
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    60
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    61
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    62
class semilatticeL = join + L +
49577
nipkow
parents: 49497
diff changeset
    63
fixes top :: "com \<Rightarrow> 'a"
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    64
assumes join_ge1 [simp]: "x \<in> L X \<Longrightarrow> y \<in> L X \<Longrightarrow> x \<sqsubseteq> x \<squnion> y"
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    65
and join_ge2 [simp]: "x \<in> L X \<Longrightarrow> y \<in> L X \<Longrightarrow> y \<sqsubseteq> x \<squnion> y"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    66
and join_least[simp]: "x \<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> z \<Longrightarrow> x \<squnion> y \<sqsubseteq> z"
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    67
and top[simp]: "x \<in> L(vars c) \<Longrightarrow> x \<sqsubseteq> top c"
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    68
and top_in_L[simp]: "top c \<in> L(vars c)"
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    69
and join_in_L[simp]: "x \<in> L X \<Longrightarrow> y \<in> L X \<Longrightarrow> x \<squnion> y \<in> L X"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    70
49577
nipkow
parents: 49497
diff changeset
    71
notation (input) top ("\<top>\<^bsub>_\<^esub>")
nipkow
parents: 49497
diff changeset
    72
notation (latex output) top ("\<top>\<^bsub>\<^raw:\isa{>_\<^raw:}>\<^esub>")
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    73
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    74
instantiation option :: (semilatticeL)semilatticeL
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    75
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    76
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    77
definition top_option where "top c = Some(top c)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    78
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    79
instance proof
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    80
  case goal1 thus ?case by(cases x, simp, cases y, simp_all)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    81
next
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    82
  case goal2 thus ?case by(cases y, simp, cases x, simp_all)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    83
next
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    84
  case goal3 thus ?case by(cases z, simp, cases y, simp, cases x, simp_all)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    85
next
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    86
  case goal4 thus ?case by(cases x, simp_all add: top_option_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    87
next
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    88
  case goal5 thus ?case by(simp add: top_option_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    89
next
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
    90
  case goal6 thus ?case by(simp add: L_option_def split: option.splits)
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    91
qed
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    92
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    93
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    94
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    95
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    96
subsection "Abstract State with Computable Ordering"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    97
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    98
hide_type  st  --"to avoid long names"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
    99
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   100
text{* A concrete type of state with computable @{text"\<sqsubseteq>"}: *}
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   101
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   102
datatype 'a st = FunDom "vname \<Rightarrow> 'a" "vname set"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   103
49344
nipkow
parents: 47619
diff changeset
   104
fun "fun" where "fun (FunDom f X) = f"
nipkow
parents: 47619
diff changeset
   105
fun dom where "dom (FunDom f X) = X"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   106
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   107
definition "show_st S = (\<lambda>x. (x, fun S x)) ` dom S"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   108
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   109
value [code] "show_st (FunDom (\<lambda>x. 1::int) {''a'',''b''})"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   110
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   111
definition "show_acom = map_acom (Option.map show_st)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   112
definition "show_acom_opt = Option.map show_acom"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   113
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   114
definition "update F x y = FunDom ((fun F)(x:=y)) (dom F)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   115
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   116
lemma fun_update[simp]: "fun (update S x y) = (fun S)(x:=y)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   117
by(rule ext)(auto simp: update_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   118
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   119
lemma dom_update[simp]: "dom (update S x y) = dom S"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   120
by(simp add: update_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   121
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   122
definition "\<gamma>_st \<gamma> F = {f. \<forall>x\<in>dom F. f x \<in> \<gamma>(fun F x)}"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   123
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   124
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   125
instantiation st :: (preord) preord
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   126
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   127
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   128
definition le_st :: "'a st \<Rightarrow> 'a st \<Rightarrow> bool" where
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   129
"F \<sqsubseteq> G = (dom F = dom G \<and> (\<forall>x \<in> dom F. fun F x \<sqsubseteq> fun G x))"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   130
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   131
instance
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   132
proof
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   133
  case goal2 thus ?case by(auto simp: le_st_def)(metis preord_class.le_trans)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   134
qed (auto simp: le_st_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   135
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   136
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   137
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   138
instantiation st :: (join) join
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   139
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   140
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   141
definition join_st :: "'a st \<Rightarrow> 'a st \<Rightarrow> 'a st" where
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   142
"F \<squnion> G = FunDom (\<lambda>x. fun F x \<squnion> fun G x) (dom F)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   143
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   144
instance ..
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   145
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   146
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   147
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   148
instantiation st :: (type) L
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   149
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   150
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   151
definition L_st :: "vname set \<Rightarrow> 'a st set" where
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   152
"L X = {F. dom F = X}"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   153
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   154
instance ..
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   155
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   156
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   157
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   158
instantiation st :: (semilattice) semilatticeL
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   159
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   160
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   161
definition top_st where "top c = FunDom (\<lambda>x. \<top>) (vars c)"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   162
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   163
instance
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   164
proof
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   165
qed (auto simp: le_st_def join_st_def top_st_def L_st_def)
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   166
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   167
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   168
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   169
49399
nipkow
parents: 49396
diff changeset
   170
text{* Trick to make code generator happy. *}
nipkow
parents: 49396
diff changeset
   171
lemma [code]: "L = (L :: _ \<Rightarrow> _ st set)"
nipkow
parents: 49396
diff changeset
   172
by(rule refl)
nipkow
parents: 49396
diff changeset
   173
(* L is not used in the code but is part of a type class that is used.
nipkow
parents: 49396
diff changeset
   174
   Hence the code generator wants to build a dictionary with L in it.
nipkow
parents: 49396
diff changeset
   175
   But L is not executable. This looping defn makes it look as if it were. *)
nipkow
parents: 49396
diff changeset
   176
nipkow
parents: 49396
diff changeset
   177
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   178
lemma mono_fun: "F \<sqsubseteq> G \<Longrightarrow> x : dom F \<Longrightarrow> fun F x \<sqsubseteq> fun G x"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   179
by(auto simp: le_st_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   180
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   181
lemma mono_update[simp]:
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   182
  "a1 \<sqsubseteq> a2 \<Longrightarrow> S1 \<sqsubseteq> S2 \<Longrightarrow> update S1 x a1 \<sqsubseteq> update S2 x a2"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   183
by(auto simp add: le_st_def update_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   184
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   185
49396
73fb17ed2e08 converted wt into a set, tuned names
nipkow
parents: 49353
diff changeset
   186
locale Gamma = Val_abs where \<gamma>=\<gamma> for \<gamma> :: "'av::semilattice \<Rightarrow> val set"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   187
begin
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   188
49497
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   189
abbreviation \<gamma>\<^isub>s :: "'av st \<Rightarrow> state set"
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   190
where "\<gamma>\<^isub>s == \<gamma>_st \<gamma>"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   191
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   192
abbreviation \<gamma>\<^isub>o :: "'av st option \<Rightarrow> state set"
49497
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   193
where "\<gamma>\<^isub>o == \<gamma>_option \<gamma>\<^isub>s"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   194
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   195
abbreviation \<gamma>\<^isub>c :: "'av st option acom \<Rightarrow> state set acom"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   196
where "\<gamma>\<^isub>c == map_acom \<gamma>\<^isub>o"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   197
49497
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   198
lemma gamma_s_Top[simp]: "\<gamma>\<^isub>s (top c) = UNIV"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   199
by(auto simp: top_st_def \<gamma>_st_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   200
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   201
lemma gamma_o_Top[simp]: "\<gamma>\<^isub>o (top c) = UNIV"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   202
by (simp add: top_option_def)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   203
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   204
(* FIXME (maybe also le \<rightarrow> sqle?) *)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   205
49497
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   206
lemma mono_gamma_s: "f \<sqsubseteq> g \<Longrightarrow> \<gamma>\<^isub>s f \<subseteq> \<gamma>\<^isub>s g"
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   207
apply(simp add:\<gamma>_st_def subset_iff le_st_def split: if_splits)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   208
by (metis mono_gamma subsetD)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   209
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   210
lemma mono_gamma_o:
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   211
  "S1 \<sqsubseteq> S2 \<Longrightarrow> \<gamma>\<^isub>o S1 \<subseteq> \<gamma>\<^isub>o S2"
49497
860b7c6bd913 tuned names
nipkow
parents: 49399
diff changeset
   212
by(induction S1 S2 rule: le_option.induct)(simp_all add: mono_gamma_s)
47619
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   213
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   214
lemma mono_gamma_c: "C1 \<sqsubseteq> C2 \<Longrightarrow> \<gamma>\<^isub>c C1 \<le> \<gamma>\<^isub>c C2"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   215
by (induction C1 C2 rule: le_acom.induct) (simp_all add:mono_gamma_o)
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   216
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   217
lemma in_gamma_option_iff:
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   218
  "x : \<gamma>_option r u \<longleftrightarrow> (\<exists>u'. u = Some u' \<and> x : r u')"
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   219
by (cases u) auto
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   220
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   221
end
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   222
0d3e95375bb7 forgot to add file
nipkow
parents:
diff changeset
   223
end