]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic/libraryObjects.ml
/me finished reviewing ...
[helm.git] / helm / ocaml / cic / libraryObjects.ml
index 6a1e8a122c0c42fb81977d7911061c83099cec5b..adbc219cc3fd72771b314a3e61eeea85a98cfc52 100644 (file)
  * http://helm.cs.unibo.it/
  *)
 
+(* $Id$ *)
+
 (**** TABLES ****)
 
+let default_eq_URIs =
+ [HelmLibraryObjects.Logic.eq_URI,
+      HelmLibraryObjects.Logic.sym_eq_URI,
+      HelmLibraryObjects.Logic.trans_eq_URI,
+      HelmLibraryObjects.Logic.eq_ind_URI,
+      HelmLibraryObjects.Logic.eq_ind_r_URI];;
+
+let default_true_URIs = [HelmLibraryObjects.Logic.true_URI]
+let default_false_URIs = [HelmLibraryObjects.Logic.false_URI]
+let default_absurd_URIs = [HelmLibraryObjects.Logic.absurd_URI]
+
 (* eq, sym_eq, trans_eq, eq_ind, eq_ind_R *)
 let eq_URIs_ref =
  ref [HelmLibraryObjects.Logic.eq_URI,
@@ -52,7 +65,7 @@ let insert_unique e extract l =
   e :: l'
 
 let set_default what l =
- match what,l with
 match what,l with
     "equality",[eq_URI;sym_eq_URI;trans_eq_URI;eq_ind_URI;eq_ind_r_URI] ->
       eq_URIs_ref :=
        insert_unique (eq_URI,sym_eq_URI,trans_eq_URI,eq_ind_URI,eq_ind_r_URI)
@@ -60,11 +73,17 @@ let set_default what l =
   | "true",[true_URI] ->
       true_URIs_ref := insert_unique true_URI (fun x -> x) !true_URIs_ref
   | "false",[false_URI] ->
-      true_URIs_ref := insert_unique false_URI (fun x -> x) !false_URIs_ref
+      false_URIs_ref := insert_unique false_URI (fun x -> x) !false_URIs_ref
   | "absurd",[absurd_URI] ->
       absurd_URIs_ref := insert_unique absurd_URI (fun x -> x) !absurd_URIs_ref
   | _,_ -> raise NotRecognized
 
+let reset_defaults () =
+  eq_URIs_ref := default_eq_URIs;
+  true_URIs_ref := default_true_URIs;
+  false_URIs_ref := default_false_URIs;
+  absurd_URIs_ref := default_absurd_URIs
+
 (**** LOOKUP FUNCTIONS ****)
 
 let eq_URI () = let eq,_,_,_,_ = List.hd !eq_URIs_ref in eq
@@ -72,6 +91,12 @@ let eq_URI () = let eq,_,_,_,_ = List.hd !eq_URIs_ref in eq
 let is_eq_URI uri =
  List.exists (fun (eq,_,_,_,_) -> UriManager.eq eq uri) !eq_URIs_ref
 
+let is_eq_ind_URI uri =
+ List.exists (fun (_,_,_,eq_ind,_) -> UriManager.eq eq_ind uri) !eq_URIs_ref
+
+let is_eq_ind_r_URI uri =
+ List.exists (fun (_,_,_,_,eq_ind_r) -> UriManager.eq eq_ind_r uri) !eq_URIs_ref
+
 let sym_eq_URI ~eq:uri =
  try
   let _,x,_,_,_ = List.find (fun eq,_,_,_,_ -> UriManager.eq eq uri) !eq_URIs_ref in x