| 1182 | // machine integers |
| 1183 | // / </remarks> |
| 1184 | public void bitvectorExample1(Context ctx) throws TestFailedException |
| 1185 | { |
| 1186 | System.out.println("BitvectorExample1"); |
| 1187 | Log.append("BitvectorExample1"); |
| 1188 | |
| 1189 | BitVecSort bv_type = ctx.mkBitVecSort(32); |
| 1190 | Expr<BitVecSort> x = ctx.mkConst("x", bv_type); |
| 1191 | Expr<BitVecSort> zero = ctx.mkNumeral("0", bv_type); |
| 1192 | BitVecNum ten = ctx.mkBV(10, 32); |
| 1193 | BitVecExpr x_minus_ten = ctx.mkBVSub(x, ten); |
| 1194 | /* bvsle is signed less than or equal to */ |
| 1195 | BoolExpr c1 = ctx.mkBVSLE(x, ten); |
| 1196 | BoolExpr c2 = ctx.mkBVSLE(x_minus_ten, zero); |
| 1197 | BoolExpr thm = ctx.mkIff(c1, c2); |
| 1198 | System.out.println("disprove: x - 10 <= 0 IFF x <= 10 for (32-bit) machine integers"); |
| 1199 | disprove(ctx, thm, false); |
| 1200 | } |
| 1201 | |
| 1202 | // / Find x and y such that: x ^ y - 103 == x * y |
| 1203 | |