-
Notifications
You must be signed in to change notification settings - Fork 44
Use entire goal in proof strategy #1936
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
Use entire goal in proof strategy #1936
Conversation
…Rule in CommonProofState
:: InternalVariable variable | ||
=> RHS variable | ||
-> Pattern variable | ||
rhsToPattern RHS { existentials, right, ensures } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This transformation is not valid, it takes
\exists(X, \and(right, ensures))
and turns it into
\and(\exists(X, right), \exists(X, ensures))
The correct thing to do is construct a Pattern
using right
and ensures
, convert that into a TermLike
, and call mkExistsN
on that TermLike
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right, the second doesn't imply the first, so they're not equivalent. Thanks!
I noticed that there already is a rhsToTerm
which only does some trivial simplification in the case the ensures
is \top
. Pattern.toTermLike
also does this for \bottom
. Changing rhsToTerm
to use Pattern.fromTermLike
made some unit tests fail. Is there any reason we don't use this there? In any case, I just implemented rhsToPattern
without using rhsToTerm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason is only that, in some cases, we expect the \and
structure of the Pattern
to be preserved. Does that answer your question?
:: InternalVariable variable | ||
=> RHS variable | ||
-> Pattern variable | ||
rhsToPattern RHS { existentials, right, ensures } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason is only that, in some cases, we expect the \and
structure of the Pattern
to be preserved. Does that answer your question?
Fixes #1918
Reviewer checklist
stack test --coverage
stack haddock