aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/success/ltac.v
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-09-25 18:54:39 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2004-09-25 18:54:39 +0000
commit648915221a74ba840334456ce68cf93295f9124d (patch)
tree8098397c63e931e7d5a4d7da851ee13955664507 /test-suite/success/ltac.v
parent297d4ee548ae983cd14a249d9bab041cdacde9bd (diff)
Ajouts
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6136 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite/success/ltac.v')
-rw-r--r--test-suite/success/ltac.v42
1 files changed, 42 insertions, 0 deletions
diff --git a/test-suite/success/ltac.v b/test-suite/success/ltac.v
index 55aa110d2..abb1c1090 100644
--- a/test-suite/success/ltac.v
+++ b/test-suite/success/ltac.v
@@ -68,3 +68,45 @@ Apply H.
Symmetry.
Assumption.
Qed.
+
+(* Check context binding in match goal *)
+(* This wasn't working in V8.0pl1, as the list of matched hyps wasn't empty *)
+Tactic Definition sym' :=
+ Match Context With [_:True|-C[?1=?2]] -> Let t = Inst C[?2=?1] In Assert t.
+
+Lemma sym' : True->~(0)=(1)->~(1)=(0).
+Intros Ht H.
+sym'.
+Exact H.
+Intro H1.
+Apply H.
+Symmetry.
+Assumption.
+Qed.
+
+(* Check that fails abort the current match context *)
+Lemma decide : True \/ False.
+(Match Context With
+| _ -> Fail 1
+| _ -> Right) Orelse Left.
+Exact I.
+Qed.
+
+(* Check that "match c with" backtracks on subterms *)
+Lemma refl : (1)=(1).
+Let t = (Match (1)=(2) With
+ [[(S ?1)]] -> '((refl_equal nat ?1) :: (1)=(1)))
+In Assert H:=t.
+Assumption.
+Qed.
+
+(* Note that backtracking in "match c with" is only on type-checking not on
+evaluation of tactics. E.g., this does not work
+
+Lemma refl : (1)=(1).
+Match (1)=(2) With
+ [[(S ?1)]] -> Apply (refl_equal nat ?1).
+Qed.
+*)
+
+