[英]Using Z3Py With Python 3.3
I've installed Microsoft Z3 ( Z3 [version 4.3.0 - 64 bit]. (C) 2006
) and it's pyc
binaries for Python2. 我已经安装了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
二进制文件。
I've written an Python3 package which needs access to z3
functionality. 我编写了一个Python3程序包,该程序包需要访问z3
功能。
In order to be able to use the pyc
binaries with my Python3 package, I decompyle
the z3
binaries and applied 2to3
. 为了能够使用pyc
与我Python3包二进制文件,我decompyle
了z3
的二进制文件和应用2to3
。
Int('string')
doesn't work because Z3Py isn't able to handle the new <class 'str'>
used as 'string'
argument: 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
decompyle
Z3's *.pyc
files first. 首先需要对Z3的*.pyc
文件进行decompyle
有点decompyle
。 So, are there any Z3Py source codes available? 那么,有没有可用的Z3Py源代码? Thanks. 谢谢。 - If anything's unclear, please leave a question comment. -如果不清楚,请发表问题评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.