day24: adding python z3, example

This commit is contained in:
efim
2023-12-24 11:47:22 +00:00
parent bea82cb548
commit 5b03b8f156
11 changed files with 378 additions and 96 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
from z3 import *
x = Real('x')
y = Real('y')
eq1 = x + y == 5
eq2 = x - y == 3
s = Solver()
s.add(eq1, eq2)
if s.check() == sat:
print("Solution:", s.model())
else:
print("No solution found")