aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/evd.ml
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-12-14 18:54:24 +0100
committerGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-12-14 19:06:14 +0100
commit2db658105f8ed20ca2153271b339c777b79da406 (patch)
tree9aedc88d0c0338c98b9f68300f16f52f2f0aa44b /pretyping/evd.ml
parente117099919cb0a474cad4fe2a6d15165b2520760 (diff)
Fix merging of name maps in union of universe contexts.
Diffstat (limited to 'pretyping/evd.ml')
-rw-r--r--pretyping/evd.ml21
1 files changed, 8 insertions, 13 deletions
diff --git a/pretyping/evd.ml b/pretyping/evd.ml
index 0fe16f0ed..eb9a8bac6 100644
--- a/pretyping/evd.ml
+++ b/pretyping/evd.ml
@@ -261,15 +261,16 @@ let instantiate_evar_array info c args =
module StringOrd = struct type t = string let compare = String.compare end
module UNameMap = struct
-
- include Map.Make(StringOrd)
-
- let union s t =
+
+ include Map.Make(StringOrd)
+
+ let union s t =
+ if s == t then s
+ else
merge (fun k l r ->
match l, r with
| Some _, _ -> l
| _, _ -> r) s t
-
end
(* 2nd part used to check consistency on the fly. *)
@@ -307,14 +308,8 @@ let union_evar_universe_context ctx ctx' =
if ctx == ctx' then ctx
else if is_empty_evar_universe_context ctx' then ctx
else
- let local =
- if ctx.uctx_local == ctx'.uctx_local then ctx.uctx_local
- else Univ.ContextSet.union ctx.uctx_local ctx'.uctx_local
- in
- let names =
- if ctx.uctx_names = ctx.uctx_names then ctx.uctx_names
- else UNameMap.union ctx.uctx_names ctx'.uctx_names
- in
+ let local = Univ.ContextSet.union ctx.uctx_local ctx'.uctx_local in
+ let names = UNameMap.union ctx.uctx_names ctx'.uctx_names in
{ uctx_names = names;
uctx_local = local;
uctx_univ_variables =