use of com.sri.ai.grinder.interpreter.SamplingProceduralAttachmentSingleQuantifierEliminator in project aic-expresso by aic-sri-international.
the class SamplingProceduralAttachmentSingleQuantifierEliminatorTest method test.
@Test
public void test() {
String intervalString = "0..10";
Context context = new TrueContext(new DifferenceArithmeticTheory(true, true));
MultiQuantifierEliminationProblem problem = new DefaultMultiQuantifierEliminationProblem(new Sum(), list(parse("I")), list(parse(intervalString)), parse("I != 3"), parse("I^2"));
SamplingProceduralAttachmentSingleQuantifierEliminator eliminator = new SamplingProceduralAttachmentSingleQuantifierEliminator(new CommonSimplifier(), new Random());
// SHOULD NOT HAVE TO
context = problem.extend(context);
Expression sampler = eliminator.solve(problem, context);
println(sampler);
Rewriter rewriter = new CombiningTopRewriter(new CommonSimplifier(), ProceduralAttachments.getProceduralAttachmentsTopRewriter(context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
println(rewriter.apply(sampler, context));
}
Aggregations