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

Suffices terminst advice #44

Closed

Conversation

HalflingHelper
Copy link
Collaborator

#42

@HalflingHelper
Copy link
Collaborator Author

Passing all tests, and I added two more where advice should / shouldn't be given. It might be worth taking some time to brainstorm more situations when this could arise, though as arguments of calls is certainly the most common.

@HalflingHelper
Copy link
Collaborator Author

Wait to merge this, there might be a problem with the operator fix :

suffices to prove:
        a + sum(d) = + a

@HalflingHelper
Copy link
Collaborator Author

Also the lalr parser doesn't like this :)
theorem foldr_eq_sum : all ls : List. sum(ls) = foldr(ls, 0, operator +)

@HalflingHelper
Copy link
Collaborator Author

It's the paren after operator+

@HalflingHelper
Copy link
Collaborator Author

Closing since 0e88ca9 appears to fix

@jsiek
Copy link
Owner

jsiek commented Dec 18, 2024

Interesting. You're solution is a more specific that what I just pushed, which could make it less verbose, which is good, but the question is whether Call is the only problematic context...

@jsiek
Copy link
Owner

jsiek commented Dec 18, 2024

I suspect that there are more contexts that could be problematic... any place in synthesis mode.

@jsiek
Copy link
Owner

jsiek commented Dec 18, 2024

So the really good solution would be to augment the substitute method to know about check/synthesis and only set inferred = False when substituting in a synthesis context. But that's a bunch more work. I'll make an issue for that.

@jsiek
Copy link
Owner

jsiek commented Dec 18, 2024

Hmm, actually, it's not as simple as recognizing synthesis mode because of generic functions.

@jsiek
Copy link
Owner

jsiek commented Dec 18, 2024

I think perhaps the fix I just pushed is good because it is conservative and not that complicated. To do better seems to require a much more complex solution.

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