Z3Py:创建未解释排序的常量列表

Z3Py: Creating a list of constants of an uninterpreted sort

我有一个未解释的排序 A

sortA = DeclareSort('A')

和函数 foo:

foo = Function('foo',sortA,sortA,BoolSort())

现在我想定义一个 A 类常量列表。我的尝试是:

X = [ Consts("c_%s" % i,sortA) for i in range(10) ]

但这行不通,因为

s.add(foo(X[0],X[1]))

给出 "Z3 expression expected" 错误。如果有任何帮助,我将不胜感激 :)

Consts 创建一个 list 常量,并且该列表不是 Z3 表达式(而是 Python Z3 表达式列表)。而是使用 Const 按预期工作。