aboutsummaryrefslogtreecommitdiff
path: root/printing/printer.ml
diff options
context:
space:
mode:
authorbarras2012-11-21 14:36:17 +0000
committerbarras2012-11-21 14:36:17 +0000
commit36f655f6ff08c6b6f744e1d26465e07a95f0fc9a (patch)
treec1066afb4604113d2a7816109d3bf62438490ade /printing/printer.ml
parentad3449aaf7bfed47b476f958f1c1ebfb898effc3 (diff)
Print univ constraints generated by a constant or inductive (when flag is set)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15989 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'printing/printer.ml')
-rw-r--r--printing/printer.ml13
1 files changed, 11 insertions, 2 deletions
diff --git a/printing/printer.ml b/printing/printer.ml
index 69fec870a3..a5f884d46c 100644
--- a/printing/printer.ml
+++ b/printing/printer.ml
@@ -113,6 +113,13 @@ let pr_sort s = pr_glob_sort (extern_sort s)
let _ = Termops.set_print_constr pr_lconstr_env
+let pr_in_comment pr x = str "(* " ++ pr x ++ str " *)"
+let pr_univ_cstr (c:Univ.constraints) =
+ if !Detyping.print_universes && not (Univ.is_empty_constraint c) then
+ fnl()++pr_in_comment (fun c -> v 0 (Univ.pr_constraints c)) c
+ else
+ mt()
+
(**********************************************************************)
(* Global references *)
@@ -674,7 +681,8 @@ let print_mutual_inductive env mind mib =
hov 0 (
str (if mib.mind_finite then "Inductive " else "CoInductive ") ++
prlist_with_sep (fun () -> fnl () ++ str" with ")
- (print_one_inductive env mib) inds)
+ (print_one_inductive env mib) inds ++
+ pr_univ_cstr mib.mind_constraints)
let get_fields =
let rec prodec_rec l subst c =
@@ -709,7 +717,8 @@ let print_record env mind mib =
prlist_with_sep (fun () -> str ";" ++ brk(2,0))
(fun (id,b,c) ->
pr_id id ++ str (if b then " : " else " := ") ++
- pr_lconstr_env envpar c) fields) ++ str" }")
+ pr_lconstr_env envpar c) fields) ++ str" }" ++
+ pr_univ_cstr mib.mind_constraints)
let pr_mutual_inductive_body env mind mib =
if mib.mind_record & not !Flags.raw_print then