public class ExponentPowExpr extends java.lang.Object implements ExponentExpr
ExponentExpr representing an exponentiation with both base and exponent being exponent expressions.| Modifier and Type | Field and Description |
|---|---|
protected ExponentExpr |
base
The base expression of this exponentiation.
|
protected ExponentExpr |
exponent
The power expression of this exponentiation.
|
| Constructor and Description |
|---|
ExponentPowExpr(ExponentExpr base,
ExponentExpr exponent) |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
evaluate()
Evaluates the expression.
|
Zn.ZnElement |
evaluate(Zn zn)
Evaluates the expression in the given ring
Zn. |
void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
ExponentExpr |
getBase()
Retrieves the base exponent expression of this exponentiation.
|
ExponentExpr |
getExponent()
Retrieves the power exponent expression of this exponentiation.
|
ExponentSumExpr |
linearize()
Returns an equivalent expression of the form
y + f(variables), where y is constant (no variables),
and the expression f is linear. |
ExponentExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, add, evaluate, evaluate, invert, isEqualTo, isEqualTo, isEqualTo, mul, mul, mul, mul, mul, negate, pow, pow, pow, pow, pow, sub, sub, sub, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkprotected final ExponentExpr base
protected final ExponentExpr exponent
public ExponentPowExpr(ExponentExpr base, ExponentExpr exponent)
public ExponentExpr getBase()
public ExponentExpr getExponent()
public java.math.BigInteger evaluate()
Expressionevaluate in interface ExponentExprevaluate in interface Expressionpublic 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 Expressionpublic Zn.ZnElement evaluate(Zn zn)
ExponentExprZn.evaluate in interface ExponentExprzn - the Zn to evaluate inZn.ZnElementpublic ExponentExpr substitute(Substitution substitutions)
Expressionsubstitute in interface ExponentExprsubstitute in interface Expressionsubstitutions - a function mapping variable expressions to their replacement expressionspublic 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\)).