Created
October 31, 2017 09:57
-
-
Save ties/f61c8ecaf91b23acacdc3b952ec31e7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from z3 import Solver, EnumSort, Const, Distinct | |
s = Solver() | |
Color, (red, green, blue) = EnumSort('Color', ['red', 'green', 'blue']) | |
a = Const('a', Color) | |
b = Const('b', Color) | |
s.add(Distinct(a, b)) | |
s.check() | |
print(s.model()) | |
# [b = green, a = red] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment