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));
}
Aggregations