aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorfilliatr1999-12-06 15:07:11 +0000
committerfilliatr1999-12-06 15:07:11 +0000
commit84c0f274e3baa424299c7b098ad7ced9ea4bab0e (patch)
tree77c010e4391739eca90d6c22b73c67df28326e6a /kernel
parent7d94e54e8dfa1d3d72d6c31f01dff49b701bcf99 (diff)
declarations eliminations / debuggae inductifs (debut)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@212 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/inductive.ml12
-rw-r--r--kernel/typeops.ml4
2 files changed, 11 insertions, 5 deletions
diff --git a/kernel/inductive.ml b/kernel/inductive.ml
index 9dc0ca3659..433a2c1d95 100644
--- a/kernel/inductive.ml
+++ b/kernel/inductive.ml
@@ -128,7 +128,14 @@ let extract nparams c =
with UserError _ -> raise (InductiveError BadEntry)
let check_params nparams params c =
- if not (fst (extract nparams c) = params) then
+ let eparams = fst (extract nparams c) in
+ try
+ List.iter2
+ (fun (n1,t1) (n2,t2) ->
+ if n1 <> n2 || strip_outer_cast t1 <> strip_outer_cast t2 then
+ raise (InductiveError BadEntry))
+ eparams params
+ with Invalid_argument _ ->
raise (InductiveError BadEntry)
let mind_extract_and_check_params mie =
@@ -146,7 +153,6 @@ let mind_check_lc params mie =
let check_lc (_,_,_,lc) =
let (lna,c) = decomp_all_DLAMV_name lc in
Array.iter (check_params nparams params) c;
- if not (List.length lna = ntypes) then
- raise (InductiveError BadEntry)
+ if not (List.length lna = ntypes) then raise (InductiveError BadEntry)
in
List.iter check_lc mie.mind_entry_inds
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index 7066462452..a12c6803ad 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -930,8 +930,8 @@ let type_fixpoint env sigma lna lar vdefj =
assert (Array.length lar = lt);
try
conv_forall2_i
- (fun i e def ar ->
- try conv_leq e def (lift lt ar)
+ (fun i env sigma def ar ->
+ try conv_leq env sigma def (lift lt ar)
with NotConvertible -> raise (IllBranch i))
env sigma
(Array.map (fun j -> j.uj_type) vdefj) (Array.map body_of_type lar)