X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2FfoUtils.ml;h=5dd1268b09250dff33f3122d5571d5ee99eabe9b;hb=2041f4fefe300f77338f6aea598f025f84db1bbc;hp=7b192579df5a55be16d38693deb120f8ea34a8b4;hpb=38c54dd8e2234836d5f3e8011c478daf7d59fa25;p=helm.git diff --git a/helm/software/components/ng_paramodulation/foUtils.ml b/helm/software/components/ng_paramodulation/foUtils.ml index 7b192579d..5dd1268b0 100644 --- a/helm/software/components/ng_paramodulation/foUtils.ml +++ b/helm/software/components/ng_paramodulation/foUtils.ml @@ -21,9 +21,8 @@ let rec lexicograph f l1 l2 = | _,[] -> 1 ;; -module Utils (B : Orderings.Blob) = struct +module Utils (B : Terms.Blob) = struct module Subst = FoSubst;; - module Order = B;; let rec eq_foterm x y = x == y || @@ -69,9 +68,6 @@ module Utils (B : Orderings.Blob) = struct | Terms.Equation _, Terms.Predicate _ -> 1 ;; - let eq_clause (id1,_,_,_,_) (id2,_,_,_,_) = id1 = id2 - let compare_clause (id1,_,_,_,_) (id2,_,_,_,_) = Pervasives.compare id1 id2 - let relocate maxvar varlist subst = List.fold_right (fun i (maxvar, varlist, s) -> @@ -79,61 +75,4 @@ module Utils (B : Orderings.Blob) = struct varlist (maxvar+1, [], subst) ;; - let fresh_clause maxvar (id, nlit, plit, varlist, proof) = - let maxvar, varlist, subst = relocate maxvar varlist Subst.id_subst in - let apply_subst_on_lit = function - | Terms.Equation (l,r,ty,o) -> - let l = Subst.apply_subst subst l in - let r = Subst.apply_subst subst r in - let ty = Subst.apply_subst subst ty in - Terms.Equation (l,r,ty,o) - | Terms.Predicate p -> - let p = Subst.apply_subst subst p in - Terms.Predicate p - in - let nlit = List.map (fun (l,s) -> (apply_subst_on_lit l,s)) nlit in - let plit = List.map (fun (l,s) -> (apply_subst_on_lit l,s)) plit in - let proof = - match proof with - | Terms.Exact t -> Terms.Exact (Subst.apply_subst subst t) - | Terms.Step (rule,c1,c2,dir,pos,s) -> - Terms.Step(rule,c1,c2,dir,pos,Subst.concat subst s) - in - (id, nlit, plit, varlist, proof), maxvar - ;; - - (* may be moved inside the bag *) - let mk_clause maxvar nlit plit proofterm = - let foterm_to_lit (acc,literals) ty = - let vars = Terms.vars_of_term ~start_acc:acc ty in - match ty with - | Terms.Node [ Terms.Leaf eq ; ty; l; r ] when B.eq B.eqP eq -> - let o = Order.compare_terms l r in - (vars,(Terms.Equation (l, r, ty, o),true)::literals) - | _ -> (vars,(Terms.Predicate ty,true)::literals) - in - let varlist = Terms.vars_of_term proofterm in - let (varlist,nlit) = List.fold_left foterm_to_lit (varlist,[]) nlit in - let (varlist,plit) = List.fold_left foterm_to_lit (varlist,[]) plit in - let proof = Terms.Exact proofterm in - fresh_clause maxvar (0, nlit, plit, varlist, proof) - ;; - - let mk_passive_clause cl = - (Order.compute_clause_weight cl, cl) - ;; - - let mk_passive_goal g = - (Order.compute_clause_weight g, g) - ;; - - let compare_passive_clauses_weight (w1,(id1,_,_,_,_)) (w2,(id2,_,_,_,_)) = - if w1 = w2 then id1 - id2 - else w1 - w2 - ;; - - let compare_passive_clauses_age (_,(id1,_,_,_,_)) (_,(id2,_,_,_,_)) = - id1 - id2 - ;; - end