-
Notifications
You must be signed in to change notification settings - Fork 3
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
FXML-2302: Support for negating PDLL constraints #57
Conversation
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! |
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.
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
simpleConstraint
is true forroot
and false forinputOp
.This required the following changes:
PDLL:
!
tokensisNegated
PDL & PDLInterp Dialects
isNegated
with default valuefalse
to the operationspdl.apply_native_constraint
andpdl_interp.apply_constraint
ByteCode:
pdl_interp.apply_constraint
branch depending onisNegated
This work is to be upstreamed to llvm-project