[英]Python Z3 solver not correctly reporting satisfiability for exponent constraints
[英]Size of constraints in the Z3 Solver()
有没有办法让我们获得在求解器中添加了多少约束? 例如,我们初始化一个 z3 求解器s = Solver()
,然后使用s.add()
添加约束。 我们如何获得最终添加到求解器中的约束数量?
您可以使用assertions
方法:
from z3 import *
s = Solver()
i = Int('i')
s.add (i > 1)
s.add (i < 12)
print s.assertions()
print len(s.assertions())
这打印:
[i > 1, i < 12]
2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.