MultiplicativeIdentityCommutative

com.phasmidsoftware.number.expression.expr.MultiplicativeIdentityCommutative

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 extractLeft method always extracts and returns the input expression as-is.
  • The extractRight method matches an expression that is the multiplicative identity (IsUnity(x)) and extracts the contained value x.

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
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def unapply(pair: (Expression, Expression)): Option[(Expression, Expression)]

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Unapply method that tries both orderings on a tuple. First tries (extractLeft(left), extractRight(right)), then tries (extractLeft(right), extractRight(left)).

Attributes

Inherited from:
CommutativeExtractor