我正在使用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
但是,无符号位向量的转换效果很好。
有什么问题?我该如何解决?非常感谢你提前。