X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcontent_pres%2Fcontent2pres.ml;h=ee11e9b6d76c36690c31a20474620bce5a842208;hb=79d584e8f049226ec9cf68e9e06880ed0d95af51;hp=97f225f62b0bc2a9b9ad5c4781ba6bbcbcba2be5;hpb=63adafe5fb700c8ecf13f74fc31086c173617e86;p=helm.git diff --git a/helm/software/components/content_pres/content2pres.ml b/helm/software/components/content_pres/content2pres.ml index 97f225f62..ee11e9b6d 100644 --- a/helm/software/components/content_pres/content2pres.ml +++ b/helm/software/components/content_pres/content2pres.ml @@ -131,8 +131,10 @@ let rec justification term2pres p = B.H([], (B.b_kw "by")::B.b_space:: B.Text([],"(")::pres_args@[B.Text([],")")]), None - else (B.b_kw "by"), - Some (B.b_toggle [B.b_kw "proof";proof2pres true term2pres p]) + else + (*(B.b_kw "by"), + Some (B.b_toggle [B.b_kw "proof";proof2pres true term2pres p])*) + proof2pres true term2pres p, None and proof2pres ?skip_initial_lambdas is_top_down term2pres p = let rec proof2pres ?skip_initial_lambdas_internal is_top_down p omit_dot = @@ -329,7 +331,7 @@ and proof2pres ?skip_initial_lambdas is_top_down term2pres p = else [] in let conclude_body = - conclude_aux ?skip_initial_lambdas_internal conclude in + conclude_aux ?skip_initial_lambdas_internal is_top_down conclude in let ann_concl = if conclude.Con.conclude_method = "Intros+LetTac" || conclude.Con.conclude_method = "ByInduction" @@ -348,8 +350,8 @@ and proof2pres ?skip_initial_lambdas is_top_down term2pres p = else [B.b_kw "done"] ) @ if not omit_dot then [B.Text([],".")] else []) in - B.V ([], prequel @ [conclude_body; ann_concl]) - | _ -> conclude_aux ?skip_initial_lambdas_internal conclude + B.V ([], prequel @ [conclude_body; ann_concl]) + | _ -> conclude_aux ?skip_initial_lambdas_internal is_top_down conclude in if indent then B.indent (B.H ([Some "helm", "xref", conclude.Con.conclude_id], @@ -357,7 +359,7 @@ and proof2pres ?skip_initial_lambdas is_top_down term2pres p = else B.H ([Some "helm", "xref", conclude.Con.conclude_id],[tconclude_body]) - and conclude_aux ?skip_initial_lambdas_internal conclude = + and conclude_aux ?skip_initial_lambdas_internal is_top_down conclude = if conclude.Con.conclude_method = "TD_Conversion" then let expected = (match conclude.Con.conclude_conclusion with @@ -426,7 +428,8 @@ and proof2pres ?skip_initial_lambdas is_top_down term2pres p = andind conclude else if (conclude.Con.conclude_method = "FalseInd") then falseind conclude - else if (conclude.Con.conclude_method = "Rewrite") then + else if conclude.Con.conclude_method = "RewriteLR" + || conclude.Con.conclude_method = "RewriteRL" then let justif1,justif2 = (match (List.nth conclude.Con.conclude_args 6) with Con.ArgProof p -> justification term2pres p @@ -448,7 +451,14 @@ and proof2pres ?skip_initial_lambdas is_top_down term2pres p = B.b_space; term2; B.b_space; justif1]):: match justif2 with None -> [] | Some j -> [B.indent j]) -*) B.V([], [justif1 ; B.H([],[B.b_kw "we proved (" ; term2 ; B.b_kw "=" ; term1; B.b_kw ") (previous)."]); B.b_kw "by _"]) +*) + if (conclude.Con.conclude_method = "RewriteLR" && is_top_down) + || (conclude.Con.conclude_method = "RewriteRL" && not is_top_down) then + B.V([], [justif1 ; B.H([],[B.b_kw "we proved (" ; term1 ; B.b_kw "=" ; term2; B.b_kw ") (equality)."]); B.b_kw "by _"]) + else + B.V([], [justif1 ; B.H([],[B.b_kw "we proved (" ; term2 ; B.b_kw "=" ; term1; B.b_kw ") (equality)."]); B.b_kw "by _"]) +(*CSC: bad idea + B.V([], [B.H([],[B.b_kw "obtain fooo " ; term2 ; B.b_kw "=" ; term1; B.b_kw "by" ; B.b_kw "proof" ; B.Text([],"."); justif1])]) *) else if conclude.Con.conclude_method = "Eq_chain" then let justification p = (*