1 (******************************************************************************)
5 (* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
8 (* This module implements a trival cache system (an hash-table) for cic *)(* objects. Uses the getter (getter.ml) and the parser (cicParser.ml) *)(* *)
9 (******************************************************************************)
11 exception CircularDependency of string;;
14 (* returns the cic object whose uri is uri. If the term is not just in cache, *)
15 (* then it is parsed via CicParser.term_of_xml from the file whose name is *)
16 (* the result of Getter.get uri *)
17 val get_obj : UriManager.uri -> Cic.obj
20 (* returns the cic object whose uri is uri either in annotated and in *)
21 (* deannotated form. It returns also the map from ids to annotation targets. *)
22 (* The term is put in cache if it's not there yet. *)
23 (* The functions raise CircularDependency if asked to retrieve a Frozen object*)
25 UriManager.uri -> Cic.annobj * (Cic.id, Cic.anntarget) Hashtbl.t * Cic.obj
28 (* USEFUL ONLY DURING THE FIXING OF THE FILES *)
29 (* change_obj uri (Some newobj) *)
30 (* maps uri to newobj in cache. *)
31 (* change_obj uri None *)
32 (* maps uri to a freeze dummy-object. *)
33 val change_obj : UriManager.uri -> Cic.obj option -> unit
35 type type_checked_obj =
36 CheckedObj of Cic.obj (* cooked obj *)
37 | UncheckedObj of Cic.obj (* uncooked obj *)
39 (* is_type_checked uri cookingsno *)
40 (*CSC commento falso ed obsoleto *)
41 (* returns (true,object) if the object has been type-checked *)
42 (* otherwise it returns (false,object) and freeze the object for *)
44 (* set_type_checking_info must be called to unfreeze the object *)
45 val is_type_checked : UriManager.uri -> int -> type_checked_obj
47 (* set_type_checking_info uri *)
48 (* must be called once the type-checking of uri is finished *)
49 (* The object whose uri is uri is unfreezed and won't be type-checked *)
50 (* again in the future (is_type_checked will return true) *)
51 val set_type_checking_info : UriManager.uri -> unit
53 (* get_cooked_obj uri cookingsno *)
54 val get_cooked_obj : UriManager.uri -> int -> Cic.obj
56 val cook_obj : (Cic.obj -> UriManager.uri -> (int * Cic.obj) list) ref