Update MonotoneOp
to allow only flattening but not idempotency
#96
Labels
MonotoneOp
to allow only flattening but not idempotency
#96
Is your feature request related to a problem? Please describe.
The
MonotoneOp
metaclass was employed for simple simplifications forand
andor
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 ifMonotoneOp
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
The text was updated successfully, but these errors were encountered: