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