From 79d584e8f049226ec9cf68e9e06880ed0d95af51 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Sat, 30 Jun 2007 12:33:24 +0000 Subject: [PATCH] In order to generate executable declarative scripts, we are now splitting the "Rewrite" content-level method into "RewriteRL" and "RewriteLR". --- .../components/acic_content/acic2content.ml | 6 ++++- .../components/content_pres/content2pres.ml | 26 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/helm/software/components/acic_content/acic2content.ml b/helm/software/components/acic_content/acic2content.ml index f27b881ba..2c51fe7f8 100644 --- a/helm/software/components/acic_content/acic2content.ml +++ b/helm/software/components/acic_content/acic2content.ml @@ -938,7 +938,11 @@ and rewrite seed context metasenv name id li ~ids_to_inner_types ~ids_to_inner_s K.proof_conclude = { K.conclude_id = gen_id conclude_prefix seed; K.conclude_aref = id; - K.conclude_method = "Rewrite"; + K.conclude_method = + if UriManager.eq uri HelmLibraryObjects.Logic.eq_ind_URI then + "RewriteLR" + else + "RewriteRL"; K.conclude_args = K.Term (false,(C.AConst (sid,uri,exp_named_subst)))::method_args; K.conclude_conclusion = 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 = (* -- 2.39.2