set operations Int, Un, INTER, UNION, Inter, Union, empty, UNIV are now proper qualified constants with authentic syntax
authorhaftmann
Thu Mar 05 08:23:11 2009 +0100 (2009-03-05)
changeset 30304d8e4cd2ac2a1
parent 30303 9c4f4ac0d038
child 30305 720226bedc4d
set operations Int, Un, INTER, UNION, Inter, Union, empty, UNIV are now proper qualified constants with authentic syntax
NEWS
src/HOL/Hoare/Hoare.thy
src/HOL/Hoare/HoareAbort.thy
src/HOL/HoareParallel/OG_Tran.thy
src/HOL/Library/Executable_Set.thy
src/HOL/Library/Finite_Cartesian_Product.thy
src/HOL/Library/LaTeXsugar.thy
src/HOL/Nominal/nominal_inductive2.ML
src/HOL/Nominal/nominal_package.ML
src/HOL/Set.thy
src/HOL/SizeChange/sct.ML
src/HOL/Tools/Qelim/cooper.ML
src/HOL/Tools/Qelim/ferrante_rackoff.ML
src/HOL/Tools/Qelim/langford.ML
src/HOL/Tools/datatype_rep_proofs.ML
src/HOL/Tools/function_package/decompose.ML
src/HOL/Tools/function_package/fundef_lib.ML
src/HOL/Tools/function_package/lexicographic_order.ML
src/HOL/Tools/function_package/scnp_reconstruct.ML
src/HOL/Tools/function_package/termination.ML
src/HOL/Tools/hologic.ML
src/HOL/Tools/inductive_set_package.ML
src/HOL/Tools/refute.ML
src/HOL/Tools/res_clause.ML
src/HOL/UNITY/Union.thy
src/HOLCF/IOA/meta_theory/ioa_package.ML
     1.1 --- a/NEWS	Thu Mar 05 08:23:10 2009 +0100
     1.2 +++ b/NEWS	Thu Mar 05 08:23:11 2009 +0100
     1.3 @@ -214,6 +214,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 @@ -291,7 +306,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/Hoare/Hoare.thy	Thu Mar 05 08:23:10 2009 +0100
     2.2 +++ b/src/HOL/Hoare/Hoare.thy	Thu Mar 05 08:23:11 2009 +0100
     2.3 @@ -161,9 +161,9 @@
     2.4  (* assn_tr' & bexp_tr'*)
     2.5  ML{*  
     2.6  fun assn_tr' (Const ("Collect",_) $ T) = dest_abstuple T
     2.7 -  | assn_tr' (Const ("op Int",_) $ (Const ("Collect",_) $ T1) $ 
     2.8 +  | assn_tr' (Const (@{const_name Set.Int}, _) $ (Const ("Collect",_) $ T1) $ 
     2.9                                     (Const ("Collect",_) $ T2)) =  
    2.10 -            Syntax.const "op Int" $ dest_abstuple T1 $ dest_abstuple T2
    2.11 +            Syntax.const "Set.Int" $ dest_abstuple T1 $ dest_abstuple T2
    2.12    | assn_tr' t = t;
    2.13  
    2.14  fun bexp_tr' (Const ("Collect",_) $ T) = dest_abstuple T 
     3.1 --- a/src/HOL/Hoare/HoareAbort.thy	Thu Mar 05 08:23:10 2009 +0100
     3.2 +++ b/src/HOL/Hoare/HoareAbort.thy	Thu Mar 05 08:23:11 2009 +0100
     3.3 @@ -163,9 +163,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 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/HoareParallel/OG_Tran.thy	Thu Mar 05 08:23:10 2009 +0100
     4.2 +++ b/src/HOL/HoareParallel/OG_Tran.thy	Thu Mar 05 08:23:11 2009 +0100
     4.3 @@ -102,7 +102,7 @@
     4.4    "SEM c S \<equiv> \<Union>sem c ` S "
     4.5  
     4.6  syntax "_Omega" :: "'a com"    ("\<Omega>" 63)
     4.7 -translations  "\<Omega>" \<rightleftharpoons> "While UNIV UNIV (Basic id)"
     4.8 +translations  "\<Omega>" \<rightleftharpoons> "While CONST UNIV CONST UNIV (Basic id)"
     4.9  
    4.10  consts fwhile :: "'a bexp \<Rightarrow> 'a com \<Rightarrow> nat \<Rightarrow> 'a com"
    4.11  primrec 
     5.1 --- a/src/HOL/Library/Executable_Set.thy	Thu Mar 05 08:23:10 2009 +0100
     5.2 +++ b/src/HOL/Library/Executable_Set.thy	Thu Mar 05 08:23:11 2009 +0100
     5.3 @@ -178,7 +178,7 @@
     5.4  
     5.5  lemma iso_insert:
     5.6    "set (insertl x xs) = insert x (set xs)"
     5.7 -  unfolding insertl_def iso_member by (simp add: Set.insert_absorb)
     5.8 +  unfolding insertl_def iso_member by (simp add: insert_absorb)
     5.9  
    5.10  lemma iso_remove1:
    5.11    assumes distnct: "distinct xs"
    5.12 @@ -261,7 +261,7 @@
    5.13  subsubsection {* const serializations *}
    5.14  
    5.15  consts_code
    5.16 -  "{}" ("{*[]*}")
    5.17 +  "Set.empty" ("{*[]*}")
    5.18    insert ("{*insertl*}")
    5.19    is_empty ("{*null*}")
    5.20    "op \<union>" ("{*unionl*}")
     6.1 --- a/src/HOL/Library/Finite_Cartesian_Product.thy	Thu Mar 05 08:23:10 2009 +0100
     6.2 +++ b/src/HOL/Library/Finite_Cartesian_Product.thy	Thu Mar 05 08:23:11 2009 +0100
     6.3 @@ -1,5 +1,4 @@
     6.4  (* Title:      HOL/Library/Finite_Cartesian_Product
     6.5 -   ID:         $Id: Finite_Cartesian_Product.thy,v 1.5 2009/01/29 22:59:46 chaieb Exp $
     6.6     Author:     Amine Chaieb, University of Cambridge
     6.7  *)
     6.8  
     6.9 @@ -16,7 +15,7 @@
    6.10  definition "dimindex (S:: 'a set) = (if finite (UNIV::'a set) then card (UNIV:: 'a set) else 1)"
    6.11  
    6.12  syntax "_type_dimindex" :: "type => nat" ("(1DIM/(1'(_')))")
    6.13 -translations "DIM(t)" => "CONST dimindex (UNIV :: t set)"
    6.14 +translations "DIM(t)" => "CONST dimindex (CONST UNIV :: t set)"
    6.15  
    6.16  lemma dimindex_nonzero: "dimindex S \<noteq>  0"
    6.17  unfolding dimindex_def 
     7.1 --- a/src/HOL/Library/LaTeXsugar.thy	Thu Mar 05 08:23:10 2009 +0100
     7.2 +++ b/src/HOL/Library/LaTeXsugar.thy	Thu Mar 05 08:23:11 2009 +0100
     7.3 @@ -30,7 +30,7 @@
     7.4  
     7.5  (* empty set *)
     7.6  notation (latex)
     7.7 -  "{}" ("\<emptyset>")
     7.8 +  "Set.empty" ("\<emptyset>")
     7.9  
    7.10  (* insert *)
    7.11  translations 
     8.1 --- a/src/HOL/Nominal/nominal_inductive2.ML	Thu Mar 05 08:23:10 2009 +0100
     8.2 +++ b/src/HOL/Nominal/nominal_inductive2.ML	Thu Mar 05 08:23:11 2009 +0100
     8.3 @@ -70,7 +70,7 @@
     8.4    | add_binders thy i (Abs (_, _, t)) bs = add_binders thy (i + 1) t bs
     8.5    | add_binders thy i _ bs = bs;
     8.6  
     8.7 -fun mk_set T [] = Const ("{}", HOLogic.mk_setT T)
     8.8 +fun mk_set T [] = Const (@{const_name Set.empty}, HOLogic.mk_setT T)
     8.9    | mk_set T (x :: xs) =
    8.10        Const ("insert", T --> HOLogic.mk_setT T --> HOLogic.mk_setT T) $ x $
    8.11          mk_set T xs;
     9.1 --- a/src/HOL/Nominal/nominal_package.ML	Thu Mar 05 08:23:10 2009 +0100
     9.2 +++ b/src/HOL/Nominal/nominal_package.ML	Thu Mar 05 08:23:11 2009 +0100
     9.3 @@ -1010,8 +1010,8 @@
     9.4              (augment_sort thy8 pt_cp_sort
     9.5                (HOLogic.mk_Trueprop (HOLogic.mk_eq
     9.6                  (supp c,
     9.7 -                 if null dts then Const ("{}", HOLogic.mk_setT atomT)
     9.8 -                 else foldr1 (HOLogic.mk_binop "op Un") (map supp args2)))))
     9.9 +                 if null dts then Const (@{const_name Set.empty}, HOLogic.mk_setT atomT)
    9.10 +                 else foldr1 (HOLogic.mk_binop @{const_name Un}) (map supp args2)))))
    9.11              (fn _ =>
    9.12                simp_tac (HOL_basic_ss addsimps (supp_def ::
    9.13                   Un_assoc :: de_Morgan_conj :: Collect_disj_eq :: finite_Un ::
    10.1 --- a/src/HOL/Set.thy	Thu Mar 05 08:23:10 2009 +0100
    10.2 +++ b/src/HOL/Set.thy	Thu Mar 05 08:23:11 2009 +0100
    10.3 @@ -1,12 +1,11 @@
    10.4  (*  Title:      HOL/Set.thy
    10.5 -    ID:         $Id$
    10.6      Author:     Tobias Nipkow, Lawrence C Paulson and Markus Wenzel
    10.7  *)
    10.8  
    10.9  header {* Set theory for higher-order logic *}
   10.10  
   10.11  theory Set
   10.12 -imports Orderings
   10.13 +imports Lattices
   10.14  begin
   10.15  
   10.16  text {* A set in HOL is simply a predicate. *}
   10.17 @@ -19,36 +18,21 @@
   10.18  types 'a set = "'a => bool"
   10.19  
   10.20  consts
   10.21 -  "{}"          :: "'a set"                             ("{}")
   10.22 -  UNIV          :: "'a set"
   10.23 +  Collect       :: "('a => bool) => 'a set"              -- "comprehension"
   10.24 +  "op :"        :: "'a => 'a set => bool"                -- "membership"
   10.25    insert        :: "'a => 'a set => 'a set"
   10.26 -  Collect       :: "('a => bool) => 'a set"              -- "comprehension"
   10.27 -  "op Int"      :: "'a set => 'a set => 'a set"          (infixl "Int" 70)
   10.28 -  "op Un"       :: "'a set => 'a set => 'a set"          (infixl "Un" 65)
   10.29 -  UNION         :: "'a set => ('a => 'b set) => 'b set"  -- "general union"
   10.30 -  INTER         :: "'a set => ('a => 'b set) => 'b set"  -- "general intersection"
   10.31 -  Union         :: "'a set set => 'a set"                -- "union of a set"
   10.32 -  Inter         :: "'a set set => 'a set"                -- "intersection of a set"
   10.33 -  Pow           :: "'a set => 'a set set"                -- "powerset"
   10.34    Ball          :: "'a set => ('a => bool) => bool"      -- "bounded universal quantifiers"
   10.35    Bex           :: "'a set => ('a => bool) => bool"      -- "bounded existential quantifiers"
   10.36    Bex1          :: "'a set => ('a => bool) => bool"      -- "bounded unique existential quantifiers"
   10.37 +  Pow           :: "'a set => 'a set set"                -- "powerset"
   10.38    image         :: "('a => 'b) => 'a set => 'b set"      (infixr "`" 90)
   10.39 -  "op :"        :: "'a => 'a set => bool"                -- "membership"
   10.40 +
   10.41 +local
   10.42  
   10.43  notation
   10.44    "op :"  ("op :") and
   10.45    "op :"  ("(_/ : _)" [50, 51] 50)
   10.46  
   10.47 -local
   10.48 -
   10.49 -
   10.50 -subsection {* Additional concrete syntax *}
   10.51 -
   10.52 -abbreviation
   10.53 -  range :: "('a => 'b) => 'b set" where -- "of function"
   10.54 -  "range f == f ` UNIV"
   10.55 -
   10.56  abbreviation
   10.57    "not_mem x A == ~ (x : A)" -- "non-membership"
   10.58  
   10.59 @@ -57,32 +41,51 @@
   10.60    not_mem  ("(_/ ~: _)" [50, 51] 50)
   10.61  
   10.62  notation (xsymbols)
   10.63 -  "op Int"  (infixl "\<inter>" 70) and
   10.64 -  "op Un"  (infixl "\<union>" 65) and
   10.65    "op :"  ("op \<in>") and
   10.66    "op :"  ("(_/ \<in> _)" [50, 51] 50) and
   10.67    not_mem  ("op \<notin>") and
   10.68 -  not_mem  ("(_/ \<notin> _)" [50, 51] 50) and
   10.69 -  Union  ("\<Union>_" [90] 90) and
   10.70 -  Inter  ("\<Inter>_" [90] 90)
   10.71 +  not_mem  ("(_/ \<notin> _)" [50, 51] 50)
   10.72  
   10.73  notation (HTML output)
   10.74 -  "op Int"  (infixl "\<inter>" 70) and
   10.75 -  "op Un"  (infixl "\<union>" 65) and
   10.76    "op :"  ("op \<in>") and
   10.77    "op :"  ("(_/ \<in> _)" [50, 51] 50) and
   10.78    not_mem  ("op \<notin>") and
   10.79    not_mem  ("(_/ \<notin> _)" [50, 51] 50)
   10.80  
   10.81  syntax
   10.82 +  "@Coll"       :: "pttrn => bool => 'a set"              ("(1{_./ _})")
   10.83 +
   10.84 +translations
   10.85 +  "{x. P}"      == "Collect (%x. P)"
   10.86 +
   10.87 +definition empty :: "'a set" ("{}") where
   10.88 +  "empty \<equiv> {x. False}"
   10.89 +
   10.90 +definition UNIV :: "'a set" where
   10.91 +  "UNIV \<equiv> {x. True}"
   10.92 +
   10.93 +syntax
   10.94    "@Finset"     :: "args => 'a set"                       ("{(_)}")
   10.95 -  "@Coll"       :: "pttrn => bool => 'a set"              ("(1{_./ _})")
   10.96 -  "@SetCompr"   :: "'a => idts => bool => 'a set"         ("(1{_ |/_./ _})")
   10.97 -  "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ :/ _./ _})")
   10.98 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3INT _./ _)" [0, 10] 10)
   10.99 -  "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3UN _./ _)" [0, 10] 10)
  10.100 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3INT _:_./ _)" [0, 10] 10)
  10.101 -  "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3UN _:_./ _)" [0, 10] 10)
  10.102 +
  10.103 +translations
  10.104 +  "{x, xs}"     == "insert x {xs}"
  10.105 +  "{x}"         == "insert x {}"
  10.106 +
  10.107 +definition Int :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Int" 70) where
  10.108 +  "A Int B \<equiv> {x. x \<in> A \<and> x \<in> B}"
  10.109 +
  10.110 +definition Un :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Un" 65) where
  10.111 +  "A Un B \<equiv> {x. x \<in> A \<or> x \<in> B}"
  10.112 +
  10.113 +notation (xsymbols)
  10.114 +  "Int"  (infixl "\<inter>" 70) and
  10.115 +  "Un"  (infixl "\<union>" 65)
  10.116 +
  10.117 +notation (HTML output)
  10.118 +  "Int"  (infixl "\<inter>" 70) and
  10.119 +  "Un"  (infixl "\<union>" 65)
  10.120 +
  10.121 +syntax
  10.122    "_Ball"       :: "pttrn => 'a set => bool => bool"      ("(3ALL _:_./ _)" [0, 0, 10] 10)
  10.123    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3EX _:_./ _)" [0, 0, 10] 10)
  10.124    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3EX! _:_./ _)" [0, 0, 10] 10)
  10.125 @@ -93,24 +96,6 @@
  10.126    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3? _:_./ _)" [0, 0, 10] 10)
  10.127    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3?! _:_./ _)" [0, 0, 10] 10)
  10.128  
  10.129 -translations
  10.130 -  "{x, xs}"     == "insert x {xs}"
  10.131 -  "{x}"         == "insert x {}"
  10.132 -  "{x. P}"      == "Collect (%x. P)"
  10.133 -  "{x:A. P}"    => "{x. x:A & P}"
  10.134 -  "UN x y. B"   == "UN x. UN y. B"
  10.135 -  "UN x. B"     == "UNION UNIV (%x. B)"
  10.136 -  "UN x. B"     == "UN x:UNIV. B"
  10.137 -  "INT x y. B"  == "INT x. INT y. B"
  10.138 -  "INT x. B"    == "INTER UNIV (%x. B)"
  10.139 -  "INT x. B"    == "INT x:UNIV. B"
  10.140 -  "UN x:A. B"   == "UNION A (%x. B)"
  10.141 -  "INT x:A. B"  == "INTER A (%x. B)"
  10.142 -  "ALL x:A. P"  == "Ball A (%x. P)"
  10.143 -  "EX x:A. P"   == "Bex A (%x. P)"
  10.144 -  "EX! x:A. P"  == "Bex1 A (%x. P)"
  10.145 -  "LEAST x:A. P" => "LEAST x. x:A & P"
  10.146 -
  10.147  syntax (xsymbols)
  10.148    "_Ball"       :: "pttrn => 'a set => bool => bool"      ("(3\<forall>_\<in>_./ _)" [0, 0, 10] 10)
  10.149    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10)
  10.150 @@ -122,26 +107,71 @@
  10.151    "_Bex"        :: "pttrn => 'a set => bool => bool"      ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10)
  10.152    "_Bex1"       :: "pttrn => 'a set => bool => bool"      ("(3\<exists>!_\<in>_./ _)" [0, 0, 10] 10)
  10.153  
  10.154 +translations
  10.155 +  "ALL x:A. P"  == "Ball A (%x. P)"
  10.156 +  "EX x:A. P"   == "Bex A (%x. P)"
  10.157 +  "EX! x:A. P"  == "Bex1 A (%x. P)"
  10.158 +  "LEAST x:A. P" => "LEAST x. x:A & P"
  10.159 +
  10.160 +definition INTER :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  10.161 +  "INTER A B \<equiv> {y. \<forall>x\<in>A. y \<in> B x}"
  10.162 +
  10.163 +definition UNION :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  10.164 +  "UNION A B \<equiv> {y. \<exists>x\<in>A. y \<in> B x}"
  10.165 +
  10.166 +definition Inter :: "'a set set \<Rightarrow> 'a set" where
  10.167 +  "Inter S \<equiv> INTER S (\<lambda>x. x)"
  10.168 +
  10.169 +definition Union :: "'a set set \<Rightarrow> 'a set" where
  10.170 +  "Union S \<equiv> UNION S (\<lambda>x. x)"
  10.171 +
  10.172 +notation (xsymbols)
  10.173 +  Inter  ("\<Inter>_" [90] 90) and
  10.174 +  Union  ("\<Union>_" [90] 90)
  10.175 +
  10.176 +
  10.177 +subsection {* Additional concrete syntax *}
  10.178 +
  10.179 +syntax
  10.180 +  "@SetCompr"   :: "'a => idts => bool => 'a set"         ("(1{_ |/_./ _})")
  10.181 +  "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ :/ _./ _})")
  10.182 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3INT _./ _)" [0, 10] 10)
  10.183 +  "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3UN _./ _)" [0, 10] 10)
  10.184 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3INT _:_./ _)" [0, 10] 10)
  10.185 +  "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3UN _:_./ _)" [0, 10] 10)
  10.186 +
  10.187  syntax (xsymbols)
  10.188    "@Collect"    :: "idt => 'a set => bool => 'a set"      ("(1{_ \<in>/ _./ _})")
  10.189 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>_./ _)" [0, 10] 10)
  10.190    "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3\<Union>_./ _)" [0, 10] 10)
  10.191 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>_./ _)" [0, 10] 10)
  10.192 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>_\<in>_./ _)" [0, 10] 10)
  10.193    "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Union>_\<in>_./ _)" [0, 10] 10)
  10.194 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>_\<in>_./ _)" [0, 10] 10)
  10.195  
  10.196  syntax (latex output)
  10.197 +  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  10.198    "@UNION1"     :: "pttrns => 'b set => 'b set"           ("(3\<Union>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  10.199 -  "@INTER1"     :: "pttrns => 'b set => 'b set"           ("(3\<Inter>(00\<^bsub>_\<^esub>)/ _)" [0, 10] 10)
  10.200 +  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  10.201    "@UNION"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Union>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  10.202 -  "@INTER"      :: "pttrn => 'a set => 'b set => 'b set"  ("(3\<Inter>(00\<^bsub>_\<in>_\<^esub>)/ _)" [0, 10] 10)
  10.203 -
  10.204 -text{*
  10.205 +
  10.206 +translations
  10.207 +  "{x:A. P}"    => "{x. x:A & P}"
  10.208 +  "INT x y. B"  == "INT x. INT y. B"
  10.209 +  "INT x. B"    == "CONST INTER CONST UNIV (%x. B)"
  10.210 +  "INT x. B"    == "INT x:CONST UNIV. B"
  10.211 +  "INT x:A. B"  == "CONST INTER A (%x. B)"
  10.212 +  "UN x y. B"   == "UN x. UN y. B"
  10.213 +  "UN x. B"     == "CONST UNION CONST UNIV (%x. B)"
  10.214 +  "UN x. B"     == "UN x:CONST UNIV. B"
  10.215 +  "UN x:A. B"   == "CONST UNION A (%x. B)"
  10.216 +
  10.217 +text {*
  10.218    Note the difference between ordinary xsymbol syntax of indexed
  10.219    unions and intersections (e.g.\ @{text"\<Union>a\<^isub>1\<in>A\<^isub>1. B"})
  10.220    and their \LaTeX\ rendition: @{term"\<Union>a\<^isub>1\<in>A\<^isub>1. B"}. The
  10.221    former does not make the index expression a subscript of the
  10.222    union/intersection symbol because this leads to problems with nested
  10.223 -  subscripts in Proof General. *}
  10.224 +  subscripts in Proof General.
  10.225 +*}
  10.226  
  10.227  abbreviation
  10.228    subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where
  10.229 @@ -183,6 +213,10 @@
  10.230    supset_eq  ("op \<supseteq>") and
  10.231    supset_eq  ("(_/ \<supseteq> _)" [50, 51] 50)
  10.232  
  10.233 +abbreviation
  10.234 +  range :: "('a => 'b) => 'b set" where -- "of function"
  10.235 +  "range f == f ` UNIV"
  10.236 +
  10.237  
  10.238  subsubsection "Bounded quantifiers"
  10.239  
  10.240 @@ -280,12 +314,12 @@
  10.241  (* To avoid eta-contraction of body: *)
  10.242  print_translation {*
  10.243  let
  10.244 -  fun btr' syn [A,Abs abs] =
  10.245 -    let val (x,t) = atomic_abs_tr' abs
  10.246 +  fun btr' syn [A, Abs abs] =
  10.247 +    let val (x, t) = atomic_abs_tr' abs
  10.248      in Syntax.const syn $ x $ A $ t end
  10.249  in
  10.250 -[("Ball", btr' "_Ball"),("Bex", btr' "_Bex"),
  10.251 - ("UNION", btr' "@UNION"),("INTER", btr' "@INTER")]
  10.252 +[(@{const_syntax Ball}, btr' "_Ball"), (@{const_syntax Bex}, btr' "_Bex"),
  10.253 + (@{const_syntax UNION}, btr' "@UNION"),(@{const_syntax INTER}, btr' "@INTER")]
  10.254  end
  10.255  *}
  10.256  
  10.257 @@ -373,15 +407,7 @@
  10.258  end
  10.259  
  10.260  defs
  10.261 -  Un_def:       "A Un B         == {x. x:A | x:B}"
  10.262 -  Int_def:      "A Int B        == {x. x:A & x:B}"
  10.263 -  INTER_def:    "INTER A B      == {y. ALL x:A. y: B(x)}"
  10.264 -  UNION_def:    "UNION A B      == {y. EX x:A. y: B(x)}"
  10.265 -  Inter_def:    "Inter S        == (INT x:S. x)"
  10.266 -  Union_def:    "Union S        == (UN x:S. x)"
  10.267    Pow_def:      "Pow A          == {B. B <= A}"
  10.268 -  empty_def:    "{}             == {x. False}"
  10.269 -  UNIV_def:     "UNIV           == {x. True}"
  10.270    insert_def:   "insert a B     == {x. x=a} Un B"
  10.271    image_def:    "f`A            == {y. EX x:A. y = f(x)}"
  10.272  
  10.273 @@ -1048,12 +1074,12 @@
  10.274    to use term-nets to associate patterns with rules.  Also, if a rule fails to
  10.275    apply, then the formula should be kept.
  10.276    [("HOL.uminus", Compl_iff RS iffD1), ("HOL.minus", [Diff_iff RS iffD1]),
  10.277 -   ("op Int", [IntD1,IntD2]),
  10.278 +   ("Int", [IntD1,IntD2]),
  10.279     ("Collect", [CollectD]), ("Inter", [InterD]), ("INTER", [INT_D])]
  10.280   *)
  10.281  
  10.282  ML {*
  10.283 -  val mksimps_pairs = [("Ball", @{thms bspec})] @ mksimps_pairs;
  10.284 +  val mksimps_pairs = [(@{const_name Ball}, @{thms bspec})] @ mksimps_pairs;
  10.285  *}
  10.286  declaration {* fn _ =>
  10.287    Simplifier.map_ss (fn ss => ss setmksimps (mksimps mksimps_pairs))
  10.288 @@ -2160,9 +2186,7 @@
  10.289  
  10.290  subsection {* Getting the Contents of a Singleton Set *}
  10.291  
  10.292 -definition
  10.293 -  contents :: "'a set \<Rightarrow> 'a"
  10.294 -where
  10.295 +definition contents :: "'a set \<Rightarrow> 'a" where
  10.296    [code del]: "contents X = (THE x. X = {x})"
  10.297  
  10.298  lemma contents_eq [simp]: "contents {x} = x"
  10.299 @@ -2215,6 +2239,255 @@
  10.300    unfolding vimage_def Collect_def mem_def ..
  10.301  
  10.302  
  10.303 +subsection {* Complete lattices *}
  10.304 +
  10.305 +notation
  10.306 +  less_eq  (infix "\<sqsubseteq>" 50) and
  10.307 +  less (infix "\<sqsubset>" 50) and
  10.308 +  inf  (infixl "\<sqinter>" 70) and
  10.309 +  sup  (infixl "\<squnion>" 65)
  10.310 +
  10.311 +class complete_lattice = lattice + bot + top +
  10.312 +  fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
  10.313 +    and Sup :: "'a set \<Rightarrow> 'a" ("\<Squnion>_" [900] 900)
  10.314 +  assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
  10.315 +     and Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> \<Sqinter>A"
  10.316 +  assumes Sup_upper: "x \<in> A \<Longrightarrow> x \<sqsubseteq> \<Squnion>A"
  10.317 +     and Sup_least: "(\<And>x. x \<in> A \<Longrightarrow> x \<sqsubseteq> z) \<Longrightarrow> \<Squnion>A \<sqsubseteq> z"
  10.318 +begin
  10.319 +
  10.320 +lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<le> a}"
  10.321 +  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
  10.322 +
  10.323 +lemma Sup_Inf:  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<le> b}"
  10.324 +  by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least)
  10.325 +
  10.326 +lemma Inf_Univ: "\<Sqinter>UNIV = \<Squnion>{}"
  10.327 +  unfolding Sup_Inf by auto
  10.328 +
  10.329 +lemma Sup_Univ: "\<Squnion>UNIV = \<Sqinter>{}"
  10.330 +  unfolding Inf_Sup by auto
  10.331 +
  10.332 +lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
  10.333 +  by (auto intro: antisym Inf_greatest Inf_lower)
  10.334 +
  10.335 +lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
  10.336 +  by (auto intro: antisym Sup_least Sup_upper)
  10.337 +
  10.338 +lemma Inf_singleton [simp]:
  10.339 +  "\<Sqinter>{a} = a"
  10.340 +  by (auto intro: antisym Inf_lower Inf_greatest)
  10.341 +
  10.342 +lemma Sup_singleton [simp]:
  10.343 +  "\<Squnion>{a} = a"
  10.344 +  by (auto intro: antisym Sup_upper Sup_least)
  10.345 +
  10.346 +lemma Inf_insert_simp:
  10.347 +  "\<Sqinter>insert a A = (if A = {} then a else a \<sqinter> \<Sqinter>A)"
  10.348 +  by (cases "A = {}") (simp_all, simp add: Inf_insert)
  10.349 +
  10.350 +lemma Sup_insert_simp:
  10.351 +  "\<Squnion>insert a A = (if A = {} then a else a \<squnion> \<Squnion>A)"
  10.352 +  by (cases "A = {}") (simp_all, simp add: Sup_insert)
  10.353 +
  10.354 +lemma Inf_binary:
  10.355 +  "\<Sqinter>{a, b} = a \<sqinter> b"
  10.356 +  by (simp add: Inf_insert_simp)
  10.357 +
  10.358 +lemma Sup_binary:
  10.359 +  "\<Squnion>{a, b} = a \<squnion> b"
  10.360 +  by (simp add: Sup_insert_simp)
  10.361 +
  10.362 +lemma bot_def:
  10.363 +  "bot = \<Squnion>{}"
  10.364 +  by (auto intro: antisym Sup_least)
  10.365 +
  10.366 +lemma top_def:
  10.367 +  "top = \<Sqinter>{}"
  10.368 +  by (auto intro: antisym Inf_greatest)
  10.369 +
  10.370 +lemma sup_bot [simp]:
  10.371 +  "x \<squnion> bot = x"
  10.372 +  using bot_least [of x] by (simp add: le_iff_sup sup_commute)
  10.373 +
  10.374 +lemma inf_top [simp]:
  10.375 +  "x \<sqinter> top = x"
  10.376 +  using top_greatest [of x] by (simp add: le_iff_inf inf_commute)
  10.377 +
  10.378 +definition SUPR :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
  10.379 +  "SUPR A f == \<Squnion> (f ` A)"
  10.380 +
  10.381 +definition INFI :: "'b set \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> 'a" where
  10.382 +  "INFI A f == \<Sqinter> (f ` A)"
  10.383 +
  10.384 +end
  10.385 +
  10.386 +syntax
  10.387 +  "_SUP1"     :: "pttrns => 'b => 'b"           ("(3SUP _./ _)" [0, 10] 10)
  10.388 +  "_SUP"      :: "pttrn => 'a set => 'b => 'b"  ("(3SUP _:_./ _)" [0, 10] 10)
  10.389 +  "_INF1"     :: "pttrns => 'b => 'b"           ("(3INF _./ _)" [0, 10] 10)
  10.390 +  "_INF"      :: "pttrn => 'a set => 'b => 'b"  ("(3INF _:_./ _)" [0, 10] 10)
  10.391 +
  10.392 +translations
  10.393 +  "SUP x y. B"   == "SUP x. SUP y. B"
  10.394 +  "SUP x. B"     == "CONST SUPR CONST UNIV (%x. B)"
  10.395 +  "SUP x. B"     == "SUP x:CONST UNIV. B"
  10.396 +  "SUP x:A. B"   == "CONST SUPR A (%x. B)"
  10.397 +  "INF x y. B"   == "INF x. INF y. B"
  10.398 +  "INF x. B"     == "CONST INFI CONST UNIV (%x. B)"
  10.399 +  "INF x. B"     == "INF x:CONST UNIV. B"
  10.400 +  "INF x:A. B"   == "CONST INFI A (%x. B)"
  10.401 +
  10.402 +(* To avoid eta-contraction of body: *)
  10.403 +print_translation {*
  10.404 +let
  10.405 +  fun btr' syn (A :: Abs abs :: ts) =
  10.406 +    let val (x,t) = atomic_abs_tr' abs
  10.407 +    in list_comb (Syntax.const syn $ x $ A $ t, ts) end
  10.408 +  val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const
  10.409 +in
  10.410 +[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")]
  10.411 +end
  10.412 +*}
  10.413 +
  10.414 +context complete_lattice
  10.415 +begin
  10.416 +
  10.417 +lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)"
  10.418 +  by (auto simp add: SUPR_def intro: Sup_upper)
  10.419 +
  10.420 +lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u"
  10.421 +  by (auto simp add: SUPR_def intro: Sup_least)
  10.422 +
  10.423 +lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i"
  10.424 +  by (auto simp add: INFI_def intro: Inf_lower)
  10.425 +
  10.426 +lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)"
  10.427 +  by (auto simp add: INFI_def intro: Inf_greatest)
  10.428 +
  10.429 +lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M"
  10.430 +  by (auto intro: antisym SUP_leI le_SUPI)
  10.431 +
  10.432 +lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M"
  10.433 +  by (auto intro: antisym INF_leI le_INFI)
  10.434 +
  10.435 +end
  10.436 +
  10.437 +
  10.438 +subsection {* Bool as complete lattice *}
  10.439 +
  10.440 +instantiation bool :: complete_lattice
  10.441 +begin
  10.442 +
  10.443 +definition
  10.444 +  Inf_bool_def: "\<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x)"
  10.445 +
  10.446 +definition
  10.447 +  Sup_bool_def: "\<Squnion>A \<longleftrightarrow> (\<exists>x\<in>A. x)"
  10.448 +
  10.449 +instance
  10.450 +  by intro_classes (auto simp add: Inf_bool_def Sup_bool_def le_bool_def)
  10.451 +
  10.452 +end
  10.453 +
  10.454 +lemma Inf_empty_bool [simp]:
  10.455 +  "\<Sqinter>{}"
  10.456 +  unfolding Inf_bool_def by auto
  10.457 +
  10.458 +lemma not_Sup_empty_bool [simp]:
  10.459 +  "\<not> Sup {}"
  10.460 +  unfolding Sup_bool_def by auto
  10.461 +
  10.462 +
  10.463 +subsection {* Fun as complete lattice *}
  10.464 +
  10.465 +instantiation "fun" :: (type, complete_lattice) complete_lattice
  10.466 +begin
  10.467 +
  10.468 +definition
  10.469 +  Inf_fun_def [code del]: "\<Sqinter>A = (\<lambda>x. \<Sqinter>{y. \<exists>f\<in>A. y = f x})"
  10.470 +
  10.471 +definition
  10.472 +  Sup_fun_def [code del]: "\<Squnion>A = (\<lambda>x. \<Squnion>{y. \<exists>f\<in>A. y = f x})"
  10.473 +
  10.474 +instance
  10.475 +  by intro_classes
  10.476 +    (auto simp add: Inf_fun_def Sup_fun_def le_fun_def
  10.477 +      intro: Inf_lower Sup_upper Inf_greatest Sup_least)
  10.478 +
  10.479 +end
  10.480 +
  10.481 +lemma Inf_empty_fun:
  10.482 +  "\<Sqinter>{} = (\<lambda>_. \<Sqinter>{})"
  10.483 +  by rule (auto simp add: Inf_fun_def)
  10.484 +
  10.485 +lemma Sup_empty_fun:
  10.486 +  "\<Squnion>{} = (\<lambda>_. \<Squnion>{})"
  10.487 +  by rule (auto simp add: Sup_fun_def)
  10.488 +
  10.489 +
  10.490 +subsection {* Set as lattice *}
  10.491 +
  10.492 +lemma inf_set_eq: "A \<sqinter> B = A \<inter> B"
  10.493 +  apply (rule subset_antisym)
  10.494 +  apply (rule Int_greatest)
  10.495 +  apply (rule inf_le1)
  10.496 +  apply (rule inf_le2)
  10.497 +  apply (rule inf_greatest)
  10.498 +  apply (rule Int_lower1)
  10.499 +  apply (rule Int_lower2)
  10.500 +  done
  10.501 +
  10.502 +lemma sup_set_eq: "A \<squnion> B = A \<union> B"
  10.503 +  apply (rule subset_antisym)
  10.504 +  apply (rule sup_least)
  10.505 +  apply (rule Un_upper1)
  10.506 +  apply (rule Un_upper2)
  10.507 +  apply (rule Un_least)
  10.508 +  apply (rule sup_ge1)
  10.509 +  apply (rule sup_ge2)
  10.510 +  done
  10.511 +
  10.512 +lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B"
  10.513 +  apply (fold inf_set_eq sup_set_eq)
  10.514 +  apply (erule mono_inf)
  10.515 +  done
  10.516 +
  10.517 +lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)"
  10.518 +  apply (fold inf_set_eq sup_set_eq)
  10.519 +  apply (erule mono_sup)
  10.520 +  done
  10.521 +
  10.522 +lemma Inf_set_eq: "\<Sqinter>S = \<Inter>S"
  10.523 +  apply (rule subset_antisym)
  10.524 +  apply (rule Inter_greatest)
  10.525 +  apply (erule Inf_lower)
  10.526 +  apply (rule Inf_greatest)
  10.527 +  apply (erule Inter_lower)
  10.528 +  done
  10.529 +
  10.530 +lemma Sup_set_eq: "\<Squnion>S = \<Union>S"
  10.531 +  apply (rule subset_antisym)
  10.532 +  apply (rule Sup_least)
  10.533 +  apply (erule Union_upper)
  10.534 +  apply (rule Union_least)
  10.535 +  apply (erule Sup_upper)
  10.536 +  done
  10.537 +  
  10.538 +lemma top_set_eq: "top = UNIV"
  10.539 +  by (iprover intro!: subset_antisym subset_UNIV top_greatest)
  10.540 +
  10.541 +lemma bot_set_eq: "bot = {}"
  10.542 +  by (iprover intro!: subset_antisym empty_subsetI bot_least)
  10.543 +
  10.544 +no_notation
  10.545 +  less_eq  (infix "\<sqsubseteq>" 50) and
  10.546 +  less (infix "\<sqsubset>" 50) and
  10.547 +  inf  (infixl "\<sqinter>" 70) and
  10.548 +  sup  (infixl "\<squnion>" 65) and
  10.549 +  Inf  ("\<Sqinter>_" [900] 900) and
  10.550 +  Sup  ("\<Squnion>_" [900] 900)
  10.551 +
  10.552  
  10.553  subsection {* Basic ML bindings *}
  10.554  
    11.1 --- a/src/HOL/SizeChange/sct.ML	Thu Mar 05 08:23:10 2009 +0100
    11.2 +++ b/src/HOL/SizeChange/sct.ML	Thu Mar 05 08:23:11 2009 +0100
    11.3 @@ -266,12 +266,12 @@
    11.4  
    11.5  fun mk_edge m G n = HOLogic.mk_prod (m, HOLogic.mk_prod (G, n))
    11.6  
    11.7 -fun mk_set T [] = Const ("{}", HOLogic.mk_setT T)
    11.8 -  | mk_set T (x :: xs) = Const ("insert",
    11.9 +fun mk_set T [] = Const (@{const_name Set.empty}, HOLogic.mk_setT T)
   11.10 +  | mk_set T (x :: xs) = Const (@{const_name insert},
   11.11        T --> HOLogic.mk_setT T --> HOLogic.mk_setT T) $ x $ mk_set T xs
   11.12  
   11.13 -fun dest_set (Const ("{}", _)) = []
   11.14 -  | dest_set (Const ("insert", _) $ x $ xs) = x :: dest_set xs
   11.15 +fun dest_set (Const (@{const_name Set.empty}, _)) = []
   11.16 +  | dest_set (Const (@{const_name insert}, _) $ x $ xs) = x :: dest_set xs
   11.17  
   11.18  val in_graph_tac =
   11.19      simp_tac (HOL_basic_ss addsimps has_edge_simps) 1
    12.1 --- a/src/HOL/Tools/Qelim/cooper.ML	Thu Mar 05 08:23:10 2009 +0100
    12.2 +++ b/src/HOL/Tools/Qelim/cooper.ML	Thu Mar 05 08:23:11 2009 +0100
    12.3 @@ -428,8 +428,8 @@
    12.4     in
    12.5      fun provein x S = 
    12.6       case term_of S of
    12.7 -        Const("{}",_) => error "Unexpected error in Cooper please email Amine Chaieb"
    12.8 -      | Const("insert",_)$y$_ => 
    12.9 +        Const(@{const_name Set.empty}, _) => error "Unexpected error in Cooper please email Amine Chaieb"
   12.10 +      | Const(@{const_name insert}, _) $ y $ _ => 
   12.11           let val (cy,S') = Thm.dest_binop S
   12.12           in if term_of x aconv y then instantiate' [] [SOME x, SOME S'] insI1
   12.13           else implies_elim (instantiate' [] [SOME x, SOME S', SOME cy] insI2) 
    13.1 --- a/src/HOL/Tools/Qelim/ferrante_rackoff.ML	Thu Mar 05 08:23:10 2009 +0100
    13.2 +++ b/src/HOL/Tools/Qelim/ferrante_rackoff.ML	Thu Mar 05 08:23:11 2009 +0100
    13.3 @@ -99,8 +99,8 @@
    13.4     in
    13.5      fun provein x S =
    13.6       case term_of S of
    13.7 -        Const("{}",_) => raise CTERM ("provein : not a member!", [S])
    13.8 -      | Const("insert",_)$y$_ =>
    13.9 +        Const(@{const_name Set.empty}, _) => raise CTERM ("provein : not a member!", [S])
   13.10 +      | Const(@{const_name insert}, _) $ y $_ =>
   13.11           let val (cy,S') = Thm.dest_binop S
   13.12           in if term_of x aconv y then instantiate' [] [SOME x, SOME S'] insI1
   13.13           else implies_elim (instantiate' [] [SOME x, SOME S', SOME cy] insI2)
    14.1 --- a/src/HOL/Tools/Qelim/langford.ML	Thu Mar 05 08:23:10 2009 +0100
    14.2 +++ b/src/HOL/Tools/Qelim/langford.ML	Thu Mar 05 08:23:11 2009 +0100
    14.3 @@ -14,9 +14,9 @@
    14.4  val dest_set =
    14.5   let 
    14.6    fun h acc ct = 
    14.7 -   case (term_of ct) of
    14.8 -     Const("{}",_) => acc
    14.9 -   | Const("insert",_)$_$t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)
   14.10 +   case term_of ct of
   14.11 +     Const (@{const_name Set.empty}, _) => acc
   14.12 +   | Const (@{const_name insert}, _) $ _ $ t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)
   14.13  in h [] end;
   14.14  
   14.15  fun prove_finite cT u = 
   14.16 @@ -48,11 +48,11 @@
   14.17         in (ne, f) end
   14.18  
   14.19       val qe = case (term_of L, term_of U) of 
   14.20 -      (Const("{}",_),_) =>  
   14.21 +      (Const (@{const_name Set.empty}, _),_) =>  
   14.22          let
   14.23            val (neU,fU) = proveneF U 
   14.24          in simp_rule (transitive ths (dlo_qeth_nolb OF [neU, fU])) end
   14.25 -    | (_,Const("{}",_)) =>  
   14.26 +    | (_,Const (@{const_name Set.empty}, _)) =>  
   14.27          let
   14.28            val (neL,fL) = proveneF L
   14.29          in simp_rule (transitive ths (dlo_qeth_noub OF [neL, fL])) end
    15.1 --- a/src/HOL/Tools/datatype_rep_proofs.ML	Thu Mar 05 08:23:10 2009 +0100
    15.2 +++ b/src/HOL/Tools/datatype_rep_proofs.ML	Thu Mar 05 08:23:11 2009 +0100
    15.3 @@ -461,7 +461,7 @@
    15.4            (if i < length newTs then Const ("True", HOLogic.boolT)
    15.5             else HOLogic.mk_mem (mk_Free "x" Univ_elT i,
    15.6               Const ("image", [isoT, HOLogic.mk_setT T] ---> UnivT) $
    15.7 -               Const (iso_name, isoT) $ Const ("UNIV", HOLogic.mk_setT T)))
    15.8 +               Const (iso_name, isoT) $ Const (@{const_name UNIV}, HOLogic.mk_setT T)))
    15.9        end;
   15.10  
   15.11      val iso_t = HOLogic.mk_Trueprop (mk_conj (map mk_iso_t
    16.1 --- a/src/HOL/Tools/function_package/decompose.ML	Thu Mar 05 08:23:10 2009 +0100
    16.2 +++ b/src/HOL/Tools/function_package/decompose.ML	Thu Mar 05 08:23:11 2009 +0100
    16.3 @@ -30,7 +30,7 @@
    16.4            if is_some (Termination.get_chain D c1 c2) then D else
    16.5            let
    16.6              val goal = HOLogic.mk_eq (HOLogic.mk_binop @{const_name "Relation.rel_comp"} (c1, c2),
    16.7 -                                      Const (@{const_name "{}"}, fastype_of c1))
    16.8 +                                      Const (@{const_name Set.empty}, fastype_of c1))
    16.9                         |> HOLogic.mk_Trueprop (* "C1 O C2 = {}" *)
   16.10  
   16.11              val chain = case FundefLib.try_proof (cterm_of thy goal) chain_tac of
    17.1 --- a/src/HOL/Tools/function_package/fundef_lib.ML	Thu Mar 05 08:23:10 2009 +0100
    17.2 +++ b/src/HOL/Tools/function_package/fundef_lib.ML	Thu Mar 05 08:23:11 2009 +0100
    17.3 @@ -139,7 +139,7 @@
    17.4  
    17.5     Here, + can be any binary operation that is AC.
    17.6  
    17.7 -   cn - The name of the binop-constructor (e.g. @{const_name "op Un"})
    17.8 +   cn - The name of the binop-constructor (e.g. @{const_name Un})
    17.9     ac - the AC rewrite rules for cn
   17.10     is - the list of indices of the expressions that should become the first part
   17.11          (e.g. [0,1,3] in the above example)
   17.12 @@ -168,8 +168,8 @@
   17.13  
   17.14  (* instance for unions *)
   17.15  fun regroup_union_conv t =
   17.16 -    regroup_conv (@{const_name "{}"})
   17.17 -                  @{const_name "op Un"}
   17.18 +    regroup_conv (@{const_name Set.empty})
   17.19 +                  @{const_name Un}
   17.20         (map (fn t => t RS eq_reflection) (@{thms "Un_ac"} @
   17.21                                            @{thms "Un_empty_right"} @
   17.22                                            @{thms "Un_empty_left"})) t
    18.1 --- a/src/HOL/Tools/function_package/lexicographic_order.ML	Thu Mar 05 08:23:10 2009 +0100
    18.2 +++ b/src/HOL/Tools/function_package/lexicographic_order.ML	Thu Mar 05 08:23:11 2009 +0100
    18.3 @@ -24,7 +24,7 @@
    18.4      let 
    18.5          val relT = HOLogic.mk_setT (HOLogic.mk_prodT (domT, domT))
    18.6          val mlexT = (domT --> HOLogic.natT) --> relT --> relT
    18.7 -        fun mk_ms [] = Const (@{const_name "{}"}, relT)
    18.8 +        fun mk_ms [] = Const (@{const_name Set.empty}, relT)
    18.9            | mk_ms (f::fs) = 
   18.10              Const (@{const_name "mlex_prod"}, mlexT) $ f $ mk_ms fs
   18.11      in
    19.1 --- a/src/HOL/Tools/function_package/scnp_reconstruct.ML	Thu Mar 05 08:23:10 2009 +0100
    19.2 +++ b/src/HOL/Tools/function_package/scnp_reconstruct.ML	Thu Mar 05 08:23:11 2009 +0100
    19.3 @@ -142,7 +142,7 @@
    19.4  
    19.5  val setT = HOLogic.mk_setT
    19.6  
    19.7 -fun mk_set T [] = Const (@{const_name "{}"}, setT T)
    19.8 +fun mk_set T [] = Const (@{const_name Set.empty}, setT T)
    19.9    | mk_set T (x :: xs) =
   19.10        Const (@{const_name insert}, T --> setT T --> setT T) $
   19.11              x $ mk_set T xs
    20.1 --- a/src/HOL/Tools/function_package/termination.ML	Thu Mar 05 08:23:10 2009 +0100
    20.2 +++ b/src/HOL/Tools/function_package/termination.ML	Thu Mar 05 08:23:11 2009 +0100
    20.3 @@ -145,7 +145,7 @@
    20.4  
    20.5  fun mk_sum_skel rel =
    20.6    let
    20.7 -    val cs = FundefLib.dest_binop_list @{const_name "op Un"} rel
    20.8 +    val cs = FundefLib.dest_binop_list @{const_name Un} rel
    20.9      fun collect_pats (Const ("Collect", _) $ Abs (_, _, c)) =
   20.10        let
   20.11          val (Const ("op &", _) $ (Const ("op =", _) $ _ $ (Const ("Pair", _) $ r $ l)) $ Gam)
   20.12 @@ -233,7 +233,7 @@
   20.13  fun CALLS tac i st =
   20.14    if Thm.no_prems st then all_tac st
   20.15    else case Thm.term_of (Thm.cprem_of st i) of
   20.16 -    (_ $ (_ $ rel)) => tac (FundefLib.dest_binop_list @{const_name "op Un"} rel, i) st
   20.17 +    (_ $ (_ $ rel)) => tac (FundefLib.dest_binop_list @{const_name Un} rel, i) st
   20.18    |_ => no_tac st
   20.19  
   20.20  type ttac = (data -> int -> tactic) -> (data -> int -> tactic) -> data -> int -> tactic
   20.21 @@ -291,9 +291,9 @@
   20.22  
   20.23        val relation =
   20.24            if null ineqs then
   20.25 -              Const (@{const_name "{}"}, fastype_of rel)
   20.26 +              Const (@{const_name Set.empty}, fastype_of rel)
   20.27            else
   20.28 -              foldr1 (HOLogic.mk_binop @{const_name "op Un"}) (map mk_compr ineqs)
   20.29 +              foldr1 (HOLogic.mk_binop @{const_name Un}) (map mk_compr ineqs)
   20.30  
   20.31        fun solve_membership_tac i =
   20.32            (EVERY' (replicate (i - 2) (rtac @{thm UnI2}))  (* pick the right component of the union *)
    21.1 --- a/src/HOL/Tools/hologic.ML	Thu Mar 05 08:23:10 2009 +0100
    21.2 +++ b/src/HOL/Tools/hologic.ML	Thu Mar 05 08:23:11 2009 +0100
    21.3 @@ -225,7 +225,7 @@
    21.4  fun dest_mem (Const ("op :", _) $ x $ A) = (x, A)
    21.5    | dest_mem t = raise TERM ("dest_mem", [t]);
    21.6  
    21.7 -fun mk_UNIV T = Const ("UNIV", mk_setT T);
    21.8 +fun mk_UNIV T = Const ("Set.UNIV", mk_setT T);
    21.9  
   21.10  
   21.11  (* binary operations and relations *)
    22.1 --- a/src/HOL/Tools/inductive_set_package.ML	Thu Mar 05 08:23:10 2009 +0100
    22.2 +++ b/src/HOL/Tools/inductive_set_package.ML	Thu Mar 05 08:23:11 2009 +0100
    22.3 @@ -73,8 +73,8 @@
    22.4          in Drule.instantiate' [] (rev (map (SOME o cterm_of thy o Var) vs))
    22.5            (p (fold (Logic.all o Var) vs t) f)
    22.6          end;
    22.7 -      fun mkop "op &" T x = SOME (Const ("op Int", T --> T --> T), x)
    22.8 -        | mkop "op |" T x = SOME (Const ("op Un", T --> T --> T), x)
    22.9 +      fun mkop "op &" T x = SOME (Const (@{const_name "Int"}, T --> T --> T), x)
   22.10 +        | mkop "op |" T x = SOME (Const (@{const_name "Un"}, T --> T --> T), x)
   22.11          | mkop _ _ _ = NONE;
   22.12        fun mk_collect p T t =
   22.13          let val U = HOLogic.dest_setT T
    23.1 --- a/src/HOL/Tools/refute.ML	Thu Mar 05 08:23:10 2009 +0100
    23.2 +++ b/src/HOL/Tools/refute.ML	Thu Mar 05 08:23:11 2009 +0100
    23.3 @@ -2089,7 +2089,7 @@
    23.4            val HOLogic_prodT = HOLogic.mk_prodT (T1, T2)
    23.5            val HOLogic_setT  = HOLogic.mk_setT HOLogic_prodT
    23.6            (* Term.term *)
    23.7 -          val HOLogic_empty_set = Const (@{const_name "{}"}, HOLogic_setT)
    23.8 +          val HOLogic_empty_set = Const (@{const_name Set.empty}, HOLogic_setT)
    23.9            val HOLogic_insert    =
   23.10              Const (@{const_name insert}, HOLogic_prodT --> HOLogic_setT --> HOLogic_setT)
   23.11          in
   23.12 @@ -3154,7 +3154,7 @@
   23.13          val HOLogic_prodT = HOLogic.mk_prodT (T1, T2)
   23.14          val HOLogic_setT  = HOLogic.mk_setT HOLogic_prodT
   23.15          (* Term.term *)
   23.16 -        val HOLogic_empty_set = Const (@{const_name "{}"}, HOLogic_setT)
   23.17 +        val HOLogic_empty_set = Const (@{const_name Set.empty}, HOLogic_setT)
   23.18          val HOLogic_insert    =
   23.19            Const (@{const_name insert}, HOLogic_prodT --> HOLogic_setT --> HOLogic_setT)
   23.20        in
    24.1 --- a/src/HOL/Tools/res_clause.ML	Thu Mar 05 08:23:10 2009 +0100
    24.2 +++ b/src/HOL/Tools/res_clause.ML	Thu Mar 05 08:23:11 2009 +0100
    24.3 @@ -99,21 +99,21 @@
    24.4  
    24.5  (*Provide readable names for the more common symbolic functions*)
    24.6  val const_trans_table =
    24.7 -      Symtab.make [("op =", "equal"),
    24.8 +      Symtab.make [(@{const_name "op ="}, "equal"),
    24.9                     (@{const_name HOL.less_eq}, "lessequals"),
   24.10                     (@{const_name HOL.less}, "less"),
   24.11 -                   ("op &", "and"),
   24.12 -                   ("op |", "or"),
   24.13 +                   (@{const_name "op &"}, "and"),
   24.14 +                   (@{const_name "op |"}, "or"),
   24.15                     (@{const_name HOL.plus}, "plus"),
   24.16                     (@{const_name HOL.minus}, "minus"),
   24.17                     (@{const_name HOL.times}, "times"),
   24.18                     (@{const_name Divides.div}, "div"),
   24.19                     (@{const_name HOL.divide}, "divide"),
   24.20 -                   ("op -->", "implies"),
   24.21 -                   ("{}", "emptyset"),
   24.22 -                   ("op :", "in"),
   24.23 -                   ("op Un", "union"),
   24.24 -                   ("op Int", "inter"),
   24.25 +                   (@{const_name "op -->"}, "implies"),
   24.26 +                   (@{const_name Set.empty}, "emptyset"),
   24.27 +                   (@{const_name "op :"}, "in"),
   24.28 +                   (@{const_name Un}, "union"),
   24.29 +                   (@{const_name Int}, "inter"),
   24.30                     ("List.append", "append"),
   24.31                     ("ATP_Linkup.fequal", "fequal"),
   24.32                     ("ATP_Linkup.COMBI", "COMBI"),
    25.1 --- a/src/HOL/UNITY/Union.thy	Thu Mar 05 08:23:10 2009 +0100
    25.2 +++ b/src/HOL/UNITY/Union.thy	Thu Mar 05 08:23:11 2009 +0100
    25.3 @@ -43,7 +43,7 @@
    25.4  translations
    25.5    "JN x : A. B"   == "JOIN A (%x. B)"
    25.6    "JN x y. B"   == "JN x. JN y. B"
    25.7 -  "JN x. B"     == "JOIN UNIV (%x. B)"
    25.8 +  "JN x. B"     == "JOIN CONST UNIV (%x. B)"
    25.9  
   25.10  syntax (xsymbols)
   25.11    SKIP     :: "'a program"                              ("\<bottom>")
    26.1 --- a/src/HOLCF/IOA/meta_theory/ioa_package.ML	Thu Mar 05 08:23:10 2009 +0100
    26.2 +++ b/src/HOLCF/IOA/meta_theory/ioa_package.ML	Thu Mar 05 08:23:11 2009 +0100
    26.3 @@ -159,7 +159,8 @@
    26.4   (constructor_head thy atypstr a)::(constructor_head_list thy atypstr r);
    26.5  
    26.6  (* producing an action set *)
    26.7 -fun action_set_string thy atyp [] = "{}" |
    26.8 +(*FIXME*)
    26.9 +fun action_set_string thy atyp [] = "Set.empty" |
   26.10  action_set_string thy atyp [a] = constr_set_string thy atyp (strip_quote a) |
   26.11  action_set_string thy atyp (a::r) = (constr_set_string thy atyp (strip_quote a)) ^
   26.12           " Un " ^ (action_set_string thy atyp r);