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

Recursive solver #372

Merged
merged 50 commits into from
Apr 15, 2020
Merged

Recursive solver #372

merged 50 commits into from
Apr 15, 2020

Conversation

flodiebold
Copy link
Member

@flodiebold flodiebold commented Apr 5, 2020

This is getting close to a state where I think it could be merged. Tests are run for both solvers unless otherwise specified.

To do:

  • lowering tests only run with the default solver currently
  • move the Generalize folder somewhere else
  • clean up a bit how high-priority clauses override low-priority ones
  • add Floundered error in program_clauses instead of using Option
  • maybe some other things I forgot

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

OK, did a first pass. I didn't read the recursive solver yet, will try to do that next, but I did a sweep over all the other code, which largely seems reasonable.

chalk-ir/src/lib.rs Outdated Show resolved Hide resolved
chalk-solve/src/clauses.rs Show resolved Hide resolved
chalk-solve/src/clauses.rs Show resolved Hide resolved
chalk-solve/src/clauses.rs Show resolved Hide resolved
chalk-solve/src/clauses/generalize.rs Outdated Show resolved Hide resolved
tests/test/cycle.rs Show resolved Hide resolved
tests/test/projection.rs Outdated Show resolved Hide resolved
tests/test/projection.rs Show resolved Hide resolved
tests/test/projection.rs Outdated Show resolved Hide resolved
tests/test/projection.rs Outdated Show resolved Hide resolved
@flodiebold flodiebold marked this pull request as ready for review April 14, 2020 18:13
@flodiebold
Copy link
Member Author

I added back the commented-out tests and added a few comments as suggested.

@nikomatsakis
Copy link
Contributor

@flodiebold can you rename recursive/mod.rs to recursive.rs, since we've been using that module convention in chalk elsewhere?

chalk-solve/src/recursive/mod.rs Outdated Show resolved Hide resolved
chalk-solve/src/recursive/mod.rs Outdated Show resolved Hide resolved
flodiebold and others added 23 commits April 15, 2020 19:33
The `program_clauses_for_env` function only added elaborated clauses, not the
actual clauses from the environment. Instead, both solvers added the clauses
afterwards. It seems easier to just add the direct clauses as well.
So if we had some implication A => B, if the solution for A had low priority, we
also made B low priority. After some testing, I don't think this is right.
 - bring back tests I commented out
 - add a few comments
 - add an is_var helper
@nikomatsakis nikomatsakis merged commit 28cef6f into rust-lang:master Apr 15, 2020
@flodiebold flodiebold deleted the recursive-solver branch April 15, 2020 22:03
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.

2 participants