X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcontent_pres%2Fsequent2pres.ml;h=549f5c7c58d6437216b9c1d9320d19856938ee62;hb=f9abd21eb0d26cf9b632af4df819225be4d091e3;hp=391b178a27c3036fbfa450e1ea9240b7d2ff9968;hpb=5f94d6c85429545d90acc39a9b9fc9a2da33d567;p=helm.git diff --git a/helm/software/components/content_pres/sequent2pres.ml b/helm/software/components/content_pres/sequent2pres.ml index 391b178a2..549f5c7c5 100644 --- a/helm/software/components/content_pres/sequent2pres.ml +++ b/helm/software/components/content_pres/sequent2pres.ml @@ -47,7 +47,7 @@ let b_ink a = Box.Ink a module K = Content module P = Mpresentation -let sequent2pres term2pres (_,_,context,ty) = +let sequent2pres0 term2pres (_,_,context,ty) = let context2pres context = let rec aux accum = function @@ -64,7 +64,7 @@ let sequent2pres term2pres (_,_,context,ty) = (match dec_name with None -> "_" | Some n -> n)) ; - Box.b_text [] ":" ; + Box.b_space; Box.b_text [] ":"; Box.b_space; term2pres ty] in aux (r::accum) tl | (Some (`Definition d))::tl -> @@ -77,9 +77,9 @@ let sequent2pres term2pres (_,_,context,ty) = [ Box.b_object (p_mi [] (match def_name with None -> "_" - | Some n -> n)) ; - Box.b_text [] (Utf8Macro.unicode_of_tex "\\def") ; - term2pres bo] in + | Some n -> n)) ; Box.b_space ; + Box.b_text [] (Utf8Macro.unicode_of_tex "\\def") ; + Box.b_space; term2pres bo] in aux (r::accum) tl | _::_ -> assert false in aux [] context in @@ -96,12 +96,25 @@ let sequent2pres term2pres (_,_,context,ty) = pres_goal]))]) let sequent2pres ~ids_to_inner_sorts = - sequent2pres + sequent2pres0 (fun annterm -> let ast, ids_to_uris = - TermAcicContent.ast_of_acic ids_to_inner_sorts annterm + TermAcicContent.ast_of_acic ~output_type:`Term ids_to_inner_sorts annterm in CicNotationPres.box_of_mpres - (CicNotationPres.render ids_to_uris + (CicNotationPres.render + ~lookup_uri:(CicNotationPres.lookup_uri ids_to_uris) (TermContentPres.pp_ast ast))) +let nsequent2pres ~ids_to_nrefs ~subst = + let lookup_uri id = + try + let nref = Hashtbl.find ids_to_nrefs id in + Some (NReference.string_of_reference nref) + with Not_found -> None + in + sequent2pres0 + (fun ast -> + CicNotationPres.box_of_mpres + (CicNotationPres.render ~lookup_uri + (TermContentPres.pp_ast ast)))