use of com.sri.ai.grinder.library.IsVariable in project aic-expresso by aic-sri-international.
the class SummationOnLinearRealArithmeticAndPolynomialStepSolver method computeSummationGivenValues.
private Expression computeSummationGivenValues(Expression literalFreeBody, Expression values, Context context) {
Expression result;
if (values.equals(Sets.EMPTY_SET) || Sets.isExtensionalSet(values)) {
result = ZERO;
} else {
Expression lowerBound = values.get(0);
Expression upperBound = values.get(1);
Polynomial bodyPolynomial = DefaultPolynomial.make(literalFreeBody);
Predicate<Expression> isVariable = new IsVariable(context.getIsUniquelyNamedConstantPredicate());
result = PolynomialIntegration.definiteIntegral(bodyPolynomial, getIndex(), lowerBound, upperBound, isVariable);
}
return result;
}
Aggregations