Created
February 4, 2020 04:05
-
-
Save stmtk1/40510b58a2414f1febab21dbbdf1324f 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
% coloring | |
adjacent(1, 2). | |
adjacent(1, 3). | |
adjacent(1, 4). | |
adjacent(1, 5). | |
adjacent(2, 1). | |
adjacent(2, 3). | |
adjacent(2, 4). | |
adjacent(3, 1). | |
adjacent(3, 2). | |
adjacent(3, 4). | |
adjacent(4, 1). | |
adjacent(4, 2). | |
adjacent(4, 3). | |
adjacent(4, 5). | |
adjacent(5, 1). | |
adjacent(5, 4). | |
color(1, red, a). | |
color(2, blue, a). | |
color(3, green, a). | |
color(4, yellow, a). | |
color(5, blue, a). | |
conflict(Coloring) :- | |
adjacent(X, Y), | |
color(X, Color, Coloring), | |
color(Y, Color, Coloring). | |
% children | |
child(A, B). | |
child(B, C). | |
child(B, D). | |
child(B, E). | |
child(C, F). | |
child(G, H). | |
grandchild(X, Y) :- | |
child(X, Z), | |
child(Z, Y). | |
ancestor(X, Y) :- | |
child(X, Y). | |
ancestor(X, Y) :- | |
child(X, Z), | |
decendant(Z, Y). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment