1 (* Copyright (C) 2004-2005, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 val baseuri_of_file : string -> string
28 val baseuri_of_baseuri_decl:
29 ('a, 'b, 'c, 'd, 'e) GrafiteAst.statement -> string option
31 (** check whether no objects are defined below a given baseuri *)
32 val is_empty: string -> bool
34 (** removes a file if it exists *)
35 val safe_remove: string -> unit
37 val is_dir: string -> bool (** @return true if file is a directory *)
38 val is_regular: string -> bool (** @return true if file is a regular file *)
40 val input_file: string -> string (** read all the contents of file to string *)
41 val output_file: string -> string -> unit (** write string to file *)
43 val absolute_path: string -> string
45 (** @return true if file is a (textual) proof script *)
46 val is_proof_script: string -> bool
48 (** @return true if file is a (binary) proof object *)
49 val is_proof_object: string -> bool
51 (** given a phrase, if it doesn't end with BuildTimeConf.phrase_sep, append
53 val append_phrase_sep: string -> string
55 val trim_blanks: string -> string
56 val strip_trailing_slash: string -> string
57 val normalize_dir: string -> string (** add trailing "/" if missing *)
58 val strip_suffix: suffix:string -> string -> string
60 (* split a string at character, char defaults to ' ' *)
61 val split: ?char:char -> string -> string list
63 val list_uniq: 'a list -> 'a list (* uniq unix filter on lists *)
65 (** @return tl tail of a list starting at a given element
66 * @param eq equality to be used, defaults to physical equality (==)
68 val list_tl_at: ?equality:('a -> 'a -> bool) -> 'a -> 'a list -> 'a list
71 val unopt: 'a option -> 'a
73 (** Gdome.element of a MathML document whose rendering should be blank. Used
74 * by cicBrowser to render "about:blank" document *)
75 val empty_mathml: unit -> Gdome.document
76 val empty_boxml: unit -> Gdome.document
78 exception History_failure
82 class type ['a] history =
84 method add : 'a -> unit
85 method next : 'a (** @raise History_failure *)
86 method previous : 'a (** @raise History_failure *)
87 method load: 'a memento -> unit
88 method save: 'a memento
93 (** shell like history: new items added at the end of the history
94 * @param size maximum history size *)
95 class shell_history : int -> [string] history
97 (** browser like history: new items added at the current point of the history
98 * @param size maximum history size
99 * @param first element in history (this history is never empty) *)
100 class ['a] browser_history: ?memento:'a memento -> int -> 'a -> ['a] history
102 (** create a singleton from a given function. Given function is invoked the
103 * first time it gets called. Next invocation will return first value *)
104 val singleton: (unit -> 'a) -> (unit -> 'a)
106 (** create a directory, building also parents if needed
107 * @raise Failure when unable to create some directory *)
108 val mkdir: string -> unit
110 val qualify: MatitaTypes.status -> string -> string
112 val get_proof_status: MatitaTypes.status -> ProofEngineTypes.status
113 val get_proof_metasenv: MatitaTypes.status -> Cic.metasenv
114 val get_proof_context: MatitaTypes.status -> Cic.context
115 val get_proof_conclusion: MatitaTypes.status -> Cic.term
117 (** given the base name of an image, returns its full path *)
118 val image_path: string -> string
119 val obj_file_of_baseuri: string -> string
120 val obj_file_of_script: string -> string
122 (** invoke a given function and return its value; in addition il will print
123 * the given string before invoking it and "/" ^ the given string afterwards.
124 * This permit tracing of functions which does not return a value *)
125 val debug_wrap: string -> (unit -> 'a) -> 'a