File: python3-z3-int-logic-test

package info (click to toggle)
z3 4.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,364 kB
  • sloc: cpp: 501,803; python: 16,788; cs: 10,567; java: 9,687; ml: 3,282; ansic: 2,531; sh: 162; javascript: 37; makefile: 32
file content (18 lines) | stat: -rwxr-xr-x 317 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3

# This is a test that checks that the Python 3 module is functional by
# trying out a small example involving integer logic.

from z3 import *

x, y = Ints("x y")

s = Solver()
s.add(x > 0, y > 0, x <= 2, y <= 2, x + 1 <= y)

assert s.check()

m = s.model()

assert m[x] == 1
assert m[y] == 2