]> matita.cs.unibo.it Git - helm.git/blob - matita/components/ng_library/nCicLibrary.mli
14a0685b4a6a74633a13e8abc7cb093e89fc8887
[helm.git] / matita / components / ng_library / nCicLibrary.mli
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 (* $Id$ *)
13
14 exception LibraryOutOfSync of string Lazy.t
15 exception IncludedFileNotCompiled of string * string 
16
17 type timestamp
18
19 class status :
20  object ('self)
21   method timestamp: timestamp
22   method set_timestamp: timestamp -> 'self
23  end
24
25 (* it also checks it and add it to the environment *)
26 val add_obj: #status as 'status -> NCic.obj -> 'status
27 val add_constraint: 
28   #status as 'status -> NCic.universe -> NCic.universe -> 'status
29 val aliases_of: NUri.uri -> NReference.reference list
30 val resolve: string -> NReference.reference list
31 (* warning: get_obj may raise (NCicEnvironment.ObjectNotFoud l) *)
32 val get_obj: NUri.uri -> NCic.obj (* changes the current timestamp *)
33
34 val time_travel: #status -> unit
35
36 val init: unit -> unit
37
38 type obj
39 type dump
40
41 class type g_dumpable_status =
42  object
43   method dump: dump
44  end
45
46 class dumpable_status :
47  object ('self)
48   inherit g_dumpable_status
49   method set_dump: dump -> 'self
50   method set_dumpable_status: #g_dumpable_status -> 'self
51  end
52
53 val get_already_included: #dumpable_status -> NUri.uri list
54 val dump_obj: #dumpable_status as 'status -> obj -> 'status
55
56 module type SerializerType =
57  sig
58   type dumpable_status
59
60   type 'a register_type =
61    'a ->
62     refresh_uri_in_universe:(NCic.universe -> NCic.universe) ->
63     refresh_uri_in_term:(NCic.term -> NCic.term) ->
64     refresh_uri_in_reference:(NReference.reference -> NReference.reference) ->
65     alias_only:bool ->
66      dumpable_status -> dumpable_status
67
68   val register: < run: 'a.  string -> 'a register_type -> ('a -> obj) >
69   val serialize: baseuri:NUri.uri -> dumpable_status -> unit
70   val require: baseuri:
71    NUri.uri -> fname:string -> alias_only:bool ->
72     dumpable_status -> dumpable_status
73   val dependencies_of: baseuri:NUri.uri -> string list
74  end
75
76 module Serializer(D: sig type dumpable_s val get: dumpable_s -> dumpable_status  val set: dumpable_s -> dumpable_status -> dumpable_s end) :
77   SerializerType with type dumpable_status = D.dumpable_s
78
79 val refresh_uri: NUri.uri -> NUri.uri
80
81 val ng_path_of_baseuri: ?no_suffix:bool -> NUri.uri -> string
82 (* EOF *)