merged
authorhaftmann
Thu Mar 05 08:24:28 2009 +0100 (2009-03-05)
changeset 30305720226bedc4d
parent 30274 44832d503659
parent 30304 d8e4cd2ac2a1
child 30306 8f4d5eaa9878
merged
NEWS
src/HOL/Library/Euclidean_Space.thy
src/HOL/Library/Finite_Cartesian_Product.thy
src/HOL/Nominal/nominal_inductive2.ML
src/HOL/Nominal/nominal_package.ML
src/HOL/Tools/Qelim/langford.ML
src/HOL/Tools/datatype_rep_proofs.ML
src/HOL/Tools/inductive_set_package.ML
src/HOL/Tools/refute.ML
src/HOL/Tools/res_clause.ML
     1.1 --- a/NEWS	Thu Mar 05 02:32:46 2009 +0100
     1.2 +++ b/NEWS	Thu Mar 05 08:24:28 2009 +0100
     1.3 @@ -220,6 +220,21 @@
     1.4  
     1.5  *** HOL ***
     1.6  
     1.7 +* Some set operations are now proper qualified constants with authentic syntax.
     1.8 +INCOMPATIBILITY:
     1.9 +
    1.10 +    op Int ~>   Set.Int
    1.11 +    op Un ~>    Set.Un
    1.12 +    INTER ~>    Set.INTER
    1.13 +    UNION ~>    Set.UNION
    1.14 +    Inter ~>    Set.Inter
    1.15 +    Union ~>    Set.Union
    1.16 +    {} ~>       Set.empty
    1.17 +    UNIV ~>     Set.UNIV
    1.18 +
    1.19 +* Class complete_lattice with operations Inf, Sup, INFI, SUPR now in theory
    1.20 +Set.
    1.21 +
    1.22  * Auxiliary class "itself" has disappeared -- classes without any parameter
    1.23  are treated as expected by the 'class' command.
    1.24  
    1.25 @@ -297,7 +312,7 @@
    1.26  avoiding strange error messages.
    1.27  
    1.28  * Simplifier: simproc for let expressions now unfolds if bound variable
    1.29 -occurs at most one time in let expression body.  INCOMPATIBILITY.
    1.30 +occurs at most once in let expression body.  INCOMPATIBILITY.
    1.31  
    1.32  * New classes "top" and "bot" with corresponding operations "top" and "bot"
    1.33  in theory Orderings;  instantiation of class "complete_lattice" requires
     2.1 --- a/src/HOL/Fun.thy	Thu Mar 05 02:32:46 2009 +0100
     2.2 +++ b/src/HOL/Fun.thy	Thu Mar 05 08:24:28 2009 +0100
     2.3 @@ -1,5 +1,4 @@
     2.4  (*  Title:      HOL/Fun.thy
     2.5 -    ID:         $Id$
     2.6      Author:     Tobias Nipkow, Cambridge University Computer Laboratory
     2.7      Copyright   1994  University of Cambridge
     2.8  *)
     3.1 --- a/src/HOL/Hoare/Hoare.thy	Thu Mar 05 02:32:46 2009 +0100
     3.2 +++ b/src/HOL/Hoare/Hoare.thy	Thu Mar 05 08:24:28 2009 +0100
     3.3 @@ -161,9 +161,9 @@
     3.4  (* assn_tr' & bexp_tr'*)
     3.5  ML{*  
     3.6  fun assn_tr' (Const ("Collect",_) $ T) = dest_abstuple T
     3.7 -  | assn_tr' (Const ("op Int",_) $ (Const ("Collect",_) $ T1) $ 
     3.8 +  | assn_tr' (Const (@{const_name Set.Int}, _) $ (Const ("Collect",_) $ T1) $ 
     3.9                                     (Const ("Collect",_) $ T2)) =  
    3.10 -            Syntax.const "op Int" $ dest_abstuple T1 $ dest_abstuple T2
    3.11 +            Syntax.const "Set.Int" $ dest_abstuple T1 $ dest_abstuple T2
    3.12    | assn_tr' t = t;
    3.13  
    3.14  fun bexp_tr' (Const ("Collect",_) $ T) = dest_abstuple T 
     4.1 --- a/src/HOL/Hoare/HoareAbort.thy	Thu Mar 05 02:32:46 2009 +0100
     4.2 +++ b/src/HOL/Hoare/HoareAbort.thy	Thu Mar 05 08:24:28 2009 +0100
     4.3 @@ -163,9 +163,9 @@
     4.4  (* assn_tr' & bexp_tr'*)
     4.5  ML{*  
     4.6  fun assn_tr' (Const ("Collect",_) $ T) = dest_abstuple T
     4.7 -  | assn_tr' (Const ("op Int",_) $ (Const ("Collect",_) $ T1) $ 
     4.8 +  | assn_tr' (Const (@{const_name Int},_) $ (Const ("Collect",_) $ T1) $ 
     4.9                                     (Const ("Collect",_) $ T2)) =  
    4.10 -            Syntax.const "op Int" $ dest_abstuple T1 $ dest_abstuple T2
    4.11 +            Syntax.const "Set.Int" $ dest_abstuple T1 $ dest_abstuple T2
    4.12    | assn_tr' t = t;
    4.13  
    4.14  fun bexp_tr' (Const ("Collect",_) $ T) = dest_abstuple T 
     5.1 --- a/src/HOL/HoareParallel/OG_Tran.thy	Thu Mar 05 02:32:46 2009 +0100
     5.2 +++ b/src/HOL/HoareParallel/OG_Tran.thy	Thu Mar 05 08:24:28 2009 +0100
     5.3 @@ -102,7 +102,7 @@
     5.4    "SEM c S \<equiv> \<Union>sem c ` S "
     5.5  
     5.6  syntax "_Omega" :: "'a com"    ("\<Omega>" 63)
     5.7 -translations  "\<Omega>" \<rightleftharpoons> "While UNIV UNIV (Basic id)"
     5.8 +translations  "\<Omega>" \<rightleftharpoons> "While CONST UNIV CONST UNIV (Basic id)"
     5.9  
    5.10  consts fwhile :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> nat \<Rightarrow> 'a com"
    5.11  primrec 
     6.1 --- a/src/HOL/Lattices.thy	Thu Mar 05 02:32:46 2009 +0100
     6.2 +++ b/src/HOL/Lattices.thy	Thu Mar 05 08:24:28 2009 +0100
     6.3 @@ -5,7 +5,7 @@
     6.4  header {* Abstract lattices *}
     6.5  
     6.6  theory Lattices
     6.7 -imports Fun
     6.8 +imports Orderings
     6.9  begin
    6.10  
    6.11  subsection {* Lattices *}
    6.12 @@ -328,135 +328,6 @@
    6.13    min_max.le_infI1 min_max.le_infI2
    6.14  
    6.15  
    6.16 -subsection {* Complete lattices *}
    6.17 -
    6.18 -class complete_lattice = lattice + bot + top +
    6.19 -  fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
    6.20 -    and Sup :: "'a set \<Rightarrow> 'a" ("\<Squnion>_" [900] 900)
    6.21 -  assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
    6.22 -     and Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> \<Sqinter>A"
    6.23 -  assumes Sup_upper: "x \<in> A \<Longrightarrow> x \<sqsubseteq> \<Squnion>A"
    6.24 -     and Sup_least: "(\<And>x. x \<in> A \<Longrightarrow> x \<sqsubseteq> z) \<Longrightarrow> \<Squnion>A \<sqsubseteq> z"
    6.25 -begin
    6.26 -
    6.27 -lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<le> a}"
    6.28 -  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
    6.29 -
    6.30 -lemma Sup_Inf:  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<le> b}"
    6.31 -  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
    6.32 -
    6.33 -lemma Inf_Univ: "\<Sqinter>UNIV = \<Squnion>{}"
    6.34 -  unfolding Sup_Inf by auto
    6.35 -
    6.36 -lemma Sup_Univ: "\<Squnion>UNIV = \<Sqinter>{}"
    6.37 -  unfolding Inf_Sup by auto
    6.38 -
    6.39 -lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
    6.40 -  by (auto intro: antisym Inf_greatest Inf_lower)
    6.41 -
    6.42 -lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
    6.43 -  by (auto intro: antisym Sup_least Sup_upper)
    6.44 -
    6.45 -lemma Inf_singleton [simp]:
    6.46 -  "\<Sqinter>{a} = a"
    6.47 -  by (auto intro: antisym Inf_lower Inf_greatest)
    6.48 -
    6.49 -lemma Sup_singleton [simp]:
    6.50 -  "\<Squnion>{a} = a"
    6.51 -  by (auto intro: antisym Sup_upper Sup_least)
    6.52 -
    6.53 -lemma Inf_insert_simp:
    6.54 -  "\<Sqinter>insert a A = (if A = {} then a else a \<sqinter> \<Sqinter>A)"
    6.55 -  by (cases "A = {}") (simp_all, simp add: Inf_insert)
    6.56 -
    6.57 -lemma Sup_insert_simp:
    6.58 -  "\<Squnion>insert a A = (if A = {} then a else a \<squnion> \<Squnion>A)"
    6.59 -  by (cases "A = {}") (simp_all, simp add: Sup_insert)
    6.60 -
    6.61 -lemma Inf_binary:
    6.62 -  "\<Sqinter>{a, b} = a \<sqinter> b"
    6.63 -  by (simp add: Inf_insert_simp)
    6.64 -
    6.65 -lemma Sup_binary:
    6.66 -  "\<Squnion>{a, b} = a \<squnion> b"
    6.67 -  by (simp add: Sup_insert_simp)
    6.68 -
    6.69 -lemma bot_def:
    6.70 -  "bot = \<Squnion>{}"
    6.71 -  by (auto intro: antisym Sup_least)
    6.72 -
    6.73 -lemma top_def:
    6.74 -  "top = \<Sqinter>{}"
    6.75 -  by (auto intro: antisym Inf_greatest)
    6.76 -
    6.77 -lemma sup_bot [simp]:
    6.78 -  "x \<squnion> bot = x"
    6.79 -  using bot_least [of x] by (simp add: le_iff_sup sup_commute)
    6.80 -
    6.81 -lemma inf_top [simp]:
    6.82 -  "x \<sqinter> top = x"
    6.83 -  using top_greatest [of x] by (simp add: le_iff_inf inf_commute)
    6.84 -
    6.85 -definition SUPR :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
    6.86 -  "SUPR A f == \<Squnion> (f ` A)"
    6.87 -
    6.88 -definition INFI :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
    6.89 -  "INFI A f == \<Sqinter> (f ` A)"
    6.90 -
    6.91 -end
    6.92 -
    6.93 -syntax
    6.94 -  "_SUP1"     :: "pttrns => 'b => 'b"           ("(3SUP _./ _)" [0, 10] 10)
    6.95 -  "_SUP"      :: "pttrn => 'a set => 'b => 'b"  ("(3SUP _:_./ _)" [0, 10] 10)
    6.96 -  "_INF1"     :: "pttrns => 'b => 'b"           ("(3INF _./ _)" [0, 10] 10)
    6.97 -  "_INF"      :: "pttrn => 'a set => 'b => 'b"  ("(3INF _:_./ _)" [0, 10] 10)
    6.98 -
    6.99 -translations
   6.100 -  "SUP x y. B"   == "SUP x. SUP y. B"
   6.101 -  "SUP x. B"     == "CONST SUPR UNIV (%x. B)"
   6.102 -  "SUP x. B"     == "SUP x:UNIV. B"
   6.103 -  "SUP x:A. B"   == "CONST SUPR A (%x. B)"
   6.104 -  "INF x y. B"   == "INF x. INF y. B"
   6.105 -  "INF x. B"     == "CONST INFI UNIV (%x. B)"
   6.106 -  "INF x. B"     == "INF x:UNIV. B"
   6.107 -  "INF x:A. B"   == "CONST INFI A (%x. B)"
   6.108 -
   6.109 -(* To avoid eta-contraction of body: *)
   6.110 -print_translation {*
   6.111 -let
   6.112 -  fun btr' syn (A :: Abs abs :: ts) =
   6.113 -    let val (x,t) = atomic_abs_tr' abs
   6.114 -    in list_comb (Syntax.const syn $ x $ A $ t, ts) end
   6.115 -  val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const
   6.116 -in
   6.117 -[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")]
   6.118 -end
   6.119 -*}
   6.120 -
   6.121 -context complete_lattice
   6.122 -begin
   6.123 -
   6.124 -lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)"
   6.125 -  by (auto simp add: SUPR_def intro: Sup_upper)
   6.126 -
   6.127 -lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u"
   6.128 -  by (auto simp add: SUPR_def intro: Sup_least)
   6.129 -
   6.130 -lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i"
   6.131 -  by (auto simp add: INFI_def intro: Inf_lower)
   6.132 -
   6.133 -lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)"
   6.134 -  by (auto simp add: INFI_def intro: Inf_greatest)
   6.135 -
   6.136 -lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M"
   6.137 -  by (auto intro: antisym SUP_leI le_SUPI)
   6.138 -
   6.139 -lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M"
   6.140 -  by (auto intro: antisym INF_leI le_INFI)
   6.141 -
   6.142 -end
   6.143 -
   6.144 -
   6.145  subsection {* Bool as lattice *}
   6.146  
   6.147  instantiation bool :: distrib_lattice
   6.148 @@ -473,28 +344,6 @@
   6.149  
   6.150  end
   6.151  
   6.152 -instantiation bool :: complete_lattice
   6.153 -begin
   6.154 -
   6.155 -definition
   6.156 -  Inf_bool_def: "\<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x)"
   6.157 -
   6.158 -definition
   6.159 -  Sup_bool_def: "\<Squnion>A \<longleftrightarrow> (\<exists>x\<in>A. x)"
   6.160 -
   6.161 -instance
   6.162 -  by intro_classes (auto simp add: Inf_bool_def Sup_bool_def le_bool_def)
   6.163 -
   6.164 -end
   6.165 -
   6.166 -lemma Inf_empty_bool [simp]:
   6.167 -  "\<Sqinter>{}"
   6.168 -  unfolding Inf_bool_def by auto
   6.169 -
   6.170 -lemma not_Sup_empty_bool [simp]:
   6.171 -  "\<not> Sup {}"
   6.172 -  unfolding Sup_bool_def by auto
   6.173 -
   6.174  
   6.175  subsection {* Fun as lattice *}
   6.176  
   6.177 @@ -522,85 +371,6 @@
   6.178  instance "fun" :: (type, distrib_lattice) distrib_lattice
   6.179    by default (auto simp add: inf_fun_eq sup_fun_eq sup_inf_distrib1)
   6.180  
   6.181 -instantiation "fun" :: (type, complete_lattice) complete_lattice
   6.182 -begin
   6.183 -
   6.184 -definition
   6.185 -  Inf_fun_def [code del]: "\<Sqinter>A = (\<lambda>x. \<Sqinter>{y. \<exists>f\<in>A. y = f x})"
   6.186 -
   6.187 -definition
   6.188 -  Sup_fun_def [code del]: "\<Squnion>A = (\<lambda>x. \<Squnion>{y. \<exists>f\<in>A. y = f x})"
   6.189 -
   6.190 -instance
   6.191 -  by intro_classes
   6.192 -    (auto simp add: Inf_fun_def Sup_fun_def le_fun_def
   6.193 -      intro: Inf_lower Sup_upper Inf_greatest Sup_least)
   6.194 -
   6.195 -end
   6.196 -
   6.197 -lemma Inf_empty_fun:
   6.198 -  "\<Sqinter>{} = (\<lambda>_. \<Sqinter>{})"
   6.199 -  by rule (auto simp add: Inf_fun_def)
   6.200 -
   6.201 -lemma Sup_empty_fun:
   6.202 -  "\<Squnion>{} = (\<lambda>_. \<Squnion>{})"
   6.203 -  by rule (auto simp add: Sup_fun_def)
   6.204 -
   6.205 -
   6.206 -subsection {* Set as lattice *}
   6.207 -
   6.208 -lemma inf_set_eq: "A \<sqinter> B = A \<inter> B"
   6.209 -  apply (rule subset_antisym)
   6.210 -  apply (rule Int_greatest)
   6.211 -  apply (rule inf_le1)
   6.212 -  apply (rule inf_le2)
   6.213 -  apply (rule inf_greatest)
   6.214 -  apply (rule Int_lower1)
   6.215 -  apply (rule Int_lower2)
   6.216 -  done
   6.217 -
   6.218 -lemma sup_set_eq: "A \<squnion> B = A \<union> B"
   6.219 -  apply (rule subset_antisym)
   6.220 -  apply (rule sup_least)
   6.221 -  apply (rule Un_upper1)
   6.222 -  apply (rule Un_upper2)
   6.223 -  apply (rule Un_least)
   6.224 -  apply (rule sup_ge1)
   6.225 -  apply (rule sup_ge2)
   6.226 -  done
   6.227 -
   6.228 -lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B"
   6.229 -  apply (fold inf_set_eq sup_set_eq)
   6.230 -  apply (erule mono_inf)
   6.231 -  done
   6.232 -
   6.233 -lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)"
   6.234 -  apply (fold inf_set_eq sup_set_eq)
   6.235 -  apply (erule mono_sup)
   6.236 -  done
   6.237 -
   6.238 -lemma Inf_set_eq: "\<Sqinter>S = \<Inter>S"
   6.239 -  apply (rule subset_antisym)
   6.240 -  apply (rule Inter_greatest)
   6.241 -  apply (erule Inf_lower)
   6.242 -  apply (rule Inf_greatest)
   6.243 -  apply (erule Inter_lower)
   6.244 -  done
   6.245 -
   6.246 -lemma Sup_set_eq: "\<Squnion>S = \<Union>S"
   6.247 -  apply (rule subset_antisym)
   6.248 -  apply (rule Sup_least)
   6.249 -  apply (erule Union_upper)
   6.250 -  apply (rule Union_least)
   6.251 -  apply (erule Sup_upper)
   6.252 -  done
   6.253 -  
   6.254 -lemma top_set_eq: "top = UNIV"
   6.255 -  by (iprover intro!: subset_antisym subset_UNIV top_greatest)
   6.256 -
   6.257 -lemma bot_set_eq: "bot = {}"
   6.258 -  by (iprover intro!: subset_antisym empty_subsetI bot_least)
   6.259 -
   6.260  
   6.261  text {* redundant bindings *}
   6.262  
   6.263 @@ -611,8 +381,6 @@
   6.264    less_eq  (infix "\<sqsubseteq>" 50) and
   6.265    less (infix "\<sqsubset>" 50) and
   6.266    inf  (infixl "\<sqinter>" 70) and
   6.267 -  sup  (infixl "\<squnion>" 65) and
   6.268 -  Inf  ("\<Sqinter>_" [900] 900) and
   6.269 -  Sup  ("\<Squnion>_" [900] 900)
   6.270 +  sup  (infixl "\<squnion>" 65)
   6.271  
   6.272  end
     7.1 --- a/src/HOL/Library/Euclidean_Space.thy	Thu Mar 05 02:32:46 2009 +0100
     7.2 +++ b/src/HOL/Library/Euclidean_Space.thy	Thu Mar 05 08:24:28 2009 +0100
     7.3 @@ -4199,7 +4199,7 @@
     7.4    assumes iB: "independent (B:: (real ^'n) set)"
     7.5    shows "\<exists>g. linear g \<and> (\<forall>x\<in>B. g x = f x)"
     7.6  proof-
     7.7 -  from maximal_independent_subset_extend[of B "UNIV"] iB
     7.8 +  from maximal_independent_subset_extend[of B UNIV] iB
     7.9    obtain C where C: "B \<subseteq> C" "independent C" "\<And>x. x \<in> span C" by auto
    7.10    
    7.11    from C(2) independent_bound[of C] linear_independent_extend_lemma[of C f]
     8.1 --- a/src/HOL/Library/Executable_Set.thy	Thu Mar 05 02:32:46 2009 +0100
     8.2 +++ b/src/HOL/Library/Executable_Set.thy	Thu Mar 05 08:24:28 2009 +0100
     8.3 @@ -178,7 +178,7 @@
     8.4  
     8.5  lemma iso_insert:
     8.6    "set (insertl x xs) = insert x (set xs)"
     8.7 -  unfolding insertl_def iso_member by (simp add: Set.insert_absorb)
     8.8 +  unfolding insertl_def iso_member by (simp add: insert_absorb)
     8.9  
    8.10  lemma iso_remove1:
    8.11    assumes distnct: "distinct xs"
    8.12 @@ -261,7 +261,7 @@
    8.13  subsubsection {* const serializations *}
    8.14  
    8.15  consts_code
    8.16 -  "{}" ("{*[]*}")
    8.17 +  "Set.empty" ("{*[]*}")
    8.18    insert ("{*insertl*}")
    8.19    is_empty ("{*null*}")
    8.20    "op \<union>" ("{*unionl*}")
     9.1 --- a/src/HOL/Library/Finite_Cartesian_Product.thy	Thu Mar 05 02:32:46 2009 +0100
     9.2 +++ b/src/HOL/Library/Finite_Cartesian_Product.thy	Thu Mar 05 08:24:28 2009 +0100
     9.3 @@ -15,7 +15,7 @@
     9.4  definition "dimindex (S:: 'a set) = (if finite (UNIV::'a set) then card (UNIV:: 'a set) else 1)"
     9.5  
     9.6  syntax "_type_dimindex" :: "type => nat" ("(1DIM/(1'(_')))")
     9.7 -translations "DIM(t)" => "CONST dimindex (UNIV :: t set)"
     9.8 +translations "DIM(t)" => "CONST dimindex (CONST UNIV :: t set)"
     9.9  
    9.10  lemma dimindex_nonzero: "dimindex S \<noteq>  0"
    9.11  unfolding dimindex_def 
    10.1 --- a/src/HOL/Library/LaTeXsugar.thy	Thu Mar 05 02:32:46 2009 +0100
    10.2 +++ b/src/HOL/Library/LaTeXsugar.thy	Thu Mar 05 08:24:28 2009 +0100
    10.3 @@ -30,7 +30,7 @@
    10.4  
    10.5  (* empty set *)
    10.6  notation (latex)
    10.7 -  "{}" ("\<emptyset>")
    10.8 +  "Set.empty" ("\<emptyset>")
    10.9  
   10.10  (* insert *)
   10.11  translations 
    11.1 --- a/src/HOL/Nominal/nominal_inductive2.ML	Thu Mar 05 02:32:46 2009 +0100
    11.2 +++ b/src/HOL/Nominal/nominal_inductive2.ML	Thu Mar 05 08:24:28 2009 +0100
    11.3 @@ -75,7 +75,7 @@
    11.4    | add_binders thy i (Abs (_, _, t)) bs = add_binders thy (i + 1) t bs
    11.5    | add_binders thy i _ bs = bs;
    11.6  
    11.7 -fun mk_set T [] = Const ("{}", HOLogic.mk_setT T)
    11.8 +fun mk_set T [] = Const (@{const_name Set.empty}, HOLogic.mk_setT T)
    11.9    | mk_set T (x :: xs) =
   11.10        Const ("insert", T --> HOLogic.mk_setT T --> HOLogic.mk_setT T) $ x $
   11.11          mk_set T xs;
    12.1 --- a/src/HOL/Nominal/nominal_package.ML	Thu Mar 05 02:32:46 2009 +0100
    12.2 +++ b/src/HOL/Nominal/nominal_package.ML	Thu Mar 05 08:24:28 2009 +0100
    12.3 @@ -1010,8 +1010,8 @@
    12.4              (augment_sort thy8 pt_cp_sort
    12.5                (HOLogic.mk_Trueprop (HOLogic.mk_eq
    12.6                  (supp c,
    12.7 -                 if null dts then Const ("{}", HOLogic.mk_setT atomT)
    12.8 -                 else foldr1 (HOLogic.mk_binop "op Un") (map supp args2)))))
    12.9 +                 if null dts then Const (@{const_name Set.empty}, HOLogic.mk_setT atomT)
   12.10 +                 else foldr1 (HOLogic.mk_binop @{const_name Un}) (map supp args2)))))
   12.11              (fn _ =>
   12.12                simp_tac (HOL_basic_ss addsimps (supp_def ::
   12.13                   Un_assoc :: de_Morgan_conj :: Collect_disj_eq :: finite_Un ::
    13.1 --- a/src/HOL/Set.thy	Thu Mar 05 02:32:46 2009 +0100
    13.2 +++ b/src/HOL/Set.thy	Thu Mar 05 08:24:28 2009 +0100
    13.3 @@ -1,12 +1,11 @@
    13.4  (*  Title:      HOL/Set.thy
    13.5 -    ID:         $Id$
    13.6      Author:     Tobias Nipkow, Lawrence C Paulson and Markus Wenzel
    13.7  *)
    13.8  
    13.9  header {* Set theory for higher-order logic *}
   13.10  
   13.11  theory Set
   13.12 -imports Orderings
   13.13 +imports Lattices
   13.14  begin
   13.15  
   13.16  text {* A set in HOL is simply a predicate. *}
   13.17 @@ -19,36 +18,21 @@
   13.18  types 'a set = "'a => bool"
   13.19  
   13.20  consts
   13.21 -  "{}"          :: "'a set"                             ("{}")
   13.22 -  UNIV          :: "'a set"
   13.23 +  Collect       :: "('a => bool) => 'a set"              -- "comprehension"
   13.24 +  "op :"        :: "'a => 'a set => bool"                -- "membership"
   13.25    insert        :: "'a => 'a set => 'a set"
   13.26 -  Collect       :: "('a => bool) => 'a set"              -- "comprehension"
   13.27 -  "op Int"      :: "'a set => 'a set => 'a set"          (infixl "Int" 70)
   13.28 -  "op Un"       :: "'a set => 'a set => 'a set"          (infixl "Un" 65)
   13.29 -  UNION         :: "'a set => ('a => 'b set) => 'b set"  -- "general union"
   13.30 -  INTER         :: "'a set => ('a => 'b set) => 'b set"  -- "general intersection"
   13.31 -  Union         :: "'a set set => 'a set"                -- "union of a set"
   13.32 -  Inter         :: "'a set set => 'a set"                -- "intersection of a set"
   13.33 -  Pow           :: "'a set => 'a set set"                -- "powerset"
   13.34    Ball          :: "'a set => ('a => bool) => bool"      -- "bounded universal quantifiers"
   13.35    Bex           :: "'a set => ('a => bool) => bool"      -- "bounded existential quantifiers"
   13.36    Bex1          :: "'a set => ('a => bool) => bool"      -- "bounded unique existential quantifiers"
   13.37 +  Pow           :: "'a set => 'a set set"                -- "powerset"
   13.38    image         :: "('a => 'b) => 'a set => 'b set"      (infixr "`" 90)
   13.39 -  "op :"        :: "'a => 'a set => bool"                -- "membership"
   13.40 +
   13.41 +local
   13.42  
   13.43  notation
   13.44    "op :"  ("op :") and
   13.45    "op :"  ("(_/ : _)" [50, 51] 50)
   13.46  
   13.47 -local
   13.48 -
   13.49 -
   13.50 -subsection {* Additional concrete syntax *}
   13.51 -
   13.52 -abbreviation
   13.53 -  range :: "('a => 'b) => 'b set" where -- "of function"
   13.54 -  "range f == f ` UNIV"
   13.55 -
   13.56  abbreviation
   13.57    "not_mem x A == ~ (x : A)" -- "non-membership"
   13.58  
   13.59 @@ -57,32 +41,51 @@
   13.60    not_mem  ("(_/ ~: _)" [50, 51] 50)
   13.61  
   13.62  notation (xsymbols)
   13.63 -  "op Int"  (infixl "\<inter>" 70) and
   13.64 -  "op Un"  (infixl "\<union>" 65) and
   13.65    "op :"  ("op \<in>") and
   13.66    "op :"  ("(_/ \<in> _)" [50, 51] 50) and
   13.67    not_mem  ("op \<notin>") and
   13.68 -  not_mem  ("(_/ \<notin> _)" [50, 51] 50) and
   13.69 -  Union  ("\<Union>_" [90] 90) and
   13.70 -  Inter  ("\<Inter>_" [90] 90)
   13.71 +  not_mem  ("(_/ \<notin> _)" [50, 51] 50)
   13.72  
   13.73  notation (HTML output)
   13.74 -  "op Int"  (infixl "\<inter>" 70) and
   13.75 -  "op Un"  (infixl "\<union>" 65) and
   13.76    "op :"  ("op \<in>") and
   13.77    "op :"  ("(_/ \<in> _)" [50, 51] 50) and
   13.78    not_mem  ("op \<notin>") and
   13.79    not_mem  ("(_/ \<notin> _)" [50, 51] 50)
   13.80  
   13.81  syntax
   13.82 +  "@Coll"       :: "pttrn => bool => 'a set"              ("(1{_./ _})")
   13.83 +
   13.84 +translations
   13.85 +  "{x. P}"      == "Collect (%x. P)"
   13.86 +
   13.87 +definition empty :: "'a set" ("{}") where
   13.88 +  "empty \<equiv> {x. False}"
   13.89 +
   13.90 +definition UNIV :: "'a set" where
   13.91 +  "UNIV \<equiv> {x. True}"
   13.92 +
   13.93 +syntax
   13.94    "@Finset"     :: "args => 'a set"                       ("{(_)}")
   13.95 -  "@Coll"       :: "pttrn => bool => 'a set"              ("(1{_./ _})")
   13.96 -  "@SetCompr"   :: "'a => idts => bool => 'a set"         ("(1{_ |/_./ _})")
   13.97 -  "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ :/ _./ _})")
   13.98 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3INT _./ _)" [0, 10] 10)
   13.99 -  "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3UN _./ _)" [0, 10] 10)
  13.100 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3INT _:_./ _)" [0, 10] 10)
  13.101 -  "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3UN _:_./ _)" [0, 10] 10)
  13.102 +
  13.103 +translations
  13.104 +  "{x, xs}"     == "insert x {xs}"
  13.105 +  "{x}"         == "insert x {}"
  13.106 +
  13.107 +definition Int :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Int" 70) where
  13.108 +  "A Int B \<equiv> {x. x \<in> A \<and> x \<in> B}"
  13.109 +
  13.110 +definition Un :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Un" 65) where
  13.111 +  "A Un B \<equiv> {x. x \<in> A \<or> x \<in> B}"
  13.112 +
  13.113 +notation (xsymbols)
  13.114 +  "Int"  (infixl "\<inter>" 70) and
  13.115 +  "Un"  (infixl "\<union>" 65)
  13.116 +
  13.117 +notation (HTML output)
  13.118 +  "Int"  (infixl "\<inter>" 70) and
  13.119 +  "Un"  (infixl "\<union>" 65)
  13.120 +
  13.121 +syntax
  13.122    "_Ball"       :: "pttrn => 'a set => bool => bool"      ("(3ALL _:_./ _)" [0, 0, 10] 10)
  13.123    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3EX _:_./ _)" [0, 0, 10] 10)
  13.124    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3EX! _:_./ _)" [0, 0, 10] 10)
  13.125 @@ -93,24 +96,6 @@
  13.126    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3? _:_./ _)" [0, 0, 10] 10)
  13.127    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3?! _:_./ _)" [0, 0, 10] 10)
  13.128  
  13.129 -translations
  13.130 -  "{x, xs}"     == "insert x {xs}"
  13.131 -  "{x}"         == "insert x {}"
  13.132 -  "{x. P}"      == "Collect (%x. P)"
  13.133 -  "{x:A. P}"    => "{x. x:A & P}"
  13.134 -  "UN x y. B"   == "UN x. UN y. B"
  13.135 -  "UN x. B"     == "UNION UNIV (%x. B)"
  13.136 -  "UN x. B"     == "UN x:UNIV. B"
  13.137 -  "INT x y. B"  == "INT x. INT y. B"
  13.138 -  "INT x. B"    == "INTER UNIV (%x. B)"
  13.139 -  "INT x. B"    == "INT x:UNIV. B"
  13.140 -  "UN x:A. B"   == "UNION A (%x. B)"
  13.141 -  "INT x:A. B"  == "INTER A (%x. B)"
  13.142 -  "ALL x:A. P"  == "Ball A (%x. P)"
  13.143 -  "EX x:A. P"   == "Bex A (%x. P)"
  13.144 -  "EX! x:A. P"  == "Bex1 A (%x. P)"
  13.145 -  "LEAST x:A. P" => "LEAST x. x:A & P"
  13.146 -
  13.147  syntax (xsymbols)
  13.148    "_Ball"       :: "pttrn => 'a set => bool => bool"      ("(3\<forall>_\<in>_./ _)" [0, 0, 10] 10)
  13.149    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10)
  13.150 @@ -122,26 +107,71 @@
  13.151    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10)
  13.152    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3\<exists>!_\<in>_./ _)" [0, 0, 10] 10)
  13.153  
  13.154 +translations
  13.155 +  "ALL x:A. P"  == "Ball A (%x. P)"
  13.156 +  "EX x:A. P"   == "Bex A (%x. P)"
  13.157 +  "EX! x:A. P"  == "Bex1 A (%x. P)"
  13.158 +  "LEAST x:A. P" => "LEAST x. x:A & P"
  13.159 +
  13.160 +definition INTER :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  13.161 +  "INTER A B \<equiv> {y. \<forall>x\<in>A. y \<in> B x}"
  13.162 +
  13.163 +definition UNION :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  13.164 +  "UNION A B \<equiv> {y. \<exists>x\<in>A. y \<in> B x}"
  13.165 +
  13.166 +definition Inter :: "'a set set \<Rightarrow> 'a set" where
  13.167 +  "Inter S \<equiv> INTER S (\<lambda>x. x)"
  13.168 +
  13.169 +definition Union :: "'a set set \<Rightarrow> 'a set" where
  13.170 +  "Union S \<equiv> UNION S (\<lambda>x. x)"
  13.171 +
  13.172 +notation (xsymbols)
  13.173 +  Inter  ("\<Inter>_" [90] 90) and
  13.174 +  Union  ("\<Union>_" [90] 90)
  13.175 +
  13.176 +
  13.177 +subsection {* Additional concrete syntax *}
  13.178 +
  13.179 +syntax
  13.180 +  "@SetCompr"   :: "'a => idts => bool => 'a set"         ("(1{_ |/_./ _})")
  13.181 +  "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ :/ _./ _})")
  13.182 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3INT _./ _)" [0, 10] 10)
  13.183 +  "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3UN _./ _)" [0, 10] 10)
  13.184 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3INT _:_./ _)" [0, 10] 10)
  13.185 +  "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3UN _:_./ _)" [0, 10] 10)
  13.186 +
  13.187  syntax (xsymbols)
  13.188    "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ \<in>/ _./ _})")
  13.189 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>_./ _)" [0, 10] 10)
  13.190    "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3\<Union>_./ _)" [0, 10] 10)
  13.191 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>_./ _)" [0, 10] 10)
  13.192 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>_\<in>_./ _)" [0, 10] 10)
  13.193    "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Union>_\<in>_./ _)" [0, 10] 10)
  13.194 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>_\<in>_./ _)" [0, 10] 10)
  13.195  
  13.196  syntax (latex output)
  13.197 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  13.198    "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3\<Union>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  13.199 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  13.200 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  13.201    "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Union>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  13.202 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  13.203 -
  13.204 -text{*
  13.205 +
  13.206 +translations
  13.207 +  "{x:A. P}"    => "{x. x:A & P}"
  13.208 +  "INT x y. B"  == "INT x. INT y. B"
  13.209 +  "INT x. B"    == "CONST INTER CONST UNIV (%x. B)"
  13.210 +  "INT x. B"    == "INT x:CONST UNIV. B"
  13.211 +  "INT x:A. B"  == "CONST INTER A (%x. B)"
  13.212 +  "UN x y. B"   == "UN x. UN y. B"
  13.213 +  "UN x. B"     == "CONST UNION CONST UNIV (%x. B)"
  13.214 +  "UN x. B"     == "UN x:CONST UNIV. B"
  13.215 +  "UN x:A. B"   == "CONST UNION A (%x. B)"
  13.216 +
  13.217 +text {*
  13.218    Note the difference between ordinary xsymbol syntax of indexed
  13.219    unions and intersections (e.g.\ @{text"\<Union>a\<^isub>1\<in>A\<^isub>1. B"})
  13.220    and their \LaTeX\ rendition: @{term"\<Union>a\<^isub>1\<in>A\<^isub>1. B"}. The
  13.221    former does not make the index expression a subscript of the
  13.222    union/intersection symbol because this leads to problems with nested
  13.223 -  subscripts in Proof General. *}
  13.224 +  subscripts in Proof General.
  13.225 +*}
  13.226  
  13.227  abbreviation
  13.228    subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where
  13.229 @@ -183,6 +213,10 @@
  13.230    supset_eq  ("op \<supseteq>") and
  13.231    supset_eq  ("(_/ \<supseteq> _)" [50, 51] 50)
  13.232  
  13.233 +abbreviation
  13.234 +  range :: "('a => 'b) => 'b set" where -- "of function"
  13.235 +  "range f == f ` UNIV"
  13.236 +
  13.237  
  13.238  subsubsection "Bounded quantifiers"
  13.239  
  13.240 @@ -280,12 +314,12 @@
  13.241  (* To avoid eta-contraction of body: *)
  13.242  print_translation {*
  13.243  let
  13.244 -  fun btr' syn [A,Abs abs] =
  13.245 -    let val (x,t) = atomic_abs_tr' abs
  13.246 +  fun btr' syn [A, Abs abs] =
  13.247 +    let val (x, t) = atomic_abs_tr' abs
  13.248      in Syntax.const syn $ x $ A $ t end
  13.249  in
  13.250 -[("Ball", btr' "_Ball"),("Bex", btr' "_Bex"),
  13.251 - ("UNION", btr' "@UNION"),("INTER", btr' "@INTER")]
  13.252 +[(@{const_syntax Ball}, btr' "_Ball"), (@{const_syntax Bex}, btr' "_Bex"),
  13.253 + (@{const_syntax UNION}, btr' "@UNION"),(@{const_syntax INTER}, btr' "@INTER")]
  13.254  end
  13.255  *}
  13.256  
  13.257 @@ -373,15 +407,7 @@
  13.258  end
  13.259  
  13.260  defs
  13.261 -  Un_def:       "A Un B         == {x. x:A | x:B}"
  13.262 -  Int_def:      "A Int B        == {x. x:A & x:B}"
  13.263 -  INTER_def:    "INTER A B      == {y. ALL x:A. y: B(x)}"
  13.264 -  UNION_def:    "UNION A B      == {y. EX x:A. y: B(x)}"
  13.265 -  Inter_def:    "Inter S        == (INT x:S. x)"
  13.266 -  Union_def:    "Union S        == (UN x:S. x)"
  13.267    Pow_def:      "Pow A          == {B. B <= A}"
  13.268 -  empty_def:    "{}             == {x. False}"
  13.269 -  UNIV_def:     "UNIV           == {x. True}"
  13.270    insert_def:   "insert a B     == {x. x=a} Un B"
  13.271    image_def:    "f`A            == {y. EX x:A. y = f(x)}"
  13.272  
  13.273 @@ -1048,12 +1074,12 @@
  13.274    to use term-nets to associate patterns with rules.  Also, if a rule fails to
  13.275    apply, then the formula should be kept.
  13.276    [("HOL.uminus", Compl_iff RS iffD1), ("HOL.minus", [Diff_iff RS iffD1]),
  13.277 -   ("op Int", [IntD1,IntD2]),
  13.278 +   ("Int", [IntD1,IntD2]),
  13.279     ("Collect", [CollectD]), ("Inter", [InterD]), ("INTER", [INT_D])]
  13.280   *)
  13.281  
  13.282  ML {*
  13.283 -  val mksimps_pairs = [("Ball", @{thms bspec})] @ mksimps_pairs;
  13.284 +  val mksimps_pairs = [(@{const_name Ball}, @{thms bspec})] @ mksimps_pairs;
  13.285  *}
  13.286  declaration {* fn _ =>
  13.287    Simplifier.map_ss (fn ss => ss setmksimps (mksimps mksimps_pairs))
  13.288 @@ -2160,9 +2186,7 @@
  13.289  
  13.290  subsection {* Getting the Contents of a Singleton Set *}
  13.291  
  13.292 -definition
  13.293 -  contents :: "'a set \<Rightarrow> 'a"
  13.294 -where
  13.295 +definition contents :: "'a set \<Rightarrow> 'a" where
  13.296    [code del]: "contents X = (THE x. X = {x})"
  13.297  
  13.298  lemma contents_eq [simp]: "contents {x} = x"
  13.299 @@ -2215,6 +2239,255 @@
  13.300    unfolding vimage_def Collect_def mem_def ..
  13.301  
  13.302  
  13.303 +subsection {* Complete lattices *}
  13.304 +
  13.305 +notation
  13.306 +  less_eq  (infix "\<sqsubseteq>" 50) and
  13.307 +  less (infix "\<sqsubset>" 50) and
  13.308 +  inf  (infixl "\<sqinter>" 70) and
  13.309 +  sup  (infixl "\<squnion>" 65)
  13.310 +
  13.311 +class complete_lattice = lattice + bot + top +
  13.312 +  fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
  13.313 +    and Sup :: "'a set \<Rightarrow> 'a" ("\<Squnion>_" [900] 900)
  13.314 +  assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
  13.315 +     and Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> \<Sqinter>A"
  13.316 +  assumes Sup_upper: "x \<in> A \<Longrightarrow> x \<sqsubseteq> \<Squnion>A"
  13.317 +     and Sup_least: "(\<And>x. x \<in> A \<Longrightarrow> x \<sqsubseteq> z) \<Longrightarrow> \<Squnion>A \<sqsubseteq> z"
  13.318 +begin
  13.319 +
  13.320 +lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<le> a}"
  13.321 +  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
  13.322 +
  13.323 +lemma Sup_Inf:  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<le> b}"
  13.324 +  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
  13.325 +
  13.326 +lemma Inf_Univ: "\<Sqinter>UNIV = \<Squnion>{}"
  13.327 +  unfolding Sup_Inf by auto
  13.328 +
  13.329 +lemma Sup_Univ: "\<Squnion>UNIV = \<Sqinter>{}"
  13.330 +  unfolding Inf_Sup by auto
  13.331 +
  13.332 +lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
  13.333 +  by (auto intro: antisym Inf_greatest Inf_lower)
  13.334 +
  13.335 +lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
  13.336 +  by (auto intro: antisym Sup_least Sup_upper)
  13.337 +
  13.338 +lemma Inf_singleton [simp]:
  13.339 +  "\<Sqinter>{a} = a"
  13.340 +  by (auto intro: antisym Inf_lower Inf_greatest)
  13.341 +
  13.342 +lemma Sup_singleton [simp]:
  13.343 +  "\<Squnion>{a} = a"
  13.344 +  by (auto intro: antisym Sup_upper Sup_least)
  13.345 +
  13.346 +lemma Inf_insert_simp:
  13.347 +  "\<Sqinter>insert a A = (if A = {} then a else a \<sqinter> \<Sqinter>A)"
  13.348 +  by (cases "A = {}") (simp_all, simp add: Inf_insert)
  13.349 +
  13.350 +lemma Sup_insert_simp:
  13.351 +  "\<Squnion>insert a A = (if A = {} then a else a \<squnion> \<Squnion>A)"
  13.352 +  by (cases "A = {}") (simp_all, simp add: Sup_insert)
  13.353 +
  13.354 +lemma Inf_binary:
  13.355 +  "\<Sqinter>{a, b} = a \<sqinter> b"
  13.356 +  by (simp add: Inf_insert_simp)
  13.357 +
  13.358 +lemma Sup_binary:
  13.359 +  "\<Squnion>{a, b} = a \<squnion> b"
  13.360 +  by (simp add: Sup_insert_simp)
  13.361 +
  13.362 +lemma bot_def:
  13.363 +  "bot = \<Squnion>{}"
  13.364 +  by (auto intro: antisym Sup_least)
  13.365 +
  13.366 +lemma top_def:
  13.367 +  "top = \<Sqinter>{}"
  13.368 +  by (auto intro: antisym Inf_greatest)
  13.369 +
  13.370 +lemma sup_bot [simp]:
  13.371 +  "x \<squnion> bot = x"
  13.372 +  using bot_least [of x] by (simp add: le_iff_sup sup_commute)
  13.373 +
  13.374 +lemma inf_top [simp]:
  13.375 +  "x \<sqinter> top = x"
  13.376 +  using top_greatest [of x] by (simp add: le_iff_inf inf_commute)
  13.377 +
  13.378 +definition SUPR :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
  13.379 +  "SUPR A f == \<Squnion> (f ` A)"
  13.380 +
  13.381 +definition INFI :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
  13.382 +  "INFI A f == \<Sqinter> (f ` A)"
  13.383 +
  13.384 +end
  13.385 +
  13.386 +syntax
  13.387 +  "_SUP1"     :: "pttrns => 'b => 'b"           ("(3SUP _./ _)" [0, 10] 10)
  13.388 +  "_SUP"      :: "pttrn => 'a set => 'b => 'b"  ("(3SUP _:_./ _)" [0, 10] 10)
  13.389 +  "_INF1"     :: "pttrns => 'b => 'b"           ("(3INF _./ _)" [0, 10] 10)
  13.390 +  "_INF"      :: "pttrn => 'a set => 'b => 'b"  ("(3INF _:_./ _)" [0, 10] 10)
  13.391 +
  13.392 +translations
  13.393 +  "SUP x y. B"   == "SUP x. SUP y. B"
  13.394 +  "SUP x. B"     == "CONST SUPR CONST UNIV (%x. B)"
  13.395 +  "SUP x. B"     == "SUP x:CONST UNIV. B"
  13.396 +  "SUP x:A. B"   == "CONST SUPR A (%x. B)"
  13.397 +  "INF x y. B"   == "INF x. INF y. B"
  13.398 +  "INF x. B"     == "CONST INFI CONST UNIV (%x. B)"
  13.399 +  "INF x. B"     == "INF x:CONST UNIV. B"
  13.400 +  "INF x:A. B"   == "CONST INFI A (%x. B)"
  13.401 +
  13.402 +(* To avoid eta-contraction of body: *)
  13.403 +print_translation {*
  13.404 +let
  13.405 +  fun btr' syn (A :: Abs abs :: ts) =
  13.406 +    let val (x,t) = atomic_abs_tr' abs
  13.407 +    in list_comb (Syntax.const syn $ x $ A $ t, ts) end
  13.408 +  val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const
  13.409 +in
  13.410 +[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")]
  13.411 +end
  13.412 +*}
  13.413 +
  13.414 +context complete_lattice
  13.415 +begin
  13.416 +
  13.417 +lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)"
  13.418 +  by (auto simp add: SUPR_def intro: Sup_upper)
  13.419 +
  13.420 +lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u"
  13.421 +  by (auto simp add: SUPR_def intro: Sup_least)
  13.422 +
  13.423 +lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i"
  13.424 +  by (auto simp add: INFI_def intro: Inf_lower)
  13.425 +
  13.426 +lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)"
  13.427 +  by (auto simp add: INFI_def intro: Inf_greatest)
  13.428 +
  13.429 +lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M"
  13.430 +  by (auto intro: antisym SUP_leI le_SUPI)
  13.431 +
  13.432 +lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M"
  13.433 +  by (auto intro: antisym INF_leI le_INFI)
  13.434 +
  13.435 +end
  13.436 +
  13.437 +
  13.438 +subsection {* Bool as complete lattice *}
  13.439 +
  13.440 +instantiation bool :: complete_lattice
  13.441 +begin
  13.442 +
  13.443 +definition
  13.444 +  Inf_bool_def: "\<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x)"
  13.445 +
  13.446 +definition
  13.447 +  Sup_bool_def: "\<Squnion>A \<longleftrightarrow> (\<exists>x\<in>A. x)"
  13.448 +
  13.449 +instance
  13.450 +  by intro_classes (auto simp add: Inf_bool_def Sup_bool_def le_bool_def)
  13.451 +
  13.452 +end
  13.453 +
  13.454 +lemma Inf_empty_bool [simp]:
  13.455 +  "\<Sqinter>{}"
  13.456 +  unfolding Inf_bool_def by auto
  13.457 +
  13.458 +lemma not_Sup_empty_bool [simp]:
  13.459 +  "\<not> Sup {}"
  13.460 +  unfolding Sup_bool_def by auto
  13.461 +
  13.462 +
  13.463 +subsection {* Fun as complete lattice *}
  13.464 +
  13.465 +instantiation "fun" :: (type, complete_lattice) complete_lattice
  13.466 +begin
  13.467 +
  13.468 +definition
  13.469 +  Inf_fun_def [code del]: "\<Sqinter>A = (\<lambda>x. \<Sqinter>{y. \<exists>f\<in>A. y = f x})"
  13.470 +
  13.471 +definition
  13.472 +  Sup_fun_def [code del]: "\<Squnion>A = (\<lambda>x. \<Squnion>{y. \<exists>f\<in>A. y = f x})"
  13.473 +
  13.474 +instance
  13.475 +  by intro_classes
  13.476 +    (auto simp add: Inf_fun_def Sup_fun_def le_fun_def
  13.477 +      intro: Inf_lower Sup_upper Inf_greatest Sup_least)
  13.478 +
  13.479 +end
  13.480 +
  13.481 +lemma Inf_empty_fun:
  13.482 +  "\<Sqinter>{} = (\<lambda>_. \<Sqinter>{})"
  13.483 +  by rule (auto simp add: Inf_fun_def)
  13.484 +
  13.485 +lemma Sup_empty_fun:
  13.486 +  "\<Squnion>{} = (\<lambda>_. \<Squnion>{})"
  13.487 +  by rule (auto simp add: Sup_fun_def)
  13.488 +
  13.489 +
  13.490 +subsection {* Set as lattice *}
  13.491 +
  13.492 +lemma inf_set_eq: "A \<sqinter> B = A \<inter> B"
  13.493 +  apply (rule subset_antisym)
  13.494 +  apply (rule Int_greatest)
  13.495 +  apply (rule inf_le1)
  13.496 +  apply (rule inf_le2)
  13.497 +  apply (rule inf_greatest)
  13.498 +  apply (rule Int_lower1)
  13.499 +  apply (rule Int_lower2)
  13.500 +  done
  13.501 +
  13.502 +lemma sup_set_eq: "A \<squnion> B = A \<union> B"
  13.503 +  apply (rule subset_antisym)
  13.504 +  apply (rule sup_least)
  13.505 +  apply (rule Un_upper1)
  13.506 +  apply (rule Un_upper2)
  13.507 +  apply (rule Un_least)
  13.508 +  apply (rule sup_ge1)
  13.509 +  apply (rule sup_ge2)
  13.510 +  done
  13.511 +
  13.512 +lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B"
  13.513 +  apply (fold inf_set_eq sup_set_eq)
  13.514 +  apply (erule mono_inf)
  13.515 +  done
  13.516 +
  13.517 +lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)"
  13.518 +  apply (fold inf_set_eq sup_set_eq)
  13.519 +  apply (erule mono_sup)
  13.520 +  done
  13.521 +
  13.522 +lemma Inf_set_eq: "\<Sqinter>S = \<Inter>S"
  13.523 +  apply (rule subset_antisym)
  13.524 +  apply (rule Inter_greatest)
  13.525 +  apply (erule Inf_lower)
  13.526 +  apply (rule Inf_greatest)
  13.527 +  apply (erule Inter_lower)
  13.528 +  done
  13.529 +
  13.530 +lemma Sup_set_eq: "\<Squnion>S = \<Union>S"
  13.531 +  apply (rule subset_antisym)
  13.532 +  apply (rule Sup_least)
  13.533 +  apply (erule Union_upper)
  13.534 +  apply (rule Union_least)
  13.535 +  apply (erule Sup_upper)
  13.536 +  done
  13.537 +  
  13.538 +lemma top_set_eq: "top = UNIV"
  13.539 +  by (iprover intro!: subset_antisym subset_UNIV top_greatest)
  13.540 +
  13.541 +lemma bot_set_eq: "bot = {}"
  13.542 +  by (iprover intro!: subset_antisym empty_subsetI bot_least)
  13.543 +
  13.544 +no_notation
  13.545 +  less_eq  (infix "\<sqsubseteq>" 50) and
  13.546 +  less (infix "\<sqsubset>" 50) and
  13.547 +  inf  (infixl "\<sqinter>" 70) and
  13.548 +  sup  (infixl "\<squnion>" 65) and
  13.549 +  Inf  ("\<Sqinter>_" [900] 900) and
  13.550 +  Sup  ("\<Squnion>_" [900] 900)
  13.551 +
  13.552  
  13.553  subsection {* Basic ML bindings *}
  13.554  
    14.1 --- a/src/HOL/SizeChange/sct.ML	Thu Mar 05 02:32:46 2009 +0100
    14.2 +++ b/src/HOL/SizeChange/sct.ML	Thu Mar 05 08:24:28 2009 +0100
    14.3 @@ -266,12 +266,12 @@
    14.4  
    14.5  fun mk_edge m G n = HOLogic.mk_prod (m, HOLogic.mk_prod (G, n))
    14.6  
    14.7 -fun mk_set T [] = Const ("{}", HOLogic.mk_setT T)
    14.8 -  | mk_set T (x :: xs) = Const ("insert",
    14.9 +fun mk_set T [] = Const (@{const_name Set.empty}, HOLogic.mk_setT T)
   14.10 +  | mk_set T (x :: xs) = Const (@{const_name insert},
   14.11        T --> HOLogic.mk_setT T --> HOLogic.mk_setT T) $ x $ mk_set T xs
   14.12  
   14.13 -fun dest_set (Const ("{}", _)) = []
   14.14 -  | dest_set (Const ("insert", _) $ x $ xs) = x :: dest_set xs
   14.15 +fun dest_set (Const (@{const_name Set.empty}, _)) = []
   14.16 +  | dest_set (Const (@{const_name insert}, _) $ x $ xs) = x :: dest_set xs
   14.17  
   14.18  val in_graph_tac =
   14.19      simp_tac (HOL_basic_ss addsimps has_edge_simps) 1
    15.1 --- a/src/HOL/Tools/Qelim/cooper.ML	Thu Mar 05 02:32:46 2009 +0100
    15.2 +++ b/src/HOL/Tools/Qelim/cooper.ML	Thu Mar 05 08:24:28 2009 +0100
    15.3 @@ -428,8 +428,8 @@
    15.4     in
    15.5      fun provein x S = 
    15.6       case term_of S of
    15.7 -        Const("{}",_) => error "Unexpected error in Cooper please email Amine Chaieb"
    15.8 -      | Const("insert",_)$y$_ => 
    15.9 +        Const(@{const_name Set.empty}, _) => error "Unexpected error in Cooper please email Amine Chaieb"
   15.10 +      | Const(@{const_name insert}, _) $ y $ _ => 
   15.11           let val (cy,S') = Thm.dest_binop S
   15.12           in if term_of x aconv y then instantiate' [] [SOME x, SOME S'] insI1
   15.13           else implies_elim (instantiate' [] [SOME x, SOME S', SOME cy] insI2) 
    16.1 --- a/src/HOL/Tools/Qelim/ferrante_rackoff.ML	Thu Mar 05 02:32:46 2009 +0100
    16.2 +++ b/src/HOL/Tools/Qelim/ferrante_rackoff.ML	Thu Mar 05 08:24:28 2009 +0100
    16.3 @@ -99,8 +99,8 @@
    16.4     in
    16.5      fun provein x S =
    16.6       case term_of S of
    16.7 -        Const("{}",_) => raise CTERM ("provein : not a member!", [S])
    16.8 -      | Const("insert",_)$y$_ =>
    16.9 +        Const(@{const_name Set.empty}, _) => raise CTERM ("provein : not a member!", [S])
   16.10 +      | Const(@{const_name insert}, _) $ y $_ =>
   16.11           let val (cy,S') = Thm.dest_binop S
   16.12           in if term_of x aconv y then instantiate' [] [SOME x, SOME S'] insI1
   16.13           else implies_elim (instantiate' [] [SOME x, SOME S', SOME cy] insI2)
    17.1 --- a/src/HOL/Tools/Qelim/langford.ML	Thu Mar 05 02:32:46 2009 +0100
    17.2 +++ b/src/HOL/Tools/Qelim/langford.ML	Thu Mar 05 08:24:28 2009 +0100
    17.3 @@ -14,9 +14,9 @@
    17.4  val dest_set =
    17.5   let 
    17.6    fun h acc ct = 
    17.7 -   case (term_of ct) of
    17.8 -     Const("{}",_) => acc
    17.9 -   | Const("insert",_)$_$t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)
   17.10 +   case term_of ct of
   17.11 +     Const (@{const_name Set.empty}, _) => acc
   17.12 +   | Const (@{const_name insert}, _) $ _ $ t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)
   17.13  in h [] end;
   17.14  
   17.15  fun prove_finite cT u = 
   17.16 @@ -48,11 +48,11 @@
   17.17         in (ne, f) end
   17.18  
   17.19       val qe = case (term_of L, term_of U) of 
   17.20 -      (Const("{}",_),_) =>  
   17.21 +      (Const (@{const_name Set.empty}, _),_) =>  
   17.22          let
   17.23            val (neU,fU) = proveneF U 
   17.24          in simp_rule (transitive ths (dlo_qeth_nolb OF [neU, fU])) end
   17.25 -    | (_,Const("{}",_)) =>  
   17.26 +    | (_,Const (@{const_name Set.empty}, _)) =>  
   17.27          let
   17.28            val (neL,fL) = proveneF L
   17.29          in simp_rule (transitive ths (dlo_qeth_noub OF [neL, fL])) end
    18.1 --- a/src/HOL/Tools/datatype_rep_proofs.ML	Thu Mar 05 02:32:46 2009 +0100
    18.2 +++ b/src/HOL/Tools/datatype_rep_proofs.ML	Thu Mar 05 08:24:28 2009 +0100
    18.3 @@ -461,7 +461,7 @@
    18.4            (if i < length newTs then Const ("True", HOLogic.boolT)
    18.5             else HOLogic.mk_mem (mk_Free "x" Univ_elT i,
    18.6               Const ("image", [isoT, HOLogic.mk_setT T] ---> UnivT) $
    18.7 -               Const (iso_name, isoT) $ Const ("UNIV", HOLogic.mk_setT T)))
    18.8 +               Const (iso_name, isoT) $ Const (@{const_name UNIV}, HOLogic.mk_setT T)))
    18.9        end;
   18.10  
   18.11      val iso_t = HOLogic.mk_Trueprop (mk_conj (map mk_iso_t
    19.1 --- a/src/HOL/Tools/function_package/decompose.ML	Thu Mar 05 02:32:46 2009 +0100
    19.2 +++ b/src/HOL/Tools/function_package/decompose.ML	Thu Mar 05 08:24:28 2009 +0100
    19.3 @@ -30,7 +30,7 @@
    19.4            if is_some (Termination.get_chain D c1 c2) then D else
    19.5            let
    19.6              val goal = HOLogic.mk_eq (HOLogic.mk_binop @{const_name "Relation.rel_comp"} (c1, c2),
    19.7 -                                      Const (@{const_name "{}"}, fastype_of c1))
    19.8 +                                      Const (@{const_name Set.empty}, fastype_of c1))
    19.9                         |> HOLogic.mk_Trueprop (* "C1 O C2 = {}" *)
   19.10  
   19.11              val chain = case FundefLib.try_proof (cterm_of thy goal) chain_tac of
    20.1 --- a/src/HOL/Tools/function_package/fundef_lib.ML	Thu Mar 05 02:32:46 2009 +0100
    20.2 +++ b/src/HOL/Tools/function_package/fundef_lib.ML	Thu Mar 05 08:24:28 2009 +0100
    20.3 @@ -139,7 +139,7 @@
    20.4  
    20.5     Here, + can be any binary operation that is AC.
    20.6  
    20.7 -   cn - The name of the binop-constructor (e.g. @{const_name "op Un"})
    20.8 +   cn - The name of the binop-constructor (e.g. @{const_name Un})
    20.9     ac - the AC rewrite rules for cn
   20.10     is - the list of indices of the expressions that should become the first part
   20.11          (e.g. [0,1,3] in the above example)
   20.12 @@ -168,8 +168,8 @@
   20.13  
   20.14  (* instance for unions *)
   20.15  fun regroup_union_conv t =
   20.16 -    regroup_conv (@{const_name "{}"})
   20.17 -                  @{const_name "op Un"}
   20.18 +    regroup_conv (@{const_name Set.empty})
   20.19 +                  @{const_name Un}
   20.20         (map (fn t => t RS eq_reflection) (@{thms "Un_ac"} @
   20.21                                            @{thms "Un_empty_right"} @
   20.22                                            @{thms "Un_empty_left"})) t
    21.1 --- a/src/HOL/Tools/function_package/lexicographic_order.ML	Thu Mar 05 02:32:46 2009 +0100
    21.2 +++ b/src/HOL/Tools/function_package/lexicographic_order.ML	Thu Mar 05 08:24:28 2009 +0100
    21.3 @@ -24,7 +24,7 @@
    21.4      let 
    21.5          val relT = HOLogic.mk_setT (HOLogic.mk_prodT (domT, domT))
    21.6          val mlexT = (domT --> HOLogic.natT) --> relT --> relT
    21.7 -        fun mk_ms [] = Const (@{const_name "{}"}, relT)
    21.8 +        fun mk_ms [] = Const (@{const_name Set.empty}, relT)
    21.9            | mk_ms (f::fs) = 
   21.10              Const (@{const_name "mlex_prod"}, mlexT) $ f $ mk_ms fs
   21.11      in
    22.1 --- a/src/HOL/Tools/function_package/scnp_reconstruct.ML	Thu Mar 05 02:32:46 2009 +0100
    22.2 +++ b/src/HOL/Tools/function_package/scnp_reconstruct.ML	Thu Mar 05 08:24:28 2009 +0100
    22.3 @@ -142,7 +142,7 @@
    22.4  
    22.5  val setT = HOLogic.mk_setT
    22.6  
    22.7 -fun mk_set T [] = Const (@{const_name "{}"}, setT T)
    22.8 +fun mk_set T [] = Const (@{const_name Set.empty}, setT T)
    22.9    | mk_set T (x :: xs) =
   22.10        Const (@{const_name insert}, T --> setT T --> setT T) $
   22.11              x $ mk_set T xs
    23.1 --- a/src/HOL/Tools/function_package/termination.ML	Thu Mar 05 02:32:46 2009 +0100
    23.2 +++ b/src/HOL/Tools/function_package/termination.ML	Thu Mar 05 08:24:28 2009 +0100
    23.3 @@ -145,7 +145,7 @@
    23.4  
    23.5  fun mk_sum_skel rel =
    23.6    let
    23.7 -    val cs = FundefLib.dest_binop_list @{const_name "op Un"} rel
    23.8 +    val cs = FundefLib.dest_binop_list @{const_name Un} rel
    23.9      fun collect_pats (Const ("Collect", _) $ Abs (_, _, c)) =
   23.10        let
   23.11          val (Const ("op &", _) $ (Const ("op =", _) $ _ $ (Const ("Pair", _) $ r $ l)) $ Gam)
   23.12 @@ -233,7 +233,7 @@
   23.13  fun CALLS tac i st =
   23.14    if Thm.no_prems st then all_tac st
   23.15    else case Thm.term_of (Thm.cprem_of st i) of
   23.16 -    (_ $ (_ $ rel)) => tac (FundefLib.dest_binop_list @{const_name "op Un"} rel, i) st
   23.17 +    (_ $ (_ $ rel)) => tac (FundefLib.dest_binop_list @{const_name Un} rel, i) st
   23.18    |_ => no_tac st
   23.19  
   23.20  type ttac = (data -> int -> tactic) -> (data -> int -> tactic) -> data -> int -> tactic
   23.21 @@ -291,9 +291,9 @@
   23.22  
   23.23        val relation =
   23.24            if null ineqs then
   23.25 -              Const (@{const_name "{}"}, fastype_of rel)
   23.26 +              Const (@{const_name Set.empty}, fastype_of rel)
   23.27            else
   23.28 -              foldr1 (HOLogic.mk_binop @{const_name "op Un"}) (map mk_compr ineqs)
   23.29 +              foldr1 (HOLogic.mk_binop @{const_name Un}) (map mk_compr ineqs)
   23.30  
   23.31        fun solve_membership_tac i =
   23.32            (EVERY' (replicate (i - 2) (rtac @{thm UnI2}))  (* pick the right component of the union *)
    24.1 --- a/src/HOL/Tools/hologic.ML	Thu Mar 05 02:32:46 2009 +0100
    24.2 +++ b/src/HOL/Tools/hologic.ML	Thu Mar 05 08:24:28 2009 +0100
    24.3 @@ -225,7 +225,7 @@
    24.4  fun dest_mem (Const ("op :", _) $ x $ A) = (x, A)
    24.5    | dest_mem t = raise TERM ("dest_mem", [t]);
    24.6  
    24.7 -fun mk_UNIV T = Const ("UNIV", mk_setT T);
    24.8 +fun mk_UNIV T = Const ("Set.UNIV", mk_setT T);
    24.9  
   24.10  
   24.11  (* binary operations and relations *)
    25.1 --- a/src/HOL/Tools/inductive_set_package.ML	Thu Mar 05 02:32:46 2009 +0100
    25.2 +++ b/src/HOL/Tools/inductive_set_package.ML	Thu Mar 05 08:24:28 2009 +0100
    25.3 @@ -73,8 +73,8 @@
    25.4          in Drule.instantiate' [] (rev (map (SOME o cterm_of thy o Var) vs))
    25.5            (p (fold (Logic.all o Var) vs t) f)
    25.6          end;
    25.7 -      fun mkop "op &" T x = SOME (Const ("op Int", T --> T --> T), x)
    25.8 -        | mkop "op |" T x = SOME (Const ("op Un", T --> T --> T), x)
    25.9 +      fun mkop "op &" T x = SOME (Const (@{const_name "Int"}, T --> T --> T), x)
   25.10 +        | mkop "op |" T x = SOME (Const (@{const_name "Un"}, T --> T --> T), x)
   25.11          | mkop _ _ _ = NONE;
   25.12        fun mk_collect p T t =
   25.13          let val U = HOLogic.dest_setT T
    26.1 --- a/src/HOL/Tools/refute.ML	Thu Mar 05 02:32:46 2009 +0100
    26.2 +++ b/src/HOL/Tools/refute.ML	Thu Mar 05 08:24:28 2009 +0100
    26.3 @@ -2089,7 +2089,7 @@
    26.4            val HOLogic_prodT = HOLogic.mk_prodT (T1, T2)
    26.5            val HOLogic_setT  = HOLogic.mk_setT HOLogic_prodT
    26.6            (* Term.term *)
    26.7 -          val HOLogic_empty_set = Const (@{const_name "{}"}, HOLogic_setT)
    26.8 +          val HOLogic_empty_set = Const (@{const_name Set.empty}, HOLogic_setT)
    26.9            val HOLogic_insert    =
   26.10              Const (@{const_name insert}, HOLogic_prodT --> HOLogic_setT --> HOLogic_setT)
   26.11          in
   26.12 @@ -3154,7 +3154,7 @@
   26.13          val HOLogic_prodT = HOLogic.mk_prodT (T1, T2)
   26.14          val HOLogic_setT  = HOLogic.mk_setT HOLogic_prodT
   26.15          (* Term.term *)
   26.16 -        val HOLogic_empty_set = Const (@{const_name "{}"}, HOLogic_setT)
   26.17 +        val HOLogic_empty_set = Const (@{const_name Set.empty}, HOLogic_setT)
   26.18          val HOLogic_insert    =
   26.19            Const (@{const_name insert}, HOLogic_prodT --> HOLogic_setT --> HOLogic_setT)
   26.20        in
    27.1 --- a/src/HOL/Tools/res_clause.ML	Thu Mar 05 02:32:46 2009 +0100
    27.2 +++ b/src/HOL/Tools/res_clause.ML	Thu Mar 05 08:24:28 2009 +0100
    27.3 @@ -98,21 +98,21 @@
    27.4  
    27.5  (*Provide readable names for the more common symbolic functions*)
    27.6  val const_trans_table =
    27.7 -      Symtab.make [("op =", "equal"),
    27.8 +      Symtab.make [(@{const_name "op ="}, "equal"),
    27.9                     (@{const_name HOL.less_eq}, "lessequals"),
   27.10                     (@{const_name HOL.less}, "less"),
   27.11 -                   ("op &", "and"),
   27.12 -                   ("op |", "or"),
   27.13 +                   (@{const_name "op &"}, "and"),
   27.14 +                   (@{const_name "op |"}, "or"),
   27.15                     (@{const_name HOL.plus}, "plus"),
   27.16                     (@{const_name HOL.minus}, "minus"),
   27.17                     (@{const_name HOL.times}, "times"),
   27.18                     (@{const_name Divides.div}, "div"),
   27.19                     (@{const_name HOL.divide}, "divide"),
   27.20 -                   ("op -->", "implies"),
   27.21 -                   ("{}", "emptyset"),
   27.22 -                   ("op :", "in"),
   27.23 -                   ("op Un", "union"),
   27.24 -                   ("op Int", "inter"),
   27.25 +                   (@{const_name "op -->"}, "implies"),
   27.26 +                   (@{const_name Set.empty}, "emptyset"),
   27.27 +                   (@{const_name "op :"}, "in"),
   27.28 +                   (@{const_name Un}, "union"),
   27.29 +                   (@{const_name Int}, "inter"),
   27.30                     ("List.append", "append"),
   27.31                     ("ATP_Linkup.fequal", "fequal"),
   27.32                     ("ATP_Linkup.COMBI", "COMBI"),
    28.1 --- a/src/HOL/UNITY/Union.thy	Thu Mar 05 02:32:46 2009 +0100
    28.2 +++ b/src/HOL/UNITY/Union.thy	Thu Mar 05 08:24:28 2009 +0100
    28.3 @@ -43,7 +43,7 @@
    28.4  translations
    28.5    "JN x : A. B"   == "JOIN A (%x. B)"
    28.6    "JN x y. B"   == "JN x. JN y. B"
    28.7 -  "JN x. B"     == "JOIN UNIV (%x. B)"
    28.8 +  "JN x. B"     == "JOIN CONST UNIV (%x. B)"
    28.9  
   28.10  syntax (xsymbols)
   28.11    SKIP     :: "'a program"                              ("\<bottom>")
    29.1 --- a/src/HOLCF/IOA/meta_theory/ioa_package.ML	Thu Mar 05 02:32:46 2009 +0100
    29.2 +++ b/src/HOLCF/IOA/meta_theory/ioa_package.ML	Thu Mar 05 08:24:28 2009 +0100
    29.3 @@ -159,7 +159,8 @@
    29.4   (constructor_head thy atypstr a)::(constructor_head_list thy atypstr r);
    29.5  
    29.6  (* producing an action set *)
    29.7 -fun action_set_string thy atyp [] = "{}" |
    29.8 +(*FIXME*)
    29.9 +fun action_set_string thy atyp [] = "Set.empty" |
   29.10  action_set_string thy atyp [a] = constr_set_string thy atyp (strip_quote a) |
   29.11  action_set_string thy atyp (a::r) = (constr_set_string thy atyp (strip_quote a)) ^
   29.12           " Un " ^ (action_set_string thy atyp r);