public class GroupPowExpr extends AbstractGroupElementExpression
GroupElementExpression representing a a group element expression raised to some power.| Modifier and Type | Field and Description |
|---|---|
protected GroupElementExpression |
base |
protected ExponentExpr |
exponent |
group| Constructor and Description |
|---|
GroupPowExpr(GroupElementExpression base,
ExponentExpr exponent) |
| Modifier and Type | Method and Description |
|---|---|
GroupElement |
evaluate(Substitution substitutions)
Evaluates the expression after substituting contained variables.
|
GroupOpExpr |
flatten(ExponentExpr exp)
Linearizes the expression \(\text{this}^\text{exponent}\).
|
void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
GroupElementExpression |
getBase()
Retrieves the base expression of this exponentiation.
|
ExponentExpr |
getExponent()
Retrieves the exponent expression of this exponentiation.
|
GroupOpExpr |
linearize()
Returns an equivalent expression of the form
y * f(groupVariables, exponentVariables),
where y is constant (no variables), and the expression f is linear. |
GroupElementExpression |
pow(ExponentExpr exp) |
GroupElementExpression |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
getGroup, getGroupOrderIfKnownclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevaluate, flatten, inv, isEqualTo, isEqualTo, isEqualTo, op, op, op, opPow, opPow, opPow, opPow, opPow, opPow, opPow, opPow, pow, pow, pow, pow, precompute, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkprotected GroupElementExpression base
protected ExponentExpr exponent
public GroupPowExpr(GroupElementExpression base, ExponentExpr exponent)
public GroupElement evaluate(Substitution substitutions)
Expressionsubstitutions - a function mapping variables to expressions that can be evaluatedpublic void forEachChild(java.util.function.Consumer<Expression> action)
ExpressionGroupOpExpr, this would call action on the left- and right-hand-side and then return.public GroupElementExpression substitute(Substitution substitutions)
Expressionsubstitutions - a function mapping variable expressions to their replacement expressionspublic GroupElementExpression getBase()
public ExponentExpr getExponent()
public GroupElementExpression pow(ExponentExpr exp)
public GroupOpExpr linearize() throws java.lang.IllegalArgumentException
GroupElementExpressiony * f(groupVariables, exponentVariables),
where y is constant (no variables), and the expression f is linear.
Linearity means that
f(groupVariables, exponentVariables) * f(groupVariables2, exponentVariables2) = f(groupVariables * groupVariables2, exponentVariables + exponentVariables2)The exact result is a
GroupOpExpr 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\)).public GroupOpExpr flatten(ExponentExpr exp)
GroupElementExpression