Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

fix(solve_by_elim): working with multiple goals#838

Merged
cipher1024 merged 4 commits intomasterfrom
solve_by_elim_multiple_goals
Mar 25, 2019
Merged

fix(solve_by_elim): working with multiple goals#838
cipher1024 merged 4 commits intomasterfrom
solve_by_elim_multiple_goals

Conversation

@kim-em
Copy link
Copy Markdown
Collaborator

@kim-em kim-em commented Mar 21, 2019

Slightly modify the behaviour of solve_by_elim, so it works on all current goals (backtracking if bad choices are made on one goal, making later goals unsolvable). No changes in the library required. The old behaviour can be recovered simply with { solve_by_elim }.

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 21, 2019

(This is a preliminary step for library_search.)

@cipher1024
Copy link
Copy Markdown
Collaborator

Why do you need this behaviour?

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 21, 2019

Why do you need this behaviour?

For library_search, in #839. It directly calls apply on the library lemma, then solve_by_elim on the newly introduced goals. It's important solve_by_elim looks at all of the goals together so it can do proper backtracking.

@cipher1024
Copy link
Copy Markdown
Collaborator

cipher1024 commented Mar 21, 2019 via email

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 22, 2019

Hmm... I guess so. I'm a bit sad --- perhaps it would have been better if the default was that you should expect a tactic to consider all the goals presented to it, not necessarily just the first one, and that "goal management" should be done explicitly. But that ship has certainly sailed, and it seems silly to wish that simp acted on all goals at once by default.

I'll add ! (but not until next week, I'm out of time).

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 25, 2019

Okay, now you have to run solve_by_elim* if you want it to try to solve all the goals together.

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 25, 2019

I went with solve_by_elim*. I worry a bit that this might be confusing, and look like the * is standing in for the list [h1, ..., hn] of additional lemmas. On the other hand, I like ! for "try harder", ? for "tell me more", and * for "work on everything".

@kim-em
Copy link
Copy Markdown
Collaborator Author

kim-em commented Mar 25, 2019

(When one day simp gets rewritten, it would be great to roll in squeeze_simp as just simp?.)

docs/tactics.md Outdated
also attempts to discharge the goal using congruence closure before each round of applying assumptions.

`solve_by_elim*` tries to solve all goals together, using backtracking if a solution for one goal
make other goals impossible.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/make/makes/

`solve_by_elim [-id]` removes a specified assumption.

`solve_by_elim*` tries to solve all goals together, using backtracking if a solution for one goal
make other goals impossible.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

@cipher1024
Copy link
Copy Markdown
Collaborator

@semorrison I like what you went with

@cipher1024 cipher1024 merged commit 0bb64a2 into master Mar 25, 2019
@johoelzl johoelzl deleted the solve_by_elim_multiple_goals branch March 25, 2019 20:22
butterthebuddha pushed a commit to butterthebuddha/mathlib that referenced this pull request May 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants