AdditiveIdentityCommutative

com.phasmidsoftware.number.expression.expr.AdditiveIdentityCommutative

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
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