(Context ctx)
| 2018 | } |
| 2019 | |
| 2020 | @SuppressWarnings("unchecked") |
| 2021 | public void optimizeExample(Context ctx) |
| 2022 | { |
| 2023 | System.out.println("Opt"); |
| 2024 | |
| 2025 | Optimize opt = ctx.mkOptimize(); |
| 2026 | |
| 2027 | // Set constraints. |
| 2028 | IntExpr xExp = ctx.mkIntConst("x"); |
| 2029 | IntExpr yExp = ctx.mkIntConst("y"); |
| 2030 | |
| 2031 | opt.Add(ctx.mkEq(ctx.mkAdd(xExp, yExp), ctx.mkInt(10)), |
| 2032 | ctx.mkGe(xExp, ctx.mkInt(0)), |
| 2033 | ctx.mkGe(yExp, ctx.mkInt(0))); |
| 2034 | |
| 2035 | // Set objectives. |
| 2036 | Optimize.Handle<IntSort> mx = opt.MkMaximize(xExp); |
| 2037 | Optimize.Handle<IntSort> my = opt.MkMaximize(yExp); |
| 2038 | |
| 2039 | System.out.println(opt.Check()); |
| 2040 | System.out.println(mx); |
| 2041 | System.out.println(my); |
| 2042 | } |
| 2043 | |
| 2044 | public void translationExample() { |
| 2045 | Context ctx1 = new Context(); |
no test coverage detected