X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcontent_pres%2Fcontent2pres.ml;h=72f51c5f8acf261a9b453bf9f0aebeb7adf88cb3;hb=f9abd21eb0d26cf9b632af4df819225be4d091e3;hp=63eec5e351a21dec9d50b7c2aedffc1ef580b433;hpb=948bb5d710c5d7f3185b6fef76c8e71f247cc664;p=helm.git diff --git a/helm/software/components/content_pres/content2pres.ml b/helm/software/components/content_pres/content2pres.ml index 63eec5e35..72f51c5f8 100644 --- a/helm/software/components/content_pres/content2pres.ml +++ b/helm/software/components/content_pres/content2pres.ml @@ -136,7 +136,8 @@ let rec justification ~for_rewriting_step ~ignore_atoms term2pres p = make_args_for_apply term2pres p.Con.proof_conclude.Con.conclude_args in [B.H([], - (if for_rewriting_step then (B.b_kw "exact") else (B.b_kw "by")):: + (*(if for_rewriting_step then (B.b_kw "exact") else (B.b_kw "by"))::*) + (B.b_kw "by"):: B.b_space:: B.Text([],"(")::pres_args@[B.Text([],")")])], None else @@ -927,17 +928,20 @@ let inductive2pres term2pres ind = let definition2pres ?recno term2pres d = let name = match d.Content.def_name with Some x -> x|_->assert false in - let rno = match recno with None -> assert false | Some x -> x in + let rno = match recno with None -> -1 (* cofix *) | Some x -> x in let ty = d.Content.def_type in let module P = CicNotationPt in let rec split_pi i t = if i <= 1 then match t with - | P.Binder ((`Pi|`Forall),(var,_ as v),t) -> [v], var, t + | P.Binder ((`Pi|`Forall),(var,_ as v),t) + | P.AttributedTerm (_,P.Binder ((`Pi|`Forall),(var,_ as v),t)) -> + [v], var, t | _ -> assert false else match t with - | P.Binder ((`Pi|`Forall), var ,ty) -> + | P.Binder ((`Pi|`Forall), var ,ty) + | P.AttributedTerm (_, P.Binder ((`Pi|`Forall), var ,ty)) -> let l, r, t = split_pi (i-1) ty in var :: l, r, t | _ -> assert false @@ -954,10 +958,14 @@ let definition2pres ?recno term2pres d = params in B.b_hv [] - [B.b_hv [] - ([ B.b_space; B.b_text [] name ] @ params @ - [B.b_kw "on" ; B.b_space; term2pres rec_param ; B.b_space; - B.b_text [] ":"; B.b_space; term2pres ty]); + [B.b_hov (RenderingAttrs.indent_attributes `BoxML) + ( [B.b_hov (RenderingAttrs.indent_attributes `BoxML) ([ B.b_space; B.b_text [] name ] @ + [B.indent(B.b_hov (RenderingAttrs.indent_attributes `BoxML) (params))])] + @ [B.b_h [] + ((if rno <> -1 then + [B.b_kw "on";B.b_space;term2pres rec_param] else []) + @ [ B.b_space; B.b_text [] ":";]) ] + @[ B.indent(term2pres ty)]); B.b_text [] ":="; B.b_h [] [B.b_space;term2pres body] ] ;; @@ -1005,7 +1013,8 @@ let njoint_def2pres term2pres joint_kind defs = ;; let content2pres0 - ?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres + ?skip_initial_lambdas ?(skip_thm_and_qed=false) + (term2pres : ?prec:int -> 'a) (id,params,metasenv,obj) = match obj with @@ -1052,6 +1061,7 @@ let content2pres ?skip_initial_lambdas ?skip_thm_and_qed ~ids_to_inner_sorts = content2pres0 ?skip_initial_lambdas ?skip_thm_and_qed +(* FG: prec not optional in my patch *) (fun ?(prec=90) annterm -> let ast, ids_to_uris = TermAcicContent.ast_of_acic ~output_type:`Term ids_to_inner_sorts annterm @@ -1062,7 +1072,8 @@ let content2pres (TermContentPres.pp_ast ast))) let ncontent2pres0 - ?skip_initial_lambdas ?(skip_thm_and_qed=false) term2pres + ?skip_initial_lambdas ?(skip_thm_and_qed=false) + (term2pres : ?prec:int -> 'a) (id,params,metasenv,obj : CicNotationPt.term Content.cobj) = match obj with