1 (* Copyright (C) 2004, HELM Team.
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.
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.
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.
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,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 class proof ?uri ~typ ~metasenv ~body () =
29 inherit [unit] StatefulProofEngine.status ?uri ~typ ~body ~metasenv
34 method private currentProof =
35 let (uri, metasenv, bo, ty) = self#proof in
39 | None -> MatitaTypes.untitled_con_uri
41 (* TODO CSC: Wrong: [] is just plainly wrong *)
42 Cic.CurrentProof (UriManager.name_of_uri uri, metasenv, bo, ty, [])
45 let currentproof = self#currentProof in
46 let (acurrentproof,_,_,ids_to_inner_sorts,_,_,_) =
47 Cic2acic.acic_object_of_cic_object ~eta_fix:false currentproof
49 let uri = MatitaTypes.unopt_uri self#uri in
51 match Cic2Xml.print_object uri ~ids_to_inner_sorts
52 ~ask_dtd_to_the_getter:true acurrentproof
54 | xml, Some bodyxml -> xml, bodyxml
55 | _, None -> assert false
60 let (xml, bodyxml) = self#toXml in
61 let buf = Buffer.create 10240 in
62 List.iter (Buffer.add_string buf)
63 [ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
64 "<!DOCTYPE ConstantType SYSTEM \"http://mowgli.cs.unibo.it:58081/getdtd?uri=cic.dtd\">\n";
66 (Misc.strip_xml_headings (Xml.pp_to_string xml));
67 (Misc.strip_xml_headings(Xml.pp_to_string bodyxml));
68 (if not (self#proof_completed) then
69 Printf.sprintf "<CurrentGoal>%d</CurrentGoal>" self#goal
78 let proof ?uri ~metasenv ~typ () =
79 let metasenv = (1, [], typ) :: metasenv in
80 let body = Cic.Meta (1,[]) in
81 let _ = CicTypeChecker.type_of_aux' metasenv [] typ in
82 new proof ~typ ~metasenv ~body ?uri ()