aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2006-10-24 12:56:16 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2006-10-24 12:56:16 +0000
commitd603bb578ef71d938c49326e2e4a8392042f607c (patch)
tree7ba80a528cdcb1a9002464f08cfe6817a4603290
parent6dceb3df36d30ad32db7e73713e7f7dee083e872 (diff)
Ajout de la tactique 'remember'
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9268 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--theories/Init/Tactics.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v
index 7b03a56c5..9a2856128 100644
--- a/theories/Init/Tactics.v
+++ b/theories/Init/Tactics.v
@@ -53,3 +53,12 @@ Ltac f_equal :=
Tactic Notation "rewrite_all" constr(eq) := repeat rewrite eq in *.
Tactic Notation "rewrite_all" "<-" constr(eq) := repeat rewrite <- eq in *.
+
+(* Keeping a copy of an expression *)
+
+Ltac remembertac x a :=
+ let x := fresh x in
+ let H := fresh "Heq" x in
+ (set (x:=a) in *; assert (H: x=a) by reflexivity; clearbody x).
+
+Tactic Notation "remember" constr(c) "as" ident(x) := remembertac x c.