]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_unification/cicMetaSubst.ml
added Format-library-friendly pretty printers defined on top of the
[helm.git] / helm / ocaml / cic_unification / cicMetaSubst.ml
index 01b7d4a99247d6905665e9d850eb25fefb767d9f..41802530bb2e004e8f68807ed9b552423885b770 100644 (file)
@@ -230,7 +230,6 @@ let rec restrict subst to_be_restricted metasenv =
 (*CSC: maybe we should rename delift in abstract, as I did in my dissertation *)
 let delift n subst context metasenv l t =
  let module S = CicSubstitution in
-(* THIS CODE SHOULD NOT BE USEFUL AT ALL
   let l =
    let (_, canonical_context, _) = CicUtil.lookup_meta n metasenv in
    List.map2 (fun ct lt ->
@@ -239,7 +238,6 @@ let delift n subst context metasenv l t =
      | Some _, _ -> lt)
      canonical_context l
   in
-*)
   let to_be_restricted = ref [] in
   let rec deliftaux k =
    let module C = Cic in
@@ -604,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 [])
+