]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/tactics/paramodulation/utils.ml
Very experimental commit: the type of the source is now required in LetIns
[helm.git] / helm / software / components / tactics / paramodulation / utils.ml
index 81c84af35acf54b90e15429d58e0ea34a616bdb8..affd4897f5b7a351906554746b4debc93accb3c3 100644 (file)
@@ -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
@@ -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