From: Claudio Sacerdoti Coen Date: Tue, 19 Nov 2002 17:18:34 +0000 (+0000) Subject: ~ask_dtd_to_the_getter parameter added to Cic2Xml.print_innertypes X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=2b5ac6792e5a19c8e3d77307afad115eb3f091b4;p=helm.git ~ask_dtd_to_the_getter parameter added to Cic2Xml.print_innertypes --- diff --git a/helm/gTopLevel/cic2Xml.ml b/helm/gTopLevel/cic2Xml.ml index e02f8cb15..f498effb6 100644 --- a/helm/gTopLevel/cic2Xml.ml +++ b/helm/gTopLevel/cic2Xml.ml @@ -28,6 +28,13 @@ exception ImpossiblePossible;; exception NotImplemented;; +let dtdname ~ask_dtd_to_the_getter dtd = + if ask_dtd_to_the_getter then + Configuration.getter_url ^ "getdtd?uri=" ^ dtd + else + "http://mowgli.cs.unibo.it/dtd/" ^ dtd +;; + let param_attribute_of_params params = String.concat " " (List.map UriManager.string_of_uri params) ;; @@ -249,17 +256,12 @@ let print_term ~ids_to_inner_sorts = aux ;; -let print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter = +let print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter obj = let module C = Cic in let module X = Xml in let module U = UriManager in - let dtdname = - if ask_dtd_to_the_getter then - Configuration.getter_url ^ "getdtd?uri=cic.dtd" - else - "http://www.cs.unibo.it/helm/dtd/cic.dtd" - in - function + let dtdname = dtdname ~ask_dtd_to_the_getter "cic.dtd" in + match obj with C.ACurrentProof (id,idbody,n,conjectures,bo,ty,params) -> let params' = param_attribute_of_params params in let xml_for_current_proof_body = @@ -394,20 +396,28 @@ let print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter = >], None ;; -let print_inner_types curi ~ids_to_inner_sorts ~ids_to_inner_types = +let + print_inner_types curi ~ids_to_inner_sorts ~ids_to_inner_types + ~ask_dtd_to_the_getter += let module C2A = Cic2acic in let module X = Xml in - X.xml_nempty "InnerTypes" ["of",UriManager.string_of_uri curi] - (Hashtbl.fold - (fun id {C2A.annsynthesized = synty ; C2A.annexpected = expty} x -> - [< x ; - X.xml_nempty "TYPE" ["of",id] - [< print_term ids_to_inner_sorts synty ; - match expty with - None -> [<>] - | Some expty' -> print_term ids_to_inner_sorts expty' + let dtdname = dtdname ~ask_dtd_to_the_getter "cictypes.dtd" in + [< X.xml_cdata "\n" ; + X.xml_cdata + ("\n") ; + X.xml_nempty "InnerTypes" ["of",UriManager.string_of_uri curi] + (Hashtbl.fold + (fun id {C2A.annsynthesized = synty ; C2A.annexpected = expty} x -> + [< x ; + X.xml_nempty "TYPE" ["of",id] + [< print_term ids_to_inner_sorts synty ; + match expty with + None -> [<>] + | Some expty' -> print_term ids_to_inner_sorts expty' + >] >] - >] - ) ids_to_inner_types [<>] - ) + ) ids_to_inner_types [<>] + ) + >] ;; diff --git a/helm/gTopLevel/cic2Xml.mli b/helm/gTopLevel/cic2Xml.mli index 0ce8cb330..0891d4996 100644 --- a/helm/gTopLevel/cic2Xml.mli +++ b/helm/gTopLevel/cic2Xml.mli @@ -40,4 +40,5 @@ val print_inner_types : UriManager.uri -> ids_to_inner_sorts: (string, string) Hashtbl.t -> ids_to_inner_types: (string, Cic2acic.anntypes) Hashtbl.t -> + ask_dtd_to_the_getter:bool -> Xml.token Stream.t diff --git a/helm/gTopLevel/gTopLevel.ml b/helm/gTopLevel/gTopLevel.ml index 999d2aaf4..8ec91964e 100644 --- a/helm/gTopLevel/gTopLevel.ml +++ b/helm/gTopLevel/gTopLevel.ml @@ -534,8 +534,8 @@ let annobj in let xmlinnertypes = - Cic2Xml.print_inner_types uri ~ids_to_inner_sorts - ~ids_to_inner_types + Cic2Xml.print_inner_types uri ~ids_to_inner_sorts ~ids_to_inner_types + ~ask_dtd_to_the_getter:true in let input = match bodyxml with @@ -566,8 +566,8 @@ let annobj in let xmlinnertypes = - Cic2Xml.print_inner_types uri ~ids_to_inner_sorts - ~ids_to_inner_types + Cic2Xml.print_inner_types uri ~ids_to_inner_sorts ~ids_to_inner_types + ~ask_dtd_to_the_getter:false in (* innertypes *) let innertypesuri = UriManager.innertypesuri_of_uri uri in @@ -788,12 +788,6 @@ let qed () = | _ -> raise OpenConjecturesStillThere ;; -(*???? -let dtdname = "http://www.cs.unibo.it/helm/dtd/cic.dtd";; -let dtdname = "/home/tassi/miohelm/helm/dtd/cic.dtd";; -*) -let dtdname = "/projects/helm/V7_mowgli/dtd/cic.dtd";; - let save () = let outputhtml = ((rendering_window ())#outputhtml : GHtml.xmhtml) in match !ProofEngine.proof with