@Test public void testArrayWrite() { var elems = new ArrayList<Tuple2<Expr<IntType>,Expr<IntType>>>(); elems.add(Tuple2.of(Int(0), Int(1))); var arr = Array(elems, Int(100), Array(Int(), Int())); var newArr = simplify(Write(arr, Int(5), Int(6))); assertTrue(newArr instanceof ArrayLitExpr); assertEquals(Int(6), Read(newArr, Int(5)).eval(ImmutableValuation.empty())); assertEquals(Int(1), Read(newArr, Int(0)).eval(ImmutableValuation.empty())); assertEquals(Int(100), Read(newArr, Int(182)).eval(ImmutableValuation.empty())); }
@SuppressWarnings("unchecked") public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) { return (Expr<T>) TABLE.dispatch(expr, valuation); }
ExprSimplifier { @SuppressWarnings("unchecked") public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) { return (Expr<T>) TABLE.dispatch(expr, valuation); } }
ExprSimplifier { @SuppressWarnings("unchecked") public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) { return (Expr<T>) TABLE.dispatch(expr, valuation); } private  ExprSimplifier(); }
ExprSimplifier { @SuppressWarnings("unchecked") public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) { return (Expr<T>) TABLE.dispatch(expr, valuation); } private  ExprSimplifier(); @SuppressWarnings("unchecked") static Expr<T> simplify(final Expr<T> expr, final Valuation valuation); }
ExprSimplifier { @SuppressWarnings("unchecked") public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) { return (Expr<T>) TABLE.dispatch(expr, valuation); } private  ExprSimplifier(); @SuppressWarnings("unchecked") static Expr<T> simplify(final Expr<T> expr, final Valuation valuation);  }