X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_transformations%2FtacticAstPp.ml;h=a5c0478acc65b9e2b24e6ef3f795285b5c05be63;hb=53ee2f5095adadffcafb40e436d23dc330d3bd87;hp=822618eb4a18d0c70616086f287ccb21d4f438fb;hpb=c05b36907ed2bf71300dffc2f4a6602dc1288045;p=helm.git diff --git a/helm/ocaml/cic_transformations/tacticAstPp.ml b/helm/ocaml/cic_transformations/tacticAstPp.ml index 822618eb4..a5c0478ac 100644 --- a/helm/ocaml/cic_transformations/tacticAstPp.ml +++ b/helm/ocaml/cic_transformations/tacticAstPp.ml @@ -42,7 +42,7 @@ let pp_reduction_kind = function | `Simpl -> "simplify" | `Whd -> "whd" | `Normalize -> "normalize" - + let rec pp_tactic = function | Absurd (_, term) -> "absurd" ^ pp_term_ast term | Apply (_, term) -> "apply " ^ pp_term_ast term @@ -149,19 +149,24 @@ let pp_alias = function | Number_alias (instance,desc) -> sprintf "alias num (instance %d) = \"%s\"" instance desc +let pp_params = function + | [] -> "" + | params -> + " " ^ + String.concat " " + (List.map + (fun (name, typ) -> sprintf "(%s:%s)" name (pp_term_ast typ)) + params) + +let pp_fields fields = + (if fields <> [] then "\n" else "") ^ + String.concat ";\n" + (List.map (fun (name,ty) -> " " ^ name ^ ": " ^ pp_term_ast ty) fields) + let pp_command = function | Qed _ -> "qed" | Set (_, name, value) -> sprintf "Set \"%s\" \"%s\"" name value | Inductive (_, params, types) -> - let pp_params = function - | [] -> "" - | params -> - " " ^ - String.concat " " - (List.map - (fun (name, typ) -> sprintf "(%s:%s)" name (pp_term_ast typ)) - params) - in let pp_constructors constructors = String.concat "\n" (List.map (fun (name, typ) -> sprintf "| %s: %s" name (pp_term_ast typ)) @@ -190,6 +195,10 @@ let pp_command = function | Some body -> "\\def " ^ pp_term_ast body) | Coercion (_,_) -> "Coercion IMPLEMENT ME!!!!!" | Alias (_,s) -> pp_alias s + | Record (_,params,name,ty,fields) -> + "record " ^ name ^ " " ^ pp_params params ^ " \\def {" ^ + pp_fields fields ^ "}" + let rec pp_tactical = function | Tactic (_, tac) -> pp_tactic tac