]> matita.cs.unibo.it Git - helm.git/commitdiff
New module HMysql (to abstract over Mysql and make profiling easier).
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 23 Sep 2005 17:43:59 +0000 (17:43 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 23 Sep 2005 17:43:59 +0000 (17:43 +0000)
25 files changed:
helm/ocaml/cic_disambiguation/disambiguate.ml
helm/ocaml/cic_disambiguation/disambiguate.mli
helm/ocaml/cic_notation/grafiteAst.ml
helm/ocaml/extlib/.depend
helm/ocaml/extlib/Makefile
helm/ocaml/extlib/hMysql.ml [new file with mode: 0644]
helm/ocaml/extlib/hMysql.mli [new file with mode: 0644]
helm/ocaml/mathql_interpreter/mQIConn.ml
helm/ocaml/mathql_interpreter/mQIConn.mli
helm/ocaml/mathql_interpreter/mQIMySql.ml
helm/ocaml/mathql_interpreter/mQIMySql.mli
helm/ocaml/metadata/metadataConstraints.ml
helm/ocaml/metadata/metadataConstraints.mli
helm/ocaml/metadata/metadataDb.ml
helm/ocaml/metadata/metadataDb.mli
helm/ocaml/paramodulation/inference.ml
helm/ocaml/paramodulation/inference.mli
helm/ocaml/paramodulation/saturate_main.ml
helm/ocaml/tactics/autoTactic.ml
helm/ocaml/tactics/autoTactic.mli
helm/ocaml/tactics/eliminationTactics.mli
helm/ocaml/tactics/fwdSimplTactic.mli
helm/ocaml/tactics/metadataQuery.ml
helm/ocaml/tactics/metadataQuery.mli
helm/ocaml/tactics/tactics.mli

index 0679b9aee634f2805bf61dca4f694cb4a4e07efe..05a15691eb3d478e7e8a0e986babac1adb7640db 100644 (file)
@@ -631,7 +631,7 @@ module type Disambiguator =
 sig
   val disambiguate_term :
     ?fresh_instances:bool ->
-    dbd:Mysql.dbd ->
+    dbd:HMysql.dbd ->
     context:Cic.context ->
     metasenv:Cic.metasenv ->
     ?initial_ugraph:CicUniv.universe_graph -> 
@@ -646,7 +646,7 @@ sig
 
   val disambiguate_obj :
     ?fresh_instances:bool ->
-    dbd:Mysql.dbd ->
+    dbd:HMysql.dbd ->
     aliases:DisambiguateTypes.environment ->(* previous interpretation status *)
     universe:DisambiguateTypes.multiple_environment option ->
     uri:UriManager.uri option ->     (* required only for inductive types *)
index 1c6d4bbe7d3e3002462b237a7b6b93aa36a5e736..356b5e117274f570634e15167c07ad810d76d2d5 100644 (file)
@@ -39,7 +39,7 @@ sig
    * input AST will be ignored. Defaults to false. *)
   val disambiguate_term :
     ?fresh_instances:bool ->
-    dbd:Mysql.dbd ->
+    dbd:HMysql.dbd ->
     context:Cic.context ->
     metasenv:Cic.metasenv ->
     ?initial_ugraph:CicUniv.universe_graph -> 
@@ -55,7 +55,7 @@ sig
   (** @param fresh_instances as per disambiguate_term *)
   val disambiguate_obj :
     ?fresh_instances:bool ->
-    dbd:Mysql.dbd ->
+    dbd:HMysql.dbd ->
     aliases:DisambiguateTypes.environment ->(* previous interpretation status *)
     universe:DisambiguateTypes.multiple_environment option ->
     uri:UriManager.uri option ->     (* required only for inductive types *)
@@ -77,7 +77,7 @@ sig
     * choice from the user is needed to disambiguate the term
     * @raise Ambiguous_term for ambiguous term *)
   val disambiguate_string:
-    dbd:Mysql.dbd ->
+    dbd:HMysql.dbd ->
     ?context:Cic.context ->
     ?metasenv:Cic.metasenv ->
     ?initial_ugraph:CicUniv.universe_graph -> 
index f406c44a885d4870333c21b7dfc0e55cef24f803..45f7c1aea7882afbb31bf08374cc27d45dd5f1b1 100644 (file)
@@ -162,6 +162,17 @@ type ('term,'obj) command =
     (* DEBUGGING *)
   | Render of loc * UriManager.uri (* render library object *)
 
