X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2FfoSubst.ml;h=aab2401684238b0d3e59ed3bc9c141c846a776d0;hb=95adf6dc8e29a71adc34e71eafe3f427990126e0;hp=5cb84e1c938d1ff20b359bc738f7f0b713cfe87f;hpb=eca915d2656084f1e58149a476a2d305758b00f9;p=helm.git diff --git a/helm/software/components/ng_paramodulation/foSubst.ml b/helm/software/components/ng_paramodulation/foSubst.ml index 5cb84e1c9..aab240168 100644 --- a/helm/software/components/ng_paramodulation/foSubst.ml +++ b/helm/software/components/ng_paramodulation/foSubst.ml @@ -36,6 +36,17 @@ varlist ;; + let rec reloc_subst subst = function + | (Terms.Leaf _) as t -> t + | Terms.Var i -> + (try + List.assoc i subst + with + Not_found -> assert false) + | (Terms.Node l) -> + Terms.Node (List.map (fun t -> reloc_subst subst t) l) +;; + let rec apply_subst subst = function | (Terms.Leaf _) as t -> t | Terms.Var i -> @@ -46,6 +57,10 @@ Terms.Node (List.map (fun t -> apply_subst subst t) l) ;; + let flat subst = + List.map (fun (x,t) -> (x, apply_subst subst t)) subst +;; + let concat x y = x @ y;; (* end *)