简体   繁体   English

如何从z3求解器生成SMTLIB2格式的公式

[英]How to generate a formula in SMTLIB2 format from z3 solver

I build the formula in z3 using the java API. 我使用Java API在z3中构建公式。 However, I have some formula that are difficult to solve, and I want to investigate why. 但是,我有一些难以解决的公式,我想调查原因。 Therefore, I want to print the formula in SMTLIB2 format. 因此,我想以SMTLIB2格式打印公式。

Is it possible to get that from a Solver object. 是否有可能从Solver对象中获取。 Currently, what I can get is only an array of assertions. 目前,我所能得到的只是一系列断言。 Thank you. 谢谢。

Yes, Solver.toString() does that. 是的, Solver.toString()做到了。 This should also include the variable/constant declarations if you are using the latest master; 如果您使用的是最新的master,则还应包括变量/常量声明。 I think that part was added after the last release. 我认为该部分是在最新发行版之后添加的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM