]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic/cicUniv.mli
ocaml 3.09 transition
[helm.git] / helm / ocaml / cic / cicUniv.mli
index f98ea84c6ce411e6541cd9179c93332ecad25ef2..be8c28bf3e105c20ac17a6673ae5fa6ecbd637e0 100644 (file)
  * http://helm.cs.unibo.it/
  *)
 
-(* Cic.Type of universe *)
+
+(*
+  The strings contains an unreadable message
+*)
+exception UniverseInconsistency of string
+
+(*
+  Cic.Type of universe 
+*)
 type universe
 
-(* returns a fresh universe and puts it in the working graph *)
-val fresh: unit -> universe
+(*
+  Opaque data structure you will use to store constraints
+*)
+type universe_graph
 
-(* add eq/ge/gt constraints to the woring graph *)
-val add_eq: universe -> universe -> bool
-val add_ge: universe -> universe -> bool
-val add_gt: universe -> universe -> bool
+(*
+  returns a fresh universe
+*)
+val fresh: 
+  ?uri:UriManager.uri ->
+  ?id:int ->
+  unit -> 
+    universe
 
-(* prints the graphs *)
-val print_global_graph: unit -> unit
-val print_working_graph: unit -> unit
+    (* names a universe if unnamed *)
+val name_universe: universe -> UriManager.uri -> universe
+    
+(*
+  really useful at the begin and in all the functions that don't care 
+  of universes
+*)
+val empty_ugraph: universe_graph
 
-type universe_graph
-val get_working: unit -> universe_graph
-val set_working: universe_graph -> unit
+(*
+  These are the real functions to add eq/ge/gt constraints 
+  to the passed graph, returning an updated graph or raising
+  UniverseInconsistency
+*)
+val add_eq: 
+  ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
+val add_ge: 
+  ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
+val add_gt: 
+  ?fast:bool -> universe -> universe -> universe_graph -> universe_graph
+
+(*
+  debug function to print the graph to standard error
+*)
+val print_ugraph: 
+  universe_graph -> unit
+
+(*
+  does what expected, but I don't remember why this was exported
+*)
+val string_of_universe: 
+  universe -> string
+
+(*
+  given the list of visible universes (see universes_of_obj) returns a
+  cleaned graph (cleaned from the not visible nodes) 
+*)
+val clean_ugraph: 
+  universe_graph -> universe list -> universe_graph
+
+(*
+  Since fresh() can't add the right uri to each node, you
+  must fill empty nodes with the uri before you serialize the graph to xml
+
+  these empty nodes are also filled in the universe list
+*)
+val fill_empty_nodes_with_uri:
+  universe_graph -> universe list -> UriManager.uri -> 
+    universe_graph * universe list
+
+(*
+  makes a union.
+  TODO:
+  - remember already merged uri so that we completely skip already merged
+    graphs, this may include a dependecy graph (not merge a subpart of an
+    already merged graph)
+*)
+val merge_ugraphs:
+  universe_graph -> universe_graph -> universe_graph
+
+(*
+  ugraph to xml file and viceversa
+*)
+val write_xml_of_ugraph: 
+  string -> universe_graph -> universe list -> unit
+
+(*
+  given a filename parses the xml and returns the data structure
+*)
+val ugraph_and_univlist_of_xml:
+  string -> universe_graph * universe list
+val restart_numbering:
+  unit -> unit
+
+(*
+  returns the universe number (used to save it do xml) 
+*) 
+val univno: universe -> int 
+
+  (** re-hash-cons URIs contained in the given universe so that phisicaly
+   * equality could be enforced. Mainly used by
+   * CicEnvironment.restore_from_channel *)
+val recons_graph: universe_graph -> universe_graph
+
+  (** re-hash-cons a single universe *)
+val recons_univ: universe -> universe
+
+  (** consistency chek that should be done before committin the graph to the
+   * cache *)
+val assert_univs_have_uri: universe_graph -> universe list-> unit
 
-val directly_to_env_begin: unit -> unit
-val directly_to_env_end: unit -> unit
+  (** asserts the universe is named *)
+val assert_univ: universe -> unit
 
-val reset_working:  unit -> unit
+val compare: universe -> universe -> int
+val eq: universe -> universe -> bool
 
+(*
+  Benchmarking stuff
+*)
+val get_spent_time: unit -> float
+val reset_spent_time: unit -> unit