foSubst.cmx: terms.cmx foSubst.cmi
orderings.cmo: terms.cmi orderings.cmi
orderings.cmx: terms.cmx orderings.cmi
-foUtils.cmo: terms.cmi orderings.cmi index.cmi foSubst.cmi foUtils.cmi
-foUtils.cmx: terms.cmx orderings.cmx index.cmx foSubst.cmx foUtils.cmi
+foUtils.cmo: terms.cmi orderings.cmi foSubst.cmi foUtils.cmi
+foUtils.cmx: terms.cmx orderings.cmx foSubst.cmx foUtils.cmi
index.cmo: terms.cmi foUtils.cmi index.cmi
index.cmx: terms.cmx foUtils.cmx index.cmi
foUnif.cmo: terms.cmi foUtils.cmi foSubst.cmi foUnif.cmi
foUnif.cmx: terms.cmx foUtils.cmx foSubst.cmx foUnif.cmi
-superposition.cmo: terms.cmi orderings.cmi index.cmi foUtils.cmi foUnif.cmi \
- foSubst.cmi superposition.cmi
-superposition.cmx: terms.cmx orderings.cmx index.cmx foUtils.cmx foUnif.cmx \
- foSubst.cmx superposition.cmi
-nCicBlob.cmo: terms.cmi nCicBlob.cmi
-nCicBlob.cmx: terms.cmx nCicBlob.cmi
+superposition.cmo: terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \
+ foUnif.cmi foSubst.cmi superposition.cmi
+superposition.cmx: terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \
+ foUnif.cmx foSubst.cmx superposition.cmi
+nCicBlob.cmo: terms.cmi foUtils.cmi nCicBlob.cmi
+nCicBlob.cmx: terms.cmx foUtils.cmx nCicBlob.cmi
cicBlob.cmo: terms.cmi cicBlob.cmi
cicBlob.cmx: terms.cmx cicBlob.cmi
paramod.cmo: superposition.cmi pp.cmi nCicBlob.cmi index.cmi foUtils.cmi \
pp.cmi: terms.cmi
foSubst.cmi: terms.cmi
orderings.cmi: terms.cmi
-foUtils.cmi: terms.cmi index.cmi
-foUnif.cmi: terms.cmi
+foUtils.cmi: terms.cmi
index.cmi: terms.cmi
+foUnif.cmi: terms.cmi
superposition.cmi: terms.cmi index.cmi
nCicBlob.cmi: terms.cmi
cicBlob.cmi: terms.cmi
foSubst.cmx: terms.cmx foSubst.cmi
orderings.cmo: terms.cmi orderings.cmi
orderings.cmx: terms.cmx orderings.cmi
-foUtils.cmo: terms.cmi orderings.cmi index.cmi foSubst.cmi foUtils.cmi
-foUtils.cmx: terms.cmx orderings.cmx index.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
+foUtils.cmo: terms.cmi orderings.cmi foSubst.cmi foUtils.cmi
+foUtils.cmx: terms.cmx orderings.cmx foSubst.cmx foUtils.cmi
index.cmo: terms.cmi foUtils.cmi index.cmi
index.cmx: terms.cmx foUtils.cmx index.cmi
-superposition.cmo: terms.cmi orderings.cmi index.cmi foUtils.cmi foUnif.cmi \
- foSubst.cmi superposition.cmi
-superposition.cmx: terms.cmx orderings.cmx index.cmx foUtils.cmx foUnif.cmx \
- foSubst.cmx superposition.cmi
-nCicBlob.cmo: terms.cmi nCicBlob.cmi
-nCicBlob.cmx: terms.cmx nCicBlob.cmi
+foUnif.cmo: terms.cmi foUtils.cmi foSubst.cmi foUnif.cmi
+foUnif.cmx: terms.cmx foUtils.cmx foSubst.cmx foUnif.cmi
+superposition.cmo: terms.cmi pp.cmi orderings.cmi index.cmi foUtils.cmi \
+ foUnif.cmi foSubst.cmi superposition.cmi
+superposition.cmx: terms.cmx pp.cmx orderings.cmx index.cmx foUtils.cmx \
+ foUnif.cmx foSubst.cmx superposition.cmi
+nCicBlob.cmo: terms.cmi foUtils.cmi nCicBlob.cmi
+nCicBlob.cmx: terms.cmx foUtils.cmx nCicBlob.cmi
cicBlob.cmo: terms.cmi cicBlob.cmi
cicBlob.cmx: terms.cmx cicBlob.cmi
paramod.cmo: superposition.cmi pp.cmi nCicBlob.cmi index.cmi foUtils.cmi \
val eq_unit_clause : B.t Terms.unit_clause -> B.t Terms.unit_clause -> bool
val compare_unit_clause : B.t Terms.unit_clause -> B.t Terms.unit_clause -> int
-(*
+
val fresh_unit_clause :
int -> B.t Terms.unit_clause -> B.t Terms.unit_clause * int
-*)
(* relocate [maxvar] [varlist] -> [newmaxvar] * [varlist] * [relocsubst] *)
val relocate : int -> int list -> int * int list * B.t Terms.substitution
DT.index t p (Terms.Nodir, c)
;;
+ type active_set = B.t Terms.unit_clause list * DT.t
+
end
val index_unit_clause :
DT.t -> B.t Terms.unit_clause -> DT.t
+ type active_set = B.t Terms.unit_clause list * DT.t
+
end
in
prerr_endline "Active table:";
List.iter (fun uc -> prerr_endline (Pp.pp_unit_clause uc)) active_clauses;
- let bag, maxvar, newclauses =
- Sup.superposition_right_with_table bag maxvar clause table
+ let bag, maxvar, _, newclauses =
+ Sup.superposition_right bag maxvar clause (active_clauses, table)
in
prerr_endline "Output clauses :";
List.iter (fun c -> prerr_endline (Pp.pp_unit_clause c)) newclauses;
| Terms.Incomparable -> "I"
let pp_unit_clause ~formatter:f c =
- let (id, l, vars, _) = c in
+ let (id, l, vars, proof) = c in
Format.fprintf f "Id : %d, " id ;
match l with
| Terms.Predicate t ->
pp_foterm f lhs;
Format.fprintf f " =(%s) " (string_of_comparison comp);
pp_foterm f rhs;
- Format.fprintf f " [%s]"
- (String.concat ", " (List.map string_of_int vars))
+ Format.fprintf f " [%s] by %s"
+ (String.concat ", " (List.map string_of_int vars))
+ (match proof with
+ | Terms.Exact _ -> "axiom"
+ | Terms.Step (Terms.SuperpositionRight, id1, id2, _, p, _) ->
+ Printf.sprintf "supR %d with %d at %s" id1 id2 (String.concat
+ "," (List.map string_of_int p))
+ | _ -> assert false)
+
;;
(* String buffer implementation *)
l (superposition_right table vl)))
| _ -> assert false
;;
+
+ (* the current equation is normal w.r.t. demodulation with atable
+ * (and is not the identity) *)
+ let superposition_right bag maxvar current (alist,atable) =
+ let ctable = IDX.index_unit_clause IDX.DT.empty current in
+ let bag, maxvar, new_clauses =
+ List.fold_left
+ (fun (bag, maxvar, acc) active ->
+ let bag, maxvar, newc =
+ superposition_right_with_table bag maxvar active ctable
+ in
+ bag, maxvar, newc @ acc)
+ (bag, maxvar, []) alist
+ in
+ let alist, atable =
+ current :: alist, IDX.index_unit_clause atable current
+ in
+ let fresh_current, maxvar = Utils.fresh_unit_clause maxvar current in
+ let bag, maxvar, additional_new_clauses =
+ superposition_right_with_table bag maxvar fresh_current atable
+ in
+ bag, maxvar, (alist, atable), new_clauses @ additional_new_clauses
+ ;;
end
module Superposition (B : Terms.Blob) :
sig
- val superposition_right_with_table :
+ (* The returned active set is the input one + the selected clause *)
+ val superposition_right :
B.t Terms.bag ->
int -> (* maxvar *)
- B.t Terms.unit_clause ->
- Index.Index(B).DT.t ->
- B.t Terms.bag * int * B.t Terms.unit_clause list
+ B.t Terms.unit_clause -> (* selected *)
+ Index.Index(B).active_set ->
+ B.t Terms.bag * int * Index.Index(B).active_set * B.t Terms.unit_clause list
end