let eq_clause (id1,_,_,_,_) (id2,_,_,_,_) = id1 = id2
let compare_clause (id1,_,_,_,_) (id2,_,_,_,_) = Pervasives.compare id1 id2
- let fresh_clause maxvar (id, nlit, plit, varlist, proof) =
- let maxvar, varlist, subst = Utils.relocate maxvar varlist FoSubst.id_subst in
+ let fresh_clause maxvar ?(subst=FoSubst.id_subst) (id, nlit, plit, varlist, proof) =
+ let maxvar, varlist, subst = Utils.relocate maxvar varlist subst in
let apply_subst_on_lit = function
| Terms.Equation (l,r,ty,o) ->
let l = FoSubst.apply_subst subst l in
with Invalid_argument _ -> false
;;
+ let vars_of_clause (id,nlit,plit,_,pr) =
+ let vars_of_lit acc lit =
+ match lit with
+ | (Terms.Predicate t,_) -> Terms.vars_of_term ~start_acc:acc t
+ | (Terms.Equation (l,r,ty,o),_) ->
+ Terms.vars_of_term ~start_acc:(Terms.vars_of_term ~start_acc:acc l) r
+ in
+ List.fold_left vars_of_lit [] (nlit@plit)
+;;
+
end