]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/matitaMisc.mli
new tacticals
[helm.git] / helm / matita / matitaMisc.mli
1 (* Copyright (C) 2004-2005, HELM Team.
2  * 
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.
6  * 
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.
11  * 
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.
16  *
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,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 val baseuri_of_file : string -> string 
27
28 val baseuri_of_baseuri_decl:
29   ('a, 'b, 'c, 'd, 'e) GrafiteAst.statement -> string option
30
31   (** check whether no objects are defined below a given baseuri *)
32 val is_empty: string -> bool
33
34 (** removes a file if it exists *)
35 val safe_remove: string -> unit
36 (** removes a dir if it exists and is empty *)
37 val safe_rmdir: string -> unit 
38 (** checks if the dir is empty *)
39 val is_dir_empty: string -> bool
40 (** removes a directory and recursively the father (if empty) *)
41 val rmdir_descend: string -> unit
42
43 val absolute_path: string -> string 
44
45   (** @return true if file is a (textual) proof script *)
46 val is_proof_script: string -> bool
47
48   (** @return true if file is a (binary) proof object *)
49 val is_proof_object: string -> bool
50
51   (** given a phrase, if it doesn't end with BuildTimeConf.phrase_sep, append
52   * it *)
53 val append_phrase_sep: string -> string
54
55 val strip_trailing_slash: string -> string
56 val normalize_dir: string -> string (** add trailing "/" if missing *)
57 val strip_suffix: suffix:string -> string -> string
58
59   (** @return tl tail of a list starting at a given element
60    * @param eq equality to be used, defaults to physical equality (==)
61    * @raise Not_found *)
62 val list_tl_at: ?equality:('a -> 'a -> bool) -> 'a -> 'a list -> 'a list
63
64   (** Gdome.element of a MathML document whose rendering should be blank. Used
65   * by cicBrowser to render "about:blank" document *)
66 val empty_mathml: Gdome.document lazy_t
67 val empty_boxml: Gdome.document lazy_t
68
69   (** shown for goals closed by side effects *)
70 val closed_goal_mathml: Gdome.document lazy_t
71
72 exception History_failure
73
74 type 'a memento
75
76 class type ['a] history =
77   object ('b)
78     method add : 'a -> unit
79     method next : 'a        (** @raise History_failure *)
80     method previous : 'a    (** @raise History_failure *)
81     method load: 'a memento -> unit
82     method save: 'a memento
83     method is_begin: bool 
84     method is_end: bool 
85   end
86
87   (** shell like history: new items added at the end of the history
88   * @param size maximum history size *)
89 class shell_history : int -> [string] history
90
91   (** browser like history: new items added at the current point of the history
92   * @param size maximum history size
93   * @param first element in history (this history is never empty) *)
94 class ['a] browser_history: ?memento:'a memento -> int -> 'a -> ['a] history
95
96   (** create a singleton from a given function. Given function is invoked the
97   * first time it gets called. Next invocation will return first value *)
98 val singleton: (unit -> 'a) -> (unit -> 'a)
99
100 val qualify: MatitaTypes.status -> string -> string
101
102 val get_current_proof: MatitaTypes.status -> ProofEngineTypes.proof
103 val get_stack: MatitaTypes.status -> Continuationals.Stack.t
104 val set_stack: Continuationals.Stack.t ->MatitaTypes.status ->MatitaTypes.status
105 val get_proof_metasenv: MatitaTypes.status ->  Cic.metasenv
106
107 val get_proof_context:
108   MatitaTypes.status -> ProofEngineTypes.goal -> Cic.context 
109
110 val get_proof_conclusion:
111   MatitaTypes.status -> ProofEngineTypes.goal -> Cic.term 
112
113   (** given the base name of an image, returns its full path *)
114 val image_path: string -> string
115 val obj_file_of_baseuri: string -> string
116 val obj_file_of_script: string -> string
117