X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Ftactics%2Fparamodulation%2Futils.ml;h=affd4897f5b7a351906554746b4debc93accb3c3;hb=cc23f034c9419186602d9250456241f2eba90d7c;hp=eabf24353395f443beea557563d0daa4a4a7273c;hpb=b0bbbe6ec20a0afa145c1e6d92530105d9d4d7e3;p=helm.git diff --git a/helm/software/components/tactics/paramodulation/utils.ml b/helm/software/components/tactics/paramodulation/utils.ml index eabf24353..affd4897f 100644 --- a/helm/software/components/tactics/paramodulation/utils.ml +++ b/helm/software/components/tactics/paramodulation/utils.ml @@ -98,6 +98,12 @@ let metas_of_term term = | C.Meta _ as t -> TermSet.singleton t | C.Appl l -> List.fold_left (fun res t -> TermSet.union res (aux t)) TermSet.empty l + | C.Lambda(n,s,t) -> + TermSet.union (aux s) (aux t) + | C.Prod(n,s,t) -> + TermSet.union (aux s) (aux t) + | C.LetIn(n,s,ty,t) -> + TermSet.union (aux s) (TermSet.union (aux ty) (aux t)) | t -> TermSet.empty (* TODO: maybe add other cases? *) in aux term @@ -259,7 +265,7 @@ let weight_of_term ?(consider_metas=true) ?(count_metas_occurrences=false) term | C.Cast (t1, t2) | C.Lambda (_, t1, t2) | C.Prod (_, t1, t2) - | C.LetIn (_, t1, t2) -> + | C.LetIn (_, t1, _, t2) -> let w1 = aux t1 in let w2 = aux t2 in w1 + w2 + 1 @@ -346,7 +352,7 @@ let compute_equality_weight (ty,left,right,o) = let compute_equality_weight e = let w = compute_equality_weight e in - let d = distance !goal_symbols (symbols_of_eq e) in + let d = 0 in (* distance !goal_symbols (symbols_of_eq e) in *) (* prerr_endline (Printf.sprintf "dist %s --- %s === %d" (String.concat ", " (List.map (CicPp.ppterm) (TermSet.elements @@ -356,7 +362,7 @@ let compute_equality_weight e = d ); *) - w + d + w + d ;; (* old @@ -747,8 +753,7 @@ let guarded_simpl ?(debug=false) context t = if t = t' then t else begin let simpl_order = !compare_terms t t' in - if debug then - prerr_endline ("comparing "^(CicPp.ppterm t)^(CicPp.ppterm t')); + debug_print (lazy ("comparing "^(CicPp.ppterm t)^(CicPp.ppterm t'))); if simpl_order = Gt then (if debug then prerr_endline "GT";t') else (if debug then prerr_endline "NO_GT";t) end