]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/content2pres.ml
1) the home button of CicBrowser now works also for NG
[helm.git] / helm / software / components / content_pres / content2pres.ml
index 46f53d8860c85a00ac600373c36e63b5f74dbfa9..282cfe26ee1655329ab3600802211bc020f6dcf9 100644 (file)
@@ -929,7 +929,7 @@ let joint_def2pres term2pres def =
   | `Inductive ind -> inductive2pres term2pres ind
   | _ -> assert false (* ZACK or raise ToDo? *)
 
-let content2pres 
+let content2pres0
   ?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres 
   (id,params,metasenv,obj) 
 =
@@ -976,7 +976,7 @@ let content2pres
 let content2pres 
   ?skip_initial_lambdas ?skip_thm_and_qed ~ids_to_inner_sorts 
 =
-  content2pres ?skip_initial_lambdas ?skip_thm_and_qed
+  content2pres0 ?skip_initial_lambdas ?skip_thm_and_qed
     (fun ?(prec=90) annterm ->
       let ast, ids_to_uris =
        TermAcicContent.ast_of_acic ~output_type:`Term ids_to_inner_sorts annterm
@@ -985,3 +985,15 @@ let content2pres
         (CicNotationPres.render
           ~lookup_uri:(CicNotationPres.lookup_uri ids_to_uris) ~prec
           (TermContentPres.pp_ast ast)))
+
+let ncontent2pres ?skip_initial_lambdas ?skip_thm_and_qed ~ids_to_nrefs =
+ 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
+  content2pres0 ?skip_initial_lambdas ?skip_thm_and_qed
+    (fun ?(prec=90) ast ->
+      CicNotationPres.box_of_mpres
+       (CicNotationPres.render ~lookup_uri ~prec (TermContentPres.pp_ast ast)))