]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/applyTransformation.ml
- cic_exportation, cic_acic, acic_content (only parts related to acic)
[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 let mpres_document pres_box =
39   Xml.add_xml_declaration (CicNotationPres.print_box pres_box)
40
41 let nmml_of_cic_sequent status metasenv subst sequent =
42   let content_sequent,ids_to_refs =
43    NTermCicContent.nmap_sequent status ~metasenv ~subst sequent in 
44   let pres_sequent = 
45    Sequent2pres.nsequent2pres ids_to_refs subst content_sequent in
46   let xmlpres = mpres_document pres_sequent in
47    Xml2Gdome.document_of_xml DomMisc.domImpl xmlpres
48
49 let ntxt_of_cic_sequent ~map_unicode_to_tex size status metasenv subst sequent =
50   let content_sequent,ids_to_refs =
51    NTermCicContent.nmap_sequent status ~metasenv ~subst sequent in 
52   let pres_sequent = 
53    Sequent2pres.nsequent2pres ids_to_refs subst content_sequent in
54   let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
55    BoxPp.render_to_string ~map_unicode_to_tex
56     (function x::_ -> x | _ -> assert false) size pres_sequent
57
58 let nmml_of_cic_object status obj =
59  let cobj,ids_to_nrefs = NTermCicContent.nmap_obj status obj in 
60  let pres_sequent = Content2pres.ncontent2pres ~ids_to_nrefs cobj in
61  let xmlpres = mpres_document pres_sequent in
62   Xml2Gdome.document_of_xml DomMisc.domImpl xmlpres
63 ;;
64
65 let ntxt_of_cic_object ~map_unicode_to_tex size status obj =
66  let cobj,ids_to_nrefs = NTermCicContent.nmap_obj status obj in 
67  let pres_sequent = Content2pres.ncontent2pres ~ids_to_nrefs cobj in
68  let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
69   BoxPp.render_to_string ~map_unicode_to_tex
70    (function x::_ -> x | _ -> assert false) size pres_sequent
71 ;;