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

[Merged by Bors] - feat(library/init/meta/tactic): informative tactic combinators #212

Closed
wants to merge 3 commits into from

Conversation

JLimperg
Copy link
Collaborator

@JLimperg JLimperg commented May 4, 2020

Many tactic combinators currently only work with tactic units. This PR introduces variants of these combinators which work with general tactic αs, as suggested in #206.

This is a choose-your-own-PR: It contains two commits corresponding to two different designs from #206. The first commit is more conservative: it leaves the existing combinators alone and implements the new ones with primed names (all_goals' etc). This leads to no breakage in core and very minimal breakage in mathlib. The second commit switches the names around so that the unit-valued combinators get the prime. This leads to mild breakage in core/mathlib, but is more consistent with the existing naming conventions (e.g. mmap vs mmap').

I'd prefer that both commits get merged, but if you want just the first one, that's also fine by me.

fixes #206

Most of the combinators for tactics (e.g. `focus`, `all_goals`, `solve`)
used to work only with `tactic unit`s. This commit adds 'informative'
variants of these combinators which work with general `tactic α`.
… tactic combinators

In 94e1dcb, we added 'informative'
variants of tactic combinators like `all_goals` and `focus`. These were
previously called `all_goals'`, `focus'` etc. However, this is
inconsistent with the existing naming convention for `mmap`/`mmap'`
etc., where the non-informative variant (i.e. the one working with
`tactic unit` only) gets the prime. This commit therefore swaps the
naming convention for the tactic combinators.
@gebner
Copy link
Member

gebner commented May 11, 2020

bors merge

bors bot pushed a commit that referenced this pull request May 11, 2020
Many tactic combinators currently only work with `tactic unit`s. This PR introduces variants of these combinators which work with general `tactic α`s, as suggested in #206.

This is a choose-your-own-PR: It contains two commits corresponding to two different designs from #206. The first commit is more conservative: it leaves the existing combinators alone and implements the new ones with primed names (`all_goals'` etc). This leads to no breakage in core and very minimal breakage in mathlib. The second commit switches the names around so that the `unit`-valued combinators get the prime. This leads to mild breakage in core/mathlib, but is more consistent with the existing naming conventions (e.g. `mmap` vs `mmap'`).

I'd prefer that both commits get merged, but if you want just the first one, that's also fine by me.

fixes #206
@bors
Copy link

bors bot commented May 11, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(library/init/meta/tactic): informative tactic combinators [Merged by Bors] - feat(library/init/meta/tactic): informative tactic combinators May 11, 2020
@bors bors bot closed this May 11, 2020
@bryangingechen bryangingechen deleted the informative-tactic-combinators branch May 15, 2020 06:19
bors bot pushed a commit to leanprover-community/mathlib that referenced this pull request May 15, 2020
## Changes to bracket notation

* `{a}` now requires an instance `has_singleton`;
* `insert a ∅ = {a}` is called `insert_emptyc_eq`, provided by an `is_lawful_singleton` instance;
* `a ∈ ({b} : set α)` is now defeq `a = b`, not `a = b ∨ false`;
* `({a} : set α)` is no longer defeq `insert a ∅`;
* `({a} : finset α)` now means `⟨⟨[a]⟩, _⟩` (used to be called `finset.singleton a`), not `insert a ∅`;
* removed `finset.singleton`;
* `{a, b}` is now `insert a {b}`, not `insert b {a}`.
* `finset.univ : finset bool` is now `{tt, ff}`;
* `(({a} : finset α) : set α)` is no longer defeq `{a}`.

## Tactic `norm_num`

The interactive tactic `norm_num` was recently rewritten in Lean. The non-interactive `tactic.norm_num` has been removed in Lean 3.12 so that we can migrate the algebraic hierarchy to mathlib in 3.13.

## Tactic combinators

leanprover-community/lean#212 renames a bunch of tactic combinators. We change to using the new names.

## Tactic `case`

leanprover-community/lean#228 slightly changes the semantics of the `case` tactic. We fix the resulting breakage to be conform the new semantics.

Co-authored-by: Jannis Limperg <jannis@limperg.de>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
## Changes to bracket notation

* `{a}` now requires an instance `has_singleton`;
* `insert a ∅ = {a}` is called `insert_emptyc_eq`, provided by an `is_lawful_singleton` instance;
* `a ∈ ({b} : set α)` is now defeq `a = b`, not `a = b ∨ false`;
* `({a} : set α)` is no longer defeq `insert a ∅`;
* `({a} : finset α)` now means `⟨⟨[a]⟩, _⟩` (used to be called `finset.singleton a`), not `insert a ∅`;
* removed `finset.singleton`;
* `{a, b}` is now `insert a {b}`, not `insert b {a}`.
* `finset.univ : finset bool` is now `{tt, ff}`;
* `(({a} : finset α) : set α)` is no longer defeq `{a}`.

## Tactic `norm_num`

The interactive tactic `norm_num` was recently rewritten in Lean. The non-interactive `tactic.norm_num` has been removed in Lean 3.12 so that we can migrate the algebraic hierarchy to mathlib in 3.13.

## Tactic combinators

leanprover-community/lean#212 renames a bunch of tactic combinators. We change to using the new names.

## Tactic `case`

leanprover-community/lean#228 slightly changes the semantics of the `case` tactic. We fix the resulting breakage to be conform the new semantics.

Co-authored-by: Jannis Limperg <jannis@limperg.de>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
## Changes to bracket notation

* `{a}` now requires an instance `has_singleton`;
* `insert a ∅ = {a}` is called `insert_emptyc_eq`, provided by an `is_lawful_singleton` instance;
* `a ∈ ({b} : set α)` is now defeq `a = b`, not `a = b ∨ false`;
* `({a} : set α)` is no longer defeq `insert a ∅`;
* `({a} : finset α)` now means `⟨⟨[a]⟩, _⟩` (used to be called `finset.singleton a`), not `insert a ∅`;
* removed `finset.singleton`;
* `{a, b}` is now `insert a {b}`, not `insert b {a}`.
* `finset.univ : finset bool` is now `{tt, ff}`;
* `(({a} : finset α) : set α)` is no longer defeq `{a}`.

## Tactic `norm_num`

The interactive tactic `norm_num` was recently rewritten in Lean. The non-interactive `tactic.norm_num` has been removed in Lean 3.12 so that we can migrate the algebraic hierarchy to mathlib in 3.13.

## Tactic combinators

leanprover-community/lean#212 renames a bunch of tactic combinators. We change to using the new names.

## Tactic `case`

leanprover-community/lean#228 slightly changes the semantics of the `case` tactic. We fix the resulting breakage to be conform the new semantics.

Co-authored-by: Jannis Limperg <jannis@limperg.de>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
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.

Generalise tactic combinators
2 participants