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