Class ProductExpression<T extends Ring<T>>

java.lang.Object
org.episteme.core.mathematics.symbolic.ProductExpression<T>
All Implemented Interfaces:
Expression<T>

public class ProductExpression<T extends Ring<T>> extends Object implements Expression<T>
Represents a product of two expressions.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • ProductExpression

      public ProductExpression(Expression<T> left, Expression<T> right, Ring<T> ring)
      Creates a product expression.
      Parameters:
      left - the left operand
      right - the right operand
      ring - the ring structure
  • Method Details

    • add

      public Expression<T> add(Expression<T> other)
      Description copied from interface: Expression
      Adds this expression to another.
      Specified by:
      add in interface Expression<T extends Ring<T>>
      Parameters:
      other - the other expression
      Returns:
      the sum expression
    • multiply

      public Expression<T> multiply(Expression<T> other)
      Description copied from interface: Expression
      Multiplies this expression by another.
      Specified by:
      multiply in interface Expression<T extends Ring<T>>
      Parameters:
      other - the other expression
      Returns:
      the product expression
    • subtract

      public Expression<T> subtract(Expression<T> other)
      Description copied from interface: Expression
      Subtracts another expression from this.
      Specified by:
      subtract in interface Expression<T extends Ring<T>>
      Parameters:
      other - the subtrahend
      Returns:
      the difference expression
    • negate

      public Expression<T> negate()
      Description copied from interface: Expression
      Negates this expression.
      Specified by:
      negate in interface Expression<T extends Ring<T>>
      Returns:
      the negated expression
    • divide

      public Expression<T> divide(Expression<T> other)
      Description copied from interface: Expression
      Divides this expression by another.
      Specified by:
      divide in interface Expression<T extends Ring<T>>
      Parameters:
      other - the divisor
      Returns:
      the quotient expression
    • differentiate

      public Expression<T> differentiate(Variable<T> variable)
      Description copied from interface: Expression
      Differentiates this expression with respect to the given variable.
      Specified by:
      differentiate in interface Expression<T extends Ring<T>>
      Parameters:
      variable - the variable to differentiate by
      Returns:
      the derivative expression
    • integrate

      public Expression<T> integrate(Variable<T> variable)
      Description copied from interface: Expression
      Integrates this expression with respect to the given variable.
      Specified by:
      integrate in interface Expression<T extends Ring<T>>
      Parameters:
      variable - the variable to integrate by
      Returns:
      the integral expression
    • compose

      public Expression<T> compose(Variable<T> variable, Expression<T> substitution)
      Description copied from interface: Expression
      Composes this expression by substituting a variable with another expression.
      Specified by:
      compose in interface Expression<T extends Ring<T>>
      Parameters:
      variable - the variable to substitute
      substitution - the expression to substitute with
      Returns:
      the composed expression
    • simplify

      public Expression<T> simplify()
      Description copied from interface: Expression
      Simplifies this expression using algebraic rules.
      Specified by:
      simplify in interface Expression<T extends Ring<T>>
      Returns:
      the simplified expression
    • toLatex

      public String toLatex()
      Description copied from interface: Expression
      Converts this expression to LaTeX format.
      Specified by:
      toLatex in interface Expression<T extends Ring<T>>
      Returns:
      the LaTeX string
    • evaluate

      public T evaluate(Map<Variable<T>, T> assignments)
      Description copied from interface: Expression
      Evaluates this expression with the given variable assignments.
      Specified by:
      evaluate in interface Expression<T extends Ring<T>>
      Parameters:
      assignments - the variable assignments
      Returns:
      the evaluated value
    • getLeft

      public Expression<T> getLeft()
      Returns the left operand.
      Returns:
      the left expression
    • getRight

      public Expression<T> getRight()
      Returns the right operand.
      Returns:
      the right expression
    • getRing

      public Ring<T> getRing()
      Returns the ring structure.
      Specified by:
      getRing in interface Expression<T extends Ring<T>>
      Returns:
      the ring
    • toString

      public String toString()
      Overrides:
      toString in class Object