]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/termViewer.mli
ocaml 3.09 transition
[helm.git] / helm / gTopLevel / termViewer.mli
1 (* Copyright (C) 2000-2002, 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://cs.unibo.it/helm/.
24  *)
25
26 (******************************************************************************)
27 (*                                                                            *)
28 (*                               PROJECT HELM                                 *)
29 (*                                                                            *)
30 (*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
31 (*                                 29/01/2003                                 *)
32 (*                                                                            *)
33 (*                                                                            *)
34 (******************************************************************************)
35
36 type mml_of_cic_sequent =
37  Cic.metasenv ->
38  int * Cic.context * Cic.term ->
39  Gdome.document * 
40  (Cic.annconjecture *
41   ((Cic.id, Cic.term) Hashtbl.t *
42    (Cic.id, Cic.id option) Hashtbl.t *
43    (string, Cic.hypothesis) Hashtbl.t *
44    (Cic.id, string) Hashtbl.t))
45    
46
47 type mml_of_cic_object =
48   Cic.obj ->
49   Gdome.document * 
50   (Cic.annobj * 
51    ((Cic.id, Cic.term) Hashtbl.t * 
52     (Cic.id, Cic.id option) Hashtbl.t *
53     (Cic.id, Cic.conjecture) Hashtbl.t * 
54     (Cic.id, Cic.hypothesis) Hashtbl.t *
55     (Cic.id, string) Hashtbl.t *   
56     (Cic.id, Cic2acic.anntypes) Hashtbl.t))
57
58 (** A widget to render sequents **)
59
60 class sequent_viewer :
61   mml_of_cic_sequent:mml_of_cic_sequent ->
62   Gtk_mathview.math_view Gtk.obj ->
63   object
64     inherit GMathViewAux.multi_selection_math_view
65
66     (* returns the list of selected terms         *)
67     (* selections which are not terms are ignored *)
68     method get_selected_terms : Cic.term list
69
70     (* returns the list of selected hypotheses         *)
71     (* selections which are not hypotheses are ignored *)
72     method get_selected_hypotheses : Cic.hypothesis list
73
74     method load_sequent : Cic.metasenv -> Cic.conjecture -> unit
75   end
76
77 val sequent_viewer :
78   mml_of_cic_sequent:mml_of_cic_sequent ->
79   ?hadjustment:GData.adjustment ->
80   ?vadjustment:GData.adjustment ->
81   ?font_size:int ->
82   ?log_verbosity:int ->
83   ?width:int ->
84   ?height:int ->
85   ?packing:(GObj.widget -> unit) ->
86   ?show:bool ->
87   unit -> sequent_viewer
88
89 (** A widget to render proofs **)
90
91 class proof_viewer :
92   mml_of_cic_object:mml_of_cic_object ->
93   Gtk_mathview.math_view Gtk.obj ->
94   object
95     inherit GMathViewAux.single_selection_math_view
96
97     (* the new current sequent becomes the one obtained *)
98     (* perforating the proof where the selection is     *)
99     method make_sequent_of_selected_term : unit
100
101     (* the new current sequent becomes the one obtained *)
102     (* focusing the proof on the selected metavariable  *)
103     method focus_sequent_of_selected_term : unit
104
105     (* load_proof also returns the annotated cic term and the *)
106     (* ids_to_inner_types and ids_to_inner_sorts maps.        *)
107     method load_proof :
108      Cic.obj ->
109       Cic.annobj * (Cic.id, Cic2acic.anntypes) Hashtbl.t *
110        (Cic.id, string) Hashtbl.t
111
112   end
113
114 val proof_viewer :
115   mml_of_cic_object:mml_of_cic_object ->
116   ?hadjustment:GData.adjustment ->
117   ?vadjustment:GData.adjustment ->
118   ?font_size:int ->
119   ?log_verbosity:int ->
120   ?width:int ->
121   ?height:int ->
122   ?packing:(GObj.widget -> unit) ->
123   ?show:bool ->
124   unit -> proof_viewer
125