diff options
author | 2018-02-21 23:40:37 +0100 | |
---|---|---|
committer | 2018-03-08 21:58:32 +0100 | |
commit | e7bf157c6af0d7f65b0611f7dfa9c00d5e1e7a83 (patch) | |
tree | 5a8d88a991ca8d96ad535729dac0498501545933 /test-suite/bugs | |
parent | 671f216c27e7ca9f57976eab03c667f09b850d51 (diff) |
More examples about shelve/given_up in tactic-in-terms.
Diffstat (limited to 'test-suite/bugs')
-rw-r--r-- | test-suite/bugs/closed/6313.v | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/test-suite/bugs/closed/6313.v b/test-suite/bugs/closed/6313.v index 1715e7f90..4d263c5a8 100644 --- a/test-suite/bugs/closed/6313.v +++ b/test-suite/bugs/closed/6313.v @@ -1,5 +1,7 @@ (* Former open goals in nested proofs were lost *) +(* This used to fail with "Incorrect number of goals (expected 1 tactic)." *) + Inductive foo := a | b | c. Goal foo -> foo. intro x. @@ -10,7 +12,7 @@ Goal foo -> foo. end); [exact a|exact c]. Abort. -(* Another example *) +(* This used to leave the goal on the shelf and fails at reflexivity *) Goal (True/\0=0 -> True) -> True. intro f. @@ -18,3 +20,45 @@ Goal (True/\0=0 -> True) -> True. (f ltac:(split; only 1:exact I)). reflexivity. Qed. + +(* The "Unshelve" used to not see the explicitly "shelved" goal *) + +Lemma f (b:comparison) : b=b. +refine (match b with + Eq => ltac:(shelve) + | Lt => ltac:(give_up) + | Gt => _ + end). +exact (eq_refl Gt). +Unshelve. +exact (eq_refl Eq). +Fail auto. (* Check that there are no more regular subgoals *) +Admitted. + +(* The "Unshelve" used to not see the explicitly "shelved" goal *) + +Lemma f2 (b:comparison) : b=b. +refine (match b with + Eq => ltac:(shelve) + | Lt => ltac:(give_up) + | Gt => _ + end). +Unshelve. (* Note: Unshelve puts goals at the end *) +exact (eq_refl Gt). +exact (eq_refl Eq). +Fail auto. (* Check that there are no more regular subgoals *) +Admitted. + +(* The "unshelve" used to not see the explicitly "shelved" goal *) + +Lemma f3 (b:comparison) : b=b. +unshelve refine (match b with + Eq => ltac:(shelve) + | Lt => ltac:(give_up) + | Gt => _ + end). +(* Note: unshelve puts goals at the beginning *) +exact (eq_refl Eq). +exact (eq_refl Gt). +Fail auto. (* Check that there are no more regular subgoals *) +Admitted. |