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

Pass canonical goals to program clauses code in SLG solver #624

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented Oct 9, 2020

It seemed like we were leaning towards this solution in the design meeting, and it turned out (assuming these changes are right) to be pretty straightforward.

Closes #568.

This should stop seeing issues related to failing to generalize program clauses pop up, but I'm only going to cc #614 since I'd like some tests maybe.

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

I'm on mobile, so not going to be a perfect response here. But this looks...not that great. I mean, it looks correct, but we went from instantiating in one place to two places, plus that rewrapping of the domain goal in the canonical binders and environment.

I guess it would nice if we could clean that up somehow. If you don't want to do that in this PR, I would like a FIXME at least and then r=me.

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.

One thing that is also missing from this PR is that we could cleanup the program_clauses_from_goal code to error out if it encounters inference variables. We're also going to have to extend that code once we start canonicalizing universal variables.

chalk-engine/src/logic.rs Outdated Show resolved Hide resolved
@nikomatsakis
Copy link
Contributor

Overall this seemed pretty nice to me. I still think that it's the right setup -- I guess my reasoning is basically that I think we ought to be caching the results of those calls, so passing in canonical things seems correct.

@bors
Copy link
Contributor

bors commented Nov 10, 2020

☔ The latest upstream changes (presumably #609) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

Instead of instantiating goals first, as is the case currently
@jackh726 jackh726 force-pushed the slg-program-clauses branch from 3d6e16c to d719618 Compare December 9, 2020 00:21
@jackh726
Copy link
Member

jackh726 commented Dec 9, 2020

Review comments have been addressed and this should be good to merge.

@jackh726 jackh726 force-pushed the slg-program-clauses branch from 328bb41 to 0b391f8 Compare December 9, 2020 03:23
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 10, 2020

📌 Commit 0b391f8 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Dec 10, 2020

⌛ Testing commit 0b391f8 with merge 44b6627...

@bors
Copy link
Contributor

bors commented Dec 10, 2020

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 44b6627 to master...

@bors bors merged commit 44b6627 into rust-lang:master Dec 10, 2020
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.

Decide whether the program clauses code should work on canonical or instantiated goals
4 participants