]> matita.cs.unibo.it Git - helm.git/blob - matita/components/ng_library/nCicLibrary.mli
WARNING: partial commit (does not compile)
[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
16 type timestamp
17
18 class type g_status =
19  object
20   method timestamp: timestamp
21  end
22
23 class status :
24  object ('self)
25   inherit g_status
26   method set_timestamp: timestamp -> 'self
27   method set_library_status: #g_status -> 'self
28  end
29
30 (* it also checks it and add it to the environment *)
31 val add_obj: #status as 'status -> NCic.obj -> 'status
32 val add_constraint: 
33   #status as 'status -> NCic.universe -> NCic.universe -> 'status
34 val aliases_of: NUri.uri -> NReference.reference list
35 val resolve: string -> NReference.reference list
36 (* warning: get_obj may raise (NCicEnvironment.ObjectNotFoud l) *)
37 val get_obj: NUri.uri -> NCic.obj (* changes the current timestamp *)
38
39 val clear_cache : unit -> unit
40
41 val time_travel: #status -> unit
42 val decompile: baseuri:NUri.uri -> unit
43
44 val init: unit -> unit
45
46 type obj
47
48 module type SerializerType =
49  sig
50   type dumpable_status
51
52   type 'a register_type =
53    'a ->
54     refresh_uri_in_universe:(NCic.universe -> NCic.universe) ->
55     refresh_uri_in_term:(NCic.term -> NCic.term) ->
56      dumpable_status -> dumpable_status
57
58   val register: < run: 'a.  string -> 'a register_type -> ('a -> obj) >
59   val serialize: baseuri:NUri.uri -> obj list -> unit
60    (* the obj is the "include" command to be added to the dump list *)
61   val require: baseuri:NUri.uri -> dumpable_status -> dumpable_status * obj
62  end
63
64 module Serializer(D: sig type dumpable_status end) :
65   SerializerType with type dumpable_status = D.dumpable_status
66
67 class dumpable_status :
68  object ('self)
69   method dump: obj list
70   method set_dump: obj list -> 'self
71  end
72
73 (* CSC: only required during old-to-NG phase, to be deleted *)
74 val refresh_uri: NUri.uri -> NUri.uri
75
76 (* EOF *)