X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Findex.ml;h=36c9dd75e693ec51cf5e168995563113c2b92f66;hb=95adf6dc8e29a71adc34e71eafe3f427990126e0;hp=4db4584a451494caf00bff8166a3a37f96d678dc;hpb=5642a453e8b4bbe228d126aa0c44d31e101969ec;p=helm.git diff --git a/helm/software/components/ng_paramodulation/index.ml b/helm/software/components/ng_paramodulation/index.ml index 4db4584a4..36c9dd75e 100644 --- a/helm/software/components/ng_paramodulation/index.ml +++ b/helm/software/components/ng_paramodulation/index.ml @@ -44,10 +44,10 @@ module Index(B : Orderings.Blob) = struct let path_string_of = let rec aux arity = function | Terms.Leaf a -> [Constant (a, arity)] - | Terms.Var i -> assert (arity = 0); [Variable] + | Terms.Var i -> (* assert (arity = 0); *) [Variable] + (* FIXME : should this be allowed or not ? | Terms.Node (Terms.Var _::_) -> - (* FIXME : should this be allowed or not ? *) - assert false + assert false *) | Terms.Node ([] | [ _ ] ) -> assert false | Terms.Node (Terms.Node _::_) -> assert false | Terms.Node (hd::tl) -> @@ -81,27 +81,33 @@ 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 + + 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