我可以将Z3仅用于“简化” SMT2文件
我想使用一些Z3策略来修改“ .smt2”文件中的表达式。 我正在这样做,以便其他SMT垫圈(CVC,Mathsat等)可以从Z3策略中受益,即使它们不支持它们。
这是一个可以通过Z3的Python API完成的示例:
def simplify_smt2_file(file_path: str) -> str:
tactics = ("simplify", "solve-eqs", "propagate-values", "simplify")
query = z3.parse_smt2_file(file_path)
goal = z3.Goal()
goal.add(query)
simplified = z3.Then(*tactics)(goal).as_expr()
solver = z3.SolverFor("NIA")
solver.add(simplified)
return solver.sexpr()
但是,我不需要使用Python。有没有办法通过Z3的SMT2接口进行操作?
I'd like to use some of z3 tactics to modify an expression in an ".smt2" file.
I'm doing it so that other SMT-solvers (cvc, mathsat etc) can benefit from z3 tactics, even though they don't support them.
Here's an example of how it can be done through z3's Python API:
def simplify_smt2_file(file_path: str) -> str:
tactics = ("simplify", "solve-eqs", "propagate-values", "simplify")
query = z3.parse_smt2_file(file_path)
goal = z3.Goal()
goal.add(query)
simplified = z3.Then(*tactics)(goal).as_expr()
solver = z3.SolverFor("NIA")
solver.add(simplified)
return solver.sexpr()
However, I need to not use Python. Is there a way to do it through z3's SMT2 interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,使用Smtlib界面没有简单的方法来执行此操作。如果您一定会使用Smtlib,则必须从字面上运行Z3,解析输出并将其馈回其他求解器。
请随时在 https://groups.google.com/g/smt-lib < /a>,由Smtlib社区中的人们订阅。
So far as I know, there's no easy way to do this using the SMTLib interface. If you're bound to using SMTLib, then you'll have to literally run z3, parse the output, and feed it back to the other solvers.
Feel free to also ask at https://groups.google.com/g/smt-lib, which is subscribed to by folks in the SMTLib community.