Skip to content

Remove Defined markers in simplifyConjunctionByAssumption #2372

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

Merged
merged 6 commits into from
Jan 27, 2021

Conversation

ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Jan 26, 2021

Needs #2366

Until #2351 is done, this will fix those cases where a conjunction isn't simplified correctly because the terms differ by Defined markers.


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

@ana-pantilie ana-pantilie marked this pull request as ready for review January 26, 2021 12:17
@ttuegel ttuegel self-requested a review January 26, 2021 22:33
Comment on lines +80 to +81
, testDefined "contradiction: f(g(x)) = a ∧ f(g(x)) = b" (Right fg) (Right a) (Right b)
, testDefined "contradiction: f(g(x)) = a ∧ f(g(x)) = b" (Left fg) (Right a) (Right b)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between Right fg and Left fg?

Copy link
Contributor Author

@ana-pantilie ana-pantilie Jan 27, 2021

Choose a reason for hiding this comment

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

Right fg will apply mkDefined to the f(g(x) in the second equals, and Left fg to the one in the first. This makes sure we test that the Defined markers are removed when both assuming and looking up terms.

equals2 =
mkLocalDefn (applyDefined2 eitherFunc) eitherC2
& Condition.fromPredicate
condition = definedFg <> equals1 <> definedFg <> equals2
Copy link
Contributor

Choose a reason for hiding this comment

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

Using definedFg here actually requires that eitherFunc is Right fg or Left fg, so I would rather we not allow passing in any value there.

Copy link
Contributor Author

@ana-pantilie ana-pantilie Jan 27, 2021

Choose a reason for hiding this comment

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

Do you mean we should remove definedFg from condition? Edit: I think this is what you meant by this comment, so I pushed a commit with this change. If you think something else should change, let me know.

@ana-pantilie ana-pantilie requested a review from ttuegel January 27, 2021 18:36
@ana-pantilie ana-pantilie merged commit 1d245bc into master Jan 27, 2021
@ana-pantilie ana-pantilie deleted the remove-defined-in-simplifyconj branch January 27, 2021 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants