aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/evarsolve.ml
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <mattam@mattam.org>2013-10-17 14:55:57 +0200
committerGravatar Matthieu Sozeau <mattam@mattam.org>2014-05-06 09:58:53 +0200
commit84cbc09bd1400f732a6c70e8a840e4c13d018478 (patch)
treef6b3417e653bea9de8f0d8f510ad19ccdbb4840e /pretyping/evarsolve.ml
parent57bee17f928fc67a599d2116edb42a59eeb21477 (diff)
Correct rebase on STM code. Thanks to E. Tassi for help on dealing with
latent universes. Now the universes in the type of a definition/lemma are eagerly added to the environment so that later proofs can be checked independently of the original (delegated) proof body. - Fixed firstorder, ring to work correctly with universe polymorphism. - Changed constr_of_global to raise an anomaly if side effects would be lost by turning a polymorphic constant into a constr. - Fix a non-termination issue in solve_evar_evar. -
Diffstat (limited to 'pretyping/evarsolve.ml')
-rw-r--r--pretyping/evarsolve.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml
index b3c65ebaf..306116d76 100644
--- a/pretyping/evarsolve.ml
+++ b/pretyping/evarsolve.ml
@@ -1082,10 +1082,16 @@ let solve_evar_evar ?(force=false) f g env evd pbty (evk1,args1 as ev1) (evk2,ar
let evi2 = Evd.find evd evk2 in
let evi2env = Evd.evar_env evi2 in
let ctx', j = Reduction.dest_arity evi2env evi2.evar_concl in
- if i == j || Evd.check_eq evd (univ_of_sort i) (univ_of_sort j)
+ let ui, uj = univ_of_sort i, univ_of_sort j in
+ if i == j || Evd.check_eq evd ui uj
then (* Shortcut, i = j *)
solve_evar_evar ~force f g env evd pbty ev1 ev2
- else
+ (* Avoid looping if postponing happened on previous evar/evar problem *)
+ else if Evd.check_leq evd ui uj then
+ solve_evar_evar ~force f g env evd None ev1 ev2
+ else if Evd.check_leq evd uj ui then
+ solve_evar_evar ~force f g env evd None ev2 ev1
+ else
let evd, k = Evd.new_sort_variable univ_flexible_alg evd in
let evd, ev3 =
Evarutil.new_pure_evar evd (Evd.evar_hyps evi)