Advertisement
logicmoo

Untitled

Apr 11th, 2019
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.61 KB | None | 0 0
  1. node(minnesota).
  2. node(wisconsin).
  3. node(illinois).
  4. node(iowa).
  5. node(indiana).
  6. node(michigan).
  7. node(ohio).
  8.  
  9. arc(minnesota, wisconsin).
  10. arc(illinois, iowa).
  11. arc(illinois, michigan).
  12. arc(illinois, wisconsin).
  13. arc(illinois, indiana).
  14. arc(indiana, ohio).
  15. arc(michigan, indiana).
  16. arc(michigan, ohio).
  17. arc(michigan, wisconsin).
  18. arc(minnesota, iowa).
  19. arc(wisconsin, iowa).
  20. arc(minnesota, michigan).
  21.  
  22.  
  23. % guess coloring
  24. col(Country, red) v col(Country, green) v col(Country, blue) :- node(Country).
  25.  
  26. % check coloring
  27. :- arc(Country1, Country2),
  28.    col(Country1, CommonColor), col(Country2, CommonColor).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement