AdditiveIdentityCommutative
com.phasmidsoftware.number.expression.expr.AdditiveIdentityCommutative
object AdditiveIdentityCommutative extends CommutativeExtractor[Expression, Expression]
Extractor for commutative additive operations with an identity element (zero).
This object is a specialized implementation of the CommutativeExtractor trait, specifically designed to handle expressions where one side of a commutative addition operation is an additive identity (e.g., zero).
It operates under the assumption that addition is commutative and attempts to extract sub-expressions from either side of a binary expression in a manner that accounts for the commutativity of the operation.
The left-hand side of the expression is simply returned as-is, while the right-hand side is inspected to check if it represents the additive identity (zero). If the right-hand side is zero, its associated sub-expression is extracted.
Attributes
- Graph
-
- Supertypes
- Self type
Members list
In this article