# HG changeset patch # User wenzelm # Date 1294504205 -3600 # Node ID 3717fc42ebe913f38f553de3362fb24b136e17ec # Parent f6ab14e61604515cc3402c0e07e59f138f6357ad Ord_List.merge convenience; diff -r f6ab14e61604 -r 3717fc42ebe9 src/HOL/Boogie/Tools/boogie_vcs.ML --- a/src/HOL/Boogie/Tools/boogie_vcs.ML Sat Jan 08 17:14:48 2011 +0100 +++ b/src/HOL/Boogie/Tools/boogie_vcs.ML Sat Jan 08 17:30:05 2011 +0100 @@ -278,7 +278,7 @@ type T = (serial * (term -> bool)) Ord_List.T val empty = [] val extend = I - fun merge (fs1, fs2) = fold (Ord_List.insert serial_ord) fs2 fs1 + fun merge data = Ord_List.merge serial_ord data ) fun add_assertion_filter f = diff -r f6ab14e61604 -r 3717fc42ebe9 src/HOL/Tools/SMT/smt_builtin.ML --- a/src/HOL/Tools/SMT/smt_builtin.ML Sat Jan 08 17:14:48 2011 +0100 +++ b/src/HOL/Tools/SMT/smt_builtin.ML Sat Jan 08 17:30:05 2011 +0100 @@ -70,7 +70,7 @@ (Ord_List.insert typ_ord (perhaps (try Logic.varifyT_global) T, f)) fun merge_ttab ttabp = - SMT_Utils.dict_merge (uncurry (Ord_List.union typ_ord) o swap) ttabp + SMT_Utils.dict_merge (Ord_List.merge typ_ord) ttabp fun lookup_ttab ctxt ttab T = let fun match (U, _) = Sign.typ_instance (ProofContext.theory_of ctxt) (T, U) diff -r f6ab14e61604 -r 3717fc42ebe9 src/HOL/Tools/SMT/smtlib_interface.ML --- a/src/HOL/Tools/SMT/smtlib_interface.ML Sat Jan 08 17:14:48 2011 +0100 +++ b/src/HOL/Tools/SMT/smtlib_interface.ML Sat Jan 08 17:30:05 2011 +0100 @@ -81,7 +81,7 @@ type T = (int * (term list -> string option)) list val empty = [] val extend = I - fun merge (bs1, bs2) = Ord_List.union fst_int_ord bs2 bs1 + fun merge data = Ord_List.merge fst_int_ord data ) fun add_logic pf = Logics.map (Ord_List.insert fst_int_ord pf) diff -r f6ab14e61604 -r 3717fc42ebe9 src/HOL/Tools/SMT/z3_interface.ML --- a/src/HOL/Tools/SMT/z3_interface.ML Sat Jan 08 17:14:48 2011 +0100 +++ b/src/HOL/Tools/SMT/z3_interface.ML Sat Jan 08 17:30:05 2011 +0100 @@ -119,7 +119,7 @@ type T = (int * mk_builtins) list val empty = [] val extend = I - fun merge (bs1, bs2) = Ord_List.union fst_int_ord bs2 bs1 + fun merge data = Ord_List.merge fst_int_ord data ) fun add_mk_builtins mk = diff -r f6ab14e61604 -r 3717fc42ebe9 src/Pure/General/ord_list.ML --- a/src/Pure/General/ord_list.ML Sat Jan 08 17:14:48 2011 +0100 +++ b/src/Pure/General/ord_list.ML Sat Jan 08 17:30:05 2011 +0100 @@ -14,6 +14,7 @@ val remove: ('b * 'a -> order) -> 'b -> 'a T -> 'a T val subset: ('b * 'a -> order) -> 'b T * 'a T -> bool val union: ('a * 'a -> order) -> 'a T -> 'a T -> 'a T + val merge: ('a * 'a -> order) -> 'a T * 'a T -> 'a T val inter: ('b * 'a -> order) -> 'b T -> 'a T -> 'a T val subtract: ('b * 'a -> order) -> 'b T -> 'a T -> 'a T end; @@ -85,6 +86,8 @@ | GREATER => y :: unio lst1 ys); in if pointer_eq (list1, list2) then list1 else handle_same (unio list1) list2 end; +fun merge ord (list1, list2) = union ord list2 list1; + (*intersection: filter second list for elements present in first list*) fun inter ord list1 list2 = let