X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Fstats.ml;h=a281ddc867a12ee8a21ab8f1ae17f629cf345e87;hb=18beb4339a683c5b6243673b91da878a208b36e3;hp=90d6ccf0b8197b9f25276130be3b27dd0594f112;hpb=db7f6d6b32515c091e0f338dd4903624f35f27ac;p=helm.git diff --git a/helm/software/components/ng_paramodulation/stats.ml b/helm/software/components/ng_paramodulation/stats.ml index 90d6ccf0b..a281ddc86 100644 --- a/helm/software/components/ng_paramodulation/stats.ml +++ b/helm/software/components/ng_paramodulation/stats.ml @@ -55,10 +55,32 @@ module Stats (B : Terms.Blob) = | Terms.Predicate _ -> assert false; ;; + let goal_pos t goal = + let rec aux path = function + | Terms.Var _ -> [] + | Terms.Leaf x -> + if B.eq t x then path else [] + | Terms.Node l -> + match + HExtlib.list_findopt + (fun x i -> + let p = aux (i::path) x in + if p = [] then None else Some p) + l + with + | None -> [] + | Some p -> p + in + aux [] + (match goal with + | _,Terms.Equation (l,r,ty,_),_,_ -> Terms.Node [ Terms.Leaf B.eqP; ty; l; r ] + | _,Terms.Predicate p,_,_ -> p) + ;; + let parse_symbols l goal = let res = parse_symbols (parse_symbols SymbMap.empty [goal]) l in SymbMap.fold (fun t (occ,ar) acc -> - (t,occ,ar,goal_occ_nbr t goal)::acc) res [] + (t,occ,ar,goal_occ_nbr t goal,goal_pos t goal)::acc) res [] ;; let rec dependencies op clauses acc =