From b443e5ce3ea09d82574b0a3196041737f0a5dcc7 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Thu, 26 Jun 2014 13:25:18 +0200 Subject: Properly refresh the local hintdb database in case an external tactic changed the hypotheses in eauto. --- tactics/eauto.ml4 | 16 ++++++++++++---- test-suite/bugs/closed/3267.v | 36 ++++++++++++++++++++++++++++++++++++ test-suite/bugs/opened/3267.v | 37 ------------------------------------- 3 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 test-suite/bugs/closed/3267.v delete mode 100644 test-suite/bugs/opened/3267.v diff --git a/tactics/eauto.ml4 b/tactics/eauto.ml4 index 98e7d3ff5f..0e9d3dcdc8 100644 --- a/tactics/eauto.ml4 +++ b/tactics/eauto.ml4 @@ -282,10 +282,18 @@ module SearchProblem = struct { depth = s.depth; tacres = res; last_tactic = pp; prev = ps; dblist = s.dblist; localdb = List.tl s.localdb } else - { depth = pred s.depth; tacres = res; - dblist = s.dblist; last_tactic = pp; prev = ps; - localdb = - List.addn (nbgl'-nbgl) (List.hd s.localdb) s.localdb }) + let newlocal = + let hyps = pf_hyps g in + List.map (fun gl -> + let gls = {Evd.it = gl; sigma = lgls.Evd.sigma } in + let hyps' = pf_hyps gls in + if hyps' == hyps then List.hd s.localdb + else make_local_hint_db ~ts:full_transparent_state true [] gls) + (List.firstn ((nbgl'-nbgl) + 1) (sig_it lgls)) + in + { depth = pred s.depth; tacres = res; + dblist = s.dblist; last_tactic = pp; prev = ps; + localdb = newlocal @ List.tl s.localdb }) l in List.sort compare (assumption_tacs @ intro_tac @ rec_tacs) diff --git a/test-suite/bugs/closed/3267.v b/test-suite/bugs/closed/3267.v new file mode 100644 index 0000000000..5ce1ddf0c4 --- /dev/null +++ b/test-suite/bugs/closed/3267.v @@ -0,0 +1,36 @@ +Module a. + Local Hint Extern 0 => progress subst. + Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. + Proof. + intros. + (* this should not fail *) + progress eauto. + Defined. +End a. + +Module b. + Local Hint Extern 0 => progress subst. + Goal forall T (x y : T) (P Q : _ -> Prop), y = x -> (P x -> Q x) -> P y -> Q y. + Proof. + intros. + eauto. + Defined. +End b. + +Module c. + Local Hint Extern 0 => progress subst; eauto. + Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. + Proof. + intros. + eauto. + Defined. +End c. + +Module d. + Local Hint Extern 0 => progress subst; repeat match goal with H : _ |- _ => revert H end. + Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. + Proof. + intros. + debug eauto. + Defined. +End d. diff --git a/test-suite/bugs/opened/3267.v b/test-suite/bugs/opened/3267.v deleted file mode 100644 index 43eb1377d2..0000000000 --- a/test-suite/bugs/opened/3267.v +++ /dev/null @@ -1,37 +0,0 @@ -Module a. - Hint Extern 0 => progress subst. - Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. - Proof. - intros. - (* this should not fail *) - Fail progress eauto. - admit. - Defined. -End a. - -Module b. - Hint Extern 0 => progress subst. - Goal forall T (x y : T) (P Q : _ -> Prop), y = x -> (P x -> Q x) -> P y -> Q y. - Proof. - intros. - eauto. - Defined. -End b. - -Module c. - Hint Extern 0 => progress subst; eauto. - Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. - Proof. - intros. - eauto. - Defined. -End c. - -Module d. - Hint Extern 0 => progress subst; repeat match goal with H : _ |- _ => revert H end. - Goal forall T (x y : T) (P Q : _ -> Prop), x = y -> (P x -> Q x) -> P y -> Q y. - Proof. - intros. - eauto. - Defined. -End d. -- cgit v1.2.3