mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
python 3 fixes
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
This commit is contained in:
parent
7232877d92
commit
8ff7735a20
|
@ -210,18 +210,18 @@ def prove(claim,assume=None,verbose=0):
|
||||||
|
|
||||||
|
|
||||||
if verbose >= 2:
|
if verbose >= 2:
|
||||||
print 'assume: '
|
print('assume: ')
|
||||||
print assume
|
print(assume)
|
||||||
print 'claim: '
|
print('claim: ')
|
||||||
print claim
|
print(claim)
|
||||||
print 'to_prove: '
|
print('to_prove: ')
|
||||||
print to_prove
|
print(to_prove)
|
||||||
|
|
||||||
f = Not(to_prove)
|
f = Not(to_prove)
|
||||||
|
|
||||||
models = get_models(f,k=1)
|
models = get_models(f,k=1)
|
||||||
if models is None: #unknown
|
if models is None: #unknown
|
||||||
print 'E: cannot solve !'
|
print('E: cannot solve !')
|
||||||
return None, None
|
return None, None
|
||||||
elif models == False: #unsat
|
elif models == False: #unsat
|
||||||
return True,None
|
return True,None
|
||||||
|
@ -458,7 +458,7 @@ def model_str(m,as_str=True):
|
||||||
|
|
||||||
if m :
|
if m :
|
||||||
vs = [(v,m[v]) for v in m]
|
vs = [(v,m[v]) for v in m]
|
||||||
vs = sorted(vs,key=lambda (a,_): str(a))
|
vs = sorted(vs,key=lambda a,_: str(a))
|
||||||
if as_str:
|
if as_str:
|
||||||
return '\n'.join(['{} = {}'.format(k,v) for (k,v) in vs])
|
return '\n'.join(['{} = {}'.format(k,v) for (k,v) in vs])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue