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