use of com.sri.ai.grinder.rewriter.core.Exhaustive in project aic-expresso by aic-sri-international.
the class AbstractInterpreter method setBaseTopRewriter.
public void setBaseTopRewriter(TopRewriter baseTopRewriter) {
Rewriter result = new Recursive(new Exhaustive(new TopRewriterUsingQuantifierEliminatorAndContextAssignments(baseTopRewriter)));
setBaseRewriter(result);
}
use of com.sri.ai.grinder.rewriter.core.Exhaustive in project aic-expresso by aic-sri-international.
the class SamplingAdderLazyIterator method makeSumOfSamplesIterator.
private AdderIterator makeSumOfSamplesIterator(MultiQuantifierEliminationProblem problem, TopRewriterUsingContextAssignments topRewriterUsingContextAssignments, Random random, Context context) {
AssignmentsSamplingIterator sampledAssignmentsIterator = new AssignmentsSamplingIterator(problem.getIndices(), problem.getConstraint(), new Recursive(new Exhaustive(topRewriterUsingContextAssignments)), random, context);
AdderIterator result = new AdderIterator(problem.getGroup(), sampledAssignmentsIterator, problem.getBody(), topRewriterUsingContextAssignments, context);
return result;
}
use of com.sri.ai.grinder.rewriter.core.Exhaustive in project aic-expresso by aic-sri-international.
the class ProceduralAttachmentsTest method runTest.
private void runTest(Expression input, Expression expected, Context context) {
TopRewriter topRewriter;
Rewriter evaluator;
Expression output;
topRewriter = new CombiningTopRewriter(new CommonSimplifier(), getProceduralAttachmentsTopRewriter(context));
evaluator = new Recursive(new Exhaustive(topRewriter));
output = evaluator.apply(input, context);
println(output);
assertEquals(expected, output);
}
use of com.sri.ai.grinder.rewriter.core.Exhaustive in project aic-expresso by aic-sri-international.
the class ExhaustiveTest method runTest.
private void runTest(Rewriter rewriter, Expression initial, Expression expected, Map<Expression, Expression> symbolsAndTypes) {
CompoundTheory theory = new CompoundTheory(new PropositionalTheory(), new DifferenceArithmeticTheory(false, true));
Context context = new TrueContext(theory);
context = context.makeCloneWithAdditionalRegisteredSymbolsAndTypes(symbolsAndTypes);
Rewriter exhaustive = new Exhaustive(rewriter);
Expression solution = exhaustive.apply(initial, context);
System.out.println("Solution: " + solution);
assertEquals(expected, solution);
}
use of com.sri.ai.grinder.rewriter.core.Exhaustive in project aic-expresso by aic-sri-international.
the class SymbolicShell method evaluate.
private static void evaluate(Expression input, ConsoleIterator consoleIterator, Theory theory, Context context) {
Rewriter prettyRewriter = new Exhaustive(new Recursive(new FirstOf(theory.getTopRewriter(), new PrettySimplifier())));
Expression result = theory.evaluate(input, context);
result = prettyRewriter.apply(result, context);
consoleIterator.getOutputWriter().println(result + "\n");
}
Aggregations