]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/paramodulation/utils.ml
version 0.7.1
[helm.git] / helm / ocaml / paramodulation / utils.ml
index 52d99327e8b5d284c143f57f864027026aa71b53..d6454f2027d4799fdf2dd49bf1ade2bdd685f24d 100644 (file)
@@ -83,6 +83,19 @@ let weight_of_term ?(consider_metas=true) term =
 ;;
 
 
+let compute_equality_weight ty left right =
+  let metasw = ref 0 in
+  let weight_of t =
+    let w, m = (weight_of_term ~consider_metas:true(* false *) t) in
+(*     let mw = List.fold_left (fun mw (_, c) -> mw + 2 * c) 0 m in *)
+(*     metasw := !metasw + mw; *)
+    metasw := !metasw + (2 * (List.length m));
+    w
+  in
+  (weight_of ty) + (weight_of left) + (weight_of right) + !metasw
+;;
+
+
 (* 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: