Search in sources :

Example 1 with TupleGetSetTopRewriter

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

the class TupleRewriterTest method testTupleGetSetTopRewriter.

@Test
public void testTupleGetSetTopRewriter() {
    TopRewriter tupleGetSetTopRewriter = new TupleGetSetTopRewriter();
    Assert.assertEquals(parse("if I = 1 then a else if I = 2 then b else c"), tupleGetSetTopRewriter.apply(parse("get((a,b,c),I)"), context));
    Assert.assertEquals(parse("if I = 1 then (e,b,c) else if I = 2 then (a,e,c) else (a,b,e)"), tupleGetSetTopRewriter.apply(parse("set((a,b,c),I,e)"), context));
}
Also used : TupleGetSetTopRewriter(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleGetSetTopRewriter) TupleEqualityTopRewriter(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualityTopRewriter) TupleGetSetTopRewriter(com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleGetSetTopRewriter) TopRewriter(com.sri.ai.grinder.sgdpllt.rewriter.api.TopRewriter) Test(org.junit.Test)

Aggregations

TopRewriter (com.sri.ai.grinder.sgdpllt.rewriter.api.TopRewriter)1 TupleEqualityTopRewriter (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleEqualityTopRewriter)1 TupleGetSetTopRewriter (com.sri.ai.grinder.sgdpllt.theory.tuple.rewriter.TupleGetSetTopRewriter)1 Test (org.junit.Test)1