Search in sources :

Example 1 with BruteForceMultiQuantifierEliminator

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);
}
Also used : ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) Expression(com.sri.ai.expresso.api.Expression) BruteForceMultiQuantifierEliminator(com.sri.ai.grinder.interpreter.BruteForceMultiQuantifierEliminator) MultiQuantifierEliminator(com.sri.ai.grinder.api.MultiQuantifierEliminator) BruteForceMultiQuantifierEliminator(com.sri.ai.grinder.interpreter.BruteForceMultiQuantifierEliminator) ConstantExpressionStepSolver(com.sri.ai.grinder.theory.base.ConstantExpressionStepSolver)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)1 ExtensionalIndexExpressionsSet (com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet)1 MultiQuantifierEliminator (com.sri.ai.grinder.api.MultiQuantifierEliminator)1 BruteForceMultiQuantifierEliminator (com.sri.ai.grinder.interpreter.BruteForceMultiQuantifierEliminator)1 ConstantExpressionStepSolver (com.sri.ai.grinder.theory.base.ConstantExpressionStepSolver)1