| `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 -> ""
(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"
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