Last active
October 28, 2020 20:46
-
-
Save rntz/d2592274d242e9175ad3dda2da5d0575 to your computer and use it in GitHub Desktop.
This file contains 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
# two folks have different preferences if one likes a beer the other doesn't. | |
differ(a, b) :- person(b), likes(beer, a), !likes(beer, b). | |
differ(a, b) :- person(a), !likes(beer, a), likes(beer, b). | |
# what you want to write | |
unique(a) :- ∀b. (a = b or differ(a,b)). | |
# how you have to write it. | |
unique(a) :- not exists_same(a). | |
exists_same(a) :- person(a), person(b), !differ(a,b), a != b. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment