diff options
-rw-r--r-- | _CoqProject | 1 | ||||
-rw-r--r-- | src/Util/Curry.v | 10 | ||||
-rw-r--r-- | src/Util/Tactics.v | 3 | ||||
-rw-r--r-- | src/Util/Tactics/ChangeInAll.v | 7 |
4 files changed, 12 insertions, 9 deletions
diff --git a/_CoqProject b/_CoqProject index e0ff28b24..94bbdc0b7 100644 --- a/_CoqProject +++ b/_CoqProject @@ -287,6 +287,7 @@ src/Util/Sigma/Associativity.v src/Util/Sigma/Lift.v src/Util/Sigma/MapProjections.v src/Util/Tactics/BreakMatch.v +src/Util/Tactics/ChangeInAll.v src/Util/Tactics/ClearDuplicates.v src/Util/Tactics/Contains.v src/Util/Tactics/ConvoyDestruct.v diff --git a/src/Util/Curry.v b/src/Util/Curry.v index 8a34cb611..d1e3a7b94 100644 --- a/src/Util/Curry.v +++ b/src/Util/Curry.v @@ -1,14 +1,8 @@ +Require Import Crypto.Util.Tactics.ChangeInAll. + Definition curry2 {A B C} (f : A -> B -> C) (x : A * B) : C := let '(a, b) := x in f a b. -(** Work around "Cannot create self-referring hypothesis" coming from - [change x with y in *] *) -Local Ltac change_in_all from to := - change from with to; - repeat match goal with - | [ H : _ |- _ ] => progress change from with to in H - end. - Ltac change_with_curried f := cbv beta in f; (* work around https://coq.inria.fr/bugs/show_bug.cgi?id=5430 *) lazymatch type of f with diff --git a/src/Util/Tactics.v b/src/Util/Tactics.v index a4ae3dac7..3c1367fae 100644 --- a/src/Util/Tactics.v +++ b/src/Util/Tactics.v @@ -1,9 +1,10 @@ (** * Generic Tactics *) Require Export Crypto.Util.FixCoqMistakes. Require Export Crypto.Util.Tactics.BreakMatch. +Require Export Crypto.Util.Tactics.ChangeInAll. +Require Export Crypto.Util.Tactics.ClearDuplicates. Require Export Crypto.Util.Tactics.Contains. Require Export Crypto.Util.Tactics.ConvoyDestruct. -Require Export Crypto.Util.Tactics.ClearDuplicates. Require Export Crypto.Util.Tactics.Head. Require Export Crypto.Util.Tactics.DebugPrint. Require Export Crypto.Util.Tactics.DestructHyps. diff --git a/src/Util/Tactics/ChangeInAll.v b/src/Util/Tactics/ChangeInAll.v new file mode 100644 index 000000000..865a723da --- /dev/null +++ b/src/Util/Tactics/ChangeInAll.v @@ -0,0 +1,7 @@ +(** Work around "Cannot create self-referring hypothesis" coming from + [change x with y in *] *) +Local Ltac change_in_all from to := + change from with to; + repeat match goal with + | [ H : _ |- _ ] => progress change from with to in H + end. |