aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/vconv.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2015-10-28 11:16:24 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2015-10-28 16:57:55 +0100
commit4f8a9d10123bd8aa4d17853a7248d3b3fe8a3625 (patch)
tree8cc009910ac8166f477f9425f98a075cac5d889a /kernel/vconv.ml
parent90dfacaacfec8265b11dc9291de9510f515c0081 (diff)
Refine Gregory Malecha's patch on VM and universe polymorphism.
- Universes are now represented in the VM by a structured constant containing the global levels. This constant is applied to local level variables if any. - When reading back a universe, we perform the union of these levels and return a [Vsort]. - Fixed a bug: structured constants could contain local universe variables in constructor arguments, which has to be prevented. Was showing up for instance when evaluating [cons _ list (nil _)] with a polymorphic [list] type. - Fixed a bug: polymorphic inductive types can have an empty stack. Was showing up when evaluating [bool] with a polymorphic [bool] type. - Made a few cosmetic changes. Patch written with Benjamin Grégoire.
Diffstat (limited to 'kernel/vconv.ml')
-rw-r--r--kernel/vconv.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/vconv.ml b/kernel/vconv.ml
index 2e519789e..4610dbcb0 100644
--- a/kernel/vconv.ml
+++ b/kernel/vconv.ml
@@ -98,6 +98,7 @@ and conv_atom env pb k a1 stk1 a2 stk2 cu =
let mib = Environ.lookup_mind mi env in
let ulen = Univ.UContext.size mib.Declarations.mind_universes in
match stk1 , stk2 with
+ | [], [] -> assert (Int.equal ulen 0); cu
| Zapp args1 :: stk1' , Zapp args2 :: stk2' ->
assert (ulen <= nargs args1);
assert (ulen <= nargs args2);
@@ -108,7 +109,7 @@ and conv_atom env pb k a1 stk1 a2 stk2 cu =
let cu = convert_instances ~flex:false u1 u2 cu in
conv_arguments env ~from:ulen k args1 args2
(conv_stack env k stk1' stk2' cu)
- | _ -> raise NotConvertible
+ | _, _ -> assert false (* Should not happen if problem is well typed *)
else
conv_stack env k stk1 stk2 cu
else raise NotConvertible