(Context ctx)
| 298 | } |
| 299 | |
| 300 | static void ModelConverterTest(Context ctx) |
| 301 | { |
| 302 | Console.WriteLine("ModelConverterTest"); |
| 303 | |
| 304 | ArithExpr xr = (ArithExpr)ctx.MkConst(ctx.MkSymbol("x"), ctx.MkRealSort()); |
| 305 | ArithExpr yr = (ArithExpr)ctx.MkConst(ctx.MkSymbol("y"), ctx.MkRealSort()); |
| 306 | Goal g4 = ctx.MkGoal(true); |
| 307 | g4.Assert(ctx.MkGt(xr, ctx.MkReal(10, 1))); |
| 308 | g4.Assert(ctx.MkEq(yr, ctx.MkAdd(xr, ctx.MkReal(1, 1)))); |
| 309 | g4.Assert(ctx.MkGt(yr, ctx.MkReal(1, 1))); |
| 310 | |
| 311 | ApplyResult ar = ApplyTactic(ctx, ctx.MkTactic("simplify"), g4); |
| 312 | if (ar.NumSubgoals == 1 && (ar.Subgoals[0].IsDecidedSat || ar.Subgoals[0].IsDecidedUnsat)) |
| 313 | throw new TestFailedException(); |
| 314 | |
| 315 | ar = ApplyTactic(ctx, ctx.AndThen(ctx.MkTactic("simplify"), ctx.MkTactic("solve-eqs")), g4); |
| 316 | if (ar.NumSubgoals == 1 && (ar.Subgoals[0].IsDecidedSat || ar.Subgoals[0].IsDecidedUnsat)) |
| 317 | throw new TestFailedException(); |
| 318 | |
| 319 | Solver s = ctx.MkSolver(); |
| 320 | foreach (BoolExpr e in ar.Subgoals[0].Formulas) |
| 321 | s.Assert(e); |
| 322 | Status q = s.Check(); |
| 323 | Console.WriteLine("Solver says: " + q); |
| 324 | Console.WriteLine("Model: \n" + s.Model); |
| 325 | if (q != Status.SATISFIABLE) |
| 326 | throw new TestFailedException(); |
| 327 | } |
| 328 | |
| 329 | /// <summary> |
| 330 | /// A simple array example. |
nothing calls this directly
no test coverage detected