Search in sources :

Example 1 with PrettySimplifier

use of com.sri.ai.grinder.library.pretty.PrettySimplifier 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");
}
Also used : PrettySimplifier(com.sri.ai.grinder.library.pretty.PrettySimplifier) Expression(com.sri.ai.expresso.api.Expression) Exhaustive(com.sri.ai.grinder.rewriter.core.Exhaustive) Rewriter(com.sri.ai.grinder.rewriter.api.Rewriter) FirstOf(com.sri.ai.grinder.rewriter.core.FirstOf) Recursive(com.sri.ai.grinder.rewriter.core.Recursive)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)1 PrettySimplifier (com.sri.ai.grinder.library.pretty.PrettySimplifier)1 Rewriter (com.sri.ai.grinder.rewriter.api.Rewriter)1 Exhaustive (com.sri.ai.grinder.rewriter.core.Exhaustive)1 FirstOf (com.sri.ai.grinder.rewriter.core.FirstOf)1 Recursive (com.sri.ai.grinder.rewriter.core.Recursive)1