Z3: change size of floatingpoint-type.
It looks like Z3 does not use a separate sign-bit,
but the first bit of the significand (mantissa).
This, the mantissa size of Z3 is one more than ours.
@@ -178,7 +178,7 @@ class Z3FormulaCreator extends FormulaCreator<Long, Long, Long, Long> {
getFormulaTypeFromSort(domainSort), getFormulaTypeFromSort(rangeSort));
case Z3_FLOATING_POINT_SORT:
return FormulaType.getFloatingPointType(
- Native.fpaGetEbits(z3context, pSort), Native.fpaGetSbits(z3context, pSort));
+ Native.fpaGetEbits(z3context, pSort), Native.fpaGetSbits(z3context, pSort) - 1);
case Z3_ROUNDING_MODE_SORT:
return FormulaType.FloatingPointRoundingModeType;
case Z3_DATATYPE_SORT:
@@ -309,7 +309,7 @@ class Z3FormulaCreator extends FormulaCreator<Long, Long, Long, Long> {
@Override
public Long getFloatingPointType(FormulaType.FloatingPointType type) {
- long fpSort = Native.mkFpaSort(getEnv(), type.getExponentSize(), type.getMantissaSize());
+ long fpSort = Native.mkFpaSort(getEnv(), type.getExponentSize(), type.getMantissaSize() + 1);
Native.incRef(getEnv(), Native.sortToAst(getEnv(), fpSort));
return fpSort;
}
