| 929 | // / Find a model for <code>x xor y</code>. |
| 930 | |
| 931 | public void findModelExample1(Context ctx) throws TestFailedException |
| 932 | { |
| 933 | System.out.println("FindModelExample1"); |
| 934 | Log.append("FindModelExample1"); |
| 935 | |
| 936 | BoolExpr x = ctx.mkBoolConst("x"); |
| 937 | BoolExpr y = ctx.mkBoolConst("y"); |
| 938 | BoolExpr x_xor_y = ctx.mkXor(x, y); |
| 939 | |
| 940 | Model model = check(ctx, x_xor_y, Status.SATISFIABLE); |
| 941 | System.out.printf("x = %s, y = %s%n", model.evaluate(x, false), model.evaluate(y, false)); |
| 942 | } |
| 943 | |
| 944 | // / Find a model for <tt>x < y + 1, x > 2</tt>. |
| 945 | // / Then, assert <tt>not(x = y)</tt>, and find another model. |