dropped redundant gen_ prefix
authorhaftmann
Wed Oct 21 08:14:38 2009 +0200 (2009-10-21 ago)
changeset 330388f9594c31de4
parent 33037 b22e44496dc2
child 33039 5018f6a76b3f
dropped redundant gen_ prefix
src/HOL/Import/hol4rews.ML
src/HOL/Import/proof_kernel.ML
src/HOL/Import/shuffler.ML
src/HOL/Library/Sum_Of_Squares/sum_of_squares.ML
src/HOL/Library/normarith.ML
src/HOL/Library/positivstellensatz.ML
src/HOL/Nominal/nominal_inductive.ML
src/HOL/Nominal/nominal_inductive2.ML
src/HOL/Nominal/nominal_primrec.ML
src/HOL/SMT/Tools/smt_monomorph.ML
src/HOL/Set.thy
src/HOL/Tools/Datatype/datatype.ML
src/HOL/Tools/Datatype/datatype_aux.ML
src/HOL/Tools/Function/context_tree.ML
src/HOL/Tools/Function/pattern_split.ML
src/HOL/Tools/Groebner_Basis/groebner.ML
src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
src/HOL/Tools/Qelim/cooper.ML
src/HOL/Tools/Qelim/presburger.ML
src/HOL/Tools/TFL/post.ML
src/HOL/Tools/TFL/tfl.ML
src/HOL/Tools/inductive_codegen.ML
src/HOL/Tools/inductive_set.ML
src/HOL/Tools/metis_tools.ML
src/HOL/Tools/old_primrec.ML
src/HOL/Tools/primrec.ML
src/HOL/Tools/prop_logic.ML
src/HOL/Tools/record.ML
src/HOL/Tools/refute.ML
src/HOL/Tools/res_atp.ML
src/HOL/Tools/res_axioms.ML
src/HOL/Tools/res_clause.ML
src/HOL/Tools/res_hol_clause.ML
src/HOL/Tools/res_reconstruct.ML
src/HOL/Tools/sat_solver.ML
src/HOL/Tools/transfer.ML
src/HOL/ex/predicate_compile.ML
src/HOLCF/Tools/Domain/domain_extender.ML
src/Provers/Arith/cancel_div_mod.ML
src/Provers/Arith/fast_lin_arith.ML
src/Pure/General/name_space.ML
src/Pure/General/path.ML
src/Pure/Proof/extraction.ML
src/Pure/Proof/reconstruct.ML
src/Pure/ProofGeneral/pgip_parser.ML
src/Pure/Syntax/ast.ML
src/Pure/Syntax/parser.ML
src/Pure/Syntax/syn_ext.ML
src/Pure/Tools/find_theorems.ML
src/Pure/codegen.ML
src/Pure/library.ML
src/Pure/meta_simplifier.ML
src/Pure/pattern.ML
src/Pure/proofterm.ML
src/Pure/thm.ML
src/Pure/variable.ML
src/Sequents/prover.ML
src/Tools/Code/code_ml.ML
src/Tools/IsaPlanner/rw_inst.ML
src/Tools/intuitionistic.ML
src/ZF/Tools/primrec_package.ML
     1.1 --- a/src/HOL/Import/hol4rews.ML	Tue Oct 20 16:13:01 2009 +0200
     1.2 +++ b/src/HOL/Import/hol4rews.ML	Wed Oct 21 08:14:38 2009 +0200
     1.3 @@ -165,7 +165,7 @@
     1.4    val empty = []
     1.5    val copy = I
     1.6    val extend = I
     1.7 -  fun merge _ = Library.gen_union Thm.eq_thm
     1.8 +  fun merge _ = Library.union Thm.eq_thm
     1.9  )
    1.10  
    1.11  val hol4_debug = Unsynchronized.ref false
     2.1 --- a/src/HOL/Import/proof_kernel.ML	Tue Oct 20 16:13:01 2009 +0200
     2.2 +++ b/src/HOL/Import/proof_kernel.ML	Wed Oct 21 08:14:38 2009 +0200
     2.3 @@ -1230,7 +1230,7 @@
     2.4            | add_consts (_, cs) = cs
     2.5          val t_consts = add_consts(t,[])
     2.6      in
     2.7 -        fn th => gen_eq_set (op =) (t_consts, add_consts (prop_of th, []))
     2.8 +        fn th => eq_set (op =) (t_consts, add_consts (prop_of th, []))
     2.9      end
    2.10  
    2.11  fun split_name str =
     3.1 --- a/src/HOL/Import/shuffler.ML	Tue Oct 20 16:13:01 2009 +0200
     3.2 +++ b/src/HOL/Import/shuffler.ML	Wed Oct 21 08:14:38 2009 +0200
     3.3 @@ -78,7 +78,7 @@
     3.4    val empty = []
     3.5    val copy = I
     3.6    val extend = I
     3.7 -  fun merge _ = Library.gen_union Thm.eq_thm
     3.8 +  fun merge _ = Library.union Thm.eq_thm
     3.9  )
    3.10  
    3.11  fun print_shuffles thy =
    3.12 @@ -563,7 +563,7 @@
    3.13          let
    3.14              val th_consts = add_consts(prop_of th,[])
    3.15          in
    3.16 -            gen_eq_set (op =) (t_consts, th_consts)
    3.17 +            eq_set (op =) (t_consts, th_consts)
    3.18          end
    3.19      end
    3.20  
     4.1 --- a/src/HOL/Library/Sum_Of_Squares/sum_of_squares.ML	Tue Oct 20 16:13:01 2009 +0200
     4.2 +++ b/src/HOL/Library/Sum_Of_Squares/sum_of_squares.ML	Wed Oct 21 08:14:38 2009 +0200
     4.3 @@ -244,7 +244,7 @@
     4.4  
     4.5  fun monomial_lcm m1 m2 =
     4.6    fold_rev (fn x => FuncUtil.Ctermfunc.update (x, max (monomial_degree x m1) (monomial_degree x m2)))
     4.7 -          (gen_union (is_equal o  FuncUtil.cterm_ord) (FuncUtil.Ctermfunc.dom m1, FuncUtil.Ctermfunc.dom m2)) (FuncUtil.Ctermfunc.empty);
     4.8 +          (union (is_equal o  FuncUtil.cterm_ord) (FuncUtil.Ctermfunc.dom m1, FuncUtil.Ctermfunc.dom m2)) (FuncUtil.Ctermfunc.empty);
     4.9  
    4.10  fun monomial_multidegree m =
    4.11   FuncUtil.Ctermfunc.fold (fn (x, k) => fn a => k + a) m 0;;
    4.12 @@ -314,7 +314,7 @@
    4.13    FuncUtil.Monomialfunc.fold (fn (m, c) => fn a => max (monomial_multidegree m) a) p 0;
    4.14  
    4.15  fun poly_variables p =
    4.16 -  sort FuncUtil.cterm_ord (FuncUtil.Monomialfunc.fold_rev (fn (m, c) => curry (gen_union (is_equal o FuncUtil.cterm_ord)) (monomial_variables m)) p []);;
    4.17 +  sort FuncUtil.cterm_ord (FuncUtil.Monomialfunc.fold_rev (fn (m, c) => curry (union (is_equal o FuncUtil.cterm_ord)) (monomial_variables m)) p []);;
    4.18  
    4.19  (* Order monomials for human presentation.                                   *)
    4.20  
    4.21 @@ -1059,7 +1059,7 @@
    4.22  
    4.23  fun real_positivnullstellensatz_general prover linf d eqs leqs pol =
    4.24  let
    4.25 - val vars = fold_rev (curry (gen_union (op aconvc)) o poly_variables)
    4.26 + val vars = fold_rev (curry (union (op aconvc)) o poly_variables)
    4.27                (pol::eqs @ map fst leqs) []
    4.28   val monoid = if linf then
    4.29        (poly_const rat_1,RealArith.Rational_lt rat_1)::
     5.1 --- a/src/HOL/Library/normarith.ML	Tue Oct 20 16:13:01 2009 +0200
     5.2 +++ b/src/HOL/Library/normarith.ML	Wed Oct 21 08:14:38 2009 +0200
     5.3 @@ -286,7 +286,7 @@
     5.4     val dests = distinct (op aconvc) (map snd rawdests)
     5.5     val srcfuns = map vector_lincomb sources
     5.6     val destfuns = map vector_lincomb dests 
     5.7 -   val vvs = fold_rev (curry (gen_union op aconvc) o FuncUtil.Ctermfunc.dom) (srcfuns @ destfuns) []
     5.8 +   val vvs = fold_rev (curry (union op aconvc) o FuncUtil.Ctermfunc.dom) (srcfuns @ destfuns) []
     5.9     val n = length srcfuns
    5.10     val nvs = 1 upto n
    5.11     val srccombs = srcfuns ~~ nvs
     6.1 --- a/src/HOL/Library/positivstellensatz.ML	Tue Oct 20 16:13:01 2009 +0200
     6.2 +++ b/src/HOL/Library/positivstellensatz.ML	Wed Oct 21 08:14:38 2009 +0200
     6.3 @@ -568,7 +568,7 @@
     6.4    fun linear_cmul c = FuncUtil.Ctermfunc.map (fn x => c */ x)
     6.5    val one_tm = @{cterm "1::real"}
     6.6    fun contradictory p (e,_) = ((FuncUtil.Ctermfunc.is_empty e) andalso not(p Rat.zero)) orelse
     6.7 -     ((gen_eq_set (op aconvc) (FuncUtil.Ctermfunc.dom e, [one_tm])) andalso
     6.8 +     ((eq_set (op aconvc) (FuncUtil.Ctermfunc.dom e, [one_tm])) andalso
     6.9         not(p(FuncUtil.Ctermfunc.apply e one_tm)))
    6.10  
    6.11    fun linear_ineqs vars (les,lts) = 
    6.12 @@ -620,7 +620,7 @@
    6.13    | NONE => (case eqs of 
    6.14      [] => 
    6.15       let val vars = remove (op aconvc) one_tm 
    6.16 -           (fold_rev (curry (gen_union (op aconvc)) o FuncUtil.Ctermfunc.dom o fst) (les@lts) []) 
    6.17 +           (fold_rev (curry (union (op aconvc)) o FuncUtil.Ctermfunc.dom o fst) (les@lts) []) 
    6.18       in linear_ineqs vars (les,lts) end
    6.19     | (e,p)::es => 
    6.20       if FuncUtil.Ctermfunc.is_empty e then linear_eqs (es,les,lts) else
    6.21 @@ -679,7 +679,7 @@
    6.22    val le_pols = map rhs le
    6.23    val lt_pols = map rhs lt 
    6.24    val aliens =  filter is_alien
    6.25 -      (fold_rev (curry (gen_union (op aconvc)) o FuncUtil.Ctermfunc.dom) 
    6.26 +      (fold_rev (curry (union (op aconvc)) o FuncUtil.Ctermfunc.dom) 
    6.27            (eq_pols @ le_pols @ lt_pols) [])
    6.28    val le_pols' = le_pols @ map (fn v => FuncUtil.Ctermfunc.onefunc (v,Rat.one)) aliens
    6.29    val (_,proof) = linear_prover (eq_pols,le_pols',lt_pols)
     7.1 --- a/src/HOL/Nominal/nominal_inductive.ML	Tue Oct 20 16:13:01 2009 +0200
     7.2 +++ b/src/HOL/Nominal/nominal_inductive.ML	Wed Oct 21 08:14:38 2009 +0200
     7.3 @@ -28,7 +28,7 @@
     7.4  fun atomize_induct ctxt = Conv.fconv_rule (Conv.prems_conv ~1
     7.5    (Conv.params_conv ~1 (K (Conv.prems_conv ~1 atomize_conv)) ctxt));
     7.6  
     7.7 -fun preds_of ps t = gen_inter (op = o apfst dest_Free) (ps, Term.add_frees t []);
     7.8 +fun preds_of ps t = inter (op = o apfst dest_Free) (ps, Term.add_frees t []);
     7.9  
    7.10  val fresh_prod = thm "fresh_prod";
    7.11  
     8.1 --- a/src/HOL/Nominal/nominal_inductive2.ML	Tue Oct 20 16:13:01 2009 +0200
     8.2 +++ b/src/HOL/Nominal/nominal_inductive2.ML	Wed Oct 21 08:14:38 2009 +0200
     8.3 @@ -33,7 +33,7 @@
     8.4      [@{thm fresh_star_set_eq}, @{thm fresh_star_Un_elim},
     8.5       @{thm fresh_star_insert_elim}, @{thm fresh_star_empty_elim}]);
     8.6  
     8.7 -fun preds_of ps t = gen_inter (op = o apfst dest_Free) (ps, Term.add_frees t []);
     8.8 +fun preds_of ps t = inter (op = o apfst dest_Free) (ps, Term.add_frees t []);
     8.9  
    8.10  val perm_bool = mk_meta_eq (thm "perm_bool");
    8.11  val perm_boolI = thm "perm_boolI";
     9.1 --- a/src/HOL/Nominal/nominal_primrec.ML	Tue Oct 20 16:13:01 2009 +0200
     9.2 +++ b/src/HOL/Nominal/nominal_primrec.ML	Wed Oct 21 08:14:38 2009 +0200
     9.3 @@ -228,7 +228,7 @@
     9.4        (case Symtab.lookup dt_info tname of
     9.5            NONE => primrec_err (quote tname ^ " is not a nominal datatype")
     9.6          | SOME dt =>
     9.7 -            if gen_subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
     9.8 +            if subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
     9.9                (tname, dt)::(find_dts dt_info tnames' tnames)
    9.10              else find_dts dt_info tnames' tnames);
    9.11  
    9.12 @@ -251,7 +251,7 @@
    9.13      val lsrs :: lsrss = maps (fn (_, (_, _, eqns)) =>
    9.14        map (fn (_, (ls, _, rs, _, _)) => ls @ rs) eqns) eqns
    9.15      val _ =
    9.16 -      (if forall (curry (gen_eq_set (op =)) lsrs) lsrss andalso forall
    9.17 +      (if forall (curry (eq_set (op =)) lsrs) lsrss andalso forall
    9.18           (fn (_, (_, _, (_, (ls, _, rs, _, _)) :: eqns)) =>
    9.19                 forall (fn (_, (ls', _, rs', _, _)) =>
    9.20                   ls = ls' andalso rs = rs') eqns
    9.21 @@ -276,7 +276,7 @@
    9.22      val defs' = map (make_def lthy fixes fs) defs;
    9.23      val names1 = map snd fnames;
    9.24      val names2 = map fst eqns;
    9.25 -    val _ = if gen_eq_set (op =) (names1, names2) then ()
    9.26 +    val _ = if eq_set (op =) (names1, names2) then ()
    9.27        else primrec_err ("functions " ^ commas_quote names2 ^
    9.28          "\nare not mutually recursive");
    9.29      val (defs_thms, lthy') = lthy |>
    10.1 --- a/src/HOL/SMT/Tools/smt_monomorph.ML	Tue Oct 20 16:13:01 2009 +0200
    10.2 +++ b/src/HOL/SMT/Tools/smt_monomorph.ML	Wed Oct 21 08:14:38 2009 +0200
    10.3 @@ -55,7 +55,7 @@
    10.4  fun proper_match ps env =
    10.5    forall (forall (not o typ_has_tvars o Envir.subst_type env) o snd) ps
    10.6  
    10.7 -val eq_tab = gen_eq_set (op =) o pairself Vartab.dest
    10.8 +val eq_tab = eq_set (op =) o pairself Vartab.dest
    10.9  
   10.10  fun specialize thy cs is ((r, ps), ces) (ts, ns) =
   10.11    let
    11.1 --- a/src/HOL/Set.thy	Tue Oct 20 16:13:01 2009 +0200
    11.2 +++ b/src/HOL/Set.thy	Wed Oct 21 08:14:38 2009 +0200
    11.3 @@ -303,7 +303,7 @@
    11.4        fun check (Const ("Ex", _) $ Abs (_, _, P), n) = check (P, n + 1)
    11.5          | check (Const ("op &", _) $ (Const ("op =", _) $ Bound m $ e) $ P, n) =
    11.6              n > 0 andalso m = n andalso not (loose_bvar1 (P, n)) andalso
    11.7 -            gen_subset (op =) (0 upto (n - 1), add_loose_bnos (e, 0, []))
    11.8 +            subset (op =) (0 upto (n - 1), add_loose_bnos (e, 0, []))
    11.9          | check _ = false
   11.10  
   11.11          fun tr' (_ $ abs) =
    12.1 --- a/src/HOL/Tools/Datatype/datatype.ML	Tue Oct 20 16:13:01 2009 +0200
    12.2 +++ b/src/HOL/Tools/Datatype/datatype.ML	Wed Oct 21 08:14:38 2009 +0200
    12.3 @@ -124,7 +124,7 @@
    12.4        |> (pairself o map) (fn (_, (tyco, dTs, _)) => (tyco, map (typ_of_dtyp descr vs) dTs));
    12.5      
    12.6      val tycos = map fst dataTs;
    12.7 -    val _ = if gen_eq_set (op =) (tycos, raw_tycos) then ()
    12.8 +    val _ = if eq_set (op =) (tycos, raw_tycos) then ()
    12.9        else error ("Type constructors " ^ commas (map quote raw_tycos)
   12.10          ^ " do not belong exhaustively to one mutual recursive datatype");
   12.11  
   12.12 @@ -489,7 +489,7 @@
   12.13      val (new_dts, types_syntax) = ListPair.unzip (map (fn (tvs, tname, mx, _) =>
   12.14        let val full_tname = Sign.full_name tmp_thy (Binding.map_name (Syntax.type_name mx) tname)
   12.15        in (case duplicates (op =) tvs of
   12.16 -            [] => if gen_eq_set (op =) (tyvars, tvs) then ((full_tname, tvs), (tname, mx))
   12.17 +            [] => if eq_set (op =) (tyvars, tvs) then ((full_tname, tvs), (tname, mx))
   12.18                    else error ("Mutually recursive datatypes must have same type parameters")
   12.19            | dups => error ("Duplicate parameter(s) for datatype " ^ quote (Binding.str_of tname) ^
   12.20                " : " ^ commas dups))
    13.1 --- a/src/HOL/Tools/Datatype/datatype_aux.ML	Tue Oct 20 16:13:01 2009 +0200
    13.2 +++ b/src/HOL/Tools/Datatype/datatype_aux.ML	Wed Oct 21 08:14:38 2009 +0200
    13.3 @@ -257,7 +257,7 @@
    13.4  fun get_nonrec_types descr sorts =
    13.5    map (typ_of_dtyp descr sorts) (Library.foldl (fn (Ts, (_, (_, _, constrs))) =>
    13.6      Library.foldl (fn (Ts', (_, cargs)) =>
    13.7 -      gen_union (op =) (filter_out is_rec_type cargs, Ts')) (Ts, constrs)) ([], descr));
    13.8 +      union (op =) (filter_out is_rec_type cargs, Ts')) (Ts, constrs)) ([], descr));
    13.9  
   13.10  (* get all recursive types in datatype description *)
   13.11  
    14.1 --- a/src/HOL/Tools/Function/context_tree.ML	Tue Oct 20 16:13:01 2009 +0200
    14.2 +++ b/src/HOL/Tools/Function/context_tree.ML	Wed Oct 21 08:14:38 2009 +0200
    14.3 @@ -90,7 +90,7 @@
    14.4        IntGraph.empty
    14.5          |> fold (fn (i,_)=> IntGraph.new_node (i,i)) num_branches
    14.6          |> fold_product (fn (i, (c1, _)) => fn (j, (_, t2)) => 
    14.7 -               if i = j orelse null (gen_inter (op =) (c1, t2))
    14.8 +               if i = j orelse null (inter (op =) (c1, t2))
    14.9                 then I else IntGraph.add_edge_acyclic (i,j))
   14.10               num_branches num_branches
   14.11      end
    15.1 --- a/src/HOL/Tools/Function/pattern_split.ML	Tue Oct 20 16:13:01 2009 +0200
    15.2 +++ b/src/HOL/Tools/Function/pattern_split.ML	Wed Oct 21 08:14:38 2009 +0200
    15.3 @@ -101,7 +101,7 @@
    15.4            let
    15.5              val t = Pattern.rewrite_term thy sigma [] feq1
    15.6            in
    15.7 -            fold_rev Logic.all (gen_inter (op =) (map Free (frees_in_term ctx t), vs')) t
    15.8 +            fold_rev Logic.all (inter (op =) (map Free (frees_in_term ctx t), vs')) t
    15.9            end
   15.10      in
   15.11        map instantiate substs
    16.1 --- a/src/HOL/Tools/Groebner_Basis/groebner.ML	Tue Oct 20 16:13:01 2009 +0200
    16.2 +++ b/src/HOL/Tools/Groebner_Basis/groebner.ML	Wed Oct 21 08:14:38 2009 +0200
    16.3 @@ -348,7 +348,7 @@
    16.4    | Add(lin1,lin2) =>
    16.5          let val lis1 = resolve_proof vars lin1
    16.6              val lis2 = resolve_proof vars lin2
    16.7 -            val dom = distinct (op =) (gen_union (op =) (map fst lis1, map fst lis2))
    16.8 +            val dom = distinct (op =) (union (op =) (map fst lis1, map fst lis2))
    16.9          in
   16.10              map (fn n => let val a = these (AList.lookup (op =) lis1 n)
   16.11                               val b = these (AList.lookup (op =) lis2 n)
   16.12 @@ -884,7 +884,7 @@
   16.13   fun isolate_monomials vars tm =
   16.14   let 
   16.15    val (cmons,vmons) =
   16.16 -    List.partition (fn m => null (gen_inter op aconvc (frees m, vars)))
   16.17 +    List.partition (fn m => null (inter op aconvc (frees m, vars)))
   16.18                     (striplist ring_dest_add tm)
   16.19    val cofactors = map (fn v => find_multipliers v vmons) vars
   16.20    val cnc = if null cmons then zero_tm
    17.1 --- a/src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML	Tue Oct 20 16:13:01 2009 +0200
    17.2 +++ b/src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML	Wed Oct 21 08:14:38 2009 +0200
    17.3 @@ -984,20 +984,20 @@
    17.4              val dupTs = map snd (duplicates (op =) vTs) @
    17.5                map_filter (AList.lookup (op =) vTs) vs;
    17.6            in
    17.7 -            gen_subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    17.8 +            subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    17.9              forall (is_eqT o fastype_of) in_ts' andalso
   17.10 -            gen_subset (op =) (term_vs t, vs) andalso
   17.11 +            subset (op =) (term_vs t, vs) andalso
   17.12              forall is_eqT dupTs
   17.13            end)
   17.14              (modes_of_term modes t handle Option =>
   17.15                 error ("Bad predicate: " ^ Syntax.string_of_term_global thy t))
   17.16        | Negprem (us, t) => find_first (fn Mode (_, is, _) =>
   17.17              length us = length is andalso
   17.18 -            gen_subset (op =) (terms_vs us, vs) andalso
   17.19 -            gen_subset (op =) (term_vs t, vs))
   17.20 +            subset (op =) (terms_vs us, vs) andalso
   17.21 +            subset (op =) (term_vs t, vs))
   17.22              (modes_of_term modes t handle Option =>
   17.23                 error ("Bad predicate: " ^ Syntax.string_of_term_global thy t))
   17.24 -      | Sidecond t => if gen_subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   17.25 +      | Sidecond t => if subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   17.26            else NONE
   17.27        ) ps);
   17.28  
   17.29 @@ -1047,16 +1047,16 @@
   17.30              (if with_generator then
   17.31                (case select_mode_prem thy gen_modes' vs ps of
   17.32                  SOME (p as Prem _, SOME mode) => check_mode_prems ((gen_prem p, mode) :: acc_ps) 
   17.33 -                  (case p of Prem (us, _) => gen_union (op =) (vs, terms_vs us) | _ => vs)
   17.34 +                  (case p of Prem (us, _) => union (op =) (vs, terms_vs us) | _ => vs)
   17.35                    (filter_out (equal p) ps)
   17.36                | _ =>
   17.37                    let 
   17.38                      val all_generator_vs = all_subsets (prem_vs \\ vs) |> sort (int_ord o (pairself length))
   17.39                    in
   17.40                      case (find_first (fn generator_vs => is_some
   17.41 -                      (select_mode_prem thy modes' (gen_union (op =) (vs, generator_vs)) ps)) all_generator_vs) of
   17.42 +                      (select_mode_prem thy modes' (union (op =) (vs, generator_vs)) ps)) all_generator_vs) of
   17.43                        SOME generator_vs => check_mode_prems ((map (generator vTs) generator_vs) @ acc_ps)
   17.44 -                        (gen_union (op =) (vs, generator_vs)) ps
   17.45 +                        (union (op =) (vs, generator_vs)) ps
   17.46                      | NONE => let
   17.47                      val _ = tracing ("ps:" ^ (commas
   17.48                      (map (fn p => string_of_moded_prem thy (p, Mode (([], []), [], []))) ps)))
   17.49 @@ -1065,7 +1065,7 @@
   17.50              else
   17.51                NONE)
   17.52          | SOME (p, SOME mode) => check_mode_prems ((if with_generator then param_gen_prem param_vs p else p, mode) :: acc_ps) 
   17.53 -            (case p of Prem (us, _) => gen_union (op =) (vs, terms_vs us) | _ => vs)
   17.54 +            (case p of Prem (us, _) => union (op =) (vs, terms_vs us) | _ => vs)
   17.55              (filter_out (equal p) ps))
   17.56      val (in_ts, in_ts') = List.partition (is_constrt thy) (fst (split_smode is ts));
   17.57      val in_vs = terms_vs in_ts;
   17.58 @@ -1073,13 +1073,13 @@
   17.59    in
   17.60      if forall is_eqT (map snd (duplicates (op =) (maps term_vTs in_ts))) andalso
   17.61      forall (is_eqT o fastype_of) in_ts' then
   17.62 -      case check_mode_prems [] (gen_union (op =) (param_vs, in_vs)) ps of
   17.63 +      case check_mode_prems [] (union (op =) (param_vs, in_vs)) ps of
   17.64           NONE => NONE
   17.65         | SOME (acc_ps, vs) =>
   17.66           if with_generator then
   17.67             SOME (ts, (rev acc_ps) @ (map (generator vTs) (concl_vs \\ vs))) 
   17.68           else
   17.69 -           if gen_subset (op =) (concl_vs, vs) then SOME (ts, rev acc_ps) else NONE
   17.70 +           if subset (op =) (concl_vs, vs) then SOME (ts, rev acc_ps) else NONE
   17.71      else NONE
   17.72    end;
   17.73  
    18.1 --- a/src/HOL/Tools/Qelim/cooper.ML	Tue Oct 20 16:13:01 2009 +0200
    18.2 +++ b/src/HOL/Tools/Qelim/cooper.ML	Wed Oct 21 08:14:38 2009 +0200
    18.3 @@ -308,7 +308,7 @@
    18.4    | Const (@{const_name Not},_)$_ => h (acc,dacc) (Thm.dest_arg t)
    18.5    | _ => (acc, dacc)
    18.6    val (cs,ds) = h ([],[]) p
    18.7 -  val l = Integer.lcms (gen_union (op =) (cs, ds))
    18.8 +  val l = Integer.lcms (union (op =) (cs, ds))
    18.9    fun cv k ct =
   18.10      let val (tm as b$s$t) = term_of ct
   18.11      in ((HOLogic.eq_const bT)$tm$(b$(linear_cmul k s)$(linear_cmul k t))
    19.1 --- a/src/HOL/Tools/Qelim/presburger.ML	Tue Oct 20 16:13:01 2009 +0200
    19.2 +++ b/src/HOL/Tools/Qelim/presburger.ML	Wed Oct 21 08:14:38 2009 +0200
    19.3 @@ -84,7 +84,7 @@
    19.4   in h [] end;
    19.5  in 
    19.6  fun is_relevant ctxt ct = 
    19.7 - gen_subset (op aconv) (term_constants (term_of ct) , snd (CooperData.get ctxt))
    19.8 + subset (op aconv) (term_constants (term_of ct) , snd (CooperData.get ctxt))
    19.9   andalso forall (fn Free (_,T) => T mem [@{typ "int"}, @{typ nat}]) (OldTerm.term_frees (term_of ct))
   19.10   andalso forall (fn Var (_,T) => T mem [@{typ "int"}, @{typ nat}]) (OldTerm.term_vars (term_of ct));
   19.11  
    20.1 --- a/src/HOL/Tools/TFL/post.ML	Tue Oct 20 16:13:01 2009 +0200
    20.2 +++ b/src/HOL/Tools/TFL/post.ML	Wed Oct 21 08:14:38 2009 +0200
    20.3 @@ -28,7 +28,7 @@
    20.4   *--------------------------------------------------------------------------*)
    20.5  fun termination_goals rules =
    20.6      map (Type.freeze o HOLogic.dest_Trueprop)
    20.7 -      (List.foldr (fn (th,A) => gen_union (op aconv) (prems_of th, A)) [] rules);
    20.8 +      (List.foldr (fn (th,A) => union (op aconv) (prems_of th, A)) [] rules);
    20.9  
   20.10  (*---------------------------------------------------------------------------
   20.11   * Three postprocessors are applied to the definition.  It
   20.12 @@ -79,7 +79,7 @@
   20.13        val {lhs,rhs} = S.dest_eq(#2 (S.strip_forall (concl th)))
   20.14        val cntxtl = (#1 o S.strip_imp) lhs  (* cntxtl should = cntxtr *)
   20.15        val cntxtr = (#1 o S.strip_imp) rhs  (* but union is solider *)
   20.16 -      val cntxt = gen_union (op aconv) (cntxtl, cntxtr)
   20.17 +      val cntxt = union (op aconv) (cntxtl, cntxtr)
   20.18    in
   20.19      R.GEN_ALL
   20.20        (R.DISCH_ALL
    21.1 --- a/src/HOL/Tools/TFL/tfl.ML	Tue Oct 20 16:13:01 2009 +0200
    21.2 +++ b/src/HOL/Tools/TFL/tfl.ML	Wed Oct 21 08:14:38 2009 +0200
    21.3 @@ -531,7 +531,7 @@
    21.4                   then writeln (cat_lines ("Extractants =" ::
    21.5                    map (Display.string_of_thm_global thy) extractants))
    21.6                   else ()
    21.7 -     val TCs = List.foldr (gen_union (op aconv)) [] TCl
    21.8 +     val TCs = List.foldr (union (op aconv)) [] TCl
    21.9       val full_rqt = WFR::TCs
   21.10       val R' = S.mk_select{Bvar=R1, Body=S.list_mk_conj full_rqt}
   21.11       val R'abs = S.rand R'
    22.1 --- a/src/HOL/Tools/inductive_codegen.ML	Tue Oct 20 16:13:01 2009 +0200
    22.2 +++ b/src/HOL/Tools/inductive_codegen.ML	Wed Oct 21 08:14:38 2009 +0200
    22.3 @@ -202,15 +202,15 @@
    22.4              val dupTs = map snd (duplicates (op =) vTs) @
    22.5                map_filter (AList.lookup (op =) vTs) vs;
    22.6            in
    22.7 -            gen_subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    22.8 +            subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    22.9              forall (is_eqT o fastype_of) in_ts' andalso
   22.10 -            gen_subset (op =) (term_vs t, vs) andalso
   22.11 +            subset (op =) (term_vs t, vs) andalso
   22.12              forall is_eqT dupTs
   22.13            end)
   22.14              (if is_set then [Mode (([], []), [], [])]
   22.15               else modes_of modes t handle Option =>
   22.16                 error ("Bad predicate: " ^ Syntax.string_of_term_global thy t))
   22.17 -      | Sidecond t => if gen_subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   22.18 +      | Sidecond t => if subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   22.19            else NONE) ps);
   22.20  
   22.21  fun check_mode_clause thy arg_vs modes (iss, is) (ts, ps) =
   22.22 @@ -222,7 +222,7 @@
   22.23        | check_mode_prems vs ps = (case select_mode_prem thy modes' vs ps of
   22.24            NONE => NONE
   22.25          | SOME (x, _) => check_mode_prems
   22.26 -            (case x of Prem (us, _, _) => gen_union (op =) (vs, terms_vs us) | _ => vs)
   22.27 +            (case x of Prem (us, _, _) => union (op =) (vs, terms_vs us) | _ => vs)
   22.28              (filter_out (equal x) ps));
   22.29      val (in_ts, in_ts') = List.partition (is_constrt thy) (fst (get_args is 1 ts));
   22.30      val in_vs = terms_vs in_ts;
   22.31 @@ -230,9 +230,9 @@
   22.32    in
   22.33      forall is_eqT (map snd (duplicates (op =) (maps term_vTs in_ts))) andalso
   22.34      forall (is_eqT o fastype_of) in_ts' andalso
   22.35 -    (case check_mode_prems (gen_union (op =) (arg_vs, in_vs)) ps of
   22.36 +    (case check_mode_prems (union (op =) (arg_vs, in_vs)) ps of
   22.37         NONE => false
   22.38 -     | SOME vs => gen_subset (op =) (concl_vs, vs))
   22.39 +     | SOME vs => subset (op =) (concl_vs, vs))
   22.40    end;
   22.41  
   22.42  fun check_modes_pred thy arg_vs preds modes (p, ms) =
   22.43 @@ -482,7 +482,7 @@
   22.44  fun constrain cs [] = []
   22.45    | constrain cs ((s, xs) :: ys) = (s, case AList.lookup (op =) cs (s : string) of
   22.46        NONE => xs
   22.47 -    | SOME xs' => gen_inter (op =) (xs, xs')) :: constrain cs ys;
   22.48 +    | SOME xs' => inter (op =) (xs, xs')) :: constrain cs ys;
   22.49  
   22.50  fun mk_extra_defs thy defs gr dep names module ts =
   22.51    Library.foldl (fn (gr, name) =>
    23.1 --- a/src/HOL/Tools/inductive_set.ML	Tue Oct 20 16:13:01 2009 +0200
    23.2 +++ b/src/HOL/Tools/inductive_set.ML	Wed Oct 21 08:14:38 2009 +0200
    23.3 @@ -209,7 +209,7 @@
    23.4        (case optf of
    23.5           NONE => fs
    23.6         | SOME f => AList.update op = (u, the_default f
    23.7 -           (Option.map (curry (gen_inter (op =)) f) (AList.lookup op = fs u))) fs));
    23.8 +           (Option.map (curry (inter (op =)) f) (AList.lookup op = fs u))) fs));
    23.9  
   23.10  
   23.11  (**************************************************************)
    24.1 --- a/src/HOL/Tools/metis_tools.ML	Tue Oct 20 16:13:01 2009 +0200
    24.2 +++ b/src/HOL/Tools/metis_tools.ML	Wed Oct 21 08:14:38 2009 +0200
    24.3 @@ -631,7 +631,7 @@
    24.4          let val (mth, tfree_lits) = hol_thm_to_fol is_conjecture ctxt mode ith
    24.5          in
    24.6             {axioms = (mth, Meson.make_meta_clause ith) :: axioms,
    24.7 -            tfrees = gen_union (op =) (tfree_lits, tfrees)}
    24.8 +            tfrees = union (op =) (tfree_lits, tfrees)}
    24.9          end;
   24.10        val lmap0 = List.foldl (add_thm true)
   24.11                          {axioms = [], tfrees = init_tfrees ctxt} cls
    25.1 --- a/src/HOL/Tools/old_primrec.ML	Tue Oct 20 16:13:01 2009 +0200
    25.2 +++ b/src/HOL/Tools/old_primrec.ML	Wed Oct 21 08:14:38 2009 +0200
    25.3 @@ -226,7 +226,7 @@
    25.4        (case Symtab.lookup dt_info tname of
    25.5            NONE => primrec_err (quote tname ^ " is not a datatype")
    25.6          | SOME dt =>
    25.7 -            if gen_subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
    25.8 +            if subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
    25.9                (tname, dt)::(find_dts dt_info tnames' tnames)
   25.10              else find_dts dt_info tnames' tnames);
   25.11  
   25.12 @@ -265,7 +265,7 @@
   25.13      val defs' = map (make_def thy fs) defs;
   25.14      val nameTs1 = map snd fnameTs;
   25.15      val nameTs2 = map fst rec_eqns;
   25.16 -    val _ = if gen_eq_set (op =) (nameTs1, nameTs2) then ()
   25.17 +    val _ = if eq_set (op =) (nameTs1, nameTs2) then ()
   25.18              else primrec_err ("functions " ^ commas_quote (map fst nameTs2) ^
   25.19                "\nare not mutually recursive");
   25.20      val primrec_name =
    26.1 --- a/src/HOL/Tools/primrec.ML	Tue Oct 20 16:13:01 2009 +0200
    26.2 +++ b/src/HOL/Tools/primrec.ML	Wed Oct 21 08:14:38 2009 +0200
    26.3 @@ -208,7 +208,7 @@
    26.4        (case Symtab.lookup dt_info tname of
    26.5            NONE => primrec_error (quote tname ^ " is not a datatype")
    26.6          | SOME dt =>
    26.7 -            if gen_subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
    26.8 +            if subset (op =) (tnames', map (#1 o snd) (#descr dt)) then
    26.9                (tname, dt)::(find_dts dt_info tnames' tnames)
   26.10              else find_dts dt_info tnames' tnames);
   26.11  
   26.12 @@ -232,7 +232,7 @@
   26.13      val defs = map (make_def lthy fixes fs) raw_defs;
   26.14      val names = map snd fnames;
   26.15      val names_eqns = map fst eqns;
   26.16 -    val _ = if gen_eq_set (op =) (names, names_eqns) then ()
   26.17 +    val _ = if eq_set (op =) (names, names_eqns) then ()
   26.18        else primrec_error ("functions " ^ commas_quote names_eqns ^
   26.19          "\nare not mutually recursive");
   26.20      val rec_rewrites' = map mk_meta_eq rec_rewrites;
    27.1 --- a/src/HOL/Tools/prop_logic.ML	Tue Oct 20 16:13:01 2009 +0200
    27.2 +++ b/src/HOL/Tools/prop_logic.ML	Wed Oct 21 08:14:38 2009 +0200
    27.3 @@ -111,8 +111,8 @@
    27.4  	  | indices False            = []
    27.5  	  | indices (BoolVar i)      = [i]
    27.6  	  | indices (Not fm)         = indices fm
    27.7 -	  | indices (Or (fm1, fm2))  = gen_union (op =) (indices fm1, indices fm2)
    27.8 -	  | indices (And (fm1, fm2)) = gen_union (op =) (indices fm1, indices fm2);
    27.9 +	  | indices (Or (fm1, fm2))  = union (op =) (indices fm1, indices fm2)
   27.10 +	  | indices (And (fm1, fm2)) = union (op =) (indices fm1, indices fm2);
   27.11  
   27.12  (* ------------------------------------------------------------------------- *)
   27.13  (* maxidx: computes the maximal variable index occuring in a formula of      *)
    28.1 --- a/src/HOL/Tools/record.ML	Tue Oct 20 16:13:01 2009 +0200
    28.2 +++ b/src/HOL/Tools/record.ML	Wed Oct 21 08:14:38 2009 +0200
    28.3 @@ -1834,7 +1834,7 @@
    28.4      val extN = full bname;
    28.5      val types = map snd fields;
    28.6      val alphas_fields = fold Term.add_tfree_namesT types [];
    28.7 -    val alphas_ext = gen_inter (op =) (alphas, alphas_fields);
    28.8 +    val alphas_ext = inter (op =) (alphas, alphas_fields);
    28.9      val len = length fields;
   28.10      val variants =
   28.11        Name.variant_list (moreN :: rN :: (rN ^ "'") :: wN :: parent_variants)
    29.1 --- a/src/HOL/Tools/refute.ML	Tue Oct 20 16:13:01 2009 +0200
    29.2 +++ b/src/HOL/Tools/refute.ML	Wed Oct 21 08:14:38 2009 +0200
    29.3 @@ -1154,7 +1154,7 @@
    29.4        val axioms = collect_axioms thy u
    29.5        (* Term.typ list *)
    29.6        val types = Library.foldl (fn (acc, t') =>
    29.7 -        gen_union (op =) (acc, (ground_types thy t'))) ([], u :: axioms)
    29.8 +        union (op =) (acc, (ground_types thy t'))) ([], u :: axioms)
    29.9        val _     = tracing ("Ground types: "
   29.10          ^ (if null types then "none."
   29.11             else commas (map (Syntax.string_of_typ_global thy) types)))
   29.12 @@ -2415,7 +2415,7 @@
   29.13                        (#2 (the (AList.lookup (op =) descr idt_index)) ~~ (snd o dest_Type) IDT))
   29.14                    (* sanity check: typ_assoc must associate types to the   *)
   29.15                    (*               elements of 'dtyps' (and only to those) *)
   29.16 -                  val _ = if not (gen_eq_set (op =) (dtyps, map fst typ_assoc))
   29.17 +                  val _ = if not (eq_set (op =) (dtyps, map fst typ_assoc))
   29.18                      then
   29.19                        raise REFUTE ("IDT_recursion_interpreter",
   29.20                          "type association has extra/missing elements")
    30.1 --- a/src/HOL/Tools/res_atp.ML	Tue Oct 20 16:13:01 2009 +0200
    30.2 +++ b/src/HOL/Tools/res_atp.ML	Wed Oct 21 08:14:38 2009 +0200
    30.3 @@ -215,7 +215,7 @@
    30.4                  val ct = const_with_typ thy (dest_ConstFree rator)
    30.5              in
    30.6                forall is_Var args andalso uni_mem gctypes ct andalso
    30.7 -                gen_subset (op =) (Term.add_vars rhs [], Term.add_vars lhs [])
    30.8 +                subset (op =) (Term.add_vars rhs [], Term.add_vars lhs [])
    30.9              end
   30.10              handle ConstFree => false
   30.11      in    
    31.1 --- a/src/HOL/Tools/res_axioms.ML	Tue Oct 20 16:13:01 2009 +0200
    31.2 +++ b/src/HOL/Tools/res_axioms.ML	Wed Oct 21 08:14:38 2009 +0200
    31.3 @@ -476,7 +476,7 @@
    31.4        val remaining_hyps = filter_out (member (op aconv) (map Thm.term_of defs))
    31.5                                        (map Thm.term_of hyps)
    31.6        val fixed = OldTerm.term_frees (concl_of st) @
    31.7 -                  List.foldl (gen_union (op aconv)) [] (map OldTerm.term_frees remaining_hyps)
    31.8 +                  List.foldl (union (op aconv)) [] (map OldTerm.term_frees remaining_hyps)
    31.9    in Seq.of_list [LocalDefs.expand (filter (is_okdef fixed o Thm.term_of) defs) st] end;
   31.10  
   31.11  
    32.1 --- a/src/HOL/Tools/res_clause.ML	Tue Oct 20 16:13:01 2009 +0200
    32.2 +++ b/src/HOL/Tools/res_clause.ML	Wed Oct 21 08:14:38 2009 +0200
    32.3 @@ -93,7 +93,7 @@
    32.4  val tconst_prefix = "tc_";
    32.5  val class_prefix = "class_";
    32.6  
    32.7 -fun union_all xss = List.foldl (gen_union (op =)) [] xss;
    32.8 +fun union_all xss = List.foldl (union (op =)) [] xss;
    32.9  
   32.10  (*Provide readable names for the more common symbolic functions*)
   32.11  val const_trans_table =
   32.12 @@ -263,7 +263,7 @@
   32.13    | pred_of_sort (LTFree (s,ty)) = (s,1)
   32.14  
   32.15  (*Given a list of sorted type variables, return a list of type literals.*)
   32.16 -fun add_typs Ts = List.foldl (gen_union (op =)) [] (map sorts_on_typs Ts);
   32.17 +fun add_typs Ts = List.foldl (union (op =)) [] (map sorts_on_typs Ts);
   32.18  
   32.19  (*The correct treatment of TFrees like 'a in lemmas (axiom clauses) is not clear.
   32.20    * Ignoring them leads to unsound proofs, since we do nothing to ensure that 'a
   32.21 @@ -372,7 +372,7 @@
   32.22        let val cpairs = type_class_pairs thy tycons classes
   32.23            val newclasses = union_all (union_all (union_all (map (map #2 o #2) cpairs))) \\ classes \\ HOLogic.typeS
   32.24            val (classes', cpairs') = iter_type_class_pairs thy tycons newclasses
   32.25 -      in (gen_union (op =) (classes', classes), gen_union (op =) (cpairs', cpairs)) end;
   32.26 +      in (union (op =) (classes', classes), union (op =) (cpairs', cpairs)) end;
   32.27  
   32.28  fun make_arity_clauses_dfg dfg thy tycons classes =
   32.29    let val (classes', cpairs) = iter_type_class_pairs thy tycons classes
    33.1 --- a/src/HOL/Tools/res_hol_clause.ML	Tue Oct 20 16:13:01 2009 +0200
    33.2 +++ b/src/HOL/Tools/res_hol_clause.ML	Wed Oct 21 08:14:38 2009 +0200
    33.3 @@ -154,7 +154,7 @@
    33.4    | combterm_of dfg thy (P $ Q) =
    33.5        let val (P',tsP) = combterm_of dfg thy P
    33.6            val (Q',tsQ) = combterm_of dfg thy Q
    33.7 -      in  (CombApp(P',Q'), gen_union (op =) (tsP, tsQ))  end
    33.8 +      in  (CombApp(P',Q'), union (op =) (tsP, tsQ))  end
    33.9    | combterm_of _ _ (t as Abs _) = raise RC.CLAUSE ("HOL CLAUSE", t);
   33.10  
   33.11  fun predicate_of dfg thy ((Const("Not",_) $ P), polarity) = predicate_of dfg thy (P, not polarity)
   33.12 @@ -166,7 +166,7 @@
   33.13    | literals_of_term1 dfg thy (lits,ts) P =
   33.14        let val ((pred,ts'),pol) = predicate_of dfg thy (P,true)
   33.15        in
   33.16 -          (Literal(pol,pred)::lits, gen_union (op =) (ts, ts'))
   33.17 +          (Literal(pol,pred)::lits, union (op =) (ts, ts'))
   33.18        end;
   33.19  
   33.20  fun literals_of_term_dfg dfg thy P = literals_of_term1 dfg thy ([],[]) P;
   33.21 @@ -475,7 +475,7 @@
   33.22      val (cma, cnh) = count_constants clauses
   33.23      val params = (t_full, cma, cnh)
   33.24      val (tptp_clss,tfree_litss) = ListPair.unzip (map (clause2tptp params) conjectures)
   33.25 -    val tfree_clss = map RC.tptp_tfree_clause (List.foldl (gen_union (op =)) [] tfree_litss)
   33.26 +    val tfree_clss = map RC.tptp_tfree_clause (List.foldl (union (op =)) [] tfree_litss)
   33.27      val _ =
   33.28        File.write_list file (
   33.29          map (#1 o (clause2tptp params)) axclauses @
    34.1 --- a/src/HOL/Tools/res_reconstruct.ML	Tue Oct 20 16:13:01 2009 +0200
    34.2 +++ b/src/HOL/Tools/res_reconstruct.ML	Wed Oct 21 08:14:38 2009 +0200
    34.3 @@ -364,7 +364,7 @@
    34.4  fun replace_dep (old:int, new) dep = if dep=old then new else [dep];
    34.5  
    34.6  fun replace_deps (old:int, new) (lno, t, deps) =
    34.7 -      (lno, t, List.foldl (gen_union (op =)) [] (map (replace_dep (old, new)) deps));
    34.8 +      (lno, t, List.foldl (union (op =)) [] (map (replace_dep (old, new)) deps));
    34.9  
   34.10  (*Discard axioms; consolidate adjacent lines that prove the same clause, since they differ
   34.11    only in type information.*)
    35.1 --- a/src/HOL/Tools/sat_solver.ML	Tue Oct 20 16:13:01 2009 +0200
    35.2 +++ b/src/HOL/Tools/sat_solver.ML	Wed Oct 21 08:14:38 2009 +0200
    35.3 @@ -471,8 +471,8 @@
    35.4          | forced_vars False             = []
    35.5          | forced_vars (BoolVar i)       = [i]
    35.6          | forced_vars (Not (BoolVar i)) = [~i]
    35.7 -        | forced_vars (Or (fm1, fm2))   = gen_inter (op =) (forced_vars fm1, forced_vars fm2)
    35.8 -        | forced_vars (And (fm1, fm2))  = gen_union (op =) (forced_vars fm1, forced_vars fm2)
    35.9 +        | forced_vars (Or (fm1, fm2))   = inter (op =) (forced_vars fm1, forced_vars fm2)
   35.10 +        | forced_vars (And (fm1, fm2))  = union (op =) (forced_vars fm1, forced_vars fm2)
   35.11          (* Above, i *and* ~i may be forced.  In this case the first occurrence takes   *)
   35.12          (* precedence, and the next partial evaluation of the formula returns 'False'. *)
   35.13          | forced_vars _                 = error "formula is not in negation normal form"
    36.1 --- a/src/HOL/Tools/transfer.ML	Tue Oct 20 16:13:01 2009 +0200
    36.2 +++ b/src/HOL/Tools/transfer.ML	Wed Oct 21 08:14:38 2009 +0200
    36.3 @@ -143,7 +143,7 @@
    36.4   {inj = h inj0 inj1 inj2, emb = h emb0 emb1 emb2,
    36.5    ret = h ret0 ret1 ret2, cong = h cg0 cg1 cg2, guess = g1 andalso g2,
    36.6    hints = subtract (op = : string*string -> bool) hints0
    36.7 -            (gen_union (op =) (hints1, hints2))}
    36.8 +            (union (op =) (hints1, hints2))}
    36.9   end;
   36.10  
   36.11  local
   36.12 @@ -151,7 +151,7 @@
   36.13  in
   36.14  fun merge_entries ({inj = inj1, emb = emb1, ret = ret1, cong = cg1, guess = g1, hints = hints1},
   36.15                     {inj = inj2, emb = emb2, ret = ret2, cong = cg2, guess = g2, hints = hints2}) =
   36.16 -    {inj = h inj1 inj2, emb = h emb1 emb2, ret = h ret1 ret2, cong = h cg1 cg2, guess = g1 andalso g2, hints = gen_union (op =) (hints1, hints2)}
   36.17 +    {inj = h inj1 inj2, emb = h emb1 emb2, ret = h ret1 ret2, cong = h cg1 cg2, guess = g1 andalso g2, hints = union (op =) (hints1, hints2)}
   36.18  end;
   36.19  
   36.20  fun add ((inja,injd), (emba,embd), (reta,retd), (cga,cgd), g, (hintsa, hintsd)) =
    37.1 --- a/src/HOL/ex/predicate_compile.ML	Tue Oct 20 16:13:01 2009 +0200
    37.2 +++ b/src/HOL/ex/predicate_compile.ML	Wed Oct 21 08:14:38 2009 +0200
    37.3 @@ -908,20 +908,20 @@
    37.4              val dupTs = map snd (duplicates (op =) vTs) @
    37.5                map_filter (AList.lookup (op =) vTs) vs;
    37.6            in
    37.7 -            gen_subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    37.8 +            subset (op =) (terms_vs (in_ts @ in_ts'), vs) andalso
    37.9              forall (is_eqT o fastype_of) in_ts' andalso
   37.10 -            gen_subset (op =) (term_vs t, vs) andalso
   37.11 +            subset (op =) (term_vs t, vs) andalso
   37.12              forall is_eqT dupTs
   37.13            end)
   37.14              (modes_of_term modes t handle Option =>
   37.15                 error ("Bad predicate: " ^ Syntax.string_of_term_global thy t))
   37.16        | Negprem (us, t) => find_first (fn Mode (_, is, _) =>
   37.17              length us = length is andalso
   37.18 -            gen_subset (op =) (terms_vs us, vs) andalso
   37.19 -            gen_subset (op =) (term_vs t, vs)
   37.20 +            subset (op =) (terms_vs us, vs) andalso
   37.21 +            subset (op =) (term_vs t, vs)
   37.22              (modes_of_term modes t handle Option =>
   37.23                 error ("Bad predicate: " ^ Syntax.string_of_term_global thy t))
   37.24 -      | Sidecond t => if gen_subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   37.25 +      | Sidecond t => if subset (op =) (term_vs t, vs) then SOME (Mode (([], []), [], []))
   37.26            else NONE
   37.27        ) ps);
   37.28  
   37.29 @@ -964,22 +964,22 @@
   37.30              (if with_generator then
   37.31                (case select_mode_prem thy gen_modes' vs ps of
   37.32                    SOME (p, SOME mode) => check_mode_prems ((gen_prem p, mode) :: acc_ps) 
   37.33 -                  (case p of Prem (us, _) => gen_union (op =) (vs, terms_vs us) | _ => vs)
   37.34 +                  (case p of Prem (us, _) => union (op =) (vs, terms_vs us) | _ => vs)
   37.35                    (filter_out (equal p) ps)
   37.36                  | NONE =>
   37.37                    let 
   37.38                      val all_generator_vs = all_subsets (prem_vs \\ vs) |> sort (int_ord o (pairself length))
   37.39                    in
   37.40                      case (find_first (fn generator_vs => is_some
   37.41 -                      (select_mode_prem thy modes' (gen_union (op =) (vs, generator_vs)) ps)) all_generator_vs) of
   37.42 +                      (select_mode_prem thy modes' (union (op =) (vs, generator_vs)) ps)) all_generator_vs) of
   37.43                        SOME generator_vs => check_mode_prems ((map (generator vTs) generator_vs) @ acc_ps)
   37.44 -                        (gen_union (op =) (vs, generator_vs)) ps
   37.45 +                        (union (op =) (vs, generator_vs)) ps
   37.46                      | NONE => NONE
   37.47                    end)
   37.48              else
   37.49                NONE)
   37.50          | SOME (p, SOME mode) => check_mode_prems ((if with_generator then param_gen_prem param_vs p else p, mode) :: acc_ps) 
   37.51 -            (case p of Prem (us, _) => gen_union (op =) (vs, terms_vs us) | _ => vs)
   37.52 +            (case p of Prem (us, _) => union (op =) (vs, terms_vs us) | _ => vs)
   37.53              (filter_out (equal p) ps))
   37.54      val (in_ts, in_ts') = List.partition (is_constrt thy) (fst (split_smode is ts));
   37.55      val in_vs = terms_vs in_ts;
   37.56 @@ -987,13 +987,13 @@
   37.57    in
   37.58      if forall is_eqT (map snd (duplicates (op =) (maps term_vTs in_ts))) andalso
   37.59      forall (is_eqT o fastype_of) in_ts' then
   37.60 -      case check_mode_prems [] (gen_union (op =) (param_vs, in_vs)) ps of
   37.61 +      case check_mode_prems [] (union (op =) (param_vs, in_vs)) ps of
   37.62           NONE => NONE
   37.63         | SOME (acc_ps, vs) =>
   37.64           if with_generator then
   37.65             SOME (ts, (rev acc_ps) @ (map (generator vTs) (concl_vs \\ vs))) 
   37.66           else
   37.67 -           if gen_subset (op =) (concl_vs, vs) then SOME (ts, rev acc_ps) else NONE
   37.68 +           if subset (op =) (concl_vs, vs) then SOME (ts, rev acc_ps) else NONE
   37.69      else NONE
   37.70    end;
   37.71  
    38.1 --- a/src/HOLCF/Tools/Domain/domain_extender.ML	Tue Oct 20 16:13:01 2009 +0200
    38.2 +++ b/src/HOLCF/Tools/Domain/domain_extender.ML	Wed Oct 21 08:14:38 2009 +0200
    38.3 @@ -59,8 +59,8 @@
    38.4              fun analyse indirect (TFree(v,s))  =
    38.5                  (case AList.lookup (op =) tvars v of 
    38.6                     NONE => error ("Free type variable " ^ quote v ^ " on rhs.")
    38.7 -                 | SOME sort => if gen_eq_set (op =) (s, defaultS) orelse
    38.8 -                                   gen_eq_set (op =) (s, sort)
    38.9 +                 | SOME sort => if eq_set (op =) (s, defaultS) orelse
   38.10 +                                   eq_set (op =) (s, sort)
   38.11                                  then TFree(v,sort)
   38.12                                  else error ("Inconsistent sort constraint" ^
   38.13                                              " for type variable " ^ quote v))
    39.1 --- a/src/Provers/Arith/cancel_div_mod.ML	Tue Oct 20 16:13:01 2009 +0200
    39.2 +++ b/src/Provers/Arith/cancel_div_mod.ML	Wed Oct 21 08:14:38 2009 +0200
    39.3 @@ -74,7 +74,7 @@
    39.4  fun proc ss t =
    39.5    let val (divs,mods) = coll_div_mod t ([],[])
    39.6    in if null divs orelse null mods then NONE
    39.7 -     else case gen_inter (op =) (divs, mods) of
    39.8 +     else case inter (op =) (divs, mods) of
    39.9              pq :: _ => SOME (cancel ss t pq)
   39.10            | [] => NONE
   39.11    end
    40.1 --- a/src/Provers/Arith/fast_lin_arith.ML	Tue Oct 20 16:13:01 2009 +0200
    40.2 +++ b/src/Provers/Arith/fast_lin_arith.ML	Wed Oct 21 08:14:38 2009 +0200
    40.3 @@ -385,7 +385,7 @@
    40.4    let val (eqs, noneqs) = List.partition (fn (Lineq(_,ty,_,_)) => ty=Eq) nontriv in
    40.5    if not (null eqs) then
    40.6       let val c =
    40.7 -           fold (fn Lineq(_,_,l,_) => fn cs => gen_union (op =) (l, cs)) eqs []
    40.8 +           fold (fn Lineq(_,_,l,_) => fn cs => union (op =) (l, cs)) eqs []
    40.9             |> filter (fn i => i <> 0)
   40.10             |> sort (int_ord o pairself abs)
   40.11             |> hd
   40.12 @@ -429,8 +429,8 @@
   40.13  val warning_count = Unsynchronized.ref 0;
   40.14  val warning_count_max = 10;
   40.15  
   40.16 -val union_term = curry (gen_union Pattern.aeconv);
   40.17 -val union_bterm = curry (gen_union
   40.18 +val union_term = curry (union Pattern.aeconv);
   40.19 +val union_bterm = curry (union
   40.20    (fn ((b:bool, t), (b', t')) => b = b' andalso Pattern.aeconv (t, t')));
   40.21  
   40.22  fun add_atoms (lhs, _, _, rhs, _, _) =
    41.1 --- a/src/Pure/General/name_space.ML	Tue Oct 20 16:13:01 2009 +0200
    41.2 +++ b/src/Pure/General/name_space.ML	Wed Oct 21 08:14:38 2009 +0200
    41.3 @@ -145,7 +145,7 @@
    41.4        space
    41.5        |> add_name' name name
    41.6        |> fold (del_name name)
    41.7 -        (if fully then names else gen_inter (op =) (names, [Long_Name.base_name name]))
    41.8 +        (if fully then names else inter (op =) (names, [Long_Name.base_name name]))
    41.9        |> fold (del_name_extra name) (get_accesses space name)
   41.10      end;
   41.11  
    42.1 --- a/src/Pure/General/path.ML	Tue Oct 20 16:13:01 2009 +0200
    42.2 +++ b/src/Pure/General/path.ML	Wed Oct 21 08:14:38 2009 +0200
    42.3 @@ -42,7 +42,7 @@
    42.4    | check_elem (chs as ["~"]) = err_elem "Illegal" chs
    42.5    | check_elem (chs as ["~", "~"]) = err_elem "Illegal" chs
    42.6    | check_elem chs =
    42.7 -      (case gen_inter (op =) (["/", "\\", "$", ":"], chs) of
    42.8 +      (case inter (op =) (["/", "\\", "$", ":"], chs) of
    42.9          [] => chs
   42.10        | bads => err_elem ("Illegal character(s) " ^ commas_quote bads ^ " in") chs);
   42.11  
    43.1 --- a/src/Pure/Proof/extraction.ML	Tue Oct 20 16:13:01 2009 +0200
    43.2 +++ b/src/Pure/Proof/extraction.ML	Wed Oct 21 08:14:38 2009 +0200
    43.3 @@ -198,7 +198,7 @@
    43.4      {realizes_eqns = merge_rules realizes_eqns1 realizes_eqns2,
    43.5       typeof_eqns = merge_rules typeof_eqns1 typeof_eqns2,
    43.6       types = AList.merge (op =) (K true) (types1, types2),
    43.7 -     realizers = Symtab.merge_list (gen_eq_set (op =) o pairself #1) (realizers1, realizers2),
    43.8 +     realizers = Symtab.merge_list (eq_set (op =) o pairself #1) (realizers1, realizers2),
    43.9       defs = Library.merge Thm.eq_thm (defs1, defs2),
   43.10       expand = Library.merge (op =) (expand1, expand2),
   43.11       prep = (case prep1 of NONE => prep2 | _ => prep1)};
   43.12 @@ -468,7 +468,7 @@
   43.13  
   43.14        in List.foldr add_args ([], []) (Library.take (n, vars) ~~ Library.take (n, ts)) end;
   43.15  
   43.16 -    fun find (vs: string list) = Option.map snd o find_first (curry (gen_eq_set (op =)) vs o fst);
   43.17 +    fun find (vs: string list) = Option.map snd o find_first (curry (eq_set (op =)) vs o fst);
   43.18      fun find' (s: string) = map_filter (fn (s', x) => if s = s' then SOME x else NONE);
   43.19  
   43.20      fun app_rlz_rews Ts vs t = strip_abs (length Ts) (freeze_thaw
    44.1 --- a/src/Pure/Proof/reconstruct.ML	Tue Oct 20 16:13:01 2009 +0200
    44.2 +++ b/src/Pure/Proof/reconstruct.ML	Wed Oct 21 08:14:38 2009 +0200
    44.3 @@ -289,7 +289,7 @@
    44.4      val _ = message "Collecting constraints...";
    44.5      val (t, prf, cs, env, _) = make_constraints_cprf thy
    44.6        (Envir.empty (maxidx_proof cprf ~1)) cprf';
    44.7 -    val cs' = map (fn p => (true, p, gen_union (op =) 
    44.8 +    val cs' = map (fn p => (true, p, union (op =) 
    44.9          (pairself (map (fst o dest_Var) o OldTerm.term_vars) p)))
   44.10        (map (pairself (Envir.norm_term env)) ((t, prop')::cs));
   44.11      val _ = message ("Solving remaining constraints (" ^ string_of_int (length cs') ^ ") ...");
    45.1 --- a/src/Pure/ProofGeneral/pgip_parser.ML	Tue Oct 20 16:13:01 2009 +0200
    45.2 +++ b/src/Pure/ProofGeneral/pgip_parser.ML	Wed Oct 21 08:14:38 2009 +0200
    45.3 @@ -77,7 +77,7 @@
    45.4    |> command K.prf_asm_goal     goal
    45.5    |> command K.prf_script       proofstep;
    45.6  
    45.7 -val _ = gen_subset (op =) (OuterKeyword.kinds, Symtab.keys command_keywords)
    45.8 +val _ = subset (op =) (OuterKeyword.kinds, Symtab.keys command_keywords)
    45.9    orelse sys_error "Incomplete coverage of command keywords";
   45.10  
   45.11  fun parse_command "sorry" text = [D.Postponegoal {text = text}, D.Closeblock {}]
    46.1 --- a/src/Pure/Syntax/ast.ML	Tue Oct 20 16:13:01 2009 +0200
    46.2 +++ b/src/Pure/Syntax/ast.ML	Wed Oct 21 08:14:38 2009 +0200
    46.3 @@ -104,7 +104,7 @@
    46.4      val rvars = add_vars rhs [];
    46.5    in
    46.6      if has_duplicates (op =) lvars then SOME "duplicate vars in lhs"
    46.7 -    else if not (gen_subset (op =) (rvars, lvars)) then SOME "rhs contains extra variables"
    46.8 +    else if not (subset (op =) (rvars, lvars)) then SOME "rhs contains extra variables"
    46.9      else NONE
   46.10    end;
   46.11  
    47.1 --- a/src/Pure/Syntax/parser.ML	Tue Oct 20 16:13:01 2009 +0200
    47.2 +++ b/src/Pure/Syntax/parser.ML	Wed Oct 21 08:14:38 2009 +0200
    47.3 @@ -101,7 +101,7 @@
    47.4  
    47.5              val tos = connected_with chains' [lhs] [lhs];
    47.6          in (copy_lookahead tos [],
    47.7 -            gen_union (op =) (if member (op =) lambdas lhs then tos else [], lambdas))
    47.8 +            union (op =) (if member (op =) lambdas lhs then tos else [], lambdas))
    47.9          end;
   47.10  
   47.11        (*test if new production can produce lambda
   47.12 @@ -109,7 +109,7 @@
   47.13        val (new_lambda, lambdas') =
   47.14          if forall (fn (Nonterminal (id, _)) => member (op =) lambdas' id
   47.15                      | (Terminal _) => false) rhs then
   47.16 -          (true, gen_union (op =) (lambdas', connected_with chains' [lhs] [lhs]))
   47.17 +          (true, union (op =) (lambdas', connected_with chains' [lhs] [lhs]))
   47.18          else
   47.19            (false, lambdas');
   47.20  
   47.21 @@ -125,7 +125,7 @@
   47.22        (*get all known starting tokens for a nonterminal*)
   47.23        fun starts_for_nt nt = snd (fst (Array.sub (prods, nt)));
   47.24  
   47.25 -      val token_union = gen_union matching_tokens;
   47.26 +      val token_union = union matching_tokens;
   47.27  
   47.28        (*update prods, lookaheads, and lambdas according to new lambda NTs*)
   47.29        val (added_starts', lambdas') =
   47.30 @@ -147,7 +147,7 @@
   47.31                      in
   47.32                        if member (op =) nts l then       (*update production's lookahead*)
   47.33                        let
   47.34 -                        val new_lambda = is_none tk andalso gen_subset (op =) (nts, lambdas);
   47.35 +                        val new_lambda = is_none tk andalso subset (op =) (nts, lambdas);
   47.36  
   47.37                          val new_tks = subtract (op =) l_starts
   47.38                            ((if is_some tk then [the tk] else []) @
   47.39 @@ -155,7 +155,7 @@
   47.40  
   47.41                          val added_tks' = token_union (new_tks, added_tks);
   47.42  
   47.43 -                        val nt_dependencies' = gen_union (op =) (nts, nt_dependencies);
   47.44 +                        val nt_dependencies' = union (op =) (nts, nt_dependencies);
   47.45  
   47.46                          (*associate production with new starting tokens*)
   47.47                          fun copy ([]: token option list) nt_prods = nt_prods
   47.48 @@ -413,7 +413,7 @@
   47.49          fun prod_of_chain from = ([Nonterminal (from, ~1)], "", ~1);
   47.50  
   47.51          val nt_prods =
   47.52 -          Library.foldl (gen_union op =) ([], map snd (snd (Array.sub (prods, tag)))) @
   47.53 +          Library.foldl (union op =) ([], map snd (snd (Array.sub (prods, tag)))) @
   47.54            map prod_of_chain ((these o AList.lookup (op =) chains) tag);
   47.55        in map (pretty_prod name) nt_prods end;
   47.56  
   47.57 @@ -562,7 +562,7 @@
   47.58      fun process_nt ~1 result = result
   47.59        | process_nt nt result =
   47.60          let
   47.61 -          val nt_prods = Library.foldl (gen_union op =)
   47.62 +          val nt_prods = Library.foldl (union op =)
   47.63                               ([], map snd (snd (Array.sub (prods2, nt))));
   47.64            val lhs_tag = convert_tag nt;
   47.65  
    48.1 --- a/src/Pure/Syntax/syn_ext.ML	Tue Oct 20 16:13:01 2009 +0200
    48.2 +++ b/src/Pure/Syntax/syn_ext.ML	Wed Oct 21 08:14:38 2009 +0200
    48.3 @@ -352,7 +352,7 @@
    48.4    in
    48.5      SynExt {
    48.6        xprods = xprods,
    48.7 -      consts = gen_union (op =) (consts, mfix_consts),
    48.8 +      consts = union (op =) (consts, mfix_consts),
    48.9        prmodes = distinct (op =) (map (fn (m, _, _) => m) tokentrfuns),
   48.10        parse_ast_translation = parse_ast_translation,
   48.11        parse_rules = parse_rules' @ parse_rules,
    49.1 --- a/src/Pure/Tools/find_theorems.ML	Tue Oct 20 16:13:01 2009 +0200
    49.2 +++ b/src/Pure/Tools/find_theorems.ML	Wed Oct 21 08:14:38 2009 +0200
    49.3 @@ -227,7 +227,7 @@
    49.4  
    49.5      fun check (t, NONE) = check (t, SOME (get_thm_names t))
    49.6        | check ((_, thm), c as SOME thm_consts) =
    49.7 -         (if gen_subset (op =) (pat_consts, thm_consts) andalso
    49.8 +         (if subset (op =) (pat_consts, thm_consts) andalso
    49.9              Pattern.matches_subterm (ProofContext.theory_of ctxt) (pat, Thm.full_prop_of thm)
   49.10            then SOME (0, 0) else NONE, c);
   49.11    in check end;
    50.1 --- a/src/Pure/codegen.ML	Tue Oct 20 16:13:01 2009 +0200
    50.2 +++ b/src/Pure/codegen.ML	Wed Oct 21 08:14:38 2009 +0200
    50.3 @@ -599,7 +599,7 @@
    50.4       else Pretty.block (separate (Pretty.brk 1) (p :: ps));
    50.5  
    50.6  fun new_names t xs = Name.variant_list
    50.7 -  (gen_union (op =) (map (fst o fst o dest_Var) (OldTerm.term_vars t),
    50.8 +  (union (op =) (map (fst o fst o dest_Var) (OldTerm.term_vars t),
    50.9      OldTerm.add_term_names (t, ML_Syntax.reserved_names))) (map mk_id xs);
   50.10  
   50.11  fun new_name t x = hd (new_names t [x]);
    51.1 --- a/src/Pure/library.ML	Tue Oct 20 16:13:01 2009 +0200
    51.2 +++ b/src/Pure/library.ML	Wed Oct 21 08:14:38 2009 +0200
    51.3 @@ -162,10 +162,10 @@
    51.4    val mem: ''a * ''a list -> bool
    51.5    val mem_int: int * int list -> bool
    51.6    val mem_string: string * string list -> bool
    51.7 -  val gen_union: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list
    51.8 -  val gen_inter: ('a * 'b -> bool) -> 'a list * 'b list -> 'a list
    51.9 -  val gen_subset: ('a * 'b -> bool) -> 'a list * 'b list -> bool
   51.10 -  val gen_eq_set: ('a * 'b -> bool) -> 'a list * 'b list -> bool
   51.11 +  val union: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list
   51.12 +  val inter: ('a * 'b -> bool) -> 'a list * 'b list -> 'a list
   51.13 +  val subset: ('a * 'b -> bool) -> 'a list * 'b list -> bool
   51.14 +  val eq_set: ('a * 'b -> bool) -> 'a list * 'b list -> bool
   51.15    val \ : ''a list * ''a -> ''a list
   51.16    val \\ : ''a list * ''a list -> ''a list
   51.17    val distinct: ('a * 'a -> bool) -> 'a list -> 'a list
   51.18 @@ -799,23 +799,23 @@
   51.19  fun (x: string) mem_string xs = member (op =) xs x;
   51.20  
   51.21  (*union of sets represented as lists: no repetitions*)
   51.22 -fun gen_union eq (xs, []) = xs
   51.23 -  | gen_union eq ([], ys) = ys
   51.24 -  | gen_union eq (x :: xs, ys) = gen_union eq (xs, insert eq x ys);
   51.25 +fun union eq (xs, []) = xs
   51.26 +  | union eq ([], ys) = ys
   51.27 +  | union eq (x :: xs, ys) = union eq (xs, insert eq x ys);
   51.28  
   51.29  (*intersection*)
   51.30 -fun gen_inter eq ([], ys) = []
   51.31 -  | gen_inter eq (x::xs, ys) =
   51.32 -      if member eq ys x then x :: gen_inter eq (xs, ys)
   51.33 -      else gen_inter eq (xs, ys);
   51.34 +fun inter eq ([], ys) = []
   51.35 +  | inter eq (x::xs, ys) =
   51.36 +      if member eq ys x then x :: inter eq (xs, ys)
   51.37 +      else inter eq (xs, ys);
   51.38  
   51.39  (*subset*)
   51.40 -fun gen_subset eq (xs, ys) = forall (member eq ys) xs;
   51.41 +fun subset eq (xs, ys) = forall (member eq ys) xs;
   51.42  
   51.43  (*set equality*)
   51.44 -fun gen_eq_set eq (xs, ys) =
   51.45 +fun eq_set eq (xs, ys) =
   51.46    eq_list eq (xs, ys) orelse
   51.47 -    (gen_subset eq (xs, ys) andalso gen_subset (eq o swap) (ys, xs));
   51.48 +    (subset eq (xs, ys) andalso subset (eq o swap) (ys, xs));
   51.49  
   51.50  
   51.51  (*removing an element from a list WITHOUT duplicates*)
    52.1 --- a/src/Pure/meta_simplifier.ML	Tue Oct 20 16:13:01 2009 +0200
    52.2 +++ b/src/Pure/meta_simplifier.ML	Wed Oct 21 08:14:38 2009 +0200
    52.3 @@ -398,7 +398,7 @@
    52.4    | vperm (t, u) = (t = u);
    52.5  
    52.6  fun var_perm (t, u) =
    52.7 -  vperm (t, u) andalso gen_eq_set (op =) (Term.add_vars t [], Term.add_vars u []);
    52.8 +  vperm (t, u) andalso eq_set (op =) (Term.add_vars t [], Term.add_vars u []);
    52.9  
   52.10  (*simple test for looping rewrite rules and stupid orientations*)
   52.11  fun default_reorient thy prems lhs rhs =
   52.12 @@ -864,7 +864,7 @@
   52.13    while the premises are solved.*)
   52.14  
   52.15  fun cond_skel (args as (_, (lhs, rhs))) =
   52.16 -  if gen_subset (op =) (Term.add_vars rhs [], Term.add_vars lhs []) then uncond_skel args
   52.17 +  if subset (op =) (Term.add_vars rhs [], Term.add_vars lhs []) then uncond_skel args
   52.18    else skel0;
   52.19  
   52.20  (*
    53.1 --- a/src/Pure/pattern.ML	Tue Oct 20 16:13:01 2009 +0200
    53.2 +++ b/src/Pure/pattern.ML	Wed Oct 21 08:14:38 2009 +0200
    53.3 @@ -216,10 +216,10 @@
    53.4  
    53.5  fun flexflex2(env,binders,F,Fty,is,G,Gty,js) =
    53.6    let fun ff(F,Fty,is,G as (a,_),Gty,js) =
    53.7 -            if gen_subset (op =) (js, is)
    53.8 +            if subset (op =) (js, is)
    53.9              then let val t= mkabs(binders,is,app(Var(G,Gty),map (idx is) js))
   53.10                   in Envir.update (((F, Fty), t), env) end
   53.11 -            else let val ks = gen_inter (op =) (is, js)
   53.12 +            else let val ks = inter (op =) (is, js)
   53.13                       val Hty = type_of_G env (Fty,length is,map (idx is) ks)
   53.14                       val (env',H) = Envir.genvar a (env,Hty)
   53.15                       fun lam(is) = mkabs(binders,is,app(H,map (idx is) ks));
   53.16 @@ -339,7 +339,7 @@
   53.17    let val js = loose_bnos t
   53.18    in if null is
   53.19       then if null js then Vartab.update_new (ixn, (T, t)) itms else raise MATCH
   53.20 -     else if gen_subset (op =) (js, is)
   53.21 +     else if subset (op =) (js, is)
   53.22            then let val t' = if downto0(is,length binders - 1) then t
   53.23                              else mapbnd (idx is) t
   53.24                 in Vartab.update_new (ixn, (T, mkabs (binders, is, t'))) itms end
    54.1 --- a/src/Pure/proofterm.ML	Tue Oct 20 16:13:01 2009 +0200
    54.2 +++ b/src/Pure/proofterm.ML	Wed Oct 21 08:14:38 2009 +0200
    54.3 @@ -900,7 +900,7 @@
    54.4  
    54.5  fun add_funvars Ts (vs, t) =
    54.6    if is_fun (fastype_of1 (Ts, t)) then
    54.7 -    gen_union (op =) (vs, map_filter (fn Var (ixn, T) =>
    54.8 +    union (op =) (vs, map_filter (fn Var (ixn, T) =>
    54.9        if is_fun T then SOME ixn else NONE | _ => NONE) (vars_of t))
   54.10    else vs;
   54.11  
   54.12 @@ -918,7 +918,7 @@
   54.13    | (Abs (_, T, u), ts) => Library.foldl (add_npvars' (T::Ts)) (vs, u :: ts)
   54.14    | (_, ts) => Library.foldl (add_npvars' Ts) (vs, ts));
   54.15  
   54.16 -fun prop_vars (Const ("==>", _) $ P $ Q) = gen_union (op =) (prop_vars P, prop_vars Q)
   54.17 +fun prop_vars (Const ("==>", _) $ P $ Q) = union (op =) (prop_vars P, prop_vars Q)
   54.18    | prop_vars (Const ("all", _) $ Abs (_, _, t)) = prop_vars t
   54.19    | prop_vars t = (case strip_comb t of
   54.20        (Var (ixn, _), _) => [ixn] | _ => []);
   54.21 @@ -936,7 +936,7 @@
   54.22    end;
   54.23  
   54.24  fun needed_vars prop =
   54.25 -  gen_union (op =) (Library.foldl (gen_union (op =))
   54.26 +  union (op =) (Library.foldl (union (op =))
   54.27      ([], map (uncurry (insert (op =))) (add_npvars true true [] ([], prop))),
   54.28    prop_vars prop);
   54.29  
   54.30 @@ -975,7 +975,7 @@
   54.31            let
   54.32              val p as (_, is', ch', prf') = shrink ls lev prf2;
   54.33              val (is, ch, ts', prf'') = shrink' ls lev ts (p::prfs) prf1
   54.34 -          in (gen_union (op =) (is, is'), ch orelse ch', ts',
   54.35 +          in (union (op =) (is, is'), ch orelse ch', ts',
   54.36                if ch orelse ch' then prf'' %% prf' else prf)
   54.37            end
   54.38        | shrink' ls lev ts prfs (prf as prf1 % t) =
   54.39 @@ -1004,15 +1004,15 @@
   54.40              val insts = Library.take (length ts', map (fst o dest_Var) vs) ~~ ts';
   54.41              val nvs = Library.foldl (fn (ixns', (ixn, ixns)) =>
   54.42                insert (op =) ixn (case AList.lookup (op =) insts ixn of
   54.43 -                  SOME (SOME t) => if is_proj t then gen_union (op =) (ixns, ixns') else ixns'
   54.44 -                | _ => gen_union (op =) (ixns, ixns')))
   54.45 +                  SOME (SOME t) => if is_proj t then union (op =) (ixns, ixns') else ixns'
   54.46 +                | _ => union (op =) (ixns, ixns')))
   54.47                    (needed prop ts'' prfs, add_npvars false true [] ([], prop));
   54.48              val insts' = map
   54.49                (fn (ixn, x as SOME _) => if member (op =) nvs ixn then (false, x) else (true, NONE)
   54.50                  | (_, x) => (false, x)) insts
   54.51            in ([], false, insts' @ map (pair false) ts'', prf) end
   54.52      and needed (Const ("==>", _) $ t $ u) ts ((b, _, _, _)::prfs) =
   54.53 -          gen_union (op =) (if b then map (fst o dest_Var) (vars_of t) else [], needed u ts prfs)
   54.54 +          union (op =) (if b then map (fst o dest_Var) (vars_of t) else [], needed u ts prfs)
   54.55        | needed (Var (ixn, _)) (_::_) _ = [ixn]
   54.56        | needed _ _ _ = [];
   54.57    in shrink end;
    55.1 --- a/src/Pure/thm.ML	Tue Oct 20 16:13:01 2009 +0200
    55.2 +++ b/src/Pure/thm.ML	Wed Oct 21 08:14:38 2009 +0200
    55.3 @@ -1463,7 +1463,7 @@
    55.4      (case duplicates (op =) cs of
    55.5        a :: _ => (warning ("Can't rename.  Bound variables not distinct: " ^ a); state)
    55.6      | [] =>
    55.7 -      (case gen_inter (op =) (cs, freenames) of
    55.8 +      (case inter (op =) (cs, freenames) of
    55.9          a :: _ => (warning ("Can't rename.  Bound/Free variable clash: " ^ a); state)
   55.10        | [] =>
   55.11          Thm (der,
    56.1 --- a/src/Pure/variable.ML	Tue Oct 20 16:13:01 2009 +0200
    56.2 +++ b/src/Pure/variable.ML	Wed Oct 21 08:14:38 2009 +0200
    56.3 @@ -301,7 +301,7 @@
    56.4      val names = names_of ctxt;
    56.5      val (xs', names') =
    56.6        if is_body ctxt then Name.variants xs names |>> map Name.skolem
    56.7 -      else (no_dups (gen_inter (op =) (xs, ys)); no_dups (gen_inter (op =) (xs, zs));
    56.8 +      else (no_dups (inter (op =) (xs, ys)); no_dups (inter (op =) (xs, zs));
    56.9          (xs, fold Name.declare xs names));
   56.10    in ctxt |> new_fixes names' xs xs' end;
   56.11  
    57.1 --- a/src/Sequents/prover.ML	Tue Oct 20 16:13:01 2009 +0200
    57.2 +++ b/src/Sequents/prover.ML	Wed Oct 21 08:14:38 2009 +0200
    57.3 @@ -31,14 +31,14 @@
    57.4         dups);
    57.5  
    57.6  fun (Pack(safes,unsafes)) add_safes ths   = 
    57.7 -    let val dups = warn_duplicates (gen_inter Thm.eq_thm_prop (ths,safes))
    57.8 +    let val dups = warn_duplicates (inter Thm.eq_thm_prop (ths,safes))
    57.9          val ths' = subtract Thm.eq_thm_prop dups ths
   57.10      in
   57.11          Pack(sort (make_ord less) (ths'@safes), unsafes)
   57.12      end;
   57.13  
   57.14  fun (Pack(safes,unsafes)) add_unsafes ths = 
   57.15 -    let val dups = warn_duplicates (gen_inter Thm.eq_thm_prop (ths,unsafes))
   57.16 +    let val dups = warn_duplicates (inter Thm.eq_thm_prop (ths,unsafes))
   57.17          val ths' = subtract Thm.eq_thm_prop dups ths
   57.18      in
   57.19          Pack(safes, sort (make_ord less) (ths'@unsafes))
    58.1 --- a/src/Tools/Code/code_ml.ML	Tue Oct 20 16:13:01 2009 +0200
    58.2 +++ b/src/Tools/Code/code_ml.ML	Wed Oct 21 08:14:38 2009 +0200
    58.3 @@ -1028,7 +1028,7 @@
    58.4      val tyco = Sign.intern_type thy raw_tyco;
    58.5      val constrs = map (Code.check_const thy) raw_constrs;
    58.6      val constrs' = (map fst o snd o Code.get_datatype thy) tyco;
    58.7 -    val _ = if gen_eq_set (op =) (constrs, constrs') then ()
    58.8 +    val _ = if eq_set (op =) (constrs, constrs') then ()
    58.9        else error ("Type " ^ quote tyco ^ ": given constructors diverge from real constructors")
   58.10      val is_first = is_first_occ background;
   58.11      val background' = register_datatype tyco constrs background;
    59.1 --- a/src/Tools/IsaPlanner/rw_inst.ML	Tue Oct 20 16:13:01 2009 +0200
    59.2 +++ b/src/Tools/IsaPlanner/rw_inst.ML	Wed Oct 21 08:14:38 2009 +0200
    59.3 @@ -139,13 +139,13 @@
    59.4        val names = List.foldr OldTerm.add_term_names [] (tgt :: rule_conds);
    59.5        val (conds_tyvs,cond_vs) = 
    59.6            Library.foldl (fn ((tyvs, vs), t) => 
    59.7 -                    (gen_union (op =)
    59.8 +                    (union (op =)
    59.9                         (OldTerm.term_tvars t, tyvs),
   59.10 -                     gen_union (op =)
   59.11 +                     union (op =)
   59.12                         (map Term.dest_Var (OldTerm.term_vars t), vs))) 
   59.13                  (([],[]), rule_conds);
   59.14        val termvars = map Term.dest_Var (OldTerm.term_vars tgt); 
   59.15 -      val vars_to_fix = gen_union (op =) (termvars, cond_vs);
   59.16 +      val vars_to_fix = union (op =) (termvars, cond_vs);
   59.17        val (renamings, names2) = 
   59.18            List.foldr (fn (((n,i),ty), (vs, names')) => 
   59.19                      let val n' = Name.variant names' n in
    60.1 --- a/src/Tools/intuitionistic.ML	Tue Oct 20 16:13:01 2009 +0200
    60.2 +++ b/src/Tools/intuitionistic.ML	Wed Oct 21 08:14:38 2009 +0200
    60.3 @@ -50,7 +50,7 @@
    60.4      if member (fn ((ps1, c1), (ps2, c2)) =>
    60.5          c1 aconv c2 andalso
    60.6          length ps1 = length ps2 andalso
    60.7 -        gen_eq_set (op aconv) (ps1, ps2)) gs (ps, c) then no_tac
    60.8 +        eq_set (op aconv) (ps1, ps2)) gs (ps, c) then no_tac
    60.9      else (step_tac ctxt THEN_ALL_NEW intprover_tac ctxt ((ps, c) :: gs) (d + 1) lim) i
   60.10    end);
   60.11  
    61.1 --- a/src/ZF/Tools/primrec_package.ML	Tue Oct 20 16:13:01 2009 +0200
    61.2 +++ b/src/ZF/Tools/primrec_package.ML	Wed Oct 21 08:14:38 2009 +0200
    61.3 @@ -65,7 +65,7 @@
    61.4    in
    61.5      if has_duplicates (op =) lfrees then
    61.6        raise RecError "repeated variable name in pattern"
    61.7 -    else if not (gen_subset (op =) (Term.add_frees rhs [], lfrees)) then
    61.8 +    else if not (subset (op =) (Term.add_frees rhs [], lfrees)) then
    61.9        raise RecError "extra variables on rhs"
   61.10      else if length middle > 1 then
   61.11        raise RecError "more than one non-variable in pattern"