繁体   English   中英

在Python 3.3中使用Z3Py

[英]Using Z3Py With Python 3.3

我的情况

我已经安装了Microsoft Z3( Z3 [version 4.3.0 - 64 bit]. (C) 2006 4.3.0-64 Z3 [version 4.3.0 - 64 bit]. (C) 2006 ),它是Python2的pyc二进制文件。

我编写了一个Python3程序包,该程序包需要访问z3功能。

为了能够使用pyc与我Python3包二进制文件,我decompylez3的二进制文件和应用2to3

我的问题

Int('string')不起作用,因为Z3Py无法处理用作'string'参数的新<class 'str'> class'str <class 'str'>

>>> import z3; z3.Int('abc')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".\bin\z3.py", line 2931, in Int
    return ArithRef(Z3_mk_const(ctx.ref(), to_symbol(name, ctx), IntSort(ctx).ast), ctx)
  File ".\bin\z3.py", line 72, in to_symbol
    return Z3_mk_string_symbol(_get_ctx(ctx).ref(), s)
  File ".\bin\z3core.py", line 1430, in Z3_mk_string_symbol
    r = lib().Z3_mk_string_symbol(a0, a1)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type

我的问题

  • 首先需要对Z3的*.pyc文件进行decompyle有点decompyle 那么,有没有可用的Z3Py源代码?
  • 是否已经存在Python3的Z3Py端口?
  • 还有其他想法如何使Z3Py与Python3一起运行

谢谢。 -如果不清楚,请发表问题评论。

unstable (正在开发中)支持Python3。此功能将在下一个Z3版本(v4.3.2)中提供。 同时,您可以按照此处的说明构建unstable分支。

暂无
暂无

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

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