public interface ExponentVariableExpr extends ExponentExpr, VariableExpression
ExponentExpr representing a named variable.| Modifier and Type | Method and Description |
|---|---|
default java.math.BigInteger |
evaluate()
Evaluates the expression.
|
default java.math.BigInteger |
evaluate(Substitution substitutions)
Evaluates the expression after substituting contained variables.
|
default Zn.ZnElement |
evaluate(Zn zn)
Evaluates the expression in the given ring
Zn. |
default Zn.ZnElement |
evaluate(Zn zn,
Substitution substitutions)
Evaluates this expression in the given
Zn after substituting variables using the given substitutions. |
default void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
default ExponentSumExpr |
linearize()
Returns an equivalent expression of the form
y + f(variables), where y is constant (no variables),
and the expression f is linear. |
default ExponentExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
add, add, add, invert, isEqualTo, isEqualTo, isEqualTo, mul, mul, mul, mul, mul, negate, pow, pow, pow, pow, pow, sub, sub, sub, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkdefault java.math.BigInteger evaluate()
Expressionevaluate in interface ExponentExprevaluate in interface Expressiondefault void forEachChild(java.util.function.Consumer<Expression> action)
ExpressionGroupOpExpr, this would call action on the left- and right-hand-side and then return.forEachChild in interface Expressiondefault Zn.ZnElement evaluate(Zn zn)
ExponentExprZn.evaluate in interface ExponentExprzn - the Zn to evaluate inZn.ZnElementdefault java.math.BigInteger evaluate(Substitution substitutions)
Expressionevaluate in interface ExponentExprevaluate in interface Expressionsubstitutions - a function mapping variables to expressions that can be evaluateddefault Zn.ZnElement evaluate(Zn zn, Substitution substitutions)
ExponentExprZn after substituting variables using the given substitutions.evaluate in interface ExponentExprzn - the ring Zn to evaluate the expression insubstitutions - a function mapping variables to expressions that can be evaluatedZn.ZnElementdefault ExponentExpr substitute(Substitution substitutions)
Expressionsubstitute in interface ExponentExprsubstitute in interface Expressionsubstitutions - a function mapping variable expressions to their replacement expressionsdefault ExponentSumExpr linearize() throws java.lang.IllegalArgumentException
ExponentExpry + f(variables), where y is constant (no variables),
and the expression f is linear.
Linearity means that
f(variables) + f(variables2) = f(variables + variables2)The exact result is a
ExponentSumExpr where the left-hand-side y fulfills
y.containsVariables() == false and the right-hand side is linear.linearize in interface ExponentExprjava.lang.IllegalArgumentException - if it's not possible to form the desired output
(e.g., the input is something like \(g^{x_1 \cdot x_2}\) for variables \(x_1, x_2\)).