]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/foSubst.ml
Rewrote the main loop for paramodulation
[helm.git] / helm / software / components / ng_paramodulation / foSubst.ml
index 92d6aba25a7ef99e6b24e0d39e187c84737761e0..6154306b5e1d9959fc5ee7ec2d0facb51d80f119 100644 (file)
@@ -9,7 +9,7 @@
      \ /   This software is distributed as is, NO WARRANTY.     
       V_______________________________________________________________ *)
 
-module Subst (B : Terms.Blob) = struct
+(* module Subst (B : Terms.Blob) = struct *)
   
   let id_subst = [];;
   
@@ -36,7 +36,16 @@ module Subst (B : Terms.Blob) = struct
       varlist
   ;;
 
-  let apply_subst = assert false;;
-  let concat = assert false
+  let rec apply_subst subst = function
+    | (Terms.Leaf _) as t -> t
+    | Terms.Var i -> 
+        (match lookup_subst i subst with
+        | Terms.Node _ as t -> apply_subst subst t
+        | t -> t)
+    | (Terms.Node l) ->
+       Terms.Node (List.map (fun t -> apply_subst subst t) l)
+;;
+
+  let concat x y = x @ y;;
   
-end
+(* end *)