1 (* Copyright (C) 2003-2005, 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://cs.unibo.it/helm/.
26 (***************************************************************************)
30 (* Andrea Asperti <asperti@cs.unibo.it> *)
33 (***************************************************************************)
37 module P = Mpresentation
41 let p_mtr a b = Mpresentation.Mtr(a,b)
42 let p_mtd a b = Mpresentation.Mtd(a,b)
43 let p_mtable a b = Mpresentation.Mtable(a,b)
44 let p_mtext a b = Mpresentation.Mtext(a,b)
45 let p_mi a b = Mpresentation.Mi(a,b)
46 let p_mo a b = Mpresentation.Mo(a,b)
47 let p_mrow a b = Mpresentation.Mrow(a,b)
48 let p_mphantom a b = Mpresentation.Mphantom(a,b)
53 split (n-1) (List.tl l) in
56 let get_xref = function
58 | `Hypothesis d -> d.Con.dec_id
59 | `Proof p -> p.Con.proof_id
60 | `Definition d -> d.Con.def_id
61 | `Joint jo -> jo.Con.joint_id
64 RenderingAttrs.spacing_attributes `BoxML
65 @ RenderingAttrs.indent_attributes `BoxML
67 let make_row items concl =
68 B.b_hv hv_attrs (items @ [ concl ])
71 B.b_v attrs [B.b_h [] items; B.b_indent concl]
73 B.b_h attrs (items@[B.b_space; concl]) *)
75 let make_concl ?(attrs=[]) verb concl =
76 B.b_hv (hv_attrs @ attrs) [ B.b_kw verb; concl ]
79 B.b_v attrs [ B.b_kw verb; B.b_indent concl]
81 B.b_h attrs [ B.b_kw verb; B.b_space; concl ] *)
83 let make_args_for_apply term2pres args =
84 let make_arg_for_apply is_first arg row =
87 Con.Aux n -> assert false
90 (match prem.Con.premise_binder with
93 (B.b_object (P.Mi ([], name)))::row
96 Some "helm", "xref", lemma.Con.lemma_id;
97 Some "xlink", "href", lemma.Con.lemma_uri ]
99 (B.b_object (P.Mi(lemma_attrs,lemma.Con.lemma_name)))::row
103 else (B.b_object (P.Mi([],"?")))::row
106 (B.b_object (P.Mi([],"?")))::row
108 if is_first then res else B.skip::res
112 make_arg_for_apply true hd
113 (List.fold_right (make_arg_for_apply false) tl [])
116 let get_name = function
120 let add_xref id = function
121 | B.Text (attrs, t) -> B.Text (((Some "helm", "xref", id) :: attrs), t)
122 | _ -> assert false (* TODO, add_xref is meaningful for all boxes *)
124 let rec justification term2pres p =
125 if ((p.Con.proof_conclude.Con.conclude_method = "Exact") or
126 ((p.Con.proof_context = []) &
127 (p.Con.proof_apply_context = []) &
128 (p.Con.proof_conclude.Con.conclude_method = "Apply"))) then
130 make_args_for_apply term2pres p.Con.proof_conclude.Con.conclude_args in
132 (B.b_kw "by")::B.b_space::
133 B.Text([],"(")::pres_args@[B.Text([],")")]), None
135 Some (B.b_toggle [B.b_kw "proof";proof2pres true term2pres p])
137 and proof2pres ?skip_initial_lambdas is_top_down term2pres p =
138 let rec proof2pres ?(skip_initial_lambdas_internal=false) is_top_down p omit_dot =
139 prerr_endline p.Con.proof_conclude.Con.conclude_method;
144 | `Hypothesis _ -> true
146 ((List.filter is_decl p.Con.proof_context) != []) in
147 let omit_conclusion = (not indent) && (p.Con.proof_context != []) in
149 (match p.Con.proof_conclude.Con.conclude_conclusion with
151 | Some t -> Some (term2pres t)) in
154 conclude2pres ~skip_initial_lambdas_internal is_top_down p.Con.proof_conclude indent omit_conclusion
158 (p.Con.proof_conclude.Con.conclude_method = "BU_Conversion")
159 p.Con.proof_apply_context
161 (p.Con.proof_conclude.Con.conclude_method = "BU_Conversion")
164 (if skip_initial_lambdas_internal then [] else p.Con.proof_context)
167 match p.Con.proof_name with
175 make_concl ~attrs:[ Some "helm", "xref", p.Con.proof_id ]
177 B.b_toggle [ concl; body ]
181 and context2pres c continuation =
182 (* we generate a subtable for each context element, for selection
184 The table generated by the head-element does not have an xref;
185 the whole context-proof is already selectable *)
191 (fun ce continuation ->
192 let xref = get_xref ce in
193 B.V([Some "helm", "xref", xref ],
194 [B.H([Some "helm", "xref", "ce_"^xref],
195 [ce2pres_in_proof_context_element ce]);
196 continuation])) tl continuation in
197 let hd_xref= get_xref hd in
199 [B.H([Some "helm", "xref", "ce_"^hd_xref],
200 [ce2pres_in_proof_context_element hd]);
203 and ce2pres_in_joint_context_element = function
204 | `Inductive _ -> assert false (* TODO *)
205 | (`Declaration _) as x -> ce2pres x
206 | (`Hypothesis _) as x -> ce2pres x
207 | (`Proof _) as x -> ce2pres x
208 | (`Definition _) as x -> ce2pres x
210 and ce2pres_in_proof_context_element = function
212 B.H ([],(List.map ce2pres_in_joint_context_element ho.Content.joint_defs))
213 | (`Declaration _) as x -> ce2pres x
214 | (`Hypothesis _) as x -> ce2pres x
215 | (`Proof _) as x -> ce2pres x
216 | (`Definition _) as x -> ce2pres x
221 let ty = term2pres d.Con.dec_type in
225 B.Object ([], P.Mi([],get_name d.Con.dec_name));
230 let ty = term2pres h.Con.dec_type in
237 B.Object ([], P.Mi ([],get_name h.Con.dec_name));
241 proof2pres false p false
243 let term = term2pres d.Con.def_term in
245 [ B.b_kw "let"; B.b_space;
246 B.Object ([], P.Mi([],get_name d.Con.def_name));
247 B.Text([],Utf8Macro.unicode_of_tex "\\def");
250 and acontext2pres is_top_down ac continuation indent in_bu_conversion =
252 (fun p continuation ->
255 B.indent (proof2pres is_top_down p in_bu_conversion)
257 proof2pres is_top_down p in_bu_conversion
259 B.V([Some "helm","xref",p.Con.proof_id],
260 [B.H([Some "helm","xref","ace_"^p.Con.proof_id],[hd]);
261 continuation])) ac continuation
263 and conclude2pres ?skip_initial_lambdas_internal is_top_down conclude indent omit_conclusion omit_dot =
265 match conclude.Con.conclude_conclusion with
266 Some t (*when not omit_conclusion or
267 (* CSC: I ignore the omit_conclusion flag in this case. *)
268 (* CSC: Is this the correct behaviour? In the stylesheets *)
269 (* CSC: we simply generated nothing (i.e. the output type *)
270 (* CSC: of the function should become an option. *)
271 conclude.Con.conclude_method = "BU_Conversion" *) ->
272 let concl = term2pres t in
273 if conclude.Con.conclude_method = "BU_Conversion" then
275 (make_concl "that is equivalent to" concl ::
276 if is_top_down then [B.b_space ; B.Text([],"done.")] else [])
277 else if conclude.Con.conclude_method = "FalseInd" then
278 (* false ind is in charge to add the conclusion *)
282 conclude_aux ?skip_initial_lambdas_internal conclude in
284 if conclude.Con.conclude_method = "Intros+LetTac"
285 || conclude.Con.conclude_method = "ByInduction"
286 || conclude.Con.conclude_method = "TD_Conversion"
289 else if omit_conclusion then B.Text([],"done.")
291 ((if not is_top_down || omit_dot then [make_concl "we proved" concl; B.Text([],if not is_top_down then "(previous)" else "")] else [B.Text([],"done")]) @ if not omit_dot then [B.Text([],".")] else [])
293 B.V ([], [conclude_body; ann_concl])
294 | _ -> conclude_aux ?skip_initial_lambdas_internal conclude
297 B.indent (B.H ([Some "helm", "xref", conclude.Con.conclude_id],
300 B.H ([Some "helm", "xref", conclude.Con.conclude_id],[tconclude_body])
302 and conclude_aux ?skip_initial_lambdas_internal conclude =
303 if conclude.Con.conclude_method = "TD_Conversion" then
305 (match conclude.Con.conclude_conclusion with
306 None -> B.Text([],"NO EXPECTED!!!")
307 | Some c -> term2pres c) in
309 (match conclude.Con.conclude_args with
310 [Con.ArgProof p] -> p
311 | _ -> assert false) in
313 (match subproof.Con.proof_conclude.Con.conclude_conclusion with
314 None -> B.Text([],"NO SYNTH!!!")
315 | Some c -> (term2pres c)) in
318 [make_concl "we need to prove" expected;
319 make_concl "or equivalently" synth;
321 proof2pres true subproof false])
322 else if conclude.Con.conclude_method = "BU_Conversion" then
324 else if conclude.Con.conclude_method = "Exact" then
326 (match conclude.Con.conclude_args with
327 [Con.Term t] -> term2pres t
329 (match p.Con.premise_binder with
330 | None -> assert false; (* unnamed hypothesis ??? *)
331 | Some s -> B.Text([],s))
332 | err -> assert false) in
333 (match conclude.Con.conclude_conclusion with
335 B.b_h [] [B.b_kw "by"; B.b_space; arg]
336 | Some c -> let conclusion = term2pres c in
337 B.b_h [] [B.b_kw "by"; B.b_space; arg]
339 else if conclude.Con.conclude_method = "Intros+LetTac" then
340 (match conclude.Con.conclude_args with
341 [Con.ArgProof p] -> proof2pres ?skip_initial_lambdas_internal true p false
345 (match conclude.Con.conclude_conclusion with
346 None -> B.Text([],"NO Conclusion!!!")
347 | Some c -> term2pres c) in
348 (match conclude.Con.conclude_args with
351 ([None,"align","baseline 1"; None,"equalrows","false";
352 None,"columnalign","left"],
353 [B.H([],[B.Object([],proof2pres p false)]);
355 (make_concl "we proved 1" conclusion))])]);
358 else if (conclude.Con.conclude_method = "Case") then
360 else if (conclude.Con.conclude_method = "ByInduction") then
362 else if (conclude.Con.conclude_method = "Exists") then
364 else if (conclude.Con.conclude_method = "AndInd") then
366 else if (conclude.Con.conclude_method = "FalseInd") then
368 else if (conclude.Con.conclude_method = "Rewrite") then
369 let justif1,justif2 =
370 (match (List.nth conclude.Con.conclude_args 6) with
371 Con.ArgProof p -> justification term2pres p
372 | _ -> assert false) in
374 (match List.nth conclude.Con.conclude_args 2 with
375 Con.Term t -> term2pres t
376 | _ -> assert false) in
378 (match List.nth conclude.Con.conclude_args 5 with
379 Con.Term t -> term2pres t
380 | _ -> assert false) in
386 B.b_space; (B.b_kw "with");
388 B.b_space; justif1])::
389 match justif2 with None -> [] | Some j -> [B.indent j])
390 *) B.V([], [justif1 ; B.H([],[B.b_kw "we proved (" ; term2 ; B.b_kw "=" ; term1; B.b_kw ") (previous)."]); B.b_kw "by _"])
391 else if conclude.Con.conclude_method = "Eq_chain" then
392 let justification p =
393 if skip_initial_lambdas <> None (* cheating *) then
396 let j1,j2 = justification term2pres p in
397 j1 :: B.b_space :: (match j2 with Some j -> [j] | None -> [])
402 | (Con.ArgProof p)::(Con.Term t)::tl ->
403 B.HOV(RenderingAttrs.indent_attributes `BoxML,([B.b_kw
404 "=";B.b_space;term2pres t;B.b_space]@justification p@
405 (if tl <> [] then [B.Text ([],".")] else [])))::(aux tl)
409 match List.hd conclude.Con.conclude_args with
413 B.HOV([],[B.Text ([],"conclude");B.b_space;term2pres hd; (* B.b_space; *)
414 B.V ([],aux (List.tl conclude.Con.conclude_args))])
415 else if conclude.Con.conclude_method = "Apply" then
417 make_args_for_apply term2pres conclude.Con.conclude_args in
421 B.Text([],"(")::pres_args@[B.Text([],")")])
424 B.b_kw ("Apply method" ^ conclude.Con.conclude_method ^ " to");
425 (B.indent (B.V ([], args2pres conclude.Con.conclude_args)))])
427 and args2pres l = List.map arg2pres l
431 Con.Aux n -> B.b_kw ("aux " ^ n)
432 | Con.Premise prem -> B.b_kw "premise"
433 | Con.Lemma lemma -> B.b_kw "lemma"
434 | Con.Term t -> term2pres t
435 | Con.ArgProof p -> proof2pres true p false
436 | Con.ArgMethod s -> B.b_kw "method"
439 let proof_conclusion =
440 (match conclude.Con.conclude_conclusion with
441 None -> B.b_kw "No conclusion???"
442 | Some t -> term2pres t) in
443 let arg,args_for_cases =
444 (match conclude.Con.conclude_args with
445 Con.Aux(_)::Con.Aux(_)::Con.Term(_)::arg::tl ->
447 | _ -> assert false) in
451 Con.Aux n -> B.b_kw "an aux???"
452 | Con.Premise prem ->
453 (match prem.Con.premise_binder with
454 None -> B.b_kw "the previous result"
455 | Some n -> B.Object ([], P.Mi([],n)))
456 | Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name))
459 | Con.ArgProof p -> B.b_kw "a proof???"
460 | Con.ArgMethod s -> B.b_kw "a method???")
462 (make_concl "we proceed by cases on" case_arg) in
464 (make_concl "to prove" proof_conclusion) in
465 B.V ([], case_on::to_prove::(make_cases args_for_cases))
467 and byinduction conclude =
468 let proof_conclusion =
469 (match conclude.Con.conclude_conclusion with
470 None -> B.b_kw "No conclusion???"
471 | Some t -> term2pres t) in
472 let inductive_arg,args_for_cases =
473 (match conclude.Con.conclude_args with
475 let l1,l2 = split (int_of_string n) tl in
476 let last_pos = (List.length l2)-1 in
477 List.nth l2 last_pos,l1
478 | _ -> assert false) in
481 (match inductive_arg with
482 Con.Aux n -> B.b_kw "an aux???"
483 | Con.Premise prem ->
484 (match prem.Con.premise_binder with
485 None -> B.b_kw "the previous result"
486 | Some n -> B.Object ([], P.Mi([],n)))
487 | Con.Lemma lemma -> B.Object ([], P.Mi([],lemma.Con.lemma_name))
490 | Con.ArgProof p -> B.b_kw "a proof???"
491 | Con.ArgMethod s -> B.b_kw "a method???") in
492 (make_concl "we proceed by induction on" arg) in
494 (make_concl "to prove" proof_conclusion) in
495 B.V ([], induction_on::to_prove:: B.Text([],".")::(make_cases args_for_cases))
497 and make_cases l = List.map make_case l
503 (match p.Con.proof_name with
504 None -> B.b_kw "no name for case!!"
505 | Some n -> B.Object ([], P.Mi([],n))) in
509 `Hypothesis h -> h.Con.dec_inductive
510 | _ -> false) p.Con.proof_context in
518 let name = get_name h.Con.dec_name in
521 B.Object ([], P.Mi ([],name));
523 (term2pres h.Con.dec_type);
525 | _ -> assert false (*[B.Text ([],"???")]*)) in
529 (B.b_kw "case"::B.b_space::name::pattern_aux)@
533 (match p.Con.proof_conclude.Con.conclude_conclusion with
534 None -> B.b_kw "No conclusion!!!"
535 | Some t -> term2pres t) in
536 let asubconcl = B.indent (make_concl "the thesis becomes" subconcl) in
537 let induction_hypothesis =
541 let text = B.indent (B.b_kw "by induction hypothesis we know") in
546 (match h.Con.dec_name with
550 [term2pres h.Con.dec_type;
553 B.Object ([], P.Mi ([],name));
556 | _ -> assert false in
557 let hyps = List.map make_hyp indhyps in
560 acontext2pres_old p.Con.proof_apply_context true in *)
562 conclude2pres true p.Con.proof_conclude true true false in
565 match p.Con.proof_apply_context with
566 [] -> p.Con.proof_conclude.Con.conclude_id
567 | {Con.proof_id = id}::_ -> id
569 B.Action([None,"type","toggle"],
570 [ B.indent (add_xref acontext_id (B.b_kw "Proof"));
572 (p.Con.proof_conclude.Con.conclude_method = "BU_Conversion")
573 p.Con.proof_apply_context body true
574 (p.Con.proof_conclude.Con.conclude_method = "BU_Conversion")
576 B.V ([], pattern::induction_hypothesis@[asubconcl;B.Text([],".");presacontext])
579 and falseind conclude =
580 let proof_conclusion =
581 (match conclude.Con.conclude_conclusion with
582 None -> B.b_kw "No conclusion???"
583 | Some t -> term2pres t) in
585 (match conclude.Con.conclude_args with
586 [Con.Aux(n);_;case_arg] -> case_arg
589 List.map (ContentPp.parg 0) conclude.Con.conclude_args;
593 Con.Aux n -> assert false
594 | Con.Premise prem ->
595 (match prem.Con.premise_binder with
596 None -> [B.b_kw "Contradiction, hence"]
598 [ B.Object ([],P.Mi([],n)); B.skip;
599 B.b_kw "is contradictory, hence"])
601 [ B.Object ([], P.Mi([],lemma.Con.lemma_name)); B.skip;
602 B.b_kw "is contradictory, hence" ]
603 | _ -> assert false) in
604 (* let body = proof2pres {proof with Con.proof_context = tl} false in *)
605 make_row arg proof_conclusion
607 and andind conclude =
609 (match conclude.Con.conclude_args with
610 [Con.Aux(n);_;Con.ArgProof proof;case_arg] -> proof,case_arg
613 List.map (ContentPp.parg 0) conclude.Con.conclude_args;
617 Con.Aux n -> assert false
618 | Con.Premise prem ->
619 (match prem.Con.premise_binder with
621 | Some n -> [(B.b_kw "by"); B.b_space; B.Object([], P.Mi([],n))])
623 [(B.b_kw "by");B.skip;
624 B.Object([], P.Mi([],lemma.Con.lemma_name))]
625 | _ -> assert false) in
626 match proof.Con.proof_context with
627 `Hypothesis hyp1::`Hypothesis hyp2::tl ->
631 B.Object ([], P.Mi([],get_name hyp1.Con.dec_name));
634 term2pres hyp1.Con.dec_type]) in
638 B.Object ([], P.Mi([],get_name hyp2.Con.dec_name));
641 term2pres hyp2.Con.dec_type]) in
642 (* let body = proof2pres {proof with Con.proof_context = tl} false in *)
643 let body= conclude2pres false proof.Con.proof_conclude false true false in
645 acontext2pres false proof.Con.proof_apply_context body false false
649 [B.H ([],arg@[B.skip; B.b_kw "we have"]);
656 and exists conclude =
658 (match conclude.Con.conclude_args with
659 [Con.Aux(n);_;Con.ArgProof proof;_] -> proof
662 List.map (ContentPp.parg 0) conclude.Con.conclude_args;
664 match proof.Con.proof_context with
665 `Declaration decl::`Hypothesis hyp::tl
666 | `Hypothesis decl::`Hypothesis hyp::tl ->
671 B.Object ([], P.Mi([],get_name decl.Con.dec_name));
672 B.Text([],":"); term2pres decl.Con.dec_type]) in
675 [(B.b_kw "such that");
678 B.Object ([], P.Mi([],get_name hyp.Con.dec_name));
681 term2pres hyp.Con.dec_type]) in
682 (* let body = proof2pres {proof with Con.proof_context = tl} false in *)
683 let body= conclude2pres false proof.Con.proof_conclude false true false in
685 acontext2pres false proof.Con.proof_apply_context body false false
695 proof2pres ?skip_initial_lambdas_internal:skip_initial_lambdas is_top_down p false
701 let conjecture2pres term2pres (id, n, context, ty) =
703 (B.b_hv [Some "helm", "xref", id]
705 B.b_h [] [B.b_text [] "{...}"; B.b_space];
710 [ B.b_object (p_mi [] "_") ;
711 B.b_object (p_mo [] ":?") ;
712 B.b_object (p_mi [] "_")]
713 | Some (`Declaration d)
714 | Some (`Hypothesis d) ->
715 let { Content.dec_name =
716 dec_name ; Content.dec_type = ty } = d
726 | Some (`Definition d) ->
728 { Content.def_name = def_name ;
729 Content.def_term = bo } = d
732 [ B.b_object (p_mi []
736 B.b_text [] (Utf8Macro.unicode_of_tex "\\Assign");
739 let proof_name = p.Content.proof_name in
741 [ B.b_object (p_mi []
742 (match proof_name with
745 B.b_text [] (Utf8Macro.unicode_of_tex "\\Assign");
746 proof2pres true term2pres p])
747 (List.rev context)) ] ::
749 [ B.b_text [] (Utf8Macro.unicode_of_tex "\\vdash");
750 B.b_object (p_mi [] (string_of_int n)) ;
754 let metasenv2pres term2pres = function
757 (* Conjectures are in their own table to make *)
758 (* diffing the DOM trees easier. *)
760 ((B.b_kw ("Conjectures:" ^
761 (let _ = incr counter; in (string_of_int !counter)))) ::
762 (List.map (conjecture2pres term2pres) metasenv'))]
764 let params2pres params =
766 B.b_text [Some "xlink", "href", UriManager.string_of_uri uri]
767 (UriManager.name_of_uri uri)
769 let rec spatiate = function
772 | hd :: tl -> hd :: B.b_text [] ", " :: spatiate tl
777 let params = spatiate (List.map param2pres p) in
779 B.b_h [] (B.b_text [] "[" :: params @ [ B.b_text [] "]" ])]
781 let recursion_kind2pres params kind =
784 | `Recursive _ -> "Recursive definition"
785 | `CoRecursive -> "CoRecursive definition"
786 | `Inductive _ -> "Inductive definition"
787 | `CoInductive _ -> "CoInductive definition"
789 B.b_h [] (B.b_kw kind :: params2pres params)
791 let inductive2pres term2pres ind =
792 let constructor2pres decl =
794 B.b_text [] ("| " ^ get_name decl.Content.dec_name ^ ":");
796 term2pres decl.Content.dec_type
801 B.b_kw (ind.Content.inductive_name ^ " of arity");
803 term2pres ind.Content.inductive_type ]
804 :: List.map constructor2pres ind.Content.inductive_constructors)
806 let joint_def2pres term2pres def =
808 | `Inductive ind -> inductive2pres term2pres ind
809 | _ -> assert false (* ZACK or raise ToDo? *)
812 ?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres
813 (id,params,metasenv,obj)
816 | `Def (Content.Const, thesis, `Proof p) ->
817 let name = get_name p.Content.proof_name in
818 let proof = proof2pres true term2pres ?skip_initial_lambdas p in
819 if skip_thm_and_qed then
823 [Some "helm","xref","id"]
824 ([ B.b_h [] (B.b_kw ("theorem " ^ name) ::
825 params2pres params @ [B.b_kw ":"]);
826 B.indent (term2pres thesis) ; B.b_kw "." ] @
827 metasenv2pres term2pres metasenv @
828 [proof ; B.b_kw "qed."])
829 | `Def (_, ty, `Definition body) ->
830 let name = get_name body.Content.def_name in
832 [Some "helm","xref","id"]
834 (B.b_kw ("definition " ^ name) :: params2pres params @ [B.b_kw ":"]);
835 B.indent (term2pres ty)] @
836 metasenv2pres term2pres metasenv @
838 B.indent (term2pres body.Content.def_term);
840 | `Decl (_, `Declaration decl)
841 | `Decl (_, `Hypothesis decl) ->
842 let name = get_name decl.Content.dec_name in
844 [Some "helm","xref","id"]
845 ([B.b_h [] (B.b_kw ("Axiom " ^ name) :: params2pres params);
847 B.indent (term2pres decl.Content.dec_type)] @
848 metasenv2pres term2pres metasenv)
851 (recursion_kind2pres params joint.Content.joint_kind
852 :: List.map (joint_def2pres term2pres) joint.Content.joint_defs)
856 ?skip_initial_lambdas ?skip_thm_and_qed ~ids_to_inner_sorts
858 content2pres ?skip_initial_lambdas ?skip_thm_and_qed
859 (fun ?(prec=90) annterm ->
860 let ast, ids_to_uris =
861 TermAcicContent.ast_of_acic ids_to_inner_sorts annterm
863 CicNotationPres.box_of_mpres
864 (CicNotationPres.render ids_to_uris ~prec
865 (TermContentPres.pp_ast ast)))