mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 12:28:44 +00:00
making tests deterministic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
2f3daf14b5
commit
3cefa0a1f7
|
@ -5787,8 +5787,15 @@ class Solver(Z3PPObject):
|
|||
>>> s.assert_and_track(x < 0, p3)
|
||||
>>> print s.check()
|
||||
unsat
|
||||
>>> print s.unsat_core()
|
||||
[p3, p1]
|
||||
>>> c = s.unsat_core()
|
||||
>>> len(c)
|
||||
2
|
||||
>>> Bool('p1') in c
|
||||
True
|
||||
>>> Bool('p2') in c
|
||||
False
|
||||
>>> p3 in c
|
||||
True
|
||||
"""
|
||||
if isinstance(p, str):
|
||||
p = Bool(p, self.ctx)
|
||||
|
@ -6985,9 +6992,9 @@ def solve(*args, **keywords):
|
|||
configure it using the options in `keywords`, adds the constraints
|
||||
in `args`, and invokes check.
|
||||
|
||||
>>> a, b = Ints('a b')
|
||||
>>> solve(a + b == 3, Or(a == 0, a == 1), a != 0)
|
||||
[b = 2, a = 1]
|
||||
>>> a = Int('a')
|
||||
>>> solve(a > 0, a < 2)
|
||||
[a = 1]
|
||||
"""
|
||||
s = Solver()
|
||||
s.set(**keywords)
|
||||
|
|
Loading…
Reference in a new issue