X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Findex.ml;h=3179f000068897755b450fcc8c315cc051c597ce;hb=a425ea9290454065cf33d33f0ae13a1006fef5fd;hp=6c26e7b86ab82cfeab8996b743d076bd614560f3;hpb=637114791874df9ebc4e0f0936513c71886a913f;p=helm.git diff --git a/helm/software/components/ng_paramodulation/index.ml b/helm/software/components/ng_paramodulation/index.ml index 6c26e7b86..3179f0000 100644 --- a/helm/software/components/ng_paramodulation/index.ml +++ b/helm/software/components/ng_paramodulation/index.ml @@ -11,8 +11,10 @@ (* $Id$ *) -module Index(B : Terms.Blob) = struct +module Index(B : Orderings.Blob) = struct module U = FoUtils.Utils(B) + module Unif = FoUnif.Founif(B) + module Pp = Pp.Pp(B) module ClauseOT = struct @@ -79,12 +81,23 @@ module Index(B : Terms.Blob) = struct type dataset = ClauseSet.t = Make(FotermIndexable)(ClauseSet) - let index_unit_clause t = function + 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 | (_,Terms.Equation (l,_,_,Terms.Gt),_,_) as c -> DT.index t l (Terms.Left2Right, c) | (_,Terms.Equation (_,r,_,Terms.Lt),_,_) as c -> DT.index t r (Terms.Right2Left, c) - | (_,Terms.Equation (l,r,_,Terms.Incomparable),_,_) as 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) @@ -93,4 +106,6 @@ module Index(B : Terms.Blob) = struct DT.index t p (Terms.Nodir, c) ;; + type active_set = B.t Terms.unit_clause list * DT.t + end