X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Fparamod.ml;h=a6f3a93c789f086a4848f3959e9183511a5251fc;hb=a872dba2b03e27967d5b9b51e950e85967340e52;hp=6c3c5118d62362eadc982fa63ecfbd9672b635cc;hpb=94ec1bb0fcb0a82bfaaf965aed6993de3a9e658a;p=helm.git diff --git a/helm/software/components/ng_paramodulation/paramod.ml b/helm/software/components/ng_paramodulation/paramod.ml index 6c3c5118d..a6f3a93c7 100644 --- a/helm/software/components/ng_paramodulation/paramod.ml +++ b/helm/software/components/ng_paramodulation/paramod.ml @@ -14,7 +14,7 @@ let debug s = prerr_endline s ;; let debug _ = ();; -let monster = 500;; +let monster = 100;; module Paramod (B : Terms.Blob) = struct exception Failure of string * B.t Terms.bag * int * int @@ -99,7 +99,7 @@ module Paramod (B : Terms.Blob) = struct let mk_clause bag maxvar (t,ty) = let (proof,ty) = B.saturate t ty in let c, maxvar = Utils.mk_unit_clause maxvar ty proof in - let bag, c = Utils.add_to_bag bag c in + let bag, c = Terms.add_to_bag c bag in (bag, maxvar), c ;; @@ -118,7 +118,11 @@ module Paramod (B : Terms.Blob) = struct (false,cl,remove_passive_clause passives cl,g_passives) else let g_cl = pick_min_passive ~use_age:use_age g_passives in - if (fst cl <= fst g_cl) then + let (id1,_,_,_),(id2,_,_,_) = snd cl, snd g_cl in + let cmp = if use_age then id1 <= id2 + else fst cl <= fst g_cl + in + if cmp then (false,cl,remove_passive_clause passives cl,g_passives) else (true,g_cl,passives,remove_passive_clause g_passives g_cl) @@ -218,13 +222,21 @@ module Paramod (B : Terms.Blob) = struct end else raise (Failure ("Timeout !",bag,maxvar,iterno)); - (* let use_age = iterno mod 10 = 0 in *) + let use_age = iterno mod 5 = 0 in let rec aux_select bag passives g_passives = let backward,(weight,current),passives,g_passives = select ~use_age:false passives g_passives in + if use_age && weight > monster then + let bag,cl = Terms.add_to_bag current bag in + if backward then + aux_select bag passives (add_passive_clause g_passives cl) + else + aux_select bag (add_passive_clause passives cl) g_passives + else if backward then + let _ = debug ("Selected goal : " ^ Pp.pp_unit_clause current) in match if noinfer then if weight > monster then None else Some (bag,current) @@ -248,8 +260,8 @@ module Paramod (B : Terms.Blob) = struct if weight > monster then bag,None else bag, Some (current,actives) else if Sup.orphan_murder bag (fst actives) current then - let (id,_,_,_) = current in - let bag = Terms.M.add id (current,true) bag in + let _ = debug "Orphan murdered" in + let bag = Terms.replace_in_bag (current,true) bag in bag, None else Sup.keep_simplified current actives bag maxvar with @@ -319,7 +331,7 @@ module Paramod (B : Terms.Blob) = struct | Sup.Success (bag, _, (i,_,_,_)) -> let l = let rec traverse ongoal (accg,acce) i = - match Terms.M.find i bag with + match Terms.get_from_bag i bag with | (id,_,_,Terms.Exact _),_ -> if ongoal then [i],acce else if (List.mem i acce) then accg,acce else accg,acce@[i]