summaryrefslogtreecommitdiffstats
path: root/rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py
diff options
context:
space:
mode:
authorKenji Hosokawa <khosokawa@jp.adit-jv.com>2021-08-26 22:48:28 +0900
committerKenji Hosokawa <khosokawa@jp.adit-jv.com>2021-08-26 22:58:27 +0900
commit44a3da18a257cc46aa0dbfd01947deeb377ab049 (patch)
tree854c7a5f1e1d671ddcccc7f1f60e55080e50ec43 /rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py
parent6166bddbc4c94c4e0da3c884e1a592dfa1faa4ad (diff)
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py')
-rw-r--r--rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py b/rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py
new file mode 100644
index 0000000..0ae4935
--- /dev/null
+++ b/rba.tool.editor.endpoint/lib/linux/z3/bin/python/example.py
@@ -0,0 +1,36 @@
+# Copyright (c) Microsoft Corporation 2015, 2016
+
+# The Z3 Python API requires libz3.dll/.so/.dylib in the
+# PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH
+# environment variable and the PYTHON_PATH environment variable
+# needs to point to the `python' directory that contains `z3/z3.py'
+# (which is at bin/python in our binary releases).
+
+# If you obtained example.py as part of our binary release zip files,
+# which you unzipped into a directory called `MYZ3', then follow these
+# instructions to run the example:
+
+# Running this example on Windows:
+# set PATH=%PATH%;MYZ3\bin
+# set PYTHONPATH=MYZ3\bin\python
+# python example.py
+
+# Running this example on Linux:
+# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:MYZ3/bin
+# export PYTHONPATH=MYZ3/bin/python
+# python example.py
+
+# Running this example on macOS:
+# export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:MYZ3/bin
+# export PYTHONPATH=MYZ3/bin/python
+# python example.py
+
+
+from z3 import *
+
+x = Real('x')
+y = Real('y')
+s = Solver()
+s.add(x + y > 5, x > 1, y > 1)
+print(s.check())
+print(s.model())