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 =
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"
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],
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
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
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 =
(*