From 449295993c1fb0732fd5b14a570f8c5260653164 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Wed, 2 Dec 2009 09:48:37 +0000 Subject: [PATCH] Added a function remove_unit_clause --- .../components/ng_paramodulation/index.ml | 26 +++++++++---------- .../components/ng_paramodulation/index.mli | 7 +++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/helm/software/components/ng_paramodulation/index.ml b/helm/software/components/ng_paramodulation/index.ml index 4db4584a4..b6ca890b2 100644 --- a/helm/software/components/ng_paramodulation/index.ml +++ b/helm/software/components/ng_paramodulation/index.ml @@ -81,27 +81,27 @@ module Index(B : Orderings.Blob) = struct type dataset = ClauseSet.t = Make(FotermIndexable)(ClauseSet) - 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 -> - DT.index t l (Terms.Left2Right, 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 + type active_set = B.t Terms.unit_clause list * DT.t end diff --git a/helm/software/components/ng_paramodulation/index.mli b/helm/software/components/ng_paramodulation/index.mli index bfed8d533..2fc8ec1e8 100644 --- a/helm/software/components/ng_paramodulation/index.mli +++ b/helm/software/components/ng_paramodulation/index.mli @@ -26,8 +26,11 @@ module Index (B : Orderings.Blob) : type data = ClauseSet.elt and type dataset = ClauseSet.t - val index_unit_clause : - int -> DT.t -> B.t Terms.unit_clause -> DT.t + val index_unit_clause : + DT.t -> B.t Terms.unit_clause -> DT.t + + val remove_unit_clause : + DT.t -> B.t Terms.unit_clause -> DT.t type active_set = B.t Terms.unit_clause list * DT.t -- 2.39.2