"</html>"
;;
-let prooffile = "/home/tassi/miohelm/currentproof";;
+let prooffile = "/public/sacerdot/currentproof";;
(*CSC: the getter should handle the innertypes, not the FS *)
-let innertypesfile = "/home/tassi/miohelm/tmp/innertypes";;
+let innertypesfile = "/public/sacerdot/innertypes";;
(* GLOBAL REFERENCES (USED BY CALLBACKS) *)
| [] -> ""
| head :: tail ->
inputt#delete_text 0 inputlen;
- MQueryGenerator.locate head
+ MQueryGenerator.locate_html head
with
e -> "<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>"
)
let _ =
CicCooking.init () ;
- if !usedb then MQueryGenerator.init () ;
+ if !usedb then
+ begin
+ MQueryGenerator.init () ;
+ CicTextualParser0.set_locate_object
+ (function id ->
+ let MathQL.MQRefs uris = MQueryGenerator.locate id in
+ let uri =
+ match uris with
+ [] -> None
+ | [uri] -> Some uri
+ | _ -> None (* here we must let the user choose one uri *)
+ in
+ match uri with
+ Some uri' ->
+ if String.sub uri' (String.length uri' - 4) 4 = ".con" then
+(*CSC: what cooking number? Here I always use 0, which may be bugged *)
+ Some (Cic.Const (UriManager.uri_of_string uri',0))
+ else
+ let uri'',typeno =
+(*CSC: the locate query now looks only for inductive type blocks ;-( *)
+(*CSC: when it will be correctly implemented we will have to work *)
+(*CSC: here on the fragment identifier *)
+ uri',0
+ in
+(*CSC: what cooking number? Here I always use 0, which may be bugged *)
+ Some (Cic.MutInd (UriManager.uri_of_string uri'',0,typeno))
+ | None -> None
+ )
+ end ;
ignore (GtkMain.Main.init ()) ;
initialize_everything () ;
if !usedb then MQueryGenerator.close ();
let close = Mqint.close
-let locate s =
- let query =
+let locate_query s =
(*CSC: next query to be fixed
1) I am exploiting the bug that does not quote '|'
2) I am searching only constants and mutual inductive definition blocks
)
)
)
- in
- build_result query
+
+let locate s = Mqint.execute (locate_query s)
+let locate_html s = build_result (locate_query s)
let levels e c t level =
env := e; cont := c;
val close : unit -> unit (* CLOSE database function *)
-val locate : string -> string (* LOCATE query building function *)
+val locate : string -> MathQL.mqresult (* LOCATE query building function *)
+val locate_html : string -> string (* LOCATE query building function *)
val backward : Cic.metasenv -> Cic.context -> Cic.term -> int -> string
(* BACKWARD query building function *)