]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/content2pres.ml
let rec/corec and co/inductive are not printed!
[helm.git] / helm / software / components / content_pres / content2pres.ml
index 63eec5e351a21dec9d50b7c2aedffc1ef580b433..9c389467c1f6cef38b4bd03536040ed599024033 100644 (file)
@@ -927,17 +927,20 @@ let inductive2pres term2pres ind =
 
 let definition2pres ?recno term2pres d =
   let name = match d.Content.def_name with Some x -> x|_->assert false in
-  let rno = match recno with None -> assert false | Some x -> x in
+  let rno = match recno with None -> -1 (* cofix *) | Some x -> x in
   let ty = d.Content.def_type in
   let module P = CicNotationPt in
   let rec split_pi i t = 
     if i <= 1 then 
       match t with 
-      | P.Binder ((`Pi|`Forall),(var,_ as v),t) -> [v], var, t 
+      | P.Binder ((`Pi|`Forall),(var,_ as v),t) 
+      | P.AttributedTerm (_,P.Binder ((`Pi|`Forall),(var,_ as v),t)) -> 
+            [v], var, t 
       | _ -> assert false
     else
       match t with
-      | P.Binder ((`Pi|`Forall), var ,ty) ->
+      | P.Binder ((`Pi|`Forall), var ,ty) 
+      | P.AttributedTerm (_, P.Binder ((`Pi|`Forall), var ,ty)) ->
            let l, r, t = split_pi (i-1) ty in
            var :: l, r, t
       | _ -> assert false
@@ -955,8 +958,9 @@ let definition2pres ?recno term2pres d =
   in
   B.b_hv [] 
    [B.b_hv [] 
-    ([ B.b_space; B.b_text [] name ] @ params @
-       [B.b_kw "on" ; B.b_space; term2pres rec_param ; B.b_space;
+    ([ B.b_space; B.b_text [] name; B.b_space ] @ params @
+    (if rno <> -1 then [B.b_kw "on" ; B.b_space; term2pres rec_param ] else [])
+    @[ B.b_space;
        B.b_text [] ":"; B.b_space; term2pres ty]); 
    B.b_text [] ":=";
    B.b_h [] [B.b_space;term2pres body] ]