use of com.sri.ai.grinder.sgdpllt.library.boole.LiteralRewriter in project aic-expresso by aic-sri-international.
the class DifferenceArithmeticTheory method makeEvaluatorStepSolver.
@Override
public ExpressionLiteralSplitterStepSolver makeEvaluatorStepSolver(Expression expression) {
Rewriter literalExternalizer = new LiteralRewriter(new Recursive(new Exhaustive(getTopRewriter())));
ExpressionLiteralSplitterStepSolver result = new Recursive(new Exhaustive(new FirstOf(getTopRewriter(), literalExternalizer))).makeStepSolver(expression);
return result;
}
use of com.sri.ai.grinder.sgdpllt.library.boole.LiteralRewriter in project aic-expresso by aic-sri-international.
the class AbstractTheory method makeEvaluatorStepSolver.
@Override
public ExpressionLiteralSplitterStepSolver makeEvaluatorStepSolver(Expression expression) {
Rewriter literalExternalizer = new LiteralRewriter(new Recursive(new Exhaustive(getTopRewriter())));
Recursive completeEvaluator = new Recursive(new Exhaustive(new FirstOf(getTopRewriter(), literalExternalizer)));
// it is a good idea to leave the literal externalizer at the end,
// since it is expensive due to duplicating the entire problem at every split
ExpressionLiteralSplitterStepSolver result = completeEvaluator.makeStepSolver(expression);
return result;
}
use of com.sri.ai.grinder.sgdpllt.library.boole.LiteralRewriter in project aic-expresso by aic-sri-international.
the class SetDNFRewriter method createBaseRewriter.
private static Rewriter createBaseRewriter() {
// Original Rewriters
TopRewriter topRewriter = new DefaultTopRewriter(new IntensionalUnionToUnionsOfIntensionalSetsOfBaseTypeTopRewriter(), // NOTE: added to simplify expressions like `if true then { (2, 2) } else { }', which are common in this setup
new BooleanSimplifier(), new UnionEmptySetTopRewriter(), new IntersectionEmptySetTopRewriter(), new IntensionalSetToConditionalTopRewriter(), new IntersectionIntensionalSetsTopRewriter(), new IntersectionExtensionalSetTopRewriter(), new DistributeIntersectionOverUnionTopRewriter());
// Rewriters based on UAI 2017 Paper
// TopRewriter topRewriter = new DefaultTopRewriter(
// new TupleEqualityTopRewriter(), // Rule 1
// new ElementOfExtensionalSetTopRewriter(), // Rule 2
// new ElementOfIntensionalUnionTopRewriter(), // Rule 3
// new IntensionalUnionEqualToEmptySetTopRewriter(), // Rule 4
// new IntersectionEmptySetTopRewriter(), // Rule 5
// new UnionEmptySetTopRewriter(), // Rule 6
// new SetIntersectExtensionalSetEqualToEmptySetTopRewriter(), // Rule 7
// new IntensionalUnionIntersectionEqualToEmptySetTopRewriter(), // Rule 8
// new DistributeIntersectionOverUnionTopRewriter(), // Rule 9
// new UnionOfSetsEqualEmptySetTopRewriter(), // Rule 10
// new ExtensionalSetEqualEmptySetTopRewriter(), // Rule 11
// new BooleanSimplifier() // NOTE: added to simplify expressions like `if true then { (2, 2) } else { }', which are common in this setup
// );
Rewriter literalExternalizer = new LiteralRewriter(new Recursive(new Exhaustive(topRewriter)));
Rewriter result = new Exhaustive(new FirstOf(topRewriter, literalExternalizer));
return result;
}
Aggregations