1

There are some constraints such as x + y > 5 , x > 3 , y < 4, so the set of models x = 4 y= 3, which is given by z3. Dose z3 can give models incrementally, such as another set of models x=5,y = 2? Thanks. Regards

Why
  • 11
  • 1

1 Answers1

0

Can you tell me please what happens with this:

x,y = Bools('x y')

s = Solver()
s.add(Or(x,y))


count = 0
while s.check() == sat and count <= 50:
  print s.model()
  s.add(Or(x != s.model()[x], y != s.model()[y])) 
  count = count + 1
print count

the output is:

[y = False, x = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
[y = True]
 51

online here

Juan Ospina
  • 1,317
  • 1
  • 7
  • 15