From: Stefano Zacchiroli Date: Fri, 6 Feb 2004 12:31:27 +0000 (+0000) Subject: added Format-library-friendly pretty printers defined on top of the X-Git-Tag: V_0_2_3~17 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=136fb0fde826e200ee8a0e902dbb6278b2afdeb8;p=helm.git added Format-library-friendly pretty printers defined on top of the previous ones (still exported) --- diff --git a/helm/ocaml/cic_unification/cicMetaSubst.ml b/helm/ocaml/cic_unification/cicMetaSubst.ml index 54f13ed11..41802530b 100644 --- a/helm/ocaml/cic_unification/cicMetaSubst.ml +++ b/helm/ocaml/cic_unification/cicMetaSubst.ml @@ -602,3 +602,15 @@ let time3 = Unix.gettimeofday () in tempi_type_of_aux_subst := !tempi_type_of_aux_subst +. time3 -. time1 ; tempi_type_of_aux := !tempi_type_of_aux +. time2 -. time1 ; res + +(** {2 Format-like pretty printers} *) + +let fpp_gen ppf s = + Format.pp_print_string ppf s; + Format.pp_print_newline ppf (); + Format.pp_print_flush ppf () + +let fppsubst ppf subst = fpp_gen ppf (ppsubst subst) +let fppterm ppf term = fpp_gen ppf (CicPp.ppterm term) +let fppmetasenv ppf metasenv = fpp_gen ppf (ppmetasenv metasenv []) + diff --git a/helm/ocaml/cic_unification/cicMetaSubst.mli b/helm/ocaml/cic_unification/cicMetaSubst.mli index 9fbe01946..60228fe08 100644 --- a/helm/ocaml/cic_unification/cicMetaSubst.mli +++ b/helm/ocaml/cic_unification/cicMetaSubst.mli @@ -65,6 +65,16 @@ val ppterm_in_context: substitution -> Cic.term -> (Cic.name option) list -> string val ppmetasenv: ?sep: string -> Cic.metasenv -> substitution -> string +(** {2 Format-like pretty printers} + * As above with prototypes suitable for toplevel/ocamldebug printers. No + * subsitutions are applied here since such printers are required to be invoked + * with only one argument. + *) + +val fppsubst: Format.formatter -> substitution -> unit +val fppterm: Format.formatter -> Cic.term -> unit +val fppmetasenv: Format.formatter -> Cic.metasenv -> unit + (* {2 Kernel wrappers} * From now on we recreate a kernel abstraction where substitutions are part of * the calculus *)