X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Fgrafite%2FgrafiteAstPp.ml;h=183fc5ec464ca725ccd4b6b54b591ad326478d70;hb=2e3e85acace6942eebcfac570ce6b33134d1a3dd;hp=d775a77dcdce83bcab4c8a018474bc7870a5bf17;hpb=577e68880396ea19dc0c190435a2268540696be1;p=helm.git diff --git a/components/grafite/grafiteAstPp.ml b/components/grafite/grafiteAstPp.ml index d775a77dc..183fc5ec4 100644 --- a/components/grafite/grafiteAstPp.ml +++ b/components/grafite/grafiteAstPp.ml @@ -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