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

Update MonotoneOp to allow only flattening but not idempotency #96

Closed
marcofavorito opened this issue Oct 15, 2023 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request high-priority High-priority tasks.

Comments

@marcofavorito
Copy link
Member

Is your feature request related to a problem? Please describe.

The MonotoneOp metaclass was employed for simple simplifications for and and or logical operators, which both simplify the arguments by exploiting the idempotency property (i.e. arg OP arg \equiv arg), and it also flattens the binary operator if its operands are binary operators of the same type.

PR #92 introduced several binary operators which do not satisfy the idempotency property (i.e. arg OP arg \equiv arg), but their implementation would benefit if MonotoneOp can be configured so to not apply the idempotency simplification if not needed.

Describe the solution you'd like
add a class attribute idempotency: bool, which by default is False, and change the behaviour of MonotoneOp depending on what is the value of idempotency. We should change the name for a generic binary operation metaclass, e.g. BinaryOpMetaclass. By doing so, we can still gain from the usefulness of flattening.

See: https://github.com/AI-Planning/pddl/pull/92/files#r1359940653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-priority High-priority tasks.
Projects
None yet
Development

No branches or pull requests

2 participants