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

Copy Markdown View Source

Rewrite rule that applies boolean annihilator laws.

See: https://en.wikipedia.org/wiki/Boolean_algebra#Monotone_laws

Applies the transformations:

  • A AND false = false (false annihilates AND)
  • false AND A = false (false annihilates AND)
  • A OR true = true (true annihilates OR)
  • true OR A = true (true annihilates OR)

The annihilator laws state that certain values (false for AND, true for OR) completely dominate the result regardless of other operands.