MultiplicativeIdentityCommutative
com.phasmidsoftware.number.expression.expr.MultiplicativeIdentityCommutative
object MultiplicativeIdentityCommutative extends CommutativeExtractor[Expression, Expression]
An object that extracts and matches expressions based on the commutative property of multiplication with the identity element (unity).
This object extends CommutativeExtractor and provides the specific implementation for extracting expressions in the form of a multiplicative operation where one operand is the multiplicative identity (unity), and the other is the remaining expression.
It defines the following extraction rules:
- The
extractLeftmethod always extracts and returns the input expression as-is. - The
extractRightmethod matches an expression that is the multiplicative identity (IsUnity(x)) and extracts the contained valuex.
The unapply mechanism allows this extractor to match pairs of expressions in a commutative manner, ensuring symmetry in the analysis of multiplicative operations.
Attributes
- Graph
-
- Supertypes
- Self type
Members list
In this article