aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/firstorder
diff options
context:
space:
mode:
authorGravatar Jasper Hugunin <jasperh@cs.washington.edu>2018-01-06 16:37:06 +0900
committerGravatar Jasper Hugunin <jasperh@cs.washington.edu>2018-01-17 14:54:14 +0900
commit58d209fe36e37b6c0ee4acd702dac333388b1b88 (patch)
tree856dcf2dc6b5e9ca2eb083c7640c07ae04308be8 /plugins/firstorder
parent8ea2a8307a8d96f8275ebbd9bd4cbd1f6b0a00c6 (diff)
Use let-in aware prod_applist_assum in dtauto and firstorder.
Fixes #6490. `prod_applist_assum` is copied from `kernel/term.ml` to `engine/termops.ml`, and adjusted to work with econstr. This change uncovered a bug in `Hipattern.match_with_nodep_ind`, where `has_nodep_prod_after` counts both products and let-ins, but was only being passed `mib.mind_nparams`, which does not count let-ins. Replaced with (Context.Rel.length mib.mind_params_ctxt).
Diffstat (limited to 'plugins/firstorder')
-rw-r--r--plugins/firstorder/formula.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/firstorder/formula.ml b/plugins/firstorder/formula.ml
index c55040df0..4c59996aa 100644
--- a/plugins/firstorder/formula.ml
+++ b/plugins/firstorder/formula.ml
@@ -55,7 +55,8 @@ let ind_hyps env sigma nevar ind largs =
let types= Inductiveops.arities_of_constructors env ind in
let myhyps t =
let t = EConstr.of_constr t in
- let t1=Termops.prod_applist sigma t largs in
+ let nparam_decls = Context.Rel.length (fst (Global.lookup_inductive (fst ind))).mind_params_ctxt in
+ let t1=Termops.prod_applist_assum sigma nparam_decls t largs in
let t2=snd (decompose_prod_n_assum sigma nevar t1) in
fst (decompose_prod_assum sigma t2) in
Array.map myhyps types