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