3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

Added API Z3_param_descrs_to_string

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-12 09:13:04 -07:00
parent 42c27b7a46
commit f7bcd40137
11 changed files with 1281 additions and 1232 deletions

View file

@ -4421,18 +4421,7 @@ class ParamDescrsRef:
return self.get_kind(arg)
def __repr__(self):
r = io.StringIO()
first = True
r.write(u'(')
for i in range(self.size()):
if first:
first = False
else:
r.write(u' ')
r.write(u'%s' % self.get_name(i))
r.write(u')')
return r.getvalue()
return Z3_param_descrs_to_string(self.ctx.ref(), self.descr)
#########################################
#

View file

@ -696,6 +696,8 @@ def init(PATH):
_lib.Z3_param_descrs_size.argtypes = [ContextObj, ParamDescrs]
_lib.Z3_param_descrs_get_name.restype = Symbol
_lib.Z3_param_descrs_get_name.argtypes = [ContextObj, ParamDescrs, ctypes.c_uint]
_lib.Z3_param_descrs_to_string.restype = ctypes.c_char_p
_lib.Z3_param_descrs_to_string.argtypes = [ContextObj, ParamDescrs]
_lib.Z3_interrupt.argtypes = [ContextObj]
_lib.Z3_get_error_msg_ex.restype = ctypes.c_char_p
_lib.Z3_get_error_msg_ex.argtypes = [ContextObj, ctypes.c_uint]
@ -3341,6 +3343,13 @@ def Z3_param_descrs_get_name(a0, a1, a2):
raise Z3Exception(lib().Z3_get_error_msg_ex(a0, err))
return r
def Z3_param_descrs_to_string(a0, a1):
r = lib().Z3_param_descrs_to_string(a0, a1)
err = lib().Z3_get_error_code(a0)
if err != Z3_OK:
raise Z3Exception(lib().Z3_get_error_msg_ex(a0, err))
return r
def Z3_interrupt(a0):
lib().Z3_interrupt(a0)
err = lib().Z3_get_error_code(a0)