]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/metadata/metadataTypes.ml
new metadataTypes interface (with ownerize function)
[helm.git] / helm / ocaml / metadata / metadataTypes.ml
index 719ba508c1ae37d5e40f364939c4dec35fe8658a..b52f522468584789df867f3cc4124c6cd897f50c 100644 (file)
@@ -63,11 +63,42 @@ let constr_of_metadata: metadata -> constr = function
   | `Rel pos -> `Rel [pos]
   | `Obj (uri, pos) -> `Obj (uri, [pos])
 
-let sort_tbl = "refSort"
-let rel_tbl = "refRel"
-let obj_tbl = "refObj"
-let owners_tbl = "owners"
-let conclno_tbl = "no_inconcl_aux"
-let conclno_hyp_tbl = "no_concl_hyp"
-let name_tbl = "objectName"
+  (** the name of the tables in the DB *)
+let sort_tbl_original = "refSort"
+let rel_tbl_original = "refRel"
+let obj_tbl_original = "refObj"
+let owners_tbl_original = "owners"
+let conclno_tbl_original = "no_inconcl_aux"
+let conclno_hyp_tbl_original = "no_concl_hyp"
+let name_tbl_original = "objectName"
+
+  (** the names currently used *)
+let sort_tbl_real = ref sort_tbl_original
+let rel_tbl_real = ref rel_tbl_original
+let obj_tbl_real = ref obj_tbl_original
+let owners_tbl_real = ref owners_tbl_original
+let conclno_tbl_real = ref conclno_tbl_original
+let conclno_hyp_tbl_real = ref conclno_hyp_tbl_original
+let name_tbl_real = ref name_tbl_original 
+
+  (** the exported symbols *)
+let sort_tbl () = ! sort_tbl_real ;; 
+let rel_tbl () = ! rel_tbl_real ;; 
+let obj_tbl () = ! obj_tbl_real ;; 
+let owners_tbl () = ! owners_tbl_real ;; 
+let conclno_tbl () = ! conclno_tbl_real ;; 
+let conclno_hyp_tbl () = ! conclno_hyp_tbl_real ;; 
+let name_tbl () = ! name_tbl_real ;; 
+
+  (** to use the owned tables *)
+let ownerize_tables owner =
+  sort_tbl_real := ( sort_tbl_original ^ "_" ^ owner) ;
+  rel_tbl_real := ( rel_tbl_original ^ "_" ^ owner) ;
+  obj_tbl_real := ( obj_tbl_original ^ "_" ^ owner) ;
+  owners_tbl_real := ( owners_tbl_original ^ "_" ^ owner) ;
+  conclno_tbl_real := ( conclno_tbl_original ^ "_" ^ owner) ;
+  conclno_hyp_tbl_real := ( conclno_hyp_tbl_original ^ "_" ^ owner) ;
+  name_tbl_real := ( name_tbl_original ^ "_" ^ owner) 
+;;
+