aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--kernel/reduction.ml5
-rw-r--r--pretyping/evarconv.ml10
2 files changed, 11 insertions, 4 deletions
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index e9be1b35d..b3e689414 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -269,8 +269,9 @@ let convert_constructors_gen cmp_instances cmp_cumul (mind, ind, cns) nargs u1 u
if not (Int.equal num_cnstr_args nargs) then
cmp_instances u1 u2 s
else
- let csts = get_cumulativity_constraints CONV cumi u1 u2 in
- cmp_cumul csts s
+ (** By invariant, both constructors have a common supertype,
+ so they are convertible _at that type_. *)
+ s
let convert_constructors ctor nargs u1 u2 (s, check) =
convert_constructors_gen (check.compare_instances ~flex:false) check.compare_cumul_instances
diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml
index 0a63985bf..3c8acb1a7 100644
--- a/pretyping/evarconv.ml
+++ b/pretyping/evarconv.ml
@@ -530,8 +530,14 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) ts env evd pbty
UnifFailure (evd, NotSameHead)
else
begin
- let evd' = check_leq_inductives evd cumi u u' in
- Success (check_leq_inductives evd' cumi u' u)
+ (** Both constructors should be liftable to the same supertype
+ at which we compare them, but we don't have access to that type in
+ untyped unification. We hence enforce that one is lower than the other.
+ Note the criterion is more relaxed in conversion. *)
+ try Success (check_leq_inductives evd cumi u u')
+ with Univ.UniverseInconsistency _ ->
+ try Success (check_leq_inductives evd cumi u' u)
+ with Univ.UniverseInconsistency e -> UnifFailure (evd, UnifUnivInconsistency e)
end
end
in