aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/univ.ml
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <mattam@mattam.org>2014-04-29 16:04:11 +0200
committerGravatar Matthieu Sozeau <mattam@mattam.org>2014-05-06 09:59:01 +0200
commit84290ba5da2a6acb4bf95b197f7a7ce8b072a1d0 (patch)
tree61c59f4149978e84ccf77b78ecb70ce3e3dd2188 /kernel/univ.ml
parent902da7d2949464ff54dafc3fda1d44365270d2e1 (diff)
Find a more efficient fix for dealing with template universes:
eagerly solve l <= k constraints as k := l when k is a fresh variable coming from a template type. This has the effect of fixing the variable at the first instantiation of the parameters of template polymorphic inductive and avoiding to generate useless <= constraints that need to be minimized afterwards.
Diffstat (limited to 'kernel/univ.ml')
-rw-r--r--kernel/univ.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/univ.ml b/kernel/univ.ml
index d931626e4..a9b511588 100644
--- a/kernel/univ.ml
+++ b/kernel/univ.ml
@@ -755,6 +755,10 @@ struct
let pr x = str(to_string x)
+ let is_level = function
+ | (v, 0) -> true
+ | _ -> false
+
let level = function
| (v,0) -> Some v
| _ -> None
@@ -809,6 +813,10 @@ struct
| Cons (l, n) when is_nil n -> Some l
| _ -> None
+ let is_level l = match node l with
+ | Cons (l, n) when is_nil n -> Expr.is_level l
+ | _ -> false
+
let level l = match node l with
| Cons (l, n) when is_nil n -> Expr.level l
| _ -> None