* 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;;
| _, 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
(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
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
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