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