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

Remove duplicate predicates #730

Open
wants to merge 2 commits into
base: master
from

Conversation

5 participants
@martint
Copy link
Member

commented May 8, 2019

Remove duplicate predicates in logical binary expressions (AND, OR).
Canonicalizes commutative arithmetic expressions and comparisons to
handle a larger number of variants.

@cla-bot cla-bot bot added the cla-signed label May 8, 2019

@martint martint force-pushed the martint:remove-duplicates branch 2 times, most recently from 882026c to b954f58 May 8, 2019

// if we have a comparison of the form <constant> <op> <expr>, normalize it to
// <expr> <op-flipped> <constant>
if (node.getLeft() instanceof Literal && !(node.getRight() instanceof Literal)) {
return new ComparisonExpression(

This comment has been minimized.

Copy link
@findepi

findepi May 15, 2019

Member
Suggested change
return new ComparisonExpression(
node = new ComparisonExpression(

otherwise it's not clear whether expressions being flipped are treated the same way as those that did not require flipping

martint added some commits May 8, 2019

Remove duplicate predicates
Remove duplicate predicates in logical binary expressions (AND, OR).
Canonicalizes commutative arithmetic expressions and comparisons to
handle a larger number of variants.

@martint martint force-pushed the martint:remove-duplicates branch from b954f58 to 1ab964b May 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.