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

Coinduction handling for recursive solver #698

Merged

Conversation

firefighterduck
Copy link
Contributor

This PR is meant to address the issue of invalid result in coinductive cycles as described in #399 . It also fixes the two coinduction tests related to that issue (i.e. coinductive_unsound1 and coinductive_multicycle4). As such it is an improved version of #683 as it uses "solution0" described here and discussed here to handle more complicated coinductive cycles.

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.

This looks close, but I think it can get simpler still! See comments below.

chalk-recursive/src/recursive.rs Outdated Show resolved Hide resolved
chalk-recursive/src/recursive.rs Outdated Show resolved Hide resolved
chalk-recursive/src/search_graph.rs Outdated Show resolved Hide resolved
chalk-recursive/src/recursive.rs Show resolved Hide resolved
@nikomatsakis nikomatsakis self-assigned this Apr 3, 2021
chalk-recursive/src/stack.rs Outdated Show resolved Hide resolved
tests/test/coinduction.rs Show resolved Hide resolved
chalk-recursive/src/recursive.rs Show resolved Hide resolved
chalk-recursive/src/recursive.rs Outdated Show resolved Hide resolved
book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
book/src/recursive/coinduction.md Show resolved Hide resolved
book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
@firefighterduck firefighterduck force-pushed the coinductive-recursive-false-positives branch 2 times, most recently from 26f7874 to 40a5014 Compare April 5, 2021 12:11
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.

Code looks great! Here are some nits on the write-up. I might like to read it over one more time, or maybe @jackh726 can read it and see if he understands it.

book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
book/src/recursive/coinduction.md Outdated Show resolved Hide resolved
add solution0

document solution0 and remove unecessary test cases

simplify according to review
@firefighterduck firefighterduck force-pushed the coinductive-recursive-false-positives branch from 40a5014 to e98a14f Compare April 11, 2021 12:37
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.

Bravo. Reading through this, I realize I have so little knowledge about the recursive solver and how it works. But the documentation here is splendid. I'm not sure I can fully grok the code changes and their implications, but nothing sticks out as wrong to me.

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

r=me once tests are done! Nice work @firefighterduck!

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 12, 2021

📌 Commit 9ce2cef has been approved by nikomatsakis

@nikomatsakis
Copy link
Contributor

Forgot we use bors now

@bors
Copy link
Contributor

bors commented Apr 12, 2021

⌛ Testing commit 9ce2cef with merge d0d8fbe...

@bors
Copy link
Contributor

bors commented Apr 12, 2021

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

@bors bors merged commit d0d8fbe into rust-lang:master Apr 12, 2021
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.

5 participants