(* Copyright (C) 2004, HELM Team. * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science * Department, University of Bologna, Italy. * * HELM is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * HELM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HELM; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * * For details, see the HELM World-Wide-Web page, * http://helm.cs.unibo.it/ *) class proof ?uri ~typ ~metasenv ~body () = object (self) inherit [unit] StatefulProofEngine.status ?uri ~typ ~body ~metasenv (fun _ -> ()) (fun _ _ -> ()) () method private currentProof = let (uri, metasenv, bo, ty) = self#proof in let uri = match uri with | Some uri -> uri | None -> MatitaTypes.untitled_con_uri in (* TODO CSC: Wrong: [] is just plainly wrong *) Cic.CurrentProof (UriManager.name_of_uri uri, metasenv, bo, ty, []) method toXml = let currentproof = self#currentProof in let (acurrentproof,_,_,ids_to_inner_sorts,_,_,_) = Cic2acic.acic_object_of_cic_object ~eta_fix:false currentproof in let uri = MatitaTypes.unopt_uri self#uri in let xml, bodyxml = match Cic2Xml.print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter:true acurrentproof with | xml, Some bodyxml -> xml, bodyxml | _, None -> assert false in (xml, bodyxml) method toString = let (xml, bodyxml) = self#toXml in let buf = Buffer.create 10240 in List.iter (Buffer.add_string buf) [ "\n"; "\n"; "\n"; (Misc.strip_xml_headings (Xml.pp_to_string xml)); (Misc.strip_xml_headings(Xml.pp_to_string bodyxml)); (if not (self#proof_completed) then Printf.sprintf "%d" self#goal else ""); "\n" ]; Buffer.contents buf end let proof ?uri ~metasenv ~typ () = let metasenv = (1, [], typ) :: metasenv in let body = Cic.Meta (1,[]) in let _ = CicTypeChecker.type_of_aux' metasenv [] typ in new proof ~typ ~metasenv ~body ?uri ()