]> matita.cs.unibo.it Git - helm.git/blob - components/cic/cicUniv.mli
experimental branch with no set baseuri command and no developments
[helm.git] / components / cic / cicUniv.mli
1 (* Copyright (C) 2004, 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
27 (*
28   The strings contains an unreadable message
29 *)
30 exception UniverseInconsistency of string Lazy.t
31
32 (*
33   Cic.Type of universe 
34 *)
35 type universe
36
37 (*
38   Opaque data structure you will use to store constraints
39 *)
40 type universe_graph
41
42 (*
43   returns a fresh universe
44 *)
45 val fresh: 
46   ?uri:UriManager.uri ->
47   ?id:int ->
48   unit -> 
49     universe
50
51     (* names a universe if unnamed *)
52 val name_universe: universe -> UriManager.uri -> universe
53     
54 (*
55   really useful at the begin and in all the functions that don't care 
56   of universes
57 *)
58 val empty_ugraph: universe_graph
59
60 (* an universe that does nothing: i.e. no constraints are kept, no merges.. *)
61 val oblivion_ugraph: universe_graph
62
63 (*
64   These are the real functions to add eq/ge/gt constraints 
65   to the passed graph, returning an updated graph or raising
66   UniverseInconsistency
67 *)
68 val add_eq: 
69   ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
70 val add_ge: 
71   ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
72 val add_gt: 
73   ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
74
75 (*
76   debug function to print the graph to standard error
77 *)
78 val print_ugraph: 
79   universe_graph -> unit
80
81 (*
82   does what expected, but I don't remember why this was exported
83 *)
84 val string_of_universe: 
85   universe -> string
86
87 (*
88   given the list of visible universes (see universes_of_obj) returns a
89   cleaned graph (cleaned from the not visible nodes) 
90 *)
91 val clean_ugraph: 
92   universe_graph -> universe list -> universe_graph
93
94 (*
95   Since fresh() can't add the right uri to each node, you
96   must fill empty nodes with the uri before you serialize the graph to xml
97
98   these empty nodes are also filled in the universe list
99 *)
100 val fill_empty_nodes_with_uri:
101   universe_graph -> universe list -> UriManager.uri -> 
102     universe_graph * universe list
103
104 (*
105   makes a union.
106   TODO:
107   - remember already merged uri so that we completely skip already merged
108     graphs, this may include a dependecy graph (not merge a subpart of an
109     already merged graph)
110 *)
111 val merge_ugraphs:
112   base_ugraph:universe_graph -> 
113   increment:(universe_graph * UriManager.uri) -> universe_graph
114
115 (*
116   ugraph to xml file and viceversa
117 *)
118 val write_xml_of_ugraph: 
119   string -> universe_graph -> universe list -> unit
120
121 (*
122   given a filename parses the xml and returns the data structure
123 *)
124 val ugraph_and_univlist_of_xml:
125   string -> universe_graph * universe list
126 val restart_numbering:
127   unit -> unit
128
129 (*
130   returns the universe number (used to save it do xml) 
131 *) 
132 val univno: universe -> int 
133
134   (** re-hash-cons URIs contained in the given universe so that phisicaly
135    * equality could be enforced. Mainly used by
136    * CicEnvironment.restore_from_channel *)
137 val recons_graph: universe_graph -> universe_graph
138
139   (** re-hash-cons a single universe *)
140 val recons_univ: universe -> universe
141
142   (** consistency check that should be done before committin the graph to the
143    * cache *)
144 val assert_univs_have_uri: universe_graph -> universe list-> unit
145
146   (** asserts the universe is named *)
147 val assert_univ: universe -> unit
148
149 val compare: universe -> universe -> int
150 val eq: universe -> universe -> bool
151
152 (*
153   Benchmarking stuff
154 *)
155 val get_spent_time: unit -> float
156 val reset_spent_time: unit -> unit
157