foUtils.cmi: terms.cmi
foUnif.cmi: terms.cmi
orderings.cmi: terms.cmi
-clauses.cmi: orderings.cmi
+clauses.cmi: terms.cmi orderings.cmi
index.cmi: terms.cmi orderings.cmi
superposition.cmi: terms.cmi orderings.cmi index.cmi
stats.cmi: terms.cmi orderings.cmi
foUtils.cmx: terms.cmx foSubst.cmx foUtils.cmi
foUnif.cmo: terms.cmi foUtils.cmi foSubst.cmi foUnif.cmi
foUnif.cmx: terms.cmx foUtils.cmx foSubst.cmx foUnif.cmi
-orderings.cmo: terms.cmi pp.cmi foUnif.cmi foSubst.cmi orderings.cmi
-orderings.cmx: terms.cmx pp.cmx foUnif.cmx foSubst.cmx orderings.cmi
-clauses.cmo: terms.cmi orderings.cmi foUtils.cmi foSubst.cmi clauses.cmi
-clauses.cmx: terms.cmx orderings.cmx foUtils.cmx foSubst.cmx clauses.cmi
-index.cmo: terms.cmi orderings.cmi foUtils.cmi index.cmi
-index.cmx: terms.cmx orderings.cmx foUtils.cmx index.cmi
+orderings.cmo: terms.cmi pp.cmi foUtils.cmi foUnif.cmi foSubst.cmi \
+ orderings.cmi
+orderings.cmx: terms.cmx pp.cmx foUtils.cmx foUnif.cmx foSubst.cmx \
+ orderings.cmi
+clauses.cmo: terms.cmi orderings.cmi foUtils.cmi foUnif.cmi foSubst.cmi \
+ clauses.cmi
+clauses.cmx: terms.cmx orderings.cmx foUtils.cmx foUnif.cmx foSubst.cmx \
+ clauses.cmi
+index.cmo: terms.cmi orderings.cmi foUtils.cmi clauses.cmi index.cmi
+index.cmx: terms.cmx orderings.cmx foUtils.cmx clauses.cmx index.cmi
superposition.cmo: terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \
- foUnif.cmi foSubst.cmi superposition.cmi
+ foUnif.cmi foSubst.cmi clauses.cmi superposition.cmi
superposition.cmx: terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \
- foUnif.cmx foSubst.cmx superposition.cmi
+ foUnif.cmx foSubst.cmx clauses.cmx superposition.cmi
stats.cmo: terms.cmi pp.cmi stats.cmi
stats.cmx: terms.cmx pp.cmx stats.cmi
paramod.cmo: terms.cmi superposition.cmi pp.cmi orderings.cmi index.cmi \
- foUtils.cmi foUnif.cmi paramod.cmi
+ foUtils.cmi foUnif.cmi clauses.cmi paramod.cmi
paramod.cmx: terms.cmx superposition.cmx pp.cmx orderings.cmx index.cmx \
- foUtils.cmx foUnif.cmx paramod.cmi
+ foUtils.cmx foUnif.cmx clauses.cmx paramod.cmi
nCicBlob.cmo: terms.cmi foUtils.cmi nCicBlob.cmi
nCicBlob.cmx: terms.cmx foUtils.cmx nCicBlob.cmi
cicBlob.cmo: terms.cmi cicBlob.cmi
(* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *)
let debug s = prerr_endline (Lazy.force s) ;;
-(* let debug _ = ();; *)
+let debug _ = ();;
let monster = 100;;
let add_passive_clause ?(bonus_weight=0) (passives_w,passives_a) cl =
let (w,cl) = Clauses.mk_passive_clause cl in
- let cl = (w+bonus_weight,cl) in
- WeightPassiveSet.add cl passives_w, AgePassiveSet.add cl passives_a
+ (* let cl = (w+bonus_weight,cl) in *)
+ let cl = if bonus_weight = 0 then (w,cl) else (0,cl) in
+ WeightPassiveSet.add cl passives_w, AgePassiveSet.add cl passives_a
;;
let add_passive_goal ?(bonus_weight=0) (passives_w,passives_a) g =
let (w,g) = Clauses.mk_passive_goal g in
- let g = (w+bonus_weight,g) in
- WeightPassiveSet.add g passives_w, AgePassiveSet.add g passives_a
+ (* let g = (w+bonus_weight,g) in *)
+ let g = if bonus_weight = 0 then (w,g) else (0,g) in
+ WeightPassiveSet.add g passives_w, AgePassiveSet.add g passives_a
;;
let remove_passive_clause (passives_w,passives_a) cl =
exception Success of B.t Terms.bag * int * B.t Terms.clause
let debug s = prerr_endline (Lazy.force s);;
- (* let debug _ = ();; *)
+ let debug _ = ();;
let enable = true;;
let rec list_first f = function
let vl = Clauses.vars_of_clause cl in
let cl,maxvar =
if fresh then Clauses.fresh_clause ~subst maxvar (0, nlit, plit, vl, proof)
- else cl,maxvar
+ else (0,nlit,plit,vl,proof),maxvar
in
let bag, cl =
- Terms.add_to_bag (0, nlit, plit, vl, proof) bag
+ Terms.add_to_bag cl bag
in
Some (bag, maxvar, cl, literal)
else
| _ -> false
let fold_build_new_clause bag maxvar id rule filter res clause_ctx =
+ debug (lazy (string_of_int (List.length res)));
let (bag, maxvar), res =
HExtlib.filter_map_acc
(fun (bag, maxvar) (t,subst,id2,pos,dir) ->
let is_subsumed ~unify bag maxvar (id, nlit, plit, vl, _) table =
match nlit,plit with
+ | [Terms.Equation (l,r,ty,_) ,_],[]
| [],[Terms.Equation (l,r,ty,_) ,_]->
(match rewrite_eq ~unify l r ty vl table with
| None -> None
if no_demod then bag, clause else demodulate bag clause table
in
if List.exists (Clauses.are_alpha_eq_cl clause) g_actives then None else
- (debug (lazy (Pp.pp_clause clause));
if (is_goal_trivial clause)
then raise (Success (bag, maxvar, clause))
else
| None -> Some (bag,clause)
| Some (bag,maxvar,cl,subst) ->
prerr_endline "Goal subsumed";
- raise (Success (bag,maxvar,cl)))
+ raise (Success (bag,maxvar,cl))
(*
else match is_subsumed ~unify:true bag maxvar clause table with
| None -> Some (bag, clause)
(* this is OK for both the sup_left and sup_right inference steps *)
let superposition table varlist is_pos subterm pos context =
let cands = IDX.DT.retrieve_unifiables table subterm in
- HExtlib.filter_map
+ let res = HExtlib.filter_map
(fun (dir, is_cand_pos, _, (id,nlit,plit,vl,_ (*as uc*))) ->
match nlit,plit with
| [],[Terms.Equation (l,r,_,o),_] ->
(let side, newside = if dir=Terms.Left2Right then l,r else r,l in
+ debug (lazy (Pp.pp_foterm subterm));
+ debug (lazy (Pp.pp_foterm side));
try
let subst =
Unif.unification (* (varlist@vl)*) [] subterm side
if o <> Terms.Lt && o <> Terms.Eq then
Some (context newside, subst, id, pos, dir)
else
- ((*prerr_endline ("Filtering: " ^
- Pp.pp_foterm side ^ " =(< || =)" ^
- Pp.pp_foterm newside);*)None)
+ (debug (lazy "Filtering out..."); None)
else
Some (context newside, subst, id, pos, dir)
with FoUnif.UnificationFailure _ -> None)
| _ -> assert false)
(IDX.ClauseSet.elements cands)
+ in
+ debug (lazy (string_of_int (List.length (IDX.ClauseSet.elements cands)) ^ " candidates"));
+ debug (lazy (string_of_int (List.length res) ^ " results"));
+ res
;;
(* Superposes selected equation with equalities in table *)
List.fold_left (superpose_literal id vl atable false)
(bag,maxvar,[],List.tl nlit,[]) nlit
in
- debug (lazy "Superposed goal with active clauses");
+ debug (lazy (string_of_int (List.length new_goals) ^ " new goals"));
(* We simplify the new goals with active clauses *)
let bag, new_goals =
List.fold_left