aboutsummaryrefslogtreecommitdiffhomepage
path: root/checker/inductive.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2014-04-10 20:16:56 -0400
committerGravatar Maxime Dénès <mail@maximedenes.fr>2014-04-10 20:16:56 -0400
commita51d94e77bd352522744da4dbdbf98b36c19631e (patch)
tree0142379dfc55f5458d83c57e313d359390a2060a /checker/inductive.ml
parent9f81e2c360c2be764e71d21ed7c266ee6e8a88c5 (diff)
Fix guard condition for nested cofixpoints in checker.
Diffstat (limited to 'checker/inductive.ml')
-rw-r--r--checker/inductive.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/checker/inductive.ml b/checker/inductive.ml
index 1130c5e03..40a9bc316 100644
--- a/checker/inductive.ml
+++ b/checker/inductive.ml
@@ -891,12 +891,12 @@ let check_one_cofix env nbfix def deftype =
raise (CoFixGuardError (env,RecCallInTypeOfAbstraction a))
| CoFix (j,(_,varit,vdefs as recdef)) ->
- if (List.for_all (noccur_with_meta n nbfix) args)
+ if List.for_all (noccur_with_meta n nbfix) args
then
- let nbfix = Array.length vdefs in
- if (Array.for_all (noccur_with_meta n nbfix) varit) then
+ if Array.for_all (noccur_with_meta n nbfix) varit then
+ let nbfix = Array.length vdefs in
let env' = push_rec_types recdef env in
- (Array.iter (check_rec_call env' alreadygrd (n+1) vlra) vdefs;
+ (Array.iter (check_rec_call env' alreadygrd (n+nbfix) vlra) vdefs;
List.iter (check_rec_call env alreadygrd n vlra) args)
else
raise (CoFixGuardError (env,RecCallInTypeOfDef c))