aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-11-05 11:59:27 +0100
committerPierre-Marie Pédrot2018-11-05 11:59:27 +0100
commit62c75af6595fc31ec076b1bedfae62f652eda05e (patch)
treed53a1ab493043f4a0cb46d675e81bd5f1ead401d
parent3c8e41cb39647b8d8cd6cb9ecd6bb887a3aedfb7 (diff)
parent6da464438366b2b5d752b44536b2bedac2a34187 (diff)
Merge PR #8874: Fix #8873: coqchk on inductive with letin parameter
-rw-r--r--checker/indtypes.ml7
-rw-r--r--test-suite/coqchk/bug_8655.v1
-rw-r--r--test-suite/success/Inductive.v2
3 files changed, 5 insertions, 5 deletions
diff --git a/checker/indtypes.ml b/checker/indtypes.ml
index 50e65ef587..f6c510ee1c 100644
--- a/checker/indtypes.ml
+++ b/checker/indtypes.ml
@@ -531,10 +531,11 @@ let check_positivity env_ar mind params nrecp inds =
Array.mapi (fun j t -> (Mrec(mind,j),t)) (Rtree.mk_rec_calls ntypes) in
let lra_ind = List.rev (Array.to_list rc) in
let lparams = rel_context_length params in
+ let ra_env =
+ List.init lparams (fun _ -> (Norec,mk_norec)) @ lra_ind in
+ let env_ar_par = push_rel_context params env_ar in
let check_one i mip =
- let ra_env =
- List.init lparams (fun _ -> (Norec,mk_norec)) @ lra_ind in
- let ienv = (env_ar, 1+lparams, ntypes, ra_env) in
+ let ienv = (env_ar_par, 1+lparams, ntypes, ra_env) in
check_positivity_one ienv params nrecp (mind,i) mip.mind_nf_lc
in
let irecargs = Array.mapi check_one inds in
diff --git a/test-suite/coqchk/bug_8655.v b/test-suite/coqchk/bug_8655.v
new file mode 100644
index 0000000000..06d08b2082
--- /dev/null
+++ b/test-suite/coqchk/bug_8655.v
@@ -0,0 +1 @@
+Inductive IND2 (A:Type) (T:=fun _ : Type->Type => A) := CONS2 : IND2 A -> IND2 (T IND2).
diff --git a/test-suite/success/Inductive.v b/test-suite/success/Inductive.v
index f07c0191f1..c2130995fc 100644
--- a/test-suite/success/Inductive.v
+++ b/test-suite/success/Inductive.v
@@ -1,7 +1,5 @@
(* Test des definitions inductives imbriquees *)
-Require Import List.
-
Inductive X : Set :=
cons1 : list X -> X.