use of com.sri.ai.grinder.interpreter.BruteForceMultiQuantifierEliminator in project aic-expresso by aic-sri-international.
the class BruteForceFunctionTheory method getSingleQuantifierEliminatorStepSolver.
@Override
public ExpressionLiteralSplitterStepSolver getSingleQuantifierEliminatorStepSolver(SingleQuantifierEliminationProblem problem, Context context) {
Expression variable = problem.getIndex();
Expression type = GrinderUtil.getTypeExpressionOfExpression(variable, context);
Expression indexExpression = IndexExpressions.makeIndexExpression(variable, type);
ExtensionalIndexExpressionsSet indexExpressionsSet = new ExtensionalIndexExpressionsSet(indexExpression);
MultiQuantifierEliminator quantifierEliminator = new BruteForceMultiQuantifierEliminator(context.getTheory().getTopRewriter());
// TODO: return conditional steps on literals on free variables.
// We are solving it straight here because there are no literals in this theory,
// however a more sophisticated solution would return conditional steps on literals on free variables.
Expression solution = quantifierEliminator.extendContextAndSolve(problem.getGroup(), indexExpressionsSet, problem.getConstraint(), problem.getBody(), context);
return new ConstantExpressionStepSolver(solution);
}
Aggregations