-matitacleanLib.cmo: matitaSync.cmi matitaMisc.cmi matitaDb.cmi \
- matitacleanLib.cmi
-matitacleanLib.cmx: matitaSync.cmx matitaMisc.cmx matitaDb.cmx \
- matitacleanLib.cmi
-matitaclean.cmo: matitacleanLib.cmi matitaDb.cmi
-matitaclean.cmx: matitacleanLib.cmx matitaDb.cmx
-matitacLib.cmo: matitaTypes.cmo matitaMisc.cmi matitaLog.cmi matitaExcPp.cmi \
- matitaEngine.cmi buildTimeConf.cmo matitacLib.cmi
-matitacLib.cmx: matitaTypes.cmx matitaMisc.cmx matitaLog.cmx matitaExcPp.cmx \
- matitaEngine.cmx buildTimeConf.cmx matitacLib.cmi
-matitac.cmo: matitacLib.cmi
-matitac.cmx: matitacLib.cmx
+matita.cmo: matitaTypes.cmi matitaScript.cmi matitaMisc.cmi \
+ matitaMathView.cmi matitaLog.cmi matitaGui.cmi matitaGtkMisc.cmi \
+ matitaEngine.cmi matitaDisambiguator.cmi buildTimeConf.cmo
+matita.cmx: matitaTypes.cmx matitaScript.cmx matitaMisc.cmx \
+ matitaMathView.cmx matitaLog.cmx matitaGui.cmx matitaGtkMisc.cmx \
+ matitaEngine.cmx matitaDisambiguator.cmx buildTimeConf.cmx
matitaDb.cmo: matitaMisc.cmi matitaDb.cmi
matitaDb.cmx: matitaMisc.cmx matitaDb.cmi
-matitadep.cmo: matitaMisc.cmi matitaExcPp.cmi
-matitadep.cmx: matitaMisc.cmx matitaExcPp.cmx
-matitaDisambiguator.cmo: matitaTypes.cmo matitaDisambiguator.cmi
+matitaDisambiguator.cmo: matitaTypes.cmi matitaDisambiguator.cmi
matitaDisambiguator.cmx: matitaTypes.cmx matitaDisambiguator.cmi
-matitaEngine.cmo: matitaTypes.cmo matitaSync.cmi matitaMisc.cmi matitaLog.cmi \
+matitaEngine.cmo: matitaTypes.cmi matitaSync.cmi matitaMisc.cmi matitaLog.cmi \
matitaDisambiguator.cmi matitaDb.cmi matitaEngine.cmi
matitaEngine.cmx: matitaTypes.cmx matitaSync.cmx matitaMisc.cmx matitaLog.cmx \
matitaDisambiguator.cmx matitaDb.cmx matitaEngine.cmi
-matitaExcPp.cmo: matitaTypes.cmo matitaExcPp.cmi
+matitaExcPp.cmo: matitaTypes.cmi matitaExcPp.cmi
matitaExcPp.cmx: matitaTypes.cmx matitaExcPp.cmi
matitaGeneratedGui.cmo: matitaGeneratedGui.cmi
matitaGeneratedGui.cmx: matitaGeneratedGui.cmi
-matitaGtkMisc.cmo: matitaTypes.cmo matitaGeneratedGui.cmi matitaGtkMisc.cmi
+matitaGtkMisc.cmo: matitaTypes.cmi matitaGeneratedGui.cmi matitaGtkMisc.cmi
matitaGtkMisc.cmx: matitaTypes.cmx matitaGeneratedGui.cmx matitaGtkMisc.cmi
-matitaGui.cmo: matitaTypes.cmo matitaScript.cmi matitaMisc.cmi matitaLog.cmi \
+matitaGui.cmo: matitaTypes.cmi matitaScript.cmi matitaMisc.cmi matitaLog.cmi \
matitaGtkMisc.cmi matitaGeneratedGui.cmi matitaExcPp.cmi \
buildTimeConf.cmo matitaGui.cmi
matitaGui.cmx: matitaTypes.cmx matitaScript.cmx matitaMisc.cmx matitaLog.cmx \
buildTimeConf.cmx matitaGui.cmi
matitaLog.cmo: matitaLog.cmi
matitaLog.cmx: matitaLog.cmi
-matitaMathView.cmo: matitaTypes.cmo matitaScript.cmi matitaMisc.cmi \
+matitaMathView.cmo: matitaTypes.cmi matitaScript.cmi matitaMisc.cmi \
matitaGui.cmi matitaGtkMisc.cmi matitaExcPp.cmi buildTimeConf.cmo \
matitaMathView.cmi
matitaMathView.cmx: matitaTypes.cmx matitaScript.cmx matitaMisc.cmx \
matitaGui.cmx matitaGtkMisc.cmx matitaExcPp.cmx buildTimeConf.cmx \
matitaMathView.cmi
-matitaMisc.cmo: matitaTypes.cmo buildTimeConf.cmo matitaMisc.cmi
+matitaMisc.cmo: matitaTypes.cmi buildTimeConf.cmo matitaMisc.cmi
matitaMisc.cmx: matitaTypes.cmx buildTimeConf.cmx matitaMisc.cmi
-matita.cmo: matitaTypes.cmo matitaScript.cmi matitaMisc.cmi \
- matitaMathView.cmi matitaLog.cmi matitaGui.cmi matitaGtkMisc.cmi \
- matitaEngine.cmi matitaDisambiguator.cmi buildTimeConf.cmo
-matita.cmx: matitaTypes.cmx matitaScript.cmx matitaMisc.cmx \
- matitaMathView.cmx matitaLog.cmx matitaGui.cmx matitaGtkMisc.cmx \
- matitaEngine.cmx matitaDisambiguator.cmx buildTimeConf.cmx
-matitaScript.cmo: matitacleanLib.cmi matitaTypes.cmo matitaSync.cmi \
+matitaScript.cmo: matitacleanLib.cmi matitaTypes.cmi matitaSync.cmi \
matitaMisc.cmi matitaLog.cmi matitaEngine.cmi matitaDisambiguator.cmi \
matitaDb.cmi matitaScript.cmi
matitaScript.cmx: matitacleanLib.cmx matitaTypes.cmx matitaSync.cmx \
matitaMisc.cmx matitaLog.cmx matitaEngine.cmx matitaDisambiguator.cmx \
matitaDb.cmx matitaScript.cmi
-matitaSync.cmo: matitaTypes.cmo matitaMisc.cmi matitaLog.cmi matitaDb.cmi \
+matitaSync.cmo: matitaTypes.cmi matitaMisc.cmi matitaLog.cmi matitaDb.cmi \
matitaSync.cmi
matitaSync.cmx: matitaTypes.cmx matitaMisc.cmx matitaLog.cmx matitaDb.cmx \
matitaSync.cmi
-matitaTypes.cmo: matitaLog.cmi
-matitaTypes.cmx: matitaLog.cmx
-matitaDisambiguator.cmi: matitaTypes.cmo
-matitaEngine.cmi: matitaTypes.cmo
+matitaTypes.cmo: matitaLog.cmi matitaTypes.cmi
+matitaTypes.cmx: matitaLog.cmx matitaTypes.cmi
+matitac.cmo: matitacLib.cmi
+matitac.cmx: matitacLib.cmx
+matitacLib.cmo: matitacleanLib.cmi matitaTypes.cmi matitaMisc.cmi \
+ matitaLog.cmi matitaExcPp.cmi matitaEngine.cmi buildTimeConf.cmo \
+ matitacLib.cmi
+matitacLib.cmx: matitacleanLib.cmx matitaTypes.cmx matitaMisc.cmx \
+ matitaLog.cmx matitaExcPp.cmx matitaEngine.cmx buildTimeConf.cmx \
+ matitacLib.cmi
+matitaclean.cmo: matitacleanLib.cmi matitaDb.cmi
+matitaclean.cmx: matitacleanLib.cmx matitaDb.cmx
+matitacleanLib.cmo: matitaSync.cmi matitaMisc.cmi matitaDb.cmi \
+ matitacleanLib.cmi
+matitacleanLib.cmx: matitaSync.cmx matitaMisc.cmx matitaDb.cmx \
+ matitacleanLib.cmi
+matitadep.cmo: matitaMisc.cmi matitaExcPp.cmi
+matitadep.cmx: matitaMisc.cmx matitaExcPp.cmx
+matitaDisambiguator.cmi: matitaTypes.cmi
+matitaEngine.cmi: matitaTypes.cmi
matitaGtkMisc.cmi: matitaGeneratedGui.cmi
matitaGui.cmi: matitaLog.cmi matitaGeneratedGui.cmi matitaDisambiguator.cmi
-matitaMathView.cmi: matitaTypes.cmo
-matitaMisc.cmi: matitaTypes.cmo
-matitaScript.cmi: matitaTypes.cmo
-matitaSync.cmi: matitaTypes.cmo
+matitaMathView.cmi: matitaTypes.cmi
+matitaMisc.cmi: matitaTypes.cmi
+matitaScript.cmi: matitaTypes.cmi
+matitaSync.cmi: matitaTypes.cmi
matitaSync.cmo \
matitaDisambiguator.cmo \
matitaEngine.cmo \
+ matitacleanLib.cmo \
matitacLib.cmo
-CLEANCMOS = $(CCMOS) matitacleanLib.cmo
+CLEANCMOS = $(CCMOS)
all: matita matitac matitatop cicbrowser matitadep matitaclean
MatitaLog.debug "l2:";
List.iter MatitaLog.debug l2
-let remove uri =
+let remove ~verbose uri =
let derived_uris_of_uri uri =
UriManager.innertypesuri_of_uri uri ::
(match UriManager.bodyuri_of_uri uri with
List.iter
(fun uri ->
(try
- MatitaLog.debug ("Removing: " ^ UriManager.string_of_uri uri);
+ if verbose then
+ MatitaLog.debug ("Removing: " ^ UriManager.string_of_uri uri);
MatitaMisc.safe_remove (Http_getter.resolve' uri)
with Http_getter_types.Key_not_found _ -> ());
remove_coercion uri;
ignore (MatitaDb.remove_uri uri))
to_remove
-
(* removes the object from DB, Disk, CoercionsDB, getter
* asserts the uri is resolved to file:// so it is only for
* user's objects *)
-val remove: UriManager.uri -> unit
-
+val remove: verbose:bool -> UriManager.uri -> unit
--- /dev/null
+(* Copyright (C) 2004-2005, 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://helm.cs.unibo.it/
+ *)
+
+exception Cancel
+exception Statement_error of string
+val statement_error : string -> 'a
+
+exception Command_error of string
+val command_error : string -> 'a
+
+exception Option_error of string * string
+exception Unbound_identifier of string
+
+type proof_status =
+ No_proof
+ | Incomplete_proof of ProofEngineTypes.status
+ | Proof of ProofEngineTypes.proof
+ | Intermediate of Cic.metasenv
+
+module StringMap : Map.S with type key = String.t
+
+type option_value =
+ | String of string
+ | Int of int
+type options = option_value StringMap.t
+val no_options : 'a StringMap.t
+
+type status = {
+ aliases : DisambiguateTypes.environment;
+ moo_content_rev : string list;
+ proof_status : proof_status;
+ options : options;
+ objects : (UriManager.uri * string) list;
+}
+
+val dump_status : status -> unit
+val get_option : status -> StringMap.key -> option_value
+val get_string_option : status -> StringMap.key -> string
+val set_option : status -> StringMap.key -> string -> status
+
+class type console =
+ object
+ method choose_uri : string list -> string
+ method clear : unit -> unit
+ method echo_error : string -> unit
+ method echo_message : string -> unit
+ method show : ?msg:string -> unit -> unit
+ method wrap_exn : (unit -> 'a) -> 'a option
+ end
+
+type abouts = [ `Blank | `Current_proof | `Us ]
+
+type mathViewer_entry =
+ [ `About of abouts
+ | `Check of string
+ | `Cic of Cic.term * Cic.metasenv
+ | `Dir of string
+ | `Uri of UriManager.uri
+ | `Whelp of string * UriManager.uri list ]
+
+val string_of_entry :
+ [< `About of [< `Blank | `Current_proof | `Us ]
+ | `Check of 'a
+ | `Cic of 'b * 'c
+ | `Dir of string
+ | `Uri of UriManager.uri
+ | `Whelp of string * 'd ] ->
+ string
+
+val entry_of_string :
+ string -> [> `About of [> `Blank | `Current_proof | `Us ] ]
+
+class type mathViewer =
+ object
+ method show_entry : ?reuse:bool -> mathViewer_entry -> unit
+ method show_uri_list :
+ ?reuse:bool -> entry:mathViewer_entry -> UriManager.uri list -> unit
+ end
MatitaLog.error (sprintf "Parse error at %d-%d: %s" x y err);
go ()
| exn -> MatitaLog.error (Printexc.to_string exn); go ()
+
+let clean_exit n =
+ match !status with
+ None -> exit n
+ | Some status ->
+ let baseuri = MatitaTypes.get_string_option !status "baseuri" in
+ MatitacleanLib.clean_baseuris ~verbose:false [baseuri];
+ exit n
let main ~mode =
Helm_registry.load_from "matita.conf.xml";
begin
MatitaLog.error
"there are still incomplete proofs at the end of the script";
- exit 2
+ clean_exit 2
end
else
begin
| Sys.Break ->
MatitaLog.error "user break!";
if mode = `COMPILER then
- exit ~-1
+ clean_exit ~-1
else
pp_ocaml_mode ()
| MatitaEngine.Drop ->
if mode = `COMPILER then
- exit 1
+ clean_exit 1
else
pp_ocaml_mode ()
| CicTextualParser2.Parse_error (floc,err) ->
let (x, y) = CicAst.loc_of_floc floc in
MatitaLog.error (sprintf "Parse error at %d-%d: %s" x y err);
if mode = `COMPILER then
- exit 1
+ clean_exit 1
else
pp_ocaml_mode ()
-
+ | _ ->
+ if mode = `COMPILER then
+ clean_exit 3
+ else
+ pp_ocaml_mode ()
+(* Copyright (C) 2004-2005, 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://helm.cs.unibo.it/
+ *)
+
val go : unit -> unit
val main : mode:[ `COMPILER | `TOPLEVEL ] -> unit
| [] -> uris
| l -> let uris, next = close_uri_list l in fix uris next @ uris
-let clean_baseuris buris =
+let clean_baseuris ?(verbose=true) buris =
let buris = List.map HGM.strip_trailing_slash buris in
(* List.iter prerr_endline buris; *)
let l = fix [] buris in
let l = MatitaMisc.list_uniq (List.fast_sort Pervasives.compare l) in
let l = List.map UriManager.uri_of_string l in
(* List.iter (fun u -> prerr_endline (UriManager.string_of_uri u)) l; *)
- List.iter MatitaSync.remove l
+ List.iter (MatitaSync.remove ~verbose) l
let is_empty buri = HG.ls (HGM.strip_trailing_slash buri ^ "/") = []
* http://helm.cs.unibo.it/
*)
-val clean_baseuris : string list -> unit
+val clean_baseuris : ?verbose:bool -> string list -> unit
val baseuri_of_file : string -> string
val baseuri_of_baseuri_decl : ('a, 'b, 'c) TacticAst.statement -> string option