+let reash_uris =
+  function
+  | Default (loc, name, uris) ->
+      let uris =
+        List.map
+          (fun uri -> UriManager.uri_of_string (UriManager.string_of_uri uri))
+          uris
+      in
+      Default (loc, name, uris)
+  | cmd -> cmd
+
 type ('term, 'lazy_term, 'reduction, 'ident) tactical =
   | Tactic of loc * ('term, 'lazy_term, 'reduction, 'ident) tactic
   | Do of loc * int * ('term, 'lazy_term, 'reduction, 'ident) tactical
index cbb3fcdfe98e0015849f65bcd229188f6e536c7e..3ca72a4d90aee9787f40ba281d6f9b18d2d8008a 100644 (file)
@@ -1,2 +1,4 @@
 hExtlib.cmo: hExtlib.cmi 
 hExtlib.cmx: hExtlib.cmi 
+hMysql.cmo: hMysql.cmi 
+hMysql.cmx: hMysql.cmi 
index 6dccb5a906add59a7c125e9618798716d2425f06..7035415203dbe4f9d6bd453e9b4895fb3e8cad32 100644 (file)
@@ -1,9 +1,10 @@
 PACKAGE = extlib
-REQUIRES =
+REQUIRES = mysql
 PREDICATES =
 
 INTERFACE_FILES = \
-        hExtlib.mli
+        hExtlib.mli \
+        hMysql.mli
 IMPLEMENTATION_FILES = \
        $(INTERFACE_FILES:%.mli=%.ml)
 EXTRA_OBJECTS_TO_INSTALL =
diff --git a/helm/ocaml/extlib/hMysql.ml b/helm/ocaml/extlib/hMysql.ml
new file mode 100644 (file)
index 0000000..77d788e
--- /dev/null
@@ -0,0 +1,57 @@
+(* Copyright (C) 2000, HELM Team.
+ * 
+ * This file is part of HELM, an Hypertextual, Electronic
+ * Library of Mathematics, developed at the Computer Science
+ * Department, University of Bologna, Italy.
+ * 
+ * HELM is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * HELM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HELM; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * For details, see the HELM World-Wide-Web page,
+ * http://cs.unibo.it/helm/.
+ *)
+
+type dbd = Mysql.dbd
+type result = Mysql.result
+type error_code = Mysql.error_code
+
+let profiler = HExtlib.profile "mysql"
+
+let quick_connect ?host ?database ?port ?password ?user () =
+ profiler.HExtlib.profile
+  (Mysql.quick_connect ?host ?database ?port ?password ?user) ()
+
+let disconnect dbd =
+ profiler.HExtlib.profile Mysql.disconnect dbd
+
+let escape s =
+ profiler.HExtlib.profile Mysql.escape s
+
+let exec dbd s =
+ profiler.HExtlib.profile (Mysql.exec dbd) s
+
+let map res ~f =
+ let map f = Mysql.map res ~f in
+ profiler.HExtlib.profile map f
+
+let iter res ~f =
+ let iter f = Mysql.iter res ~f in
+ profiler.HExtlib.profile iter f
+
+let errno dbd =
+ profiler.HExtlib.profile Mysql.errno dbd
+
+let status dbd =
+ profiler.HExtlib.profile Mysql.status dbd
diff --git a/helm/ocaml/extlib/hMysql.mli b/helm/ocaml/extlib/hMysql.mli
new file mode 100644 (file)
index 0000000..df8ac0b
--- /dev/null
@@ -0,0 +1,48 @@
+(* Copyright (C) 2000, HELM Team.
+ * 
+ * This file is part of HELM, an Hypertextual, Electronic
+ * Library of Mathematics, developed at the Computer Science
+ * Department, University of Bologna, Italy.
+ * 
+ * HELM is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * HELM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HELM; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * For details, see the HELM World-Wide-Web page,
+ * http://cs.unibo.it/helm/.
+ *)
+
+type dbd
+type result
+
+(* the exceptions raised are from the Mysql module *)
+
+val quick_connect :
+  ?host:string ->
+  ?database:string ->
+  ?port:int -> ?password:string -> ?user:string -> unit -> dbd
+
+val disconnect : Mysql.dbd -> unit
+
+val escape: string -> string
+
+val exec: dbd -> string -> result
+
+val map : result -> f:(string option array -> 'a) -> 'a list
+
+val iter : result -> f:(string option array -> unit) -> unit
+
+val errno : dbd -> Mysql.error_code
+
+val status : dbd -> Mysql.status
index d4a0b067fd5c336fcdee15b6124fa13fe1bb9150..aaf16fac4c0c692c037eaa793b58c80a7c734622 100644 (file)
@@ -26,7 +26,7 @@
 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
  *)
 
