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(tactic/itauto): add support for [decidable p] assumptions #10744

Closed
wants to merge 8 commits into from

Conversation

digama0
Copy link
Member

@digama0 digama0 commented Dec 12, 2021

This allows proving theorems like the following, which use excluded middle selectively through decidable assumptions:

example (p q r : Prop) [decidable p] : (p → (q ∨ r)) → ((p → q) ∨ (p → r)) := by itauto

This also fixes a bug in the proof search order of the original itauto implementation causing nontermination in one of the new tests, which also makes the "big test" at the end run instantly.

Also adds a ! option to enable decidability for all propositions using classical logic.

Because adding decidability instances can be expensive for proof search, they are disabled by default. You can specify specific decidable instances to add by itauto [p, q], or use itauto* which adds all decidable atoms. (The ! option is useless on its own, and should be combined with * or [p] options.)

@robertylewis
Copy link
Member

What's the relation now between itauto! and tauto? And tauto!? Is there any real difference between tauto and tauto!? (I had the vague memory that the former became the latter at some point, but it still parses the !.)

import tactic

example (p : Prop) : p ∨ ¬ p :=
by tauto

@ericrbg
Copy link
Collaborator

ericrbg commented Dec 13, 2021

tauto! definitely does something more than tauto; I've had problems only one can solve. Mario said here:

Eric Rodriguez: is itauto! just a strictly better tauto! now?

Mario Carneiro: I believe so. tauto works on some heuristic instantiation stuff so it might be able to do some problems that aren't technically propositional logic, like A -> (A -> B) -> B where A and B are types

@robertylewis
Copy link
Member

So tauto isn't intuitionistic, but weaker than tauto!, and itauto! isn't intuitionistic (despite the i) and is incomparable to tauto!. finish and friends are also incomparable, despite the description (like tauto) being "prop logic + heuristic instantiation."

This is a mess that needs cleaning. Will post on Zulip in a bit.

@robertylewis robertylewis added the t-meta Tactics, attributes or user commands label Dec 13, 2021
@digama0
Copy link
Member Author

digama0 commented Dec 30, 2021

Given the situation with exponential blowup, I've reverted the default behavior of itauto to the previous version, where decidability instances are ignored. To turn on splitting on decidability instances, you can use itauto*, or itauto [p] for more controlled splitting.

@digama0 digama0 added the awaiting-review The author would like community review of the PR label Dec 30, 2021
@robertylewis
Copy link
Member

Thanks for the changes!

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Dec 30, 2021
bors bot pushed a commit that referenced this pull request Dec 30, 2021
This allows proving theorems like the following, which use excluded middle selectively through `decidable` assumptions:
```
example (p q r : Prop) [decidable p] : (p → (q ∨ r)) → ((p → q) ∨ (p → r)) := by itauto
```
This also fixes a bug in the proof search order of the original itauto implementation causing nontermination in one of the new tests, which also makes the "big test" at the end run instantly.

Also adds a `!` option to enable decidability for all propositions using classical logic.

Because adding decidability instances can be expensive for proof search, they are disabled by default. You can specify specific decidable instances to add by `itauto [p, q]`, or use `itauto*` which adds all decidable atoms. (The `!` option is useless on its own, and should be combined with `*` or `[p]` options.)
@bors
Copy link

bors bot commented Dec 30, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(tactic/itauto): add support for [decidable p] assumptions [Merged by Bors] - feat(tactic/itauto): add support for [decidable p] assumptions Dec 30, 2021
@bors bors bot closed this Dec 30, 2021
@bors bors bot deleted the itauto_decidable branch December 30, 2021 23:35
erdOne pushed a commit that referenced this pull request Jan 1, 2022
This allows proving theorems like the following, which use excluded middle selectively through `decidable` assumptions:
```
example (p q r : Prop) [decidable p] : (p → (q ∨ r)) → ((p → q) ∨ (p → r)) := by itauto
```
This also fixes a bug in the proof search order of the original itauto implementation causing nontermination in one of the new tests, which also makes the "big test" at the end run instantly.

Also adds a `!` option to enable decidability for all propositions using classical logic.

Because adding decidability instances can be expensive for proof search, they are disabled by default. You can specify specific decidable instances to add by `itauto [p, q]`, or use `itauto*` which adds all decidable atoms. (The `!` option is useless on its own, and should be combined with `*` or `[p]` options.)
@digama0 digama0 added the modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. label Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants