简体   繁体   English

z3(py)smt-lib2输出

[英]z3 (py) smt-lib2 output

How to output assertions made with z3py in SMT-LIB2 format? 如何使用SMT-LIB2格式的z3py输出断言? I can't find any mention of that in the documentation. 我在文档中找不到任何提及。 I found a flag Z3_PRINT_SMTLIB_FULL but I don't know how to set it. 我找到了一个标志Z3_PRINT_SMTLIB_FULL但我不知道如何设置它。

You can use the method sexpr(). 您可以使用方法sexpr()。 For example: http://rise4fun.com/Z3Py/9t 例如: http//rise4fun.com/Z3Py/9t

x, y = Reals('x y')
print (x + y * 3).sexpr()

There is online documentation of the Python API. 有Python API的在线文档。 For example, the sexpr() method is documented under: 例如,sexpr()方法记录在:

http://research.microsoft.com/en-us/um/redmond/projects/z3/z3.html#ExprRef http://research.microsoft.com/en-us/um/redmond/projects/z3/z3.html#ExprRef

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

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