]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/applyTransformation.ml
- further simplifications (??) of the status dependencies
[helm.git] / matita / matita / applyTransformation.ml
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 (*                   Andrea Asperti <asperti@cs.unibo.it>                  *)
31 (*                                21/11/2003                               *)
32 (*                                                                         *)
33 (*                                                                         *)
34 (***************************************************************************)
35
36 (* $Id$ *)
37
38 class status =
39  object
40   inherit Interpretations.status
41   inherit TermContentPres.status
42  end
43
44 let mpres_document pres_box =
45   Xml.add_xml_declaration (CicNotationPres.print_box pres_box)
46
47 let ntxt_of_cic_sequent ~map_unicode_to_tex size status metasenv subst sequent =
48   let content_sequent,ids_to_refs =
49    Interpretations.nmap_sequent status ~metasenv ~subst sequent in 
50   let pres_sequent = 
51    Sequent2pres.nsequent2pres status ids_to_refs subst content_sequent in
52   let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
53    BoxPp.render_to_string ~map_unicode_to_tex
54     (function x::_ -> x | _ -> assert false) size pres_sequent
55
56 let ntxt_of_cic_object ~map_unicode_to_tex size status obj =
57  let cobj,ids_to_nrefs = Interpretations.nmap_obj status obj in 
58  let pres_sequent = Content2pres.ncontent2pres status ~ids_to_nrefs cobj in
59  let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
60   BoxPp.render_to_string ~map_unicode_to_tex
61    (function x::_ -> x | _ -> assert false) size pres_sequent
62 ;;