]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_transformations/tacticAstPp.ml
lapply and fwd improved
[helm.git] / helm / ocaml / cic_transformations / tacticAstPp.ml
index 83fdaf0829d7238c20faa991b08f96b373b3201f..67b5733d2a0644ef7376a6eff154af6810af2942 100644 (file)
@@ -37,6 +37,8 @@ let pp_term_cic term = CicPp.ppterm term
 
 let pp_idents idents = "[" ^ String.concat "; " idents ^ "]"
 
+let pp_terms_ast terms = String.concat ", " (List.map pp_term_ast terms)
+
 let pp_reduction_kind = function
   | `Reduce -> "reduce"
   | `Simpl -> "simplify"
@@ -82,6 +84,9 @@ let rec pp_tactic = function
   | Exists _ -> "exists"
   | Fold (_, kind, pattern) ->
       sprintf "fold %s %s" (pp_reduction_kind kind) (pp_pattern pattern)
+  | FwdSimpl (_, hyp, idents) -> 
+      sprintf "fwd %s%s" hyp 
+        (match idents with [] -> "" | idents -> " " ^ pp_idents idents)
   | Generalize (_, pattern, ident) ->
      sprintf "generalize %s%s" (pp_pattern pattern)
       (match ident with None -> "" | Some id -> " as " ^ id)
@@ -95,6 +100,12 @@ let rec pp_tactic = function
       sprintf "intros%s%s"
         (match num with None -> "" | Some num -> " " ^ string_of_int num)
         (match idents with [] -> "" | idents -> " " ^ pp_idents idents)
+  | LApply (_, level_opt, terms, term, ident_opt) -> 
+      sprintf "lapply %s%s%s%s" 
+        (match level_opt with None -> "" | Some i -> " depth = " ^ string_of_int i ^ " ")  
+        (pp_term_ast term) 
+        (match terms with [] -> "" | _ -> " to " ^ pp_terms_ast terms)
+        (match ident_opt with None -> "" | Some ident -> " using " ^ ident)
   | Left _ -> "left"
   | LetIn (_, term, ident) -> sprintf "let %s in %s" (pp_term_ast term) ident
   | Reduce (_, kind, pat) ->
@@ -112,11 +123,6 @@ let rec pp_tactic = function
   | Split _ -> "split"
   | Symmetry _ -> "symmetry"
   | Transitivity (_, term) -> "transitivity " ^ pp_term_ast term
-  | FwdSimpl (_, term) -> sprintf "fwd %s" (pp_term_ast term)
-  | LApply (_, term_opt, term, ident) -> 
-      sprintf "lapply %s%s%s" (pp_term_ast term) 
-        (match term_opt with None -> "" | Some t -> " to " ^ pp_term_ast t)
-        (match ident with None -> "" | Some id -> " using " ^ id)
 
 let pp_flavour = function
   | `Definition -> "Definition"