public interface GroupVariableExpr extends GroupElementExpression, VariableExpression
GroupElementExpression representing a variable which does not have a known value at time of creation.| Modifier and Type | Method and Description |
|---|---|
default GroupElement |
evaluate()
Evaluates the expression.
|
default GroupElement |
evaluate(Substitution substitutions)
Evaluates the expression after substituting contained variables.
|
default GroupOpExpr |
flatten(ExponentExpr exponent)
Linearizes the expression \(\text{this}^\text{exponent}\).
|
default void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
default Group |
getGroup()
Returns the group such that this expression evaluates to an element of this group, or null if group is unknown
(for example, if expression consists only of variables).
|
default 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. |
default GroupElementExpression |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
flatten, inv, isEqualTo, isEqualTo, isEqualTo, op, op, op, opPow, opPow, opPow, opPow, opPow, opPow, opPow, opPow, pow, pow, pow, pow, pow, precompute, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkdefault GroupElement evaluate()
Expressionevaluate in interface Expressionevaluate in interface GroupElementExpressiondefault GroupElement evaluate(Substitution substitutions)
Expressionevaluate in interface Expressionevaluate in interface GroupElementExpressionsubstitutions - a function mapping variables to expressions that can be evaluateddefault GroupElementExpression substitute(Substitution substitutions)
Expressionsubstitute in interface Expressionsubstitute in interface GroupElementExpressionsubstitutions - a function mapping variable expressions to their replacement expressionsdefault Group getGroup()
GroupElementExpressiongetGroup in interface GroupElementExpressiondefault GroupOpExpr flatten(ExponentExpr exponent)
GroupElementExpressionflatten in interface GroupElementExpressiondefault 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 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.linearize in interface GroupElementExpressionjava.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\)).