-type connection = MySQL_C    of Mysql.dbd
+type connection = MySQL_C    of HMysql.dbd
                 | Postgres_C of Postgres.connection
                | No_C
                   
index 94ea83f76148895ad7db7e6f90dee400e58b9bb3..35c8b3ef002087b54a86de8c5ddfbaa99261cfde 100644 (file)
@@ -26,7 +26,7 @@
 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
  *)
 
-type connection = MySQL_C    of Mysql.dbd
+type connection = MySQL_C    of HMysql.dbd
                 | Postgres_C of Postgres.connection
                | No_C
                   
index 4a68c93987a1c856af9c237ae938e20a7a76a3ed..46f350e210dc25169ccb5c7f49e018d9ef520c70 100644 (file)
@@ -38,10 +38,10 @@ let init () =
     HR.get_opt HR.get_int "mathql_interpreter.mysql_connection.port" in
    let password =
     HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.password" in
-   try Mysql.quick_connect ?host ?database ?user ?port ?password ()
+   try HMysql.quick_connect ?host ?database ?user ?port ?password ()
    with _ -> raise (Failure "mqi_connecion")
 
-let close c = Mysql.disconnect c
+let close c = HMysql.disconnect c
 
 let quote s =
    let rec quote_aux s =
@@ -56,7 +56,7 @@ let quote s =
 let exec (c, out) q = 
    let g = function None -> "" | Some v -> v in
    let f a = List.map g (Array.to_list a) in
-   out q; Mysql.map ~f:f (Mysql.exec c q)
+   out q; HMysql.map ~f:f (Mysql.exec c q)
 
 let exec c table cols ct cfl =
    let rec iter f last sep = function
index 36e8f18d904efb0aaff0f6e6142ebd709891ca40..8afaf401ddde2d0f9762fe5fee7d7b4de7ca91da 100644 (file)
 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
  *)
 
-val init  : unit -> Mysql.dbd
+val init  : unit -> HMysql.dbd
 
-val close : Mysql.dbd -> unit
+val close : HMysql.dbd -> unit
 
-val exec  : Mysql.dbd * (MQITypes.query -> unit) ->
+val exec  : HMysql.dbd * (MQITypes.query -> unit) ->
             MQITypes.table -> MQITypes.columns ->
             string MQITypes.con_true -> string MQITypes.con_false -> 
            MQITypes.result
index d18663fadcaea3998f1267915967827c0ce83611..6431513ff3220f4ebdab16cb95d8c6bf82f5c611 100644 (file)
@@ -151,7 +151,7 @@ let add_constraint ?(start=0) ?(tables=default_tables) (n,from,where) metadata =
       in
       ((n+2), from, where)
 
-let exec ~(dbd:Mysql.dbd) ?rating (n,from,where) =
+let exec ~(dbd:HMysql.dbd) ?rating (n,from,where) =
   let from = String.concat ", " from in
   let where = String.concat " and " where in
   let query =
@@ -164,12 +164,12 @@ let exec ~(dbd:Mysql.dbd) ?rating (n,from,where) =
           from where 
   in
 (*  prerr_endline query; *)
-  let result = Mysql.exec dbd query in
-  Mysql.map result
+  let result = HMysql.exec dbd query in
+  HMysql.map result
     (fun row -> match row.(0) with Some s -> UriManager.uri_of_string s | _ -> assert false)
 
 
-let at_least ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff ?rating tables
+let at_least ~(dbd:HMysql.dbd) ?concl_card ?full_card ?diff ?rating tables
   (metadata: MetadataTypes.constr list)
 =
   let obj_tbl,rel_tbl,sort_tbl, count_tbl = tables 
@@ -185,7 +185,7 @@ let at_least ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff ?rating tables
   exec ~dbd ?rating (n,from,where)
     
 let at_least  
-  ~(dbd:Mysql.dbd) ?concl_card ?full_card ?diff ?rating
+  ~(dbd:HMysql.dbd) ?concl_card ?full_card ?diff ?rating
       (metadata: MetadataTypes.constr list)
 =
   if are_tables_ownerized () then
