簡體   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