aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Dénès2016-09-05 17:50:27 +0200
committerMaxime Dénès2016-09-05 17:53:09 +0200
commit47a2da7326ed975039f9e94780aeb9b1079f4854 (patch)
tree49dbc887b617b86d1aa15fb04c84ebbc5a9e6d1e
parent52b82dd42b93af6831df3bfea4822c6c8680a288 (diff)
Fix #5065: Anomaly: Not a proof by induction
Using abstract can create beta-redexes or let-ins in the head of the proof terms. The code projecting out mutual lemmas was not robust enough.
-rw-r--r--stm/lemmas.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/stm/lemmas.ml b/stm/lemmas.ml
index 40dbe2190b..ef304af3fe 100644
--- a/stm/lemmas.ml
+++ b/stm/lemmas.ml
@@ -249,10 +249,14 @@ let save_remaining_recthms (locality,p,kind) norm ctx body opaq i ((id,pl),(t_i,
| Some body ->
let body = norm body in
let k = Kindops.logical_kind_of_goal_kind kind in
- let body_i = match kind_of_term body with
+ let rec body_i t = match kind_of_term t with
| Fix ((nv,0),decls) -> mkFix ((nv,i),decls)
| CoFix (0,decls) -> mkCoFix (i,decls)
+ | LetIn(na,t1,ty,t2) -> mkLetIn (na,t1,ty, body_i t2)
+ | Lambda(na,ty,t) -> mkLambda(na,ty,body_i t)
+ | App (t, args) -> mkApp (body_i t, args)
| _ -> anomaly Pp.(str "Not a proof by induction: " ++ Printer.pr_constr body) in
+ let body_i = body_i body in
match locality with
| Discharge ->
let const = definition_entry ~types:t_i ~opaque:opaq ~poly:p