InvalidCastException for Z3 in F#



我尝试在 F# 中启动并运行 Z3 求解器。因此,我在Visual Studio中创建了一个新的F#项目,添加了对Microsoft.Z3.dll的引用,并键入了以下代码:

open Microsoft.Z3
let ctx = new Context() 
let a = ctx.MkBoolConst("a")

在交互式窗口中运行此选项会产生以下错误:

System.InvalidCastException: Unable to cast object of type 'Microsoft.Z3.AlgebraicNum' to type 'Microsoft.Z3.BoolExpr'.
at Microsoft.Z3.Context.MkBoolConst(String name)
at <StartupCode$FSI_0013>.$FSI_0013.main@() in C:Users...Program.fs:line 3
Stopped due to error

我错过了什么?

这听起来很像 https://github.com/Z3Prover/z3/issues/1882

您可能需要重新编译/重新安装。按照该票证中的说明进行操作。

最新更新