能从Z3得到最终的CNF公式吗?

能从Z3得到最终的CNF公式吗?,z3,z3py,Z3,Z3py,这是我的简单编码。我想得到表示所有这些约束的最终布尔CNF。Z3解算器中是否有任何选项可以获得最终的布尔CNF x = Int('x') y = Int('y') c1 = And(x >= 1, x <= 10) c2 = And(y >= 1, y <= 10) c3 = Distinct(x,y) s = Solver() s.add(c1 , c2 , c3) # I need the final Boolean CNF formula from Z3 sol

这是我的简单编码。我想得到表示所有这些约束的最终布尔CNF。Z3解算器中是否有任何选项可以获得最终的布尔CNF

x = Int('x')
y = Int('y')

c1 = And(x >= 1, x <= 10)
c2 = And(y >= 1, y <= 10)
c3 = Distinct(x,y)

s = Solver()
s.add(c1 , c2 , c3)
# I need the final Boolean CNF formula from Z3 solver...
x=Int('x')
y=Int('y')

c1=和(x>=1,x=1,y正如艾拉特所说,使用目标和战术。 以下是一个例子:

x=Int('x')
y=Int('y')
c1=和(x>=1,x=1,y,使用目标和战术,Z3的
examples
文件夹中应该有示例。
x = Int('x')
y = Int('y')

c1 = And(x >= 1, x <= 10)
c2 = And(y >= 1, y <= 10)
c3 = Distinct(x,y)

g = Goal()
g.add(c1 , c2 , c3)

describe_tactics()

t = Tactic('tseitin-cnf')
print t(g)