Crux.Expression.RewriteRule.CommutativityLaw (crux v0.1.3)

Copy Markdown View Source

Rewrite rule that applies commutativity laws to normalize expression order.

See: https://en.wikipedia.org/wiki/Commutative_property

Applies the transformations:

  • A AND B = B AND A
  • A OR B = B OR A

This normalization helps other rewrite rules match patterns more effectively by ensuring a consistent lexicographic order of operands.