]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/orderings.ml
Initial implementation of statuses using objects in place of nested records.
[helm.git] / helm / software / components / ng_paramodulation / orderings.ml
index 7c8a80995d697479fa9d15540fa84fc39433d5aa..51b48a4c32951f4fc7c9cc9ea2a9ca18a0df5ab9 100644 (file)
@@ -49,12 +49,12 @@ module Orderings (B : Terms.Blob) = struct
     (w, List.sort compare l) (* from the smallest meta to the bigest *)
   ;;
   
-  let compute_unit_clause_weight = 
+  let compute_unit_clause_weight (_,l, _, _) 
     let weight_of_polynomial w m =
       let factor = 2 in      
       w + factor * List.fold_left (fun acc (_,occ) -> acc+occ) 0 m
     in
-    function
+    match l with
     | Terms.Predicate t -> 
         let w, m = weight_of_term t in 
         weight_of_polynomial w m
@@ -117,6 +117,11 @@ module Orderings (B : Terms.Blob) = struct
    * if head_only=true then it is not >>> but helps case 2 of 3.14 p 39 *)
   let rec aux_ordering ?(head_only=false) t1 t2 =
     match t1, t2 with
+    (* We want to discard any identity equality. *
+     * If we give back XEQ, no inference rule    *
+     * will be applied on this equality          *)
+    | Terms.Var i, Terms.Var j when i = j ->
+       XEQ
     (* 1. *)
     | Terms.Var _, _
     | _, Terms.Var _ -> XINCOMPARABLE