abstract:{ tactic block#19023
Conversation
0b031de to
e2798e0
Compare
8fc3e37 to
28073d0
Compare
|
I guess if there are problems we need users to find them. |
|
@coqbot run full ci |
|
How do we abstract goals? Goal True * True * True.
refine (_, _, _).
1: abstract: auto.? |
|
I don't understand the question. |
|
How would we focus on say the second goal and abstract it at the same time? Do we have to do or would something like make more sense? |
In the current state of the PR yes |
|
Maybe it's worth adding |
|
Ah, but for transparent abstract we need a name, and I guess that might be ambiguous to parse? We could do |
There was a problem hiding this comment.
We should have a test for the behavior of nested abstract blocks, for the behavior of structured braces inside an abstract block, as well as for invoking abstract tac inside an abstract:{ block.
|
Why would transparent_abstract need a name more than abstract? |
|
Of these, only 5 really needs a name (though 4 may benefit from one). Probably 3 and 4 (and maybe 5) are the ones where the abstract block would be especially nice.
|
28073d0 to
868d431
Compare
|
I don't want to derail this PR and would love to see it get merged, so feel free to ignore this comment if it is too far out of scope: |
|
It's basically equivalent to Goal True. (* example goal *)
let g := match goal with |- ?g => g end in
let _ := open_constr:(?[tmp] :> g) in
(* we won't be able to do "?tmp" once it's defined, so put it in the goal context *)
unshelve let gevar := open_constr:(let tmp := ?tmp in _ :> g) in
(* reduce the letin before refine so there's no trace in the proof *)
let gevar := eval cbv in gevar in
refine gevar.
[tmp]:{
exact I. (* or any other tactics *)
}
(* without this unfold the subproof lemma is "let tmp := I in tmp" *)
let tmp := eval unfold tmp in tmp in
abstract exact tmp.but a bit more efficient as it doesn't need to communicate through the goal context and so gets to generate one less evar. I don't really see the point of this with_tactic idea. |
|
What may make sense as a general feature is some Goal True.
match goal with |- ?g => ghost evar (tmp:g) end.
[tmp]:{
exact I.
}
let tmp := eval unfold tmp in tmp in
abstract exact tmp. |
|
@JasonGross I've been advocating for a while that there should be a way to allow selectors based on arbitrary functions (of Ltac2 type |
|
The current syntax does not seem very forward compatible, it would be good to have a better one. For instance we will probably want to have And if we want to allow generalized focus operations using a pair of tactics we need something that handles them, but since |
|
What about |
|
@mattam82 suggested something based on |
|
Maybe we could even skip the semicolumn then. |
868d431 to
0211e24
Compare
0211e24 to
22d53a7
Compare
22d53a7 to
6f9ad26
Compare
Overlays: