| 1394 | // machine integers |
| 1395 | // / </remarks> |
| 1396 | public void bitvectorExample1(Context ctx) throws TestFailedException |
| 1397 | { |
| 1398 | System.out.println("BitvectorExample1"); |
| 1399 | Log.append("BitvectorExample1"); |
| 1400 | |
| 1401 | BitVecSort bv_type = ctx.mkBitVecSort(32); |
| 1402 | BitVecExpr x = (BitVecExpr) ctx.mkConst("x", bv_type); |
| 1403 | BitVecNum zero = (BitVecNum) ctx.mkNumeral("0", bv_type); |
| 1404 | BitVecNum ten = ctx.mkBV(10, 32); |
| 1405 | BitVecExpr x_minus_ten = ctx.mkBVSub(x, ten); |
| 1406 | /* bvsle is signed less than or equal to */ |
| 1407 | BoolExpr c1 = ctx.mkBVSLE(x, ten); |
| 1408 | BoolExpr c2 = ctx.mkBVSLE(x_minus_ten, zero); |
| 1409 | BoolExpr thm = ctx.mkIff(c1, c2); |
| 1410 | System.out |
| 1411 | .println("disprove: x - 10 <= 0 IFF x <= 10 for (32-bit) machine integers"); |
| 1412 | disprove(ctx, thm, false); |
| 1413 | } |
| 1414 | |
| 1415 | // / Find x and y such that: x ^ y - 103 == x * y |
| 1416 | |