Skip to content

Commit 053cb72

Browse files
handle return status
1 parent 4f6811a commit 053cb72

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/python/efsmt.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ def efsmt(ys, phi, maxloops = None):
1616
while maxloops is None or loops <= maxloops:
1717
loops += 1
1818
eres = E.check()
19-
if eres == unsat:
20-
return unsat
21-
else:
19+
if eres == sat:
2220
emodel = E.model()
2321
sub_phi = substitute(phi, [(x, emodel.eval(x, True)) for x in xs])
2422
F.push()
2523
F.add(Not(sub_phi))
26-
if F.check() == sat:
24+
fres = F.check()
25+
if fres == sat:
2726
fmodel = F.model()
2827
sub_phi = substitute(phi, [(y, fmodel.eval(y, True)) for y in ys])
2928
E.add(sub_phi)
3029
else:
31-
return sat, [(x, emodel.eval(x, True)) for x in xs]
30+
return fres, [(x, emodel.eval(x, True)) for x in xs]
3231
F.pop()
32+
else:
33+
return eres
3334
return unknown
3435

3536
x, y, z = Reals("x y z")

0 commit comments

Comments
 (0)