]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/paramodulation/utils.ml
removed first Cic.term from type equality, added an int (weight of the equality)
[helm.git] / helm / ocaml / paramodulation / utils.ml
index f2c475799cf818e2aebec504efd2af369823d53e..42703045d0019616b041af03fd1031d02ab66f4f 100644 (file)
@@ -7,8 +7,8 @@ let print_metasenv metasenv =
 ;;
 
 
-let print_subst subst =
-  String.concat "\n"
+let print_subst ?(prefix="\n") subst =
+  String.concat prefix
     (List.map
        (fun (i, (c, t, ty)) ->
           Printf.sprintf "?%d -> %s : %s" i
@@ -83,6 +83,12 @@ let weight_of_term ?(consider_metas=true) term =
 ;;
 
 
+let compute_equality_weight ty left right =
+  let weight_of t = fst (weight_of_term ~consider_metas:false t) in
+  (weight_of ty) + (weight_of left) + (weight_of right)
+;;
+
+
 (* returns a "normalized" version of the polynomial weight wl (with type
  * weight list), i.e. a list sorted ascending by meta number,
  * from 0 to maxmeta. wl must be sorted descending by meta number. Example: