Page 1 of 1

PROLOG LANGUAGE: Map will include the states of Arkansas, Louisiana, Tennessee, Mississippi, & Alabama. The map maker

Posted: Fri Jul 08, 2022 6:35 am
by answerhappygod
PROLOG LANGUAGE:
Map will include the states of Arkansas, Louisiana, Tennessee,Mississippi, & Alabama. The map maker only has 3 colors to use and no two states whichshare a border can be colored the same color. Write a programwhich finds an acceptable assignment of colors to states. Write a Prolog program states/5 which findsan acceptable assignment of colors to the 5 states above stateswithout using a graph as the underlying data structure.
Test file::- nl, write('States: ').:- states(TN,MS,AL,LA,AR), write(['TN', TN, ' MS', MS, ' AL', AL, ' LA',LA, ' AR', AR]), nl.
DO NOT SEND ME THIS INCORRECT CODE. THIS IS A COMPLETESHIT.love_compatible(X, Y) :- likes(X, Y), likes(Y, X).X = Arkansas,Y = LouisianaX = Arkansas,Y = Louisiana ; /* typing semicolon causes Prolog to find the nextmatch */X = Arkansas,Y = Louisiana.likes(Tennessee,Mississippi).likes(Mississippi,Alabama).likes(Arkansas,Louisiana,).likes(Louisiana,Arkansas,).love_compatible(X, Y) :- likes(X, Y), likes (Y, X).germany(BW, BY) :- neighbor(BW, BY).