Search in sources :

Example 31 with PropositionalTheory

use of com.sri.ai.grinder.sgdpllt.theory.propositional.PropositionalTheory in project aic-expresso by aic-sri-international.

the class RecursiveTest 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.registerAdditionalSymbolsAndTypes(symbolsAndTypes);
    Rewriter recursive = new Recursive(rewriter);
    Expression solution = recursive.apply(initial, context);
    System.out.println("Solution: " + solution);
    assertEquals(expected, solution);
}
Also used : Context(com.sri.ai.grinder.sgdpllt.api.Context) TrueContext(com.sri.ai.grinder.sgdpllt.core.TrueContext) Expression(com.sri.ai.expresso.api.Expression) DifferenceArithmeticTheory(com.sri.ai.grinder.sgdpllt.theory.differencearithmetic.DifferenceArithmeticTheory) Rewriter(com.sri.ai.grinder.sgdpllt.rewriter.api.Rewriter) PropositionalTheory(com.sri.ai.grinder.sgdpllt.theory.propositional.PropositionalTheory) CompoundTheory(com.sri.ai.grinder.sgdpllt.theory.compound.CompoundTheory) Recursive(com.sri.ai.grinder.sgdpllt.rewriter.core.Recursive) TrueContext(com.sri.ai.grinder.sgdpllt.core.TrueContext)

Aggregations

PropositionalTheory (com.sri.ai.grinder.sgdpllt.theory.propositional.PropositionalTheory)31 CompoundTheory (com.sri.ai.grinder.sgdpllt.theory.compound.CompoundTheory)25 DifferenceArithmeticTheory (com.sri.ai.grinder.sgdpllt.theory.differencearithmetic.DifferenceArithmeticTheory)24 EqualityTheory (com.sri.ai.grinder.sgdpllt.theory.equality.EqualityTheory)23 Context (com.sri.ai.grinder.sgdpllt.api.Context)22 Expression (com.sri.ai.expresso.api.Expression)19 TheoryTestingSupport (com.sri.ai.grinder.sgdpllt.tester.TheoryTestingSupport)18 Test (org.junit.Test)18 TrueContext (com.sri.ai.grinder.sgdpllt.core.TrueContext)14 Theory (com.sri.ai.grinder.sgdpllt.api.Theory)8 LinearRealArithmeticTheory (com.sri.ai.grinder.sgdpllt.theory.linearrealarithmetic.LinearRealArithmeticTheory)8 Type (com.sri.ai.expresso.api.Type)7 TupleTheory (com.sri.ai.grinder.sgdpllt.theory.tuple.TupleTheory)6 LinkedHashMap (java.util.LinkedHashMap)5 FunctionType (com.sri.ai.expresso.type.FunctionType)4 StepSolver (com.sri.ai.grinder.sgdpllt.api.StepSolver)4 AbstractTheoryTestingSupport (com.sri.ai.grinder.sgdpllt.core.constraint.AbstractTheoryTestingSupport)4 Rewriter (com.sri.ai.grinder.sgdpllt.rewriter.api.Rewriter)4 UnificationStepSolver (com.sri.ai.grinder.sgdpllt.theory.base.UnificationStepSolver)4 Categorical (com.sri.ai.expresso.type.Categorical)3