X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2FfoUtils.ml;h=a970bb6f0c51ee67870e6577b9797daf45b1abca;hb=07fb52e761b192a97c6fe00c657e670b2d1fc2f1;hp=624b6c99cf3a842fb791a1a552245a61cfcc2c03;hpb=01b628fc79155f545b283c1d095d8a2ffe00e0a1;p=helm.git diff --git a/helm/software/components/ng_paramodulation/foUtils.ml b/helm/software/components/ng_paramodulation/foUtils.ml index 624b6c99c..a970bb6f0 100644 --- a/helm/software/components/ng_paramodulation/foUtils.ml +++ b/helm/software/components/ng_paramodulation/foUtils.ml @@ -20,9 +20,14 @@ let rec lexicograph f l1 l2 = | [],_ -> ~-1 | _,[] -> 1 ;; + +let mk_id = + let id = ref 0 in + fun () -> incr id; !id +;; module Utils (B : Terms.Blob) = struct - module Subst = FoSubst.Subst(B) ;; + module Subst = FoSubst;; (*.Subst(B) ;;*) module Order = Orderings.Orderings(B) ;; let rec eq_foterm x y = @@ -102,11 +107,6 @@ module Utils (B : Terms.Blob) = struct ;; (* may be moved inside the bag *) - let mk_id = - let id = ref 0 in - fun () -> incr id; !id - ;; - let mk_unit_clause maxvar ty proofterm = let varlist = let rec aux acc = function @@ -130,10 +130,27 @@ module Utils (B : Terms.Blob) = struct 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 + let bag = Terms.M.add id (clause,false) bag in bag, clause ;; let empty_bag = Terms.M.empty ;; + let mk_passive_clause cl = + (Order.compute_unit_clause_weight cl, cl) + ;; + + let mk_passive_goal g = + (Order.compute_goal_weight g, g) + ;; + + let compare_passive_clauses_weight (w1,(id1,_,_,_)) (w2,(id2,_,_,_)) = + if w1 = w2 then id1 - id2 + else w1 - w2 + ;; + + let compare_passive_clauses_age (_,(id1,_,_,_)) (_,(id2,_,_,_)) = + id1 - id2 + ;; + end