Search in sources :

Example 1 with TupleEqualitySimplifier

use of com.sri.ai.grinder.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.theory.tuple.rewriter.TupleEqualitySimplifier) Expression(com.sri.ai.expresso.api.Expression) TupleGetSimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleGetSimplifier) TupleQuantifierSimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleQuantifierSimplifier) TupleEqualitySimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleEqualitySimplifier) TupleSetSimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleSetSimplifier) TupleDisequalitySimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleDisequalitySimplifier) TupleValuedFreeVariablesSimplifier(com.sri.ai.grinder.theory.tuple.rewriter.TupleValuedFreeVariablesSimplifier) Simplifier(com.sri.ai.grinder.rewriter.api.Simplifier) Test(org.junit.Test)

Aggregations

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