]> matita.cs.unibo.it Git - helm.git/blob - matita/components/ng_cic_content/interpretations.mli
Use of standard OCaml syntax
[helm.git] / matita / components / ng_cic_content / interpretations.mli
1 (* Copyright (C) 2005, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26
27   (** {2 State handling} *)
28
29 val hide_coercions: bool ref
30
31 type db
32
33 class type g_status =
34   object
35     inherit NCicCoercion.g_status
36     method interp_db: db
37   end
38
39 class virtual status :
40   object ('self)
41     inherit g_status
42     inherit NCicCoercion.status
43     method set_interp_db: db -> 'self
44     method set_interp_status: #g_status -> 'self
45   end
46
47 val add_interpretation:
48   (#status as 'status) ->
49   string ->                                       (* id / description *)
50   string * NotationPt.argument_pattern list -> (* symbol, level 2 pattern *)
51   NotationPt.cic_appl_pattern ->               (* level 3 pattern *)
52     'status
53
54 exception Interpretation_not_found
55
56   (** @raise Interpretation_not_found *)
57 val lookup_interpretations:
58   #status ->
59    ?sorted:bool -> string -> (* symbol *)
60     (string * NotationPt.argument_pattern list *
61       NotationPt.cic_appl_pattern) list
62
63   (** {3 Interpretations toggling} *)
64
65 val toggle_active_interpretations: (#status as 'status) -> bool -> 'status
66
67   (** {2 content -> cic} *)
68
69   (** @param env environment from argument_pattern to cic terms
70    * @param pat cic_appl_pattern *)
71 val instantiate_appl_pattern:
72   mk_appl:('term list -> 'term) -> 
73   mk_implicit:(bool -> 'term) ->
74   term_of_nref : (NReference.reference -> 'term) ->
75   (string * 'term) list -> NotationPt.cic_appl_pattern ->
76     'term
77
78 val nmap_term:
79  #status ->
80   metasenv:NCic.metasenv -> subst:NCic.substitution -> context:NCic.context ->
81   NCic.term ->
82    NotationPt.term *
83    (Content.id, NReference.reference) Hashtbl.t    (* id -> reference *)
84
85 val nmap_context:
86  #status ->
87   metasenv:NCic.metasenv -> subst:NCic.substitution ->
88   NCic.context ->
89    NotationPt.term Content.context *
90    (Content.id, NReference.reference) Hashtbl.t    (* id -> reference *)
91
92 val nmap_sequent:
93  #status -> metasenv:NCic.metasenv -> subst:NCic.substitution ->
94   int * NCic.conjecture ->
95    NotationPt.term Content.conjecture *
96     (Content.id, NReference.reference) Hashtbl.t    (* id -> reference *)
97
98 val nmap_cobj:
99  #status -> NCic.obj ->
100   NotationPt.term Content.cobj *
101    (Content.id, NReference.reference) Hashtbl.t    (* id -> reference *)
102
103 val nmap_obj:
104  #status -> NCic.obj ->
105   NotationPt.term NotationPt.obj *
106    (Content.id, NReference.reference) Hashtbl.t    (* id -> reference *)