From bca340f9c590e6530f8346fddd61c9fa0ae7f411 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Thu, 4 Mar 2010 07:54:40 +0000 Subject: [PATCH] Fixed a bug in deep_eq: we generated new clauses but neglected the relocating subst. Caused problems in proof reconstruction. --- .../ng_paramodulation/superposition.ml | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/helm/software/components/ng_paramodulation/superposition.ml b/helm/software/components/ng_paramodulation/superposition.ml index 37b39fa28..f38acb536 100644 --- a/helm/software/components/ng_paramodulation/superposition.ml +++ b/helm/software/components/ng_paramodulation/superposition.ml @@ -26,7 +26,7 @@ module Superposition (B : Orderings.Blob) = * B.t Terms.unit_clause * B.t Terms.substitution - (* let debug s = prerr_endline (Lazy.force s);; *) + let print s = prerr_endline (Lazy.force s);; let debug _ = ();; let enable = true;; @@ -328,17 +328,22 @@ module Superposition (B : Orderings.Blob) = | _, Terms.Equation (l,r,_,_), vl, proof -> (try Some (Unif.unification (* vl *) [] l r) with FoUnif.UnificationFailure _ -> None) - | _, Terms.Equation (_,_,_,_), _, _ -> None | _, Terms.Predicate _, _, _ -> assert false ;; - let build_new_clause bag maxvar filter rule t subst id id2 pos dir = + let build_new_clause_reloc bag maxvar filter rule t subst id id2 pos dir = let maxvar, _vl, subst = Utils.relocate maxvar (Terms.vars_of_term (Subst.apply_subst subst t)) subst in match build_clause bag filter rule t subst id id2 pos dir with - | Some (bag, c) -> Some ((bag, maxvar), c) - | None -> None + | Some (bag, c) -> Some ((bag, maxvar), c), subst + | None -> None,subst ;; + + let build_new_clause bag maxvar filter rule t subst id id2 pos dir = + fst (build_new_clause_reloc bag maxvar filter rule t + subst id id2 pos dir) + ;; + let prof_build_new_clause = HExtlib.profile ~enable "build_new_clause";; let build_new_clause bag maxvar filter rule t subst id id2 pos x = prof_build_new_clause.HExtlib.profile (build_new_clause bag maxvar filter @@ -427,13 +432,14 @@ module Superposition (B : Orderings.Blob) = (Terms.Node[Terms.Leaf B.eqP;ty;contextl r;contextr r]) in (match - build_new_clause bag maxvar (fun _ -> true) + build_new_clause_reloc bag maxvar (fun _ -> true) Terms.Superposition id_t subst1 id id2 (pos@[2]) dir with - | Some ((bag, maxvar), c) -> + | Some ((bag, maxvar), c), r -> + let newsubst = Subst.concat r newsubst in Some(bag,maxvar,c,newsubst) - | None -> assert false) + | None, _ -> assert false) | None -> match l,r with | Terms.Node (a::la), Terms.Node (b::lb) when @@ -455,6 +461,7 @@ module Superposition (B : Orderings.Blob) = in acc | _,_ -> None ;; + let prof_deep_eq = HExtlib.profile ~enable "deep_eq";; let deep_eq ~unify l r ty pos contextl contextr table x = prof_deep_eq.HExtlib.profile (deep_eq ~unify l r ty pos contextl contextr table) x @@ -619,8 +626,8 @@ module Superposition (B : Orderings.Blob) = let bag, clause = if no_demod then bag, clause else demodulate bag clause table in - let _ = debug ("demodulated goal : " - ^ Pp.pp_unit_clause clause) + let _ = debug (lazy ("demodulated goal : " + ^ Pp.pp_unit_clause clause)) in if List.exists (are_alpha_eq clause) g_actives then None else match (is_identity_goal clause) with -- 2.39.2