X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fcomponents%2Fng_paramodulation%2FnCicBlob.ml;h=9ca541a65ca7afa4a48cfad6c7ee594cc9a5cbf0;hb=4154281937451b96f89f7b2c5d098193448c240f;hp=b9314a20317203d127413454acc13727d7c8616a;hpb=894d518aa760c9f816ddb0dc2b3fa88e1fe20a94;p=helm.git diff --git a/matita/components/ng_paramodulation/nCicBlob.ml b/matita/components/ng_paramodulation/nCicBlob.ml index b9314a203..9ca541a65 100644 --- a/matita/components/ng_paramodulation/nCicBlob.ml +++ b/matita/components/ng_paramodulation/nCicBlob.ml @@ -45,19 +45,26 @@ with type t = NCic.term and type input = NCic.term = struct type t = NCic.term - let eq x y = x = y;; - (* NCicReduction.alpha_eq C.metasenv C.subst C.context x y;; *) + let eq x y = + (* CSC: NCicPp.status is the best I can put here *) + x = y || + NCicReduction.alpha_eq (new NCicPp.status) C.metasenv C.subst C.context x y;; let height_of_ref = function | NReference.Def h -> h | NReference.Fix(_,_,h) -> h | _ -> 0 + external old_hash_param : + int -> int -> 'a -> int = "caml_hash_univ_param" (*[@@noalloc]*);; + + let old_hash = old_hash_param 10 100;; + let compare_refs (NReference.Ref (u1,r1)) (NReference.Ref (u2,r2)) = let x = height_of_ref r2 - height_of_ref r1 in if x = 0 then - Hashtbl.hash (NUri.string_of_uri u1,r1) - - Hashtbl.hash (NUri.string_of_uri u2,r2) + old_hash (NUri.string_of_uri u1,r1) - + old_hash (NUri.string_of_uri u2,r2) else x let rec compare x y = @@ -73,15 +80,13 @@ with type t = NCic.term and type input = NCic.term = struct | ( NCic.Meta _ | NCic.Appl _ ), NCic.Const _ -> 1 | NCic.Appl _, NCic.Meta _ -> ~-1 | NCic.Meta _, NCic.Appl _ -> 1 - | _ -> Pervasives.compare x y + | _ -> Stdlib.compare x y (* was assert false, but why? *) ;; let compare x y = - (* CSC: NCicPp.status is the best I can put here *) - if NCicReduction.alpha_eq (new NCicPp.status) [] [] [] x y then 0 - (* if x = y then 0 *) + if eq x y then 0 else compare x y ;;