Search in sources :

Example 1 with TupleEqualitySimplifier

use of com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualitySimplifier in project aic-expresso by aic-sri-international.

the class TupleRewriterTest method testTupleEqualitySimplification.

@Test
public void testTupleEqualitySimplification() {
    Simplifier tupleEqualitySimplifier = new TupleEqualitySimplifier();
    Assert.assertEquals(parse("A1 = B1 and A2 = B2 and A3 = B3"), tupleEqualitySimplifier.apply(parse("(A1, A2, A3) = (B1, B2, B3)"), context));
    Expression expr = parse("(A1, A2) = (B1, B2, B3)");
    Assert.assertTrue(expr == tupleEqualitySimplifier.apply(expr, context));
    expr = parse("A1 = B1");
    Assert.assertTrue(expr == tupleEqualitySimplifier.apply(expr, context));
}
Also used : TupleEqualitySimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualitySimplifier) Expression(com.sri.ai.expresso.api.Expression) Simplifier(com.sri.ai.grinder.sgdpllt.rewriter.api.Simplifier) TupleEqualitySimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualitySimplifier) TupleGetSimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleGetSimplifier) TupleQuantifierSimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleQuantifierSimplifier) TupleDisequalitySimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleDisequalitySimplifier) TupleValuedFreeVariablesSimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleValuedFreeVariablesSimplifier) TupleSetSimplifier(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleSetSimplifier) Test(org.junit.Test)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)1 Simplifier (com.sri.ai.grinder.sgdpllt.rewriter.api.Simplifier)1 TupleDisequalitySimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleDisequalitySimplifier)1 TupleEqualitySimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualitySimplifier)1 TupleGetSimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleGetSimplifier)1 TupleQuantifierSimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleQuantifierSimplifier)1 TupleSetSimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleSetSimplifier)1 TupleValuedFreeVariablesSimplifier (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleValuedFreeVariablesSimplifier)1 Test (org.junit.Test)1