public class ExponentEmptyExpr extends java.lang.Object implements ExponentExpr
ExponentExpr representing an empty value useful for instantiating a new expression.
Combination with other exponent expressions leads to this expression being replaced by an evaluatable expression. Cannot be evaluated on its own.
| Constructor and Description |
|---|
ExponentEmptyExpr() |
| Modifier and Type | Method and Description |
|---|---|
ExponentExpr |
add(ExponentExpr other)
Adds the given expression to this expression.
|
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 |
invert()
Multiplicatively inverts this expression.
|
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 |
mul(ExponentExpr other)
Multiplies this expression with the given expression.
|
ExponentExpr |
sub(ExponentExpr other)
Subtracts the given expression from this expression.
|
ExponentExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, evaluate, evaluate, isEqualTo, isEqualTo, isEqualTo, mul, mul, mul, mul, negate, pow, pow, pow, pow, pow, sub, sub, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkpublic 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 ExponentExpr invert()
ExponentExprinvert in interface ExponentExprpublic ExponentExpr mul(ExponentExpr other)
ExponentExprmul in interface ExponentExprother - the factorpublic 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\)).public ExponentExpr add(ExponentExpr other)
ExponentExpradd in interface ExponentExprother - the addendpublic ExponentExpr sub(ExponentExpr other)
ExponentExprsub in interface ExponentExprother - the subtrahend