@@ -432,7 +432,7 @@ let must_of_prefix ?(where = `Conclusion) m s =
 
 let escape = Str.global_replace (Str.regexp_string "\'") "\\'"
 
-let get_constants (dbd:Mysql.dbd) ~where uri =
+let get_constants (dbd:HMysql.dbd) ~where uri =
   let uri = escape (UriManager.string_of_uri uri) in
   let positions =
     match where with
@@ -452,16 +452,16 @@ let get_constants (dbd:Mysql.dbd) ~where uri =
       MetadataTypes.library_obj_tbl uri pos_predicate
       
   in
-  let result = Mysql.exec dbd query in
+  let result = HMysql.exec dbd query in
   let set = ref UriManagerSet.empty in
-  Mysql.iter result
+  HMysql.iter result
     (fun col ->
       match col.(0) with
       | Some uri -> set := UriManagerSet.add (UriManager.uri_of_string uri) !set
       | _ -> assert false);
   !set
 
-let at_most ~(dbd:Mysql.dbd) ?(where = `Conclusion) only u =
+let at_most ~(dbd:HMysql.dbd) ?(where = `Conclusion) only u =
   let inconcl = get_constants dbd ~where u in
   UriManagerSet.subset inconcl only
 
@@ -479,7 +479,7 @@ let myspeciallist =
    0,UriManager.uri_of_string "cic:/Coq/Init/Logic/f_equal3.con"]
 
 
-let compute_exactly ~(dbd:Mysql.dbd) ?(facts=false) ~where main prefixes =
+let compute_exactly ~(dbd:HMysql.dbd) ?(facts=false) ~where main prefixes =
   List.concat
     (List.map 
       (fun (m,s) -> 
@@ -510,7 +510,7 @@ let compute_exactly ~(dbd:Mysql.dbd) ?(facts=false) ~where main prefixes =
 
   (* critical value reached, fallback to "only" constraints *)
 
-let compute_with_only ~(dbd:Mysql.dbd) ?(facts=false) ?(where = `Conclusion) 
+let compute_with_only ~(dbd:HMysql.dbd) ?(facts=false) ?(where = `Conclusion) 
   main prefixes constants
 =
   let max_prefix_length = 
@@ -545,7 +545,7 @@ let compute_with_only ~(dbd:Mysql.dbd) ?(facts=false) ?(where = `Conclusion)
 
   (* real match query implementation *)
 
-let cmatch ~(dbd:Mysql.dbd)  ?(facts=false) t =
+let cmatch ~(dbd:HMysql.dbd)  ?(facts=false) t =
   let (main, constants) = signature_of t in
   match main with
   | None -> []
@@ -597,7 +597,7 @@ let power consts =
 
 type where = [ `Conclusion | `Statement ]
 
-let sigmatch ~(dbd:Mysql.dbd) ?(facts=false) ?(where = `Conclusion)
+let sigmatch ~(dbd:HMysql.dbd) ?(facts=false) ?(where = `Conclusion)
  (main, constants)
 =
  let main,types =
index 4f84ce9a73814485abb0a78dc7c0dcbae2a474f4..63757ae47c772861dba3e141051c6dfa0c2c5b38 100644 (file)
@@ -36,17 +36,17 @@ type term_signature = (UriManager.uri * UriManager.uri list) option * UriManager
 
   (** @return sorted list of theorem URIs, first URIs in the least have higher
   * relevance *)
-val cmatch: dbd:Mysql.dbd -> ?facts:bool -> Cic.term -> UriManager.uri list
+val cmatch: dbd:HMysql.dbd -> ?facts:bool -> Cic.term -> UriManager.uri list
 
   (** as cmatch, but returned list is not sorted but rather tagged with
   * relevance information: higher the tag, higher the relevance *)
-val cmatch': dbd:Mysql.dbd -> ?facts:bool -> Cic.term -> (int * UriManager.uri) list
+val cmatch': dbd:HMysql.dbd -> ?facts:bool -> Cic.term -> (int * UriManager.uri) list
 
 type where = [ `Conclusion | `Statement ] (** signature matching extent *)
 
   (** @param where defaults to `Conclusion *)
 val sigmatch:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?facts:bool ->
   ?where:where -> 
   term_signature ->
@@ -78,7 +78,7 @@ val add_constraint:
   * @return list of URI satisfying given constraints *)
 
 val at_least:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?concl_card:cardinality_condition ->
   ?full_card:cardinality_condition ->
   ?diff:cardinality_condition ->
@@ -88,7 +88,7 @@ val at_least:
 
   (** @param where defaults to `Conclusion *)
 val at_most:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?where:where -> UriManagerSet.t ->
     (UriManager.uri -> bool)
 
