aboutsummaryrefslogtreecommitdiffhomepage
path: root/engine
diff options
context:
space:
mode:
authorGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-03-04 00:59:00 +0100
committerGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-04-13 14:10:04 +0200
commitfc4dd229797ae341127ee615ec6201e953124727 (patch)
tree5ff536d8ee877b9a27f5f8fbe2a1eb0d018ef3a8 /engine
parent8e00ec838eadffb5c868fdbfa693471cdd80ef8c (diff)
univ minimization: rename acc' -> enforce_uppers
Diffstat (limited to 'engine')
-rw-r--r--engine/universes.ml23
1 files changed, 12 insertions, 11 deletions
diff --git a/engine/universes.ml b/engine/universes.ml
index c05157c9c..3b7a40dab 100644
--- a/engine/universes.ml
+++ b/engine/universes.ml
@@ -876,7 +876,7 @@ let minimize_univ_variables ctx us algs left right cstrs =
instantiate_with_lbound u lbound lower ~alg:false ~enforce:true acc
end
in
- let acc' acc =
+ let enforce_uppers acc =
match LMap.find u right with
| exception Not_found -> acc
| cstrs ->
@@ -895,16 +895,17 @@ let minimize_univ_variables ctx us algs left right cstrs =
in
(ctx, us, algs, insts, cstrs), b
in
- if not (LSet.mem u ctx) then acc' (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
- else
- let lbound = compute_lbound left in
- match lbound with
- | None -> (* Nothing to do *)
- acc' (acc, {enforce=true;alg=false;lbound=Universe.make u; lower})
- | Some lbound ->
- try acc' (instantiate_lbound lbound)
- with UpperBoundedAlg ->
- acc' (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
+ if not (LSet.mem u ctx)
+ then enforce_uppers (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
+ else
+ let lbound = compute_lbound left in
+ match lbound with
+ | None -> (* Nothing to do *)
+ enforce_uppers (acc, {enforce=true;alg=false;lbound=Universe.make u; lower})
+ | Some lbound ->
+ try enforce_uppers (instantiate_lbound lbound)
+ with UpperBoundedAlg ->
+ enforce_uppers (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
and aux (ctx, us, algs, seen, cstrs as acc) u =
try acc, LMap.find u seen
with Not_found -> instance acc u