public interface ExponentExpr extends Expression
Expression that evaluates to an integer.| Modifier and Type | Method and Description |
|---|---|
default ExponentExpr |
add(java.math.BigInteger other)
Adds the given constant to this expression.
|
default ExponentExpr |
add(ExponentExpr other)
Adds the given expression to this expression.
|
default ExponentExpr |
add(long other)
Adds the given constant to this expression.
|
default ExponentExpr |
add(java.lang.String other)
Adds an
ExponentVariableExpr with the given variable name to this expression. |
default ExponentExpr |
add(Zn.ZnElement other)
Adds the given constant to this expression.
|
java.math.BigInteger |
evaluate()
Evaluates the expression.
|
default java.math.BigInteger |
evaluate(Substitution substitutions)
Evaluates the expression after substituting contained variables.
|
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 ExponentExpr |
invert()
Multiplicatively inverts this expression.
|
default ExponentEqualityExpr |
isEqualTo(java.math.BigInteger other)
Creates an
ExponentEqualityExpr of this expression and the argument. |
default ExponentEqualityExpr |
isEqualTo(ExponentExpr other)
Creates an
ExponentEqualityExpr of this expression and the argument. |
default ExponentEqualityExpr |
isEqualTo(Zn.ZnElement other)
Creates an
ExponentEqualityExpr of this expression and the argument. |
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 |
mul(java.math.BigInteger other)
Multiplies this expression with the given constant.
|
default ExponentExpr |
mul(ExponentExpr other)
Multiplies this expression with the given expression.
|
default ExponentExpr |
mul(long other)
Multiplies this expression with the given constant.
|
default ExponentExpr |
mul(RingElement other)
Multiplies this expression with the given constant.
|
default ExponentExpr |
mul(java.lang.String other)
Multiplies a
ExponentVariableExpr with the given variable name with this expression. |
default ExponentExpr |
negate()
Negates this expression.
|
default ExponentExpr |
pow(java.math.BigInteger exponent)
Raises this expression to the given power.
|
default ExponentExpr |
pow(ExponentExpr exponent)
Raises this expression to the given power.
|
default ExponentExpr |
pow(long exponent)
Raises this expression to the given power.
|
default ExponentExpr |
pow(RingElement exponent) |
default ExponentExpr |
pow(java.lang.String exponent)
Raises this expression to the power variable with the given name.
|
default ExponentExpr |
sub(java.math.BigInteger other)
Subtracts the given constant from this expression.
|
default ExponentExpr |
sub(ExponentExpr other)
Subtracts the given expression from this expression.
|
default ExponentExpr |
sub(long other)
Adds the given constant to this expression.
|
default ExponentExpr |
sub(java.lang.String other)
Subtracts a
ExponentVariableExpr with the given variable name from this expression. |
default ExponentExpr |
sub(Zn.ZnElement other)
Subtracts the given constant from this expression.
|
default ExponentExpr |
substitute(java.lang.String variable,
Expression substitution) |
ExponentExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
default ExponentExpr |
substitute(VariableExpression variable,
Expression substitution)
Substitutes a specific variable with the given expression.
|
accumulate, containsExprMatchingPredicate, containsVariables, forEachChild, getVariables, treeWalkjava.math.BigInteger evaluate()
Expressionevaluate in interface ExpressionZn.ZnElement evaluate(Zn zn)
Zn.zn - the Zn to evaluate inZn.ZnElementdefault java.math.BigInteger evaluate(Substitution substitutions)
Expressionevaluate in interface Expressionsubstitutions - a function mapping variables to expressions that can be evaluateddefault Zn.ZnElement evaluate(Zn zn, Substitution substitutions)
Zn after substituting variables using the given substitutions.zn - the ring Zn to evaluate the expression insubstitutions - a function mapping variables to expressions that can be evaluatedZn.ZnElementdefault ExponentExpr substitute(java.lang.String variable, Expression substitution)
substitute in interface Expressiondefault ExponentExpr substitute(VariableExpression variable, Expression substitution)
Expressionsubstitute in interface Expressionvariable - the variable to replacesubstitution - the expression to substituteExponentExpr substitute(Substitution substitutions)
Expressionsubstitute in interface Expressionsubstitutions - a function mapping variable expressions to their replacement expressionsdefault ExponentExpr negate()
default ExponentExpr invert()
default ExponentExpr add(ExponentExpr other)
other - the addenddefault ExponentExpr add(Zn.ZnElement other)
default ExponentExpr add(java.lang.String other)
ExponentVariableExpr with the given variable name to this expression.other - the name of the variable to adddefault ExponentExpr add(java.math.BigInteger other)
default ExponentExpr add(long other)
default ExponentExpr sub(ExponentExpr other)
other - the subtrahenddefault ExponentExpr sub(Zn.ZnElement other)
default ExponentExpr sub(java.lang.String other)
ExponentVariableExpr with the given variable name from this expression.
Realized by adding the negation.other - the name of the variable to subtractdefault ExponentExpr sub(java.math.BigInteger other)
default ExponentExpr sub(long other)
default ExponentExpr mul(ExponentExpr other)
other - the factordefault ExponentExpr mul(java.math.BigInteger other)
other - the factordefault ExponentExpr mul(RingElement other)
other - the factordefault ExponentExpr mul(long other)
other - the factordefault ExponentExpr mul(java.lang.String other)
ExponentVariableExpr with the given variable name with this expression.other - the name of the variable to multiply withdefault ExponentExpr pow(ExponentExpr exponent)
exponent - the powerdefault ExponentExpr pow(long exponent)
exponent - the powerdefault ExponentExpr pow(java.math.BigInteger exponent)
exponent - the powerdefault ExponentExpr pow(RingElement exponent)
default ExponentExpr pow(java.lang.String exponent)
exponent - the name of the power variabledefault ExponentEqualityExpr isEqualTo(ExponentExpr other)
ExponentEqualityExpr of this expression and the argument.default ExponentEqualityExpr isEqualTo(Zn.ZnElement other)
ExponentEqualityExpr of this expression and the argument.default ExponentEqualityExpr isEqualTo(java.math.BigInteger other)
ExponentEqualityExpr of this expression and the argument.ExponentSumExpr linearize() throws java.lang.IllegalArgumentException
y + 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.java.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\)).