From f53890d1629ea7aaff86ea92e5ac27ab027b2e8d Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Fri, 2 Mar 2018 13:37:07 +0100 Subject: universe normalisation: put equivalence class partition in UGraph ie don't go through having Eq constraints but directly to the unionfind. --- kernel/uGraph.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kernel/uGraph.ml') diff --git a/kernel/uGraph.ml b/kernel/uGraph.ml index 5d1644614d..c37df4c5ea 100644 --- a/kernel/uGraph.ml +++ b/kernel/uGraph.ml @@ -768,18 +768,18 @@ let normalize_universes g = g.entries g let constraints_of_universes g = + let module UF = Unionfind.Make (LSet) (LMap) in + let uf = UF.create () in let constraints_of u v acc = match v with | Canonical {univ=u; ltle} -> UMap.fold (fun v strict acc-> let typ = if strict then Lt else Le in Constraint.add (u,typ,v) acc) ltle acc - | Equiv v -> Constraint.add (u,Eq,v) acc + | Equiv v -> UF.union u v uf; acc in - UMap.fold constraints_of g.entries Constraint.empty - -let constraints_of_universes g = - constraints_of_universes (normalize_universes g) + let csts = UMap.fold constraints_of g.entries Constraint.empty in + csts, UF.partition uf (** [sort_universes g] builds a totally ordered universe graph. The output graph should imply the input graph (and the implication -- cgit v1.2.3