]> matita.cs.unibo.it Git - helm.git/blobdiff - components/grafite/grafiteAstPp.ml
matitaGui: some missing cases during disambiguation now treated
[helm.git] / components / grafite / grafiteAstPp.ml
index d775a77dcdce83bcab4c8a018474bc7870a5bf17..183fc5ec464ca725ccd4b6b54b591ad326478d70 100644 (file)
@@ -44,6 +44,7 @@ let pp_reduction_kind ~term_pp = function
   | `Whd -> "whd"
  
 let pp_tactic_pattern ~term_pp ~lazy_term_pp (what, hyp, goal) = 
+  if what = None && hyp = [] && goal = None then "" else 
   let what_text =
     match what with
     | None -> ""
@@ -142,17 +143,19 @@ let rec pp_tactic ~term_pp ~lazy_term_pp =
         (match terms with [] -> "" | _ -> " to " ^ terms_pp ~term_pp terms)
         (match ident_opt with None -> "" | Some ident -> " as " ^ ident)
   | Left _ -> "left"
-  | LetIn (_, term, ident) -> sprintf "letin %s \\def %s" ident (term_pp term)
+  | LetIn (_, term, ident) -> 
+     sprintf "letin %s \\def %s" ident (term_pp term)
   | Reduce (_, kind, pat) ->
       sprintf "%s %s" (pp_reduction_kind kind) (pp_tactic_pattern pat)
   | Reflexivity _ -> "reflexivity"
   | Replace (_, pattern, t) ->
       sprintf "replace %s with %s" (pp_tactic_pattern pattern) (lazy_term_pp t)
-  | Rewrite (_, pos, t, pattern) -> 
-      sprintf "rewrite %s %s %s" 
+  | Rewrite (_, pos, t, pattern, names) -> 
+      sprintf "rewrite %s %s %s%s
         (if pos = `LeftToRight then ">" else "<")
         (term_pp t)
         (pp_tactic_pattern pattern)
+       (if names = [] then "" else " as " ^ pp_idents names)
   | Right _ -> "right"
   | Ring _ -> "ring"
   | Split _ -> "split"
@@ -197,8 +200,9 @@ let pp_arg ~term_pp arg =
 let pp_macro ~term_pp = 
   let term_pp = pp_arg ~term_pp in
   let style_pp = function
-     | Declarative -> ""
-     | Procedural -> "procedural "
+     | Declarative         -> ""
+     | Procedural None     -> "procedural "
+     | Procedural (Some i) -> sprintf "procedural %u " i
   in
   let prefix_pp prefix = 
      if prefix = "" then "" else sprintf " \"%s\"" prefix