From 52b82dd42b93af6831df3bfea4822c6c8680a288 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 3 Sep 2016 11:45:29 +0200 Subject: Fixing what is probably a typo in Strict Proofs mode (#5062). --- plugins/decl_mode/decl_proof_instr.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/decl_mode/decl_proof_instr.ml b/plugins/decl_mode/decl_proof_instr.ml index ba9fb728c1..0680139598 100644 --- a/plugins/decl_mode/decl_proof_instr.ml +++ b/plugins/decl_mode/decl_proof_instr.ml @@ -42,7 +42,7 @@ let _ = declare_bool_option { optsync = true; optdepr = false; - optname = "strict mode"; + optname = "strict proofs"; optkey = ["Strict";"Proofs"]; optread = get_strictness; optwrite = set_strictness } -- cgit v1.2.3 From 47a2da7326ed975039f9e94780aeb9b1079f4854 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 5 Sep 2016 17:50:27 +0200 Subject: 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. --- stm/lemmas.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 53b2acb9befe13c0383b923d09a0d5a6c416449e Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 5 Sep 2016 17:52:38 +0200 Subject: Test file for #5065 - Anomaly: Not a proof by induction --- test-suite/bugs/closed/5065.v | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test-suite/bugs/closed/5065.v diff --git a/test-suite/bugs/closed/5065.v b/test-suite/bugs/closed/5065.v new file mode 100644 index 0000000000..6bd677ba6f --- /dev/null +++ b/test-suite/bugs/closed/5065.v @@ -0,0 +1,6 @@ +Inductive foo := C1 : bar -> foo with bar := C2 : foo -> bar. + +Lemma L1 : foo -> True with L2 : bar -> True. +intros; clear L1 L2; abstract (exact I). +intros; exact I. +Qed. \ No newline at end of file -- cgit v1.2.3