From d0d6431ba6049b918ecb6d65dae360a2505fddee Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 29 Aug 2018 17:55:15 -0400 Subject: Improve speed of do_with_exactly_one_hyp tactic We assume that there are many hypotheses, and that running [tac] is just as fast to succeed as to fail. --- src/Util/Tactics/DoWithHyp.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Util/Tactics/DoWithHyp.v b/src/Util/Tactics/DoWithHyp.v index 3c068fe01..cee21b6d9 100644 --- a/src/Util/Tactics/DoWithHyp.v +++ b/src/Util/Tactics/DoWithHyp.v @@ -1,3 +1,4 @@ +Require Import Crypto.Util.Tactics.Test. Require Import Crypto.Util.Tactics.Not. Require Export Crypto.Util.FixCoqMistakes. @@ -11,7 +12,8 @@ Ltac do_with_hyp' tac := Ltac do_with_exactly_one_hyp tac := match goal with | [ H : _ |- _ ] - => not (idtac; match goal with + => test (tac H); + not (idtac; match goal with | [ H' : _ |- _ ] => tryif constr_eq H H' then fail else tac H' end); tac H -- cgit v1.2.3