Skip to content

[Merged by Bors] - feat: factor out backtracking code from solve_by_elim#2920

Closed
kim-em wants to merge 12 commits intomasterfrom
refactor_solve_by_elim
Closed

[Merged by Bors] - feat: factor out backtracking code from solve_by_elim#2920
kim-em wants to merge 12 commits intomasterfrom
refactor_solve_by_elim

Conversation

@kim-em
Copy link
Copy Markdown
Contributor

@kim-em kim-em commented Mar 16, 2023

Following up from discussion on zulip.

No change in functionality, this is just a refactor.


Open in Gitpod

@kim-em kim-em added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Mar 16, 2023
@urkud urkud added the t-meta Tactics, attributes or user commands label Mar 16, 2023
@Parcly-Taxel Parcly-Taxel removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Mar 16, 2023
Copy link
Copy Markdown
Contributor

@kmill kmill left a comment

Choose a reason for hiding this comment

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

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+

@bors
Copy link
Copy Markdown

bors bot commented Apr 1, 2023

✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@kim-em kim-em added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Apr 1, 2023
@kim-em
Copy link
Copy Markdown
Contributor Author

kim-em commented Apr 1, 2023

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Apr 1, 2023
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>
@bors
Copy link
Copy Markdown

bors bot commented Apr 1, 2023

Build failed:

  • Build

@kim-em
Copy link
Copy Markdown
Contributor Author

kim-em commented Apr 2, 2023

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>
@bors
Copy link
Copy Markdown

bors bot commented Apr 2, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: factor out backtracking code from solve_by_elim [Merged by Bors] - feat: factor out backtracking code from solve_by_elim Apr 2, 2023
@bors bors bot closed this Apr 2, 2023
@bors bors bot deleted the refactor_solve_by_elim branch April 2, 2023 08:53
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants