(Context ctx)
| 299 | } |
| 300 | |
| 301 | @SuppressWarnings("unchecked") |
| 302 | void modelConverterTest(Context ctx) throws TestFailedException |
| 303 | { |
| 304 | System.out.println("ModelConverterTest"); |
| 305 | |
| 306 | Expr<RealSort> xr = ctx.mkConst(ctx.mkSymbol("x"), ctx.mkRealSort()); |
| 307 | Expr<RealSort> yr = ctx.mkConst(ctx.mkSymbol("y"), ctx.mkRealSort()); |
| 308 | Goal g4 = ctx.mkGoal(true, false, false); |
| 309 | g4.add(ctx.mkGt(xr, ctx.mkReal(10, 1))); |
| 310 | g4.add(ctx.mkEq(yr, ctx.mkAdd(xr, ctx.mkReal(1, 1)))); |
| 311 | g4.add(ctx.mkGt(yr, ctx.mkReal(1, 1))); |
| 312 | |
| 313 | ApplyResult ar = applyTactic(ctx, ctx.mkTactic("simplify"), g4); |
| 314 | if (ar.getNumSubgoals() == 1 |
| 315 | && (ar.getSubgoals()[0].isDecidedSat() || ar.getSubgoals()[0] |
| 316 | .isDecidedUnsat())) |
| 317 | throw new TestFailedException(); |
| 318 | |
| 319 | ar = applyTactic(ctx, ctx.andThen(ctx.mkTactic("simplify"), |
| 320 | ctx.mkTactic("solve-eqs")), g4); |
| 321 | if (ar.getNumSubgoals() == 1 |
| 322 | && (ar.getSubgoals()[0].isDecidedSat() || ar.getSubgoals()[0] |
| 323 | .isDecidedUnsat())) |
| 324 | throw new TestFailedException(); |
| 325 | |
| 326 | Solver s = ctx.mkSolver(); |
| 327 | for (BoolExpr e : ar.getSubgoals()[0].getFormulas()) |
| 328 | s.add(e); |
| 329 | Status q = s.check(); |
| 330 | System.out.printf("Solver says: %s%n", q); |
| 331 | System.out.printf("Model: %n%s%n", s.getModel()); |
| 332 | if (q != Status.SATISFIABLE) |
| 333 | throw new TestFailedException(); |
| 334 | } |
| 335 | |
| 336 | // / A simple array example. |
| 337 |
no test coverage detected