X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=inline;f=helm%2Focaml%2Fcic_transformations%2FtacticAstPp.ml;h=eebc73c89c1e1cdb5b01a5ff32c2a02590573af2;hb=46f19eadce5f3a11c0ae26934fd8d1b597906416;hp=99fc38553a49c60b7eeb8b2505511ef9701253c7;hpb=7e7ce7bb6b95e9bd10dc180671ba7512ff2537dd;p=helm.git diff --git a/helm/ocaml/cic_transformations/tacticAstPp.ml b/helm/ocaml/cic_transformations/tacticAstPp.ml index 99fc38553..eebc73c89 100644 --- a/helm/ocaml/cic_transformations/tacticAstPp.ml +++ b/helm/ocaml/cic_transformations/tacticAstPp.ml @@ -29,6 +29,7 @@ open TacticAst let tactical_terminator = "." let tactic_terminator = tactical_terminator +let command_terminator = tactical_terminator let tactical_separator = ";" let pp_term_ast term = CicAstPp.pp_term term @@ -87,7 +88,10 @@ let rec pp_tactic = function | Replace (_, t1, t2) -> sprintf "replace %s with %s" (pp_term_ast t1) (pp_term_ast t2) | Replace_pattern (_, _, _) -> assert false (* TODO *) - | Rewrite (_, _, _, _) -> assert false (* TODO *) + | Rewrite (_, pos, t, None) -> + sprintf "rewrite %s %s" + (if pos = `Left then "left" else "right") (pp_term_ast t) + | Rewrite _ -> assert false (* TODO *) | Right _ -> "right" | Ring _ -> "ring" | Split _ -> "split" @@ -109,6 +113,13 @@ let pp_search_kind = function | `Elim -> "elim" let pp_macro pp_term = function + (* Whelp *) + | WInstance (_, term) -> "whelp instance " ^ pp_term term + | WHint (_, t) -> "whelp hint " ^ pp_term t + | WLocate (_, s) -> "whelp locate " ^ s + | WElim (_, t) -> "whelp elim " ^ pp_term t + | WMatch (_, term) -> "whelp match " ^ pp_term term + (* real macros *) | Abort _ -> "Abort" | Check (_, term) -> sprintf "Check %s" (pp_term term) | Hint _ -> "hint" @@ -135,7 +146,7 @@ let pp_alias = function sprintf "alias num (instance %d) = \"%s\"" instance desc let pp_command = function - | Qed _ -> "Qed" + | Qed _ -> "qed" | Set (_, name, value) -> sprintf "Set \"%s\" \"%s\"" name value | Inductive (_, params, types) -> let pp_params = function @@ -194,4 +205,17 @@ and pp_tacticals tacs = let pp_tactical tac = pp_tactical tac ^ tactical_terminator let pp_tactic tac = pp_tactic tac ^ tactic_terminator - +let pp_command tac = pp_command tac ^ command_terminator + +let pp_executable = function + | Macro (_,x) -> pp_macro_ast x + | Tactical (_,x) -> pp_tactical x + | Command (_,x) -> pp_command x + +let pp_comment = function + | Note (_,str) -> sprintf "(* %s *)" str + | Code (_,code) -> sprintf "(** %s. **)" (pp_executable code) + +let pp_statement = function + | Executable (_, ex) -> pp_executable ex + | Comment (_, c) -> pp_comment c