]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/index.ml
Removed dead code
[helm.git] / helm / software / components / ng_paramodulation / index.ml
index d07fba8a44a78b180a5578912e03c1e43c0080f0..4db4584a451494caf00bff8166a3a37f96d678dc 100644 (file)
 
 (* $Id$ *)
 
-module Index(B : Terms.Blob) = struct
-  module U = Terms.Utils(B)
+module Index(B : Orderings.Blob) = struct
+  module U = FoUtils.Utils(B)
+  module Unif = FoUnif.Founif(B)
+  module Pp = Pp.Pp(B)
 
   module ClauseOT =
     struct 
@@ -43,9 +45,11 @@ module Index(B : Terms.Blob) = struct
         let rec aux arity = function
           | Terms.Leaf a -> [Constant (a, arity)]
           | Terms.Var i -> assert (arity = 0); [Variable]
-          | Terms.Node (Terms.Var _::_) -> assert false
+          | Terms.Node (Terms.Var _::_) ->
+             (* FIXME : should this be allowed or not ? *)
+             assert false
           | Terms.Node ([] | [ _ ] ) -> assert false
-          | Terms.Node (Terms.Node _::_) -> assert false
+          | Terms.Node (Terms.Node _::_) -> assert false             
           | Terms.Node (hd::tl) ->
               aux (List.length tl) hd @ List.flatten (List.map (aux 0) tl) 
         in 
@@ -76,5 +80,28 @@ module Index(B : Terms.Blob) = struct
       type data = ClauseSet.elt and 
       type dataset = ClauseSet.t
     = Make(FotermIndexable)(ClauseSet)
+  
+  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),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)
+    | (_,Terms.Equation (l,r,_,Terms.Invertible),vl,_) as c ->
+       DT.index t l (Terms.Left2Right, c)
+    | (_,Terms.Equation (_,r,_,Terms.Eq),_,_)  -> assert false
+    | (_,Terms.Predicate p,_,_) as c ->
+          DT.index t p (Terms.Nodir, c)
+  ;;
+
+  type active_set = B.t Terms.unit_clause list * DT.t
 
 end