]> matita.cs.unibo.it Git - helm.git/commitdiff
eq_chain
authorEnrico Tassi <enrico.tassi@inria.fr>
Wed, 3 May 2006 11:26:21 +0000 (11:26 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Wed, 3 May 2006 11:26:21 +0000 (11:26 +0000)
helm/software/components/content_pres/content2pres.ml

index 543ea0ac8436c8bc39bed6f31b74aeadcf587341..a15200b16a14aea39ea6bc2d991fa94ca2ff2615 100644 (file)
@@ -112,7 +112,6 @@ let make_args_for_apply term2pres args =
       make_arg_for_apply true hd 
         (List.fold_right (make_arg_for_apply false) tl [])
   | _ -> assert false
-
 let get_name = function
   | Some s -> s
   | None -> "_"
@@ -130,9 +129,8 @@ let rec justification term2pres p =
       make_args_for_apply term2pres p.Con.proof_conclude.Con.conclude_args in
     B.H([],
       (B.b_kw "by")::B.b_space::
-      B.Text([],"(")::pres_args@[B.Text([],")")]), None
-  else 
-    (B.b_kw "by"),
+      B.Text([],"(")::pres_args@[B.Text([],")")]), None 
+  else (B.b_kw "by"),
     Some (B.b_toggle [B.b_kw "proof";proof2pres term2pres p])
      
 and proof2pres term2pres p =
@@ -360,7 +358,7 @@ and proof2pres term2pres p =
     else if (conclude.Con.conclude_method = "FalseInd") then
       falseind conclude
     else if (conclude.Con.conclude_method = "Rewrite") then
-      let justif1, justif2 = 
+      let justif1,justif2 = 
         (match (List.nth conclude.Con.conclude_args 6) with
            Con.ArgProof p -> justification term2pres p
          | _ -> assert false) in
@@ -377,10 +375,29 @@ and proof2pres term2pres p =
           (B.b_kw "rewrite");
           B.b_space; term1;
           B.b_space; (B.b_kw "with");
-          B.b_space; term2; 
-          B.b_space; justif1]) ::
-          match justif2 with None -> [] | Some j -> [B.indent j])
-    else if conclude.Con.conclude_method = "Apply" then
+          B.b_space; term2;
+          B.b_space; justif1])::
+           match justif2 with None -> [] | Some j -> [B.indent j])
+    else if conclude.Con.conclude_method = "Eq_chain" then
+      let justification p =
+       let j1,j2 = justification term2pres p in
+         j1 :: B.b_space :: (match j2 with Some j -> [j] | None -> [])
+      in
+      let rec aux args =
+       match args with
+         | [] -> []
+         | (Con.ArgProof p)::(Con.Term t)::tl -> 
+             B.H([],([B.b_kw "=";B.b_space;term2pres t;B.b_space]@justification p))::(aux tl)
+         | _ -> assert false 
+      in
+      let hd = 
+       match List.hd conclude.Con.conclude_args with
+         | Con.Term t -> t 
+         | _ -> assert false 
+      in
+      B.H([],[term2pres hd; B.b_space; 
+             B.V ([],aux (List.tl conclude.Con.conclude_args))])
+     else if conclude.Con.conclude_method = "Apply" then
       let pres_args = 
         make_args_for_apply term2pres conclude.Con.conclude_args in
       B.H([],