]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/nCicBlob.ml
Generalized initialization of eqP.
[helm.git] / helm / software / components / ng_paramodulation / nCicBlob.ml
index 09399b3261b2d634352c54cc63b95614b898fb0b..b02a1ebc0b4cadb1614a44f46971d601ccc6170b 100644 (file)
 
 (* $Id: terms.mli 9822 2009-06-03 15:37:06Z tassi $ *)
 
+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/peq.ind" in
+  let ref = NReference.reference_of_spec uri (NReference.Ind(true,0,2)) in
+    NCic.Const ref
+
+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
@@ -18,7 +40,8 @@ module type NCicContext =
     val context : NCic.context
   end
 
-module NCicBlob(C : NCicContext) : Terms.Blob with type t = NCic.term = struct
+module NCicBlob(C : NCicContext) : Terms.Blob 
+with type t = NCic.term and type input = NCic.term = struct
 
   type t = NCic.term
 
@@ -26,7 +49,7 @@ module NCicBlob(C : NCicContext) : Terms.Blob with type t = NCic.term = struct
 
   let rec compare x y = 
     match x,y with
-    | NCic.Rel i, NCic.Rel j -> i-j
+    | NCic.Rel i, NCic.Rel j -> j-i
     | NCic.Meta (i,_), NCic.Meta (j,_) -> i-j
     | NCic.Const r1, NCic.Const r2 -> NReference.compare r1 r2
     | NCic.Appl l1, NCic.Appl l2 -> FoUtils.lexicograph compare l1 l2
@@ -47,6 +70,8 @@ module NCicBlob(C : NCicContext) : Terms.Blob with type t = NCic.term = struct
   let pp t = 
     NCicPp.ppterm ~context:C.context ~metasenv:C.metasenv ~subst:C.subst t;;
 
+  type input = NCic.term
+
   let rec embed = function
     | NCic.Meta (i,_) -> Terms.Var i, [i]
     | NCic.Appl l ->
@@ -74,15 +99,8 @@ module NCicBlob(C : NCicContext) : Terms.Blob with type t = NCic.term = struct
     let sty = embed sty in
     proof, sty
   ;;
-
-  let eqP = 
-    let r = 
-      OCic2NCic.reference_of_oxuri 
-       (UriManager.uri_of_string 
-         "cic:/matita/logic/equality/eq.ind#xpointer(1/1)")
-    in
-    NCic.Const r
+  
+  let eqP = (!eqPref)()
   ;;
 
-
  end