Skip to content

Commit 6f5d95c

Browse files
committed
Added assertions to uncover potential z3 bug
1 parent b307c07 commit 6f5d95c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/org/sosy_lab/java_smt/solvers/z3/Z3FloatingPointFormulaManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ protected Long makeNumberImpl(
8383
Native.mkNumeral(
8484
z3context, mantissa.toString(), Native.mkBvSort(z3context, type.getMantissaSize()));
8585

86-
assert Native.getSort(z3context, signBv) != Native.getSort(z3context, mantBv);
86+
assert Native.getBvSortSize(z3context, Native.getSort(z3context, signBv)) == 1
87+
: "SignBV should be 1 bit long";
88+
assert Native.getBvSortSize(z3context, Native.getSort(z3context, expoBv))
89+
== type.getExponentSize()
90+
: "ExpoBV should be " + type.getExponentSize() + " bits long";
91+
assert Native.getBvSortSize(z3context, Native.getSort(z3context, mantBv))
92+
== type.getMantissaSize()
93+
: "MantBV should be " + type.getMantissaSize() + " bits long";
8794

8895
return Native.mkFpaFp(z3context, signBv, expoBv, mantBv);
8996
}

0 commit comments

Comments
 (0)