ExpressionMatchers

com.phasmidsoftware.number.expression.expr.ExpressionMatchers
See theExpressionMatchers companion class

The ExpressionMatchers object provides utilities for evaluating relationships between two Expression objects using a given ExpressionBiFunction. It enables analysis of complementary expressions under specific mathematical or logical contexts.

These methods are here so that they're not part of the ExpressionMatchers API.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Evaluates whether two Expression instances, when combined using the provided ExpressionBiFunction, yield the appropriate identity value (although, in practice, we shortcut that logic a little).

Evaluates whether two Expression instances, when combined using the provided ExpressionBiFunction, yield the appropriate identity value (although, in practice, we shortcut that logic a little).

This method is designed to identify cases where the resulting Expression meets particular characteristics, such as being a zero-valued Structure or a unit-valued Unitary.

TODO Move this into ExpressionBiFunction.

Value parameters

f

The binary function (ExpressionBiFunction) applied to evaluate the relationship between the two Expression instances.

x

The first Expression operand used in the evaluation.

y

The second Expression operand used in the evaluation.

Attributes

Returns

An Option[Expression] containing the complementary result if the specified conditions are met, or None if no such complement is identified.

Simplifies a sequence of Expression instances by applying a grouping function and a matching strategy to produce a simplified result.

Simplifies a sequence of Expression instances by applying a grouping function and a matching strategy to produce a simplified result.

Value parameters

grouper

A function that groups and transforms a sequence of Expression instances into a single Expression.

xs

The sequence of Expression instances to simplify.

Attributes

Returns

A MatchResult[Expression] containing the result of the simplification process.