X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Findex.ml;h=7a67aa9ad3cf8256c68d8455f0e83287ef78c1d8;hb=e588f626df2898792cc9c0372f6d67602ca720fc;hp=3179f000068897755b450fcc8c315cc051c597ce;hpb=9450b36b5e385818adbcda257fa74260c2979fcd;p=helm.git diff --git a/helm/software/components/ng_paramodulation/index.ml b/helm/software/components/ng_paramodulation/index.ml index 3179f0000..7a67aa9ad 100644 --- a/helm/software/components/ng_paramodulation/index.ml +++ b/helm/software/components/ng_paramodulation/index.ml @@ -80,32 +80,34 @@ module Index(B : Orderings.Blob) = struct type data = ClauseSet.elt and type dataset = ClauseSet.t = Make(FotermIndexable)(ClauseSet) - - let are_invertible maxvar varlist l r = - let _,_,subst = U.relocate maxvar varlist FoSubst.id_subst in - let l = FoSubst.apply_subst subst l in - try (ignore(Unif.alpha_eq l r);true) with - FoUnif.UnificationFailure _ -> false - let index_unit_clause maxvar t = function + let process op t = function | (_,Terms.Equation (l,_,_,Terms.Gt),_,_) as c -> - DT.index t l (Terms.Left2Right, c) + op t l (Terms.Left2Right, c) | (_,Terms.Equation (_,r,_,Terms.Lt),_,_) as c -> - DT.index t r (Terms.Right2Left, c) + op t r (Terms.Right2Left, c) | (_,Terms.Equation (l,r,_,Terms.Incomparable),vl,_) as c -> -(* if are_invertible maxvar vl l r then - (prerr_endline ("Invertible " ^ (Pp.pp_foterm l) ^ "=" ^ - (Pp.pp_foterm r)); - DT.index t l (Terms.Left2Right, c)) - else *) - DT.index - (DT.index t l (Terms.Left2Right, c)) - r (Terms.Right2Left, c) + op (op t l (Terms.Left2Right, c)) + r (Terms.Right2Left, c) + | (_,Terms.Equation (l,r,_,Terms.Invertible),vl,_) as c -> + op t l (Terms.Left2Right, c) | (_,Terms.Equation (_,r,_,Terms.Eq),_,_) -> assert false | (_,Terms.Predicate p,_,_) as c -> - DT.index t p (Terms.Nodir, c) + op t p (Terms.Nodir, c) ;; + let index_unit_clause = + process DT.index + + let remove_unit_clause = + process DT.remove_index + + let fold = DT.fold + + let elems index = + DT.fold index (fun _ dataset acc -> ClauseSet.union dataset acc) + ClauseSet.empty + type active_set = B.t Terms.unit_clause list * DT.t end