Z3 将有符号位向量表达式转换为整数抛出AccessViolationException

Z3 将有符号位向量表达式转换为整数抛出AccessViolationException,z3,Z3,我正在使用Z3.NET API,并尝试使用以下代码将有符号位向量表达式转换为整数: using (Context context = new Context()) { Expr e = context.MkBV2Int(context.MkBV(-1, 32), true); } 但是,我得到以下例外: Unhandled Exception: System.AccessViolationException: Attempted to read or write protected m

我正在使用Z3.NET API,并尝试使用以下代码将有符号位向量表达式转换为整数:

using (Context context = new Context())
{
    Expr e = context.MkBV2Int(context.MkBV(-1, 32), true);
}
但是,我得到以下例外:

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.Z3.Native.LIB.Z3_mk_bv2int(IntPtr a0, IntPtr a1, Int32 a2)
   at Microsoft.Z3.Native.Z3_mk_bv2int(IntPtr a0, IntPtr a1, Int32 a2) in Z3 src\src\api\dotnet\Native.cs:line 2386
   at Microsoft.Z3.Context.MkBV2Int(BitVecExpr t, Boolean signed) in Z3 src\src\api\dotnet\Context.cs:line 1800
但是,无符号位向量的转换非常有效


有什么问题?我该如何修复它?提前非常感谢。

感谢您报告此问题!在较低级别的C API中确实存在一个bug。现在已在不稳定分支中修复了此问题(请参见)