aboutsummaryrefslogtreecommitdiff
path: root/kernel/uGraph.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-11-13 15:32:06 +0100
committerGaëtan Gilbert2018-11-16 15:10:21 +0100
commit14c4a4281abf4d71ea33f12d8e8701ee8984e0fe (patch)
tree3af1b33279f35f387e4d61e7e6afb2833b473c4a /kernel/uGraph.ml
parent778213b89d893b55e572fc1813c7209d647ed6b0 (diff)
Make UGraph printing independent of hash order
Diffstat (limited to 'kernel/uGraph.ml')
-rw-r--r--kernel/uGraph.ml11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/uGraph.ml b/kernel/uGraph.ml
index 9ff51fca55..ad94362aaf 100644
--- a/kernel/uGraph.ml
+++ b/kernel/uGraph.ml
@@ -942,22 +942,25 @@ let check_eq_instances g t1 t2 =
(** Pretty-printing *)
+let pr_umap sep pr map =
+ let cmp (u,_) (v,_) = Level.compare u v in
+ Pp.prlist_with_sep sep pr (List.sort cmp (UMap.bindings map))
+
let pr_arc prl = function
| _, Canonical {univ=u; ltle; _} ->
if UMap.is_empty ltle then mt ()
else
prl u ++ str " " ++
v 0
- (pr_sequence (fun (v, strict) ->
+ (pr_umap Pp.spc (fun (v, strict) ->
(if strict then str "< " else str "<= ") ++ prl v)
- (UMap.bindings ltle)) ++
+ ltle) ++
fnl ()
| u, Equiv v ->
prl u ++ str " = " ++ prl v ++ fnl ()
let pr_universes prl g =
- let graph = UMap.fold (fun u a l -> (u,a)::l) g.entries [] in
- prlist (pr_arc prl) graph
+ pr_umap mt (pr_arc prl) g.entries
(* Dumping constraints to a file *)