| 1137 | // / Find a model for <code>x xor y</code>. |
| 1138 | |
| 1139 | public void findModelExample1(Context ctx) throws TestFailedException |
| 1140 | { |
| 1141 | System.out.println("FindModelExample1"); |
| 1142 | Log.append("FindModelExample1"); |
| 1143 | |
| 1144 | BoolExpr x = ctx.mkBoolConst("x"); |
| 1145 | BoolExpr y = ctx.mkBoolConst("y"); |
| 1146 | BoolExpr x_xor_y = ctx.mkXor(x, y); |
| 1147 | |
| 1148 | Model model = check(ctx, x_xor_y, Status.SATISFIABLE); |
| 1149 | System.out.println("x = " + model.evaluate(x, false) + ", y = " |
| 1150 | + model.evaluate(y, false)); |
| 1151 | } |
| 1152 | |
| 1153 | // / Find a model for <tt>x < y + 1, x > 2</tt>. |
| 1154 | // / Then, assert <tt>not(x = y)</tt>, and find another model. |