@@ -101,7 +101,7 @@ val add_all_constr:
   int * string list * string list
 
 val exec: 
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?rating:[ `Hits ] -> 
   int * string list * string list -> 
   UriManager.uri list
index 8d963bfc47cb75a8f0f880a530da3fc6e66da8c9..c5fbb79a832ac642a3584d93a270fd931140c94b 100644 (file)
@@ -55,21 +55,21 @@ let execute_insert dbd uri (sort_cols, rel_cols, obj_cols) =
     let query_sort = 
       sprintf "INSERT %s VALUES %s;" (sort_tbl ()) (String.concat "," sort_tuples) 
     in
-    ignore (Mysql.exec dbd query_sort)
+    ignore (HMysql.exec dbd query_sort)
     end;
   if rel_tuples <> [] then
     begin
     let query_rel = 
       sprintf "INSERT %s VALUES %s;" (rel_tbl ()) (String.concat "," rel_tuples) 
     in
-    ignore (Mysql.exec dbd query_rel)
+    ignore (HMysql.exec dbd query_rel)
     end;
   if obj_tuples <> [] then
     begin
     let query_obj = 
       sprintf "INSERT %s VALUES %s;" (obj_tbl ()) (String.concat "," obj_tuples) 
     in
-    ignore (Mysql.exec dbd query_obj)
+    ignore (HMysql.exec dbd query_obj)
     end
   
     
@@ -109,7 +109,7 @@ let insert_const_no ~dbd l =
  let insert =
   sprintf "INSERT INTO %s VALUES %s" (count_tbl ()) (String.concat "," data)
  in
-  ignore (Mysql.exec dbd insert)
+  ignore (HMysql.exec dbd insert)
   
 let insert_name ~dbd l =
  let data =
@@ -120,7 +120,7 @@ let insert_name ~dbd l =
  let insert =
   sprintf "INSERT INTO %s VALUES %s" (name_tbl ()) (String.concat "," data)
  in
-  ignore (Mysql.exec dbd insert)
+  ignore (HMysql.exec dbd insert)
 
 type columns =
   MetadataPp.t list list * MetadataPp.t list list * MetadataPp.t list list
@@ -136,7 +136,7 @@ let eventually_analyze dbd =
     begin
       let analyze t = "OPTIMIZE TABLE " ^ t ^ ";" in
       List.iter 
-        (fun table -> ignore (Mysql.exec dbd (analyze table)))
+        (fun table -> ignore (HMysql.exec dbd (analyze table)))
         [name_tbl (); rel_tbl (); sort_tbl (); obj_tbl(); count_tbl()]
     end
   
@@ -157,11 +157,11 @@ let index_obj ~dbd ~uri =
 let tables_to_clean =
   [sort_tbl; rel_tbl; obj_tbl; name_tbl; count_tbl]
 
-let clean ~(dbd:Mysql.dbd) =
+let clean ~(dbd:HMysql.dbd) =
   let owned_uris =  (* list of uris in list-of-columns format *)
     let query = sprintf "SELECT source FROM %s" (name_tbl ()) in
-    let result = Mysql.exec dbd query in
-    let uris = Mysql.map result (fun cols ->
+    let result = HMysql.exec dbd query in
+    let uris = HMysql.map result (fun cols ->
       match cols.(0) with
       | Some src -> src
       | None -> assert false) in
@@ -173,7 +173,7 @@ let clean ~(dbd:Mysql.dbd) =
       sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\"" (tbl ()) s 
     in
     List.iter
-      (fun source_col -> ignore (Mysql.exec dbd (query source_col)))
+      (fun source_col -> ignore (HMysql.exec dbd (query source_col)))
       owned_uris
   in
   List.iter del_from tables_to_clean;
@@ -185,7 +185,7 @@ let unindex ~dbd ~uri =
     let query tbl =
       sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\"" (tbl ()) uri
     in
-    ignore (Mysql.exec dbd (query tbl))
+    ignore (HMysql.exec dbd (query tbl))
   in
   List.iter del_from tables_to_clean
 
index d70ec4a347d4495f260129fe97b707ec7fa26cbb..86820aafbc4abaf266b1ce07e938720cc49d9f87 100644 (file)
 
 
 
-val index_obj: dbd:Mysql.dbd -> uri:UriManager.uri -> unit
+val index_obj: dbd:HMysql.dbd -> uri:UriManager.uri -> unit
     
 (* TODO Zack indexing of variables and (perhaps?) incomplete proofs *)
 
   (** remove from the db all metadata pertaining to a given owner
   * @return list of uris removed from the db *)
-val clean: dbd:Mysql.dbd -> string list
+val clean: dbd:HMysql.dbd -> string list
 
-val unindex: dbd:Mysql.dbd -> uri:UriManager.uri -> unit
+val unindex: dbd:HMysql.dbd -> uri:UriManager.uri -> unit
 
 val count_distinct: 
   [`Conclusion | `Hypothesis | `Statement ] -> 
