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

Return early when treating ambiguous cycles #48

Merged
merged 2 commits into from
Jun 15, 2017

Conversation

scalexm
Copy link
Member

@scalexm scalexm commented Jun 14, 2017

This should solve the problem where an Ambig(Unknown) answer was used to feed a cycle and not producing back any answer.

_ => ()
};

answer = actual_answer;
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to make a test for this? or is that test basically just in your PR for #12?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well that's funny because in fact if I provide a test for that and deactivate the fix, the test program will not even load because of the overlap check which will loop forever. So I was indeed relying on this behaviour to test the fix in my PR for #12 (the trait_wf test would not load without the fix). Still I added a general test in this PR, which is better for documentation.

} else {
answer = actual_answer;
}
let fixed_point = actual_answer == answer;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here explaining why we have this special case? Also, I suspect that you can get into similar problems when you have guidance as well, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect it as well although ambig with guidance can perform some unification, but I cannot find examples where a cycle gives ambig with guidance after being fed. Nonetheless stopping when we get Ambig regardless of the guidance should not affect correctness of the final answer.

@scalexm scalexm changed the title Return early when treating ambiguous cycles with no guidance Return early when treating ambiguous cycles Jun 15, 2017
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