]> matita.cs.unibo.it Git - helm.git/blob - matita/components/ng_cic_content/interpretations.mli
- content/interpretations.ml and ng_cic_content/nTermCicContent.ml where
[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 type id = string
30
31 val hide_coercions: bool ref
32
33 type db
34
35 class type g_status =
36   object
37     inherit NCicCoercion.g_status
38     method interp_db: db
39   end
40
41 class status :
42   object ('self)
43     inherit NCicCoercion.status
44     method interp_db: db
45     method set_interp_db: db -> 'self
46     method set_interp_status: #g_status -> 'self
47   end
48
49 type cic_id = string
50
51 val add_interpretation:
52   #status as 'status ->
53   string ->                                       (* id / description *)
54   string * NotationPt.argument_pattern list -> (* symbol, level 2 pattern *)
55   NotationPt.cic_appl_pattern ->               (* level 3 pattern *)
56     'status
57
58 exception Interpretation_not_found
59
60   (** @raise Interpretation_not_found *)
61 val lookup_interpretations:
62   #status ->
63    ?sorted:bool -> string -> (* symbol *)
64     (string * NotationPt.argument_pattern list *
65       NotationPt.cic_appl_pattern) list
66
67   (** {3 Interpretations toggling} *)
68
69 val toggle_active_interpretations: #status as 'status -> bool -> 'status
70
71   (** {2 content -> cic} *)
72
73   (** @param env environment from argument_pattern to cic terms
74    * @param pat cic_appl_pattern *)
75 val instantiate_appl_pattern:
76   mk_appl:('term list -> 'term) -> 
77   mk_implicit:(bool -> 'term) ->
78   term_of_nref : (NReference.reference -> 'term) ->
79   (string * 'term) list -> NotationPt.cic_appl_pattern ->
80     'term
81
82 val nmap_sequent:
83  #status -> metasenv:NCic.metasenv -> subst:NCic.substitution ->
84   int * NCic.conjecture ->
85    NotationPt.term Content.conjecture *
86     (id, NReference.reference) Hashtbl.t    (* id -> reference *)
87
88 val nmap_obj:
89  #status -> NCic.obj ->
90   NotationPt.term Content.cobj *
91    (id, NReference.reference) Hashtbl.t    (* id -> reference *)