index 4f1b43bdbeab378d7f05422f1806d108e390d19f..8118c369a2713f79c68d015c166b560461c191a8 100644 (file)
@@ -1118,7 +1118,7 @@ let equations_blacklist =
     ]
       ;;
 
-let find_library_equalities ~(dbd:Mysql.dbd) context status maxmeta = 
+let find_library_equalities ~(dbd:HMysql.dbd) context status maxmeta = 
   let module C = Cic in
   let module S = CicSubstitution in
   let module T = CicTypeChecker in
index 2011dd979b6bab4f3194de51868ea42dbd4dc50f..4bb43ea8fa2761538273c750d5d7f7896445b0e4 100644 (file)
@@ -108,5 +108,5 @@ val extract_differing_subterms:
 val build_proof_term: equality -> Cic.term
 
 val find_library_equalities:
-  dbd:Mysql.dbd -> Cic.context -> ProofEngineTypes.status -> int ->
+  dbd:HMysql.dbd -> Cic.context -> ProofEngineTypes.status -> int ->
   equality list * int
index 9766b79f6ca5683e7a8121d93091bfdf08a1b3fd..1870a5137127ea975abcef23b28cd899d9f60318 100644 (file)
@@ -2,7 +2,7 @@ let configuration_file = ref "../../matita/matita.conf.xml";;
 
 let core_notation_script = "../../matita/core_notation.moo";;
 
-let get_from_user ~(dbd:Mysql.dbd) =
+let get_from_user ~(dbd:HMysql.dbd) =
   let rec get () =
     match read_line () with
     | "" -> []
@@ -52,7 +52,7 @@ in
 Helm_registry.load_from !configuration_file;
 CicNotation.load_notation core_notation_script;
 CicNotation.load_notation "../../matita/coq.moo";
-let dbd = Mysql.quick_connect
+let dbd = HMysql.quick_connect
   ~host:(Helm_registry.get "db.host")
   ~user:(Helm_registry.get "db.user")
   ~database:(Helm_registry.get "db.database")
