X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fng_paramodulation%2FnCicBlob.ml;h=be5158452065511f0169d3c9f7b2b38b36e9ba82;hb=578ba04e1a0812f538729fbc02ea38d2cfd0ed3e;hp=fb9ee62457b2c2e20257ac08368ac4f09fffa6f1;hpb=2c01ff6094173915e7023076ea48b5804dca7778;p=helm.git diff --git a/matita/components/ng_paramodulation/nCicBlob.ml b/matita/components/ng_paramodulation/nCicBlob.ml index fb9ee6245..be5158452 100644 --- a/matita/components/ng_paramodulation/nCicBlob.ml +++ b/matita/components/ng_paramodulation/nCicBlob.ml @@ -14,8 +14,8 @@ let eqPref = ref (fun _ -> assert false);; let set_eqP t = eqPref := fun _ -> t;; -let default_eqP() = - let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/eq.ind" in +let default_eqP() = + let uri = NUri.uri_of_string "cic:/matita/basics/logic/eq.ind" in let ref = NReference.reference_of_spec uri (NReference.Ind(true,0,2)) in NCic.Const ref ;; @@ -33,18 +33,6 @@ let setoid_eq = let set_default_eqP() = eqPref := default_eqP -let set_reference_of_oxuri f = - let eqnew = function - _ -> - let r = f(UriManager.uri_of_string - "cic:/matita/logic/equality/eq.ind#xpointer(1/1)") - in - NCic.Const r - in - eqPref := eqnew -;; - - module type NCicContext = sig val metasenv : NCic.metasenv @@ -57,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 = @@ -91,8 +86,7 @@ with type t = NCic.term and type input = NCic.term = struct ;; let compare x y = - if NCicReduction.alpha_eq [] [] [] x y then 0 - (* if x = y then 0 *) + if eq x y then 0 else compare x y ;; @@ -109,7 +103,9 @@ with type t = NCic.term and type input = NCic.term = struct | _ -> None let pp t = - NCicPp.ppterm ~context:C.context ~metasenv:C.metasenv ~subst:C.subst t;; + (* CSC: NCicPp.status is the best I can put here *) + (new NCicPp.status)#ppterm ~context:C.context + ~metasenv:C.metasenv ~subst:C.subst t;; type input = NCic.term @@ -130,8 +126,9 @@ with type t = NCic.term and type input = NCic.term = struct let saturate t ty = let sty, _, args = - NCicMetaSubst.saturate ~delta:0 C.metasenv C.subst C.context - ty 0 + (* CSC: NCicPp.status is the best I can put here *) + NCicMetaSubst.saturate (new NCicPp.status) ~delta:0 C.metasenv C.subst + C.context ty 0 in let proof = if args = [] then Terms.Leaf t