Debian Codegraph @

test-suite/bugs/bug_6313.v

raw
1 (* Former open goals in nested proofs were lost *)
2
3 (* This used to fail with "Incorrect number of goals (expected 1 tactic)." *)
4
5 Inductive foo := a | b | c.
6 Goal foo -> foo.
7 intro x.
8 simple refine (match x with
9 | a => _
10 | b => ltac:(exact b)
11 | c => _
12 end); [exact a|exact c].
13 Abort.
14
15 (* This used to leave the goal on the shelf and fails at reflexivity *)
16
17 Goal (True/\0=0 -> True) -> True.
18 intro f.
19 refine
20 (f ltac:(split; only 1:exact I)).
21 reflexivity.
22 Qed.
23
24 (* The "Unshelve" used to not see the explicitly "shelved" goal *)
25
26 Lemma f (b:comparison) : b=b.
27 refine (match b with
28 Eq => ltac:(shelve)
29 | Lt => ltac:(give_up)
30 | Gt => _
31 end).
32 exact (eq_refl Gt).
33 Unshelve.
34 exact (eq_refl Eq).
35 Fail auto. (* Check that there are no more regular subgoals *)
36 Admitted.
37
38 (* The "Unshelve" used to not see the explicitly "shelved" goal *)
39
40 Lemma f2 (b:comparison) : b=b.
41 refine (match b with
42 Eq => ltac:(shelve)
43 | Lt => ltac:(give_up)
44 | Gt => _
45 end).
46 Unshelve. (* Note: Unshelve puts goals at the end *)
47 exact (eq_refl Gt).
48 exact (eq_refl Eq).
49 Fail auto. (* Check that there are no more regular subgoals *)
50 Admitted.
51
52 (* The "unshelve" used to not see the explicitly "shelved" goal *)
53
54 Lemma f3 (b:comparison) : b=b.
55 unshelve refine (match b with
56 Eq => ltac:(shelve)
57 | Lt => ltac:(give_up)
58 | Gt => _
59 end).
60 (* Note: unshelve puts goals at the beginning *)
61 exact (eq_refl Eq).
62 exact (eq_refl Gt).
63 Fail auto. (* Check that there are no more regular subgoals *)
64 Admitted.