[Merged by Bors] - feat: factor out backtracking code from solve_by_elim#2920
Closed
[Merged by Bors] - feat: factor out backtracking code from solve_by_elim#2920
Conversation
thorimur
reviewed
Mar 16, 2023
thorimur
reviewed
Mar 16, 2023
eric-wieser
reviewed
Apr 1, 2023
kmill
approved these changes
Apr 1, 2023
Contributor
kmill
left a comment
There was a problem hiding this comment.
The only thing I might have suggested is that acc could be an Array, but that's not a good idea since the program is actually taking advantage of sharing (from the g.firstContinuation line).
The backtracking API seems reasonable enough and it doesn't seem like you're really jumping through any hoops to use it, so I approve.
bors d+
|
✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with |
Contributor
Author
|
bors merge |
bors bot
pushed a commit
that referenced
this pull request
Apr 1, 2023
Following up from discussion on [zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.60mono.60.20changes.3F). No change in functionality, this is just a refactor. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
|
Build failed:
|
Contributor
Author
|
bors merge |
bors bot
pushed a commit
that referenced
this pull request
Apr 2, 2023
Following up from discussion on [zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.60mono.60.20changes.3F). No change in functionality, this is just a refactor. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
|
Pull request successfully merged into master. Build succeeded: |
MonadMaverick
pushed a commit
that referenced
this pull request
Apr 9, 2023
Following up from discussion on [zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.60mono.60.20changes.3F). No change in functionality, this is just a refactor. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
MonadMaverick
pushed a commit
that referenced
this pull request
Apr 9, 2023
Following up from discussion on [zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.60mono.60.20changes.3F). No change in functionality, this is just a refactor. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
1 task
bors bot
pushed a commit
that referenced
this pull request
Apr 21, 2023
We had some unfortunate spaghetti code in `solve_by_elim`. When @hrmacbeth had requested additional features for `apply_rules`, the easiest way to provide them was to re-use `solve_by_elim`'s parsing and lemma handling. (See #856.) However `apply_rules` doesn't to backtracking, and `solve_by_elim` is all about it. At the time, `solve_by_elim` didn't have clean separation between its "lemma application" and "backtracking" considerations, so the solution was to add some hacks the prevented the backtracking from actually occurring, in the backtracking code... Since #2920, those considerations have been cleanly separated out. Thus it's possible to greatly simplify how we don't backtrack when we don't want to (in `apply_rules`). This PR does that. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
kbuzzard
pushed a commit
that referenced
this pull request
Apr 22, 2023
We had some unfortunate spaghetti code in `solve_by_elim`. When @hrmacbeth had requested additional features for `apply_rules`, the easiest way to provide them was to re-use `solve_by_elim`'s parsing and lemma handling. (See #856.) However `apply_rules` doesn't to backtracking, and `solve_by_elim` is all about it. At the time, `solve_by_elim` didn't have clean separation between its "lemma application" and "backtracking" considerations, so the solution was to add some hacks the prevented the backtracking from actually occurring, in the backtracking code... Since #2920, those considerations have been cleanly separated out. Thus it's possible to greatly simplify how we don't backtrack when we don't want to (in `apply_rules`). This PR does that. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
kim-em
added a commit
that referenced
this pull request
May 10, 2023
We had some unfortunate spaghetti code in `solve_by_elim`. When @hrmacbeth had requested additional features for `apply_rules`, the easiest way to provide them was to re-use `solve_by_elim`'s parsing and lemma handling. (See #856.) However `apply_rules` doesn't to backtracking, and `solve_by_elim` is all about it. At the time, `solve_by_elim` didn't have clean separation between its "lemma application" and "backtracking" considerations, so the solution was to add some hacks the prevented the backtracking from actually occurring, in the backtracking code... Since #2920, those considerations have been cleanly separated out. Thus it's possible to greatly simplify how we don't backtrack when we don't want to (in `apply_rules`). This PR does that. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
hrmacbeth
pushed a commit
that referenced
this pull request
May 10, 2023
We had some unfortunate spaghetti code in `solve_by_elim`. When @hrmacbeth had requested additional features for `apply_rules`, the easiest way to provide them was to re-use `solve_by_elim`'s parsing and lemma handling. (See #856.) However `apply_rules` doesn't to backtracking, and `solve_by_elim` is all about it. At the time, `solve_by_elim` didn't have clean separation between its "lemma application" and "backtracking" considerations, so the solution was to add some hacks the prevented the backtracking from actually occurring, in the backtracking code... Since #2920, those considerations have been cleanly separated out. Thus it's possible to greatly simplify how we don't backtrack when we don't want to (in `apply_rules`). This PR does that. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
hrmacbeth
pushed a commit
that referenced
this pull request
May 11, 2023
We had some unfortunate spaghetti code in `solve_by_elim`. When @hrmacbeth had requested additional features for `apply_rules`, the easiest way to provide them was to re-use `solve_by_elim`'s parsing and lemma handling. (See #856.) However `apply_rules` doesn't to backtracking, and `solve_by_elim` is all about it. At the time, `solve_by_elim` didn't have clean separation between its "lemma application" and "backtracking" considerations, so the solution was to add some hacks the prevented the backtracking from actually occurring, in the backtracking code... Since #2920, those considerations have been cleanly separated out. Thus it's possible to greatly simplify how we don't backtrack when we don't want to (in `apply_rules`). This PR does that. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up from discussion on zulip.
No change in functionality, this is just a refactor.