index e89608cd4f9c04438b3e1e7d2f823f5efeb11c64..a0835a9b89db982e12e2a483cda54c72afa29068 100644 (file)
@@ -279,7 +279,7 @@ let default_depth = 5
 let default_width = 3
 
 (*
-let auto_tac ?(depth=default_depth) ?(width=default_width) ~(dbd:Mysql.dbd)
+let auto_tac ?(depth=default_depth) ?(width=default_width) ~(dbd:HMysql.dbd)
   ()
 =
   let auto_tac dbd (proof,goal) =
@@ -311,7 +311,7 @@ let term_is_equality = ref
   (fun term -> debug_print (lazy "term_is_equality E` DUMMY!!!!"); false);;
 
 
-let auto_tac ?(depth=default_depth) ?(width=default_width) ?paramodulation ~(dbd:Mysql.dbd) () =
+let auto_tac ?(depth=default_depth) ?(width=default_width) ?paramodulation ~(dbd:HMysql.dbd) () =
   let auto_tac dbd (proof, goal) =
     let normal_auto () = 
       let universe = MetadataQuery.signature_of_goal ~dbd (proof, goal) in
index d9061c1efac5e026c88924897a3a8a9194d39e50..e2f20f787f06c4b36ec70a98dca0d9e50824fd52 100644 (file)
 
 val auto_tac:
   ?depth:int -> ?width:int -> ?paramodulation:string ->
-  dbd:Mysql.dbd -> unit ->
+  dbd:HMysql.dbd -> unit ->
   ProofEngineTypes.tactic
 
 val paramodulation_tactic:
-  (Mysql.dbd -> ProofEngineTypes.status ->
+  (HMysql.dbd -> ProofEngineTypes.status ->
      ProofEngineTypes.proof * ProofEngineTypes.goal list) ref
 
 val term_is_equality:
index 5074f81346145a92265ae25864dde9b6e0223860..cf6589f9a5bb3c83c9d6d6d5f6718ff7e2332b8b 100644 (file)
@@ -30,4 +30,4 @@ val elim_type_tac:
 val decompose_tac:
  ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
  ?user_types:((UriManager.uri * int) list) ->
- dbd:Mysql.dbd -> string -> ProofEngineTypes.tactic
+ dbd:HMysql.dbd -> string -> ProofEngineTypes.tactic
index e16bd5719edf1a79f1a70ce83e48c12c69feff39..d75b83320ce4d25914906c9f5e0b0913f613f1bb 100644 (file)
@@ -29,4 +29,4 @@ val lapply_tac:
 
 val fwd_simpl_tac:
    ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
-   dbd:Mysql.dbd -> string -> ProofEngineTypes.tactic
+   dbd:HMysql.dbd -> string -> ProofEngineTypes.tactic
index ddeab3e6e685892cda6ada1eab64db1cfdc0473a..c266502cb16fa50378252228c2f3c7af2e9dea7c 100644 (file)
@@ -48,7 +48,7 @@ let sqlpat_of_shellglob =
 
 let nonvar uri = not (UriManager.uri_is_var uri)
 
-let locate ~(dbd:Mysql.dbd) ?(vars = false) pat =
+let locate ~(dbd:HMysql.dbd) ?(vars = false) pat =
   let sql_pat = sqlpat_of_shellglob pat in
   let query =
         sprintf ("SELECT source FROM %s WHERE value LIKE \"%s\" UNION "^^
@@ -56,12 +56,12 @@ let locate ~(dbd:Mysql.dbd) ?(vars = false) pat =
           (MetadataTypes.name_tbl ()) sql_pat
            MetadataTypes.library_name_tbl sql_pat
   in
-  let result = Mysql.exec dbd query in
+  let result = HMysql.exec dbd query in
   List.filter nonvar
-    (Mysql.map result
+    (HMysql.map result
       (fun cols -> match cols.(0) with Some s -> UriManager.uri_of_string s | _ -> assert false))
 
-let match_term ~(dbd:Mysql.dbd) ty =
+let match_term ~(dbd:HMysql.dbd) ty =
 (*   debug_print (lazy (CicPp.ppterm ty)); *)
   let metadata = MetadataExtractor.compute ~body:None ~ty in
   let constants_no =
@@ -236,7 +236,7 @@ let cmatch' =
  fun ~dbd ~facts signature -> profiler.profile (Constr.cmatch' ~dbd ~facts) signature
 *) let apply_tac_verbose = PrimitiveTactics.apply_tac_verbose let cmatch' = Constr.cmatch'
 
-let signature_of_goal ~(dbd:Mysql.dbd) ((proof, goal) as status) =
+let signature_of_goal ~(dbd:HMysql.dbd) ((proof, goal) as status) =
  let (_, metasenv, _, _) = proof in
  let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
  let main, sig_constants = Constr.signature_of ty in
@@ -254,7 +254,7 @@ let signature_of_goal ~(dbd:Mysql.dbd) ((proof, goal) as status) =
  let uris = List.filter Hashtbl_equiv.not_a_duplicate uris in
   uris
 
-let equations_for_goal ~(dbd:Mysql.dbd) ((proof, goal) as status) =
+let equations_for_goal ~(dbd:HMysql.dbd) ((proof, goal) as status) =
  let (_, metasenv, _, _) = proof in
  let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
  let main, sig_constants = Constr.signature_of ty in
@@ -275,7 +275,7 @@ let equations_for_goal ~(dbd:Mysql.dbd) ((proof, goal) as status) =
        else raise Goal_is_not_an_equation
 
 let experimental_hint 
-  ~(dbd:Mysql.dbd) ?(facts=false) ?signature ((proof, goal) as status) =
+  ~(dbd:HMysql.dbd) ?(facts=false) ?signature ((proof, goal) as status) =
   let (_, metasenv, _, _) = proof in
   let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
   let (uris, (main, sig_constants)) =
@@ -357,7 +357,7 @@ let experimental_hint
     (aux uris)
 
 let new_experimental_hint 
-  ~(dbd:Mysql.dbd) ?(facts=false) ?signature ~universe
+  ~(dbd:HMysql.dbd) ?(facts=false) ?signature ~universe
   ((proof, goal) as status)
 =
   let (_, metasenv, _, _) = proof in
@@ -583,10 +583,10 @@ let fwd_simpl ~dbd t =
         let from = "genLemma" in
         let where =
           Printf.sprintf "h_outer = \"%s\""
-           (Mysql.escape (UriManager.string_of_uri outer)) in
+           (HMysql.escape (UriManager.string_of_uri outer)) in
          let query = Printf.sprintf "SELECT %s FROM %s WHERE %s" select from where in
-        let result = Mysql.exec dbd query in
-         let lemmas = Mysql.map ~f:(map inners) result in
+        let result = HMysql.exec dbd query in
+         let lemmas = HMysql.map ~f:(map inners) result in
         let ranked = List.fold_left rank [] lemmas in
         let ordered = List.rev (List.fast_sort compare ranked) in
          map_filter filter 0 ordered
@@ -604,5 +604,5 @@ let decomposables ~dbd =
    in
    let select, from = "source", "decomposables" in
    let query = Printf.sprintf "SELECT %s FROM %s" select from in
-   let decomposables = Mysql.map ~f:map (Mysql.exec dbd query) in
+   let decomposables = HMysql.map ~f:map (HMysql.exec dbd query) in
    map_filter (fun _ x -> x) 0 decomposables   
index b2bd57bf3f76383ea3a0c23550f9434185fd0018..747844226c749bafab57af67f7b34d2abe6715b7 100644 (file)
   * is interpreted as 0 or more characters and "?" as exactly one character *)
 
 val signature_of_goal:
-  dbd:Mysql.dbd -> ProofEngineTypes.status -> UriManager.uri list
+  dbd:HMysql.dbd -> ProofEngineTypes.status -> UriManager.uri list
 
 val equations_for_goal:
-  dbd:Mysql.dbd -> ProofEngineTypes.status -> UriManager.uri list
+  dbd:HMysql.dbd -> ProofEngineTypes.status -> UriManager.uri list
 
 val locate:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?vars:bool -> string -> UriManager.uri list
 
 val experimental_hint:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?facts:bool ->
   ?signature:MetadataConstraints.term_signature ->
   ProofEngineTypes.status ->
@@ -48,7 +48,7 @@ val experimental_hint:
        (ProofEngineTypes.proof * ProofEngineTypes.goal list))) list
 
 val new_experimental_hint:
-  dbd:Mysql.dbd ->
+  dbd:HMysql.dbd ->
   ?facts:bool ->
   ?signature:MetadataConstraints.term_signature ->
   universe:UriManager.uri list ->
@@ -57,13 +57,13 @@ val new_experimental_hint:
      ((Cic.term -> Cic.term) *
        (ProofEngineTypes.proof * ProofEngineTypes.goal list))) list
 
-val match_term: dbd:Mysql.dbd -> Cic.term -> UriManager.uri list
+val match_term: dbd:HMysql.dbd -> Cic.term -> UriManager.uri list
 
  (** @param string is an uri *)
-val elim: dbd:Mysql.dbd -> UriManager.uri -> UriManager.uri list
+val elim: dbd:HMysql.dbd -> UriManager.uri -> UriManager.uri list
 
-val instance: dbd:Mysql.dbd -> Cic.term -> UriManager.uri list
+val instance: dbd:HMysql.dbd -> Cic.term -> UriManager.uri list
 
-val fwd_simpl: dbd:Mysql.dbd -> Cic.term -> UriManager.uri list
+val fwd_simpl: dbd:HMysql.dbd -> Cic.term -> UriManager.uri list
 
-val decomposables: dbd:Mysql.dbd -> (UriManager.uri * int) list
+val decomposables: dbd:HMysql.dbd -> (UriManager.uri * int) list
index 5ac63b07e9696310af3736cfa367cde902240fd0..8ea9f641c08932c13e5f75a73bd9b6fb75f3045d 100644 (file)
@@ -5,7 +5,7 @@ val assumption : ProofEngineTypes.tactic
 val auto :
   ?depth:int ->
   ?width:int ->
-  ?paramodulation:string -> dbd:Mysql.dbd -> unit -> ProofEngineTypes.tactic
+  ?paramodulation:string -> dbd:HMysql.dbd -> unit -> ProofEngineTypes.tactic
 val change :
   pattern:ProofEngineTypes.pattern ->
   ProofEngineTypes.lazy_term -> ProofEngineTypes.tactic
@@ -21,7 +21,7 @@ val decide_equality : ProofEngineTypes.tactic
 val decompose :
   ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
   ?user_types:(UriManager.uri * int) list ->
-  dbd:Mysql.dbd -> string -> ProofEngineTypes.tactic
+  dbd:HMysql.dbd -> string -> ProofEngineTypes.tactic
 val discriminate : term:Cic.term -> ProofEngineTypes.tactic
 val elim_intros :
   ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
@@ -42,7 +42,7 @@ val fold :
 val fourier : ProofEngineTypes.tactic
 val fwd_simpl :
   ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
-  dbd:Mysql.dbd -> string -> ProofEngineTypes.tactic
+  dbd:HMysql.dbd -> string -> ProofEngineTypes.tactic
 val generalize :
   ?mk_fresh_name_callback:ProofEngineTypes.mk_fresh_name_type ->
   ProofEngineTypes.pattern -> ProofEngineTypes.tactic