Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tactic #486

Merged
merged 3 commits into from Nov 21, 2018
Merged

use tactic #486

merged 3 commits into from Nov 21, 2018

Conversation

robertylewis
Copy link
Member

As requested on Zulip, a synonym for refine ⟨x, _⟩.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

For reviewers: code review check list

@digama0
Copy link
Member

digama0 commented Nov 21, 2018

Is it possible to make the equivalent of <e1, e2, ..., en, _> with pexpr generation? The problem with <e1, <e2, ..., <en, _>>> is that it doesn't work with inductives and structures with more than two args.

@sgouezel
Copy link
Collaborator

Copy docstring to docs/tactics.md?

@robertylewis
Copy link
Member Author

No way that's obvious to me. The anonymous constructor is a macro, and I can't build that shape recursively. This could be made to work for arbitrary inductives by looking at the target, identifying the constructor, and applying that, but that's more effort than I meant to spend here -- I don't think existsi works in that generality either, does it?

@johoelzl
Copy link
Collaborator

Myabe an adoption of the constructor tactic would help here?

@robertylewis
Copy link
Member Author

You can do tactic.fconstructor >> l.mmap' tactic.refine when you have a single constructor with multiple arguments, but not when you have nested constructors with one argument each (like ∃ a b c : ℤ, a + b + c = 6). The anonymous constructor notation conveniently covers both these cases, but they're not really analogous otherwise.

@digama0
Copy link
Member

digama0 commented Nov 21, 2018

Another possible generalization is to "figure out" the right bracketing of constructors, but maybe that's too magical? (Although I don't mind small tactics, once we have decided to have a tactic it seems reasonable to generalize it to any adjacent use cases to get something nice.)

@robertylewis
Copy link
Member Author

Yeah, I mean, this is a one liner where the doc string took longer to write than the tactic itself. I can try to generalize it at some point but it won't happen this week.

@digama0 digama0 merged commit e793967 into leanprover-community:master Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants