]> matita.cs.unibo.it Git - helm.git/commitdiff
In order to generate executable declarative scripts, we are now splitting
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sat, 30 Jun 2007 12:33:24 +0000 (12:33 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sat, 30 Jun 2007 12:33:24 +0000 (12:33 +0000)
the "Rewrite" content-level method into "RewriteRL" and "RewriteLR".

helm/software/components/acic_content/acic2content.ml
helm/software/components/content_pres/content2pres.ml

index f27b881ba888a68653bb2393f6168d03084f6f8f..2c51fe7f80331d23c800fdab42fa9dc78e073bd2 100644 (file)
@@ -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 = 
index 97f225f62b0bc2a9b9ad5c4781ba6bbcbcba2be5..ee11e9b6d76c36690c31a20474620bce5a842208 100644 (file)
@@ -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 =
 (*