let rec given_clause bag maxvar actives passives g_actives g_passives =
(* keep goals demodulated w.r.t. actives and check if solved *)
- (* we may move this at the end of infer_right and simplify with
- * just new_clauses *)
+ (* we may move this at the end of infer_right *)
let bag, g_actives =
List.fold_left
(fun (bag,acc) c ->
- let bag, c = Sup.backward_simplify maxvar (snd actives) bag c in
+ let bag, c = Sup.simplify_goal maxvar (snd actives) bag c in
bag, c::acc)
(bag,[]) g_actives
in
- (* backward step : superposition left, simplifications on goals *)
- debug "Backward infer step...";
+ (* superposition left, simplifications on goals *)
+ debug "infer_left step...";
let bag, maxvar, g_actives, g_passives =
match select g_passives with
| None -> bag, maxvar, g_actives, g_passives
| Some (g_current, g_passives) ->
debug ("Selected goal : " ^ Pp.pp_unit_clause g_current);
let bag, g_current =
- Sup.backward_simplify maxvar (snd actives) bag g_current
+ Sup.simplify_goal maxvar (snd actives) bag g_current
in
let bag, maxvar, new_goals =
Sup.infer_left bag maxvar g_current actives
| None -> bag, maxvar, actives, passives, g_passives
| Some (current, passives) ->
debug ("Selected fact : " ^ Pp.pp_unit_clause current);
- match Sup.forward_simplify (snd actives) bag current with
+ match Sup.simplify (snd actives) bag current with
| None -> debug ("Discarded fact");
bag, maxvar, actives, passives, g_passives
| Some (bag, current) ->
;;
(* demodulate and check for subsumption *)
- let forward_simplify table bag clause =
+ let simplify table bag clause =
let bag, clause = demodulate bag clause table in
if is_identity_clause clause then None
else
else Some (bag, clause)
;;
- (* this is like forward_simplify but raises Success *)
- let backward_simplify maxvar table bag clause =
+ (* this is like simplify but raises Success *)
+ let simplify_goal maxvar table bag clause =
let bag, clause = demodulate bag clause table in
if (is_identity_clause clause) || (is_subsumed ~unify:true clause table)
then raise (Success (bag, maxvar, clause))
let ctable = IDX.index_unit_clause IDX.DT.empty current in
let bag, (alist, atable) =
let bag, alist =
- HExtlib.filter_map_acc (forward_simplify ctable) bag alist
+ HExtlib.filter_map_acc (simplify ctable) bag alist
in
bag, (alist, List.fold_left IDX.index_unit_clause IDX.DT.empty alist)
in
debug "Another superposition";
let new_clauses = new_clauses @ additional_new_clauses in
let bag, new_clauses =
- HExtlib.filter_map_acc (forward_simplify atable) bag new_clauses
+ HExtlib.filter_map_acc (simplify atable) bag new_clauses
in
debug "Demodulated new clauses";
bag, maxvar, (alist, atable), new_clauses