(* $Id: terms.ml 9836 2009-06-05 15:33:35Z denes $ *)
+let rec lexicograph f l1 l2 =
+ match l1, l2 with
+ | [], [] -> 0
+ | x::xs, y::ys ->
+ let c = f x y in
+ if c <> 0 then c else lexicograph f xs ys
+ | [],_ -> ~-1
+ | _,[] -> 1
+;;
module Utils (B : Terms.Blob) = struct
module Subst = FoSubst.Subst(B) ;;
| _ -> false
;;
- let rec lexicograph f l1 l2 =
- match l1, l2 with
- | [], [] -> 0
- | x::xs, y::ys ->
- let c = f x y in
- if c <> 0 then c else lexicograph f xs ys
- | [],_ -> ~-1
- | _,[] -> 1
- ;;
let rec compare_foterm x y =
match x, y with
in
let lit =
match ty with
- | Terms.Node [ Terms.Leaf eq ; ty; l; r ] when B.is_eq_predicate eq ->
+ | Terms.Node [ Terms.Leaf eq ; ty; l; r ] when B.eq B.eqP eq ->
let o = Order.compare_terms l r in
Terms.Equation (l, r, ty, o)
| t -> Terms.Predicate t
fresh_unit_clause maxvar (mk_id (), lit, varlist, proof)
;;
+ let add_to_bag bag (_,lit,vl,proof) =
+ let id = mk_id () in
+ let clause = (id, lit, vl, proof) in
+ let bag = Terms.M.add id clause bag in
+ bag, clause
+ ;;
+
+ let empty_bag = Terms.M.empty ;;
+
end