summaryrefslogtreecommitdiff
path: root/pretyping/inductiveops.ml
diff options
context:
space:
mode:
authorGravatar Stephane Glondu <steph@glondu.net>2012-03-27 07:48:23 +0200
committerGravatar Stephane Glondu <steph@glondu.net>2012-03-27 07:48:23 +0200
commitad988252cac876f0b9998b5223f565d0a22aebb8 (patch)
tree0c0e0cd5c943b3fbeb97c99cf46e19bbc97144c0 /pretyping/inductiveops.ml
parent11b04078a227fd8849972d05417487520177fb04 (diff)
parent6e34b272d789455a9be589e27ad3a998cf25496b (diff)
Merge tag 'upstream/8.3.pl4+dfsg'
Upstream version 8.3.pl4+dfsg
Diffstat (limited to 'pretyping/inductiveops.ml')
-rw-r--r--pretyping/inductiveops.ml21
1 files changed, 4 insertions, 17 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index 6e54c170..fe90941d 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: inductiveops.ml 14641 2011-11-06 11:59:10Z herbelin $ *)
+(* $Id: inductiveops.ml 15019 2012-03-02 17:27:18Z letouzey $ *)
open Util
open Names
@@ -403,21 +403,6 @@ let arity_of_case_predicate env (ind,params) dep k =
(* Inferring the sort of parameters of a polymorphic inductive type
knowing the sort of the conclusion *)
-(* Check if u (sort of a parameter) appears in the sort of the
- inductive (is). This is done by trying to enforce u > u' >= is
- in the empty univ graph. If an inconsistency appears, then
- is depends on u. *)
-let is_constrained is u =
- try
- let u' = fresh_local_univ() in
- let _ =
- merge_constraints
- (enforce_geq u (super u')
- (enforce_geq u' is Constraint.empty))
- initial_universes in
- false
- with UniverseInconsistency _ -> true
-
(* Compute the inductive argument types: replace the sorts
that appear in the type of the inductive by the sort of the
conclusion, and the other ones by fresh universes. *)
@@ -429,7 +414,9 @@ let rec instantiate_universes env scl is = function
| (na,None,ty)::sign, Some u::exp ->
let ctx,_ = Reduction.dest_arity env ty in
let s =
- if is_constrained is u then
+ (* Does the sort of parameter [u] appear in (or equal)
+ the sort of inductive [is] ? *)
+ if univ_depends u is then
scl (* constrained sort: replace by scl *)
else
(* unconstriained sort: replace by fresh universe *)