]> matita.cs.unibo.it Git - helm.git/blobdiff - components/acic_content/cicNotationPp.ml
Bug fixed in the guarded_by_descructors function: in some cases the context
[helm.git] / components / acic_content / cicNotationPp.ml
index ff0a09265c0d6b985d4c439b70931f74f0b8eb0a..49cefaec7db3f7f76652d9e24e9543bd4de9f495 100644 (file)
@@ -99,7 +99,6 @@ let rec pp_term ?(pp_parens = true) t =
     | Ast.Case (term, indtype, typ, patterns) ->
         sprintf "match %s%s%s with %s"
           (pp_term term)
-         (match typ with None -> "" | Some t -> sprintf " return %s" (pp_term t))          
           (match indtype with
           | None -> ""
           | Some (ty, href_opt) ->
@@ -107,7 +106,8 @@ let rec pp_term ?(pp_parens = true) t =
               (match debug_printing, href_opt with
               | true, Some uri ->
                   sprintf "(i.e.%s)" (UriManager.string_of_uri uri)
-              | _ -> ""))
+              | _ -> ""))        
+         (match typ with None -> "" | Some t -> sprintf " return %s" (pp_term t))          
           (pp_patterns patterns)
     | Ast.Cast (t1, t2) -> sprintf "(%s: %s)" (pp_term ~pp_parens:true t1) (pp_term ~pp_parens:true t2)
     | Ast.LetIn (var, t1, t2) ->
@@ -289,8 +289,11 @@ let pp_fields fields =
   (if fields <> [] then "\n" else "") ^ 
   String.concat ";\n" 
     (List.map 
-      (fun (name,ty,coercion) -> 
-        " " ^ name ^ if coercion then ":>" else ": " ^ pp_term ty) fields)
+      (fun (name,ty,coercion,arity) -> 
+        " " ^ name ^ 
+        if coercion then (":" ^ 
+          if arity > 0 then string_of_int arity else "" ^ ">") else ": " ^
+        pp_term ty) fields)
         
 let pp_obj = function
  | Ast.Inductive (params, types) ->