]> matita.cs.unibo.it Git - helm.git/blob - matitaB/components/ng_library/nCicLibrary.mli
89e701fc16bc25e0b3d970e6fcdd5838b322ec24
[helm.git] / matitaB / 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 virtual status :
20  string option ->
21  object ('self)
22   inherit NCic.status
23   method timestamp: timestamp
24   method set_timestamp: timestamp -> 'self
25  end
26
27 (* it also checks it and add it to the environment *)
28 val add_obj: #status as 'status -> NCic.obj -> 'status
29 val add_constraint: 
30   #status as 'status -> NCic.universe -> NCic.universe -> 'status
31 val aliases_of: NUri.uri -> NReference.reference list
32 val resolve: string -> NReference.reference list
33 (* warning: get_obj may raise (NCicEnvironment.ObjectNotFoud l) *)
34 val get_obj: #NCic.status -> NUri.uri -> NCic.obj (* changes the current timestamp *)
35
36 val time_travel: #status -> unit
37
38 val init: unit -> unit
39
40 type obj
41 type dump
42
43 class type g_dumpable_status =
44  object
45   method dump: dump
46  end
47
48 class dumpable_status : 
49  object ('self)
50   inherit g_dumpable_status
51   method set_dump: dump -> 'self
52   method set_dumpable_status: #g_dumpable_status -> 'self
53  end
54
55 val get_transitively_included: #dumpable_status -> NUri.uri list
56 val dump_obj: #dumpable_status as 'status -> obj -> 'status
57
58 module type SerializerType =
59  sig
60   type dumpable_status
61
62   type 'a register_type =
63    'a ->
64     refresh_uri_in_universe:(NCic.universe -> NCic.universe) ->
65     refresh_uri_in_term:(NCic.status -> NCic.term -> NCic.term) ->
66     refresh_uri_in_reference:(NReference.reference -> NReference.reference) ->
67     alias_only:bool ->
68      dumpable_status -> dumpable_status
69
70   val register: < run: 'a.  string -> 'a register_type -> ('a -> obj) >
71   val serialize: baseuri:NUri.uri -> dumpable_status -> unit
72   val require: baseuri:
73    NUri.uri -> fname:string -> alias_only:bool ->
74     dumpable_status -> dumpable_status
75   val dependencies_of: string option -> baseuri:NUri.uri -> string list
76  end
77
78 module Serializer(D: sig type dumpable_s val get: dumpable_s -> dumpable_status
79   val set: dumpable_s -> dumpable_status -> dumpable_s val user : dumpable_s ->
80   string option end) :
81  SerializerType with type dumpable_status = D.dumpable_s
82
83 val refresh_uri: NUri.uri -> NUri.uri
84
85 val ng_path_of_baseuri: ?no_suffix:bool -> string option -> NUri.uri -> string
86 (* EOF *)