-
Notifications
You must be signed in to change notification settings - Fork 4
FXML-2302: Support for negating PDLL constraints #57
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
FXML-2302: Support for negating PDLL constraints #57
Conversation
ttjost
left a comment
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.
Could you just add a test (failure maybe?) for the rewrite section?
4444648 to
3ec1761
Compare
|
Thank you for the review! |
ttjost
left a comment
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.
Great! Thanks for adding the test and making the necessary changes.
ljfitz
left a comment
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.
Thanks Martin - looks like a useful addition and clearly coded.
This PR introduces support for negation of constraints.
Previously, this could only be handled by creating an additional native call, e.g.
or by including an explicit additional operand for negation, e.g.
Constraint checkA(input: Attr, negated: Attr);With this a constraint can simply be negated by prefixing it with
!. e.g.This pattern only matches if the constraint
simpleConstraintis true forrootand false forinputOp.This required the following changes:
PDLL:
!tokensisNegatedPDL & PDLInterp Dialects
isNegatedwith default valuefalseto the operationspdl.apply_native_constraintandpdl_interp.apply_constraintByteCode:
pdl_interp.apply_constraintbranch depending onisNegatedThis work is to be upstreamed to llvm-project