Prolog Lab Assignment

 

 

Hunter, Laura, Jim, Sally, and Jack work in the same building with five adjacent offices. Hunter doesn’t work in the 5th office and Laura doesn’t work in the first office. Jim doesn’t work in the first or last office, and he is not in an office adjacent to Jack or Laura. Sally works in some office higher than Laura’s. Who works in what offices?

In addition to the member function from before we will define:

 

adjacent(X, Y) :- X =:= Y+1.

     adjacent(X, Y) :- X =:= Y-1. 

 

Write the rest of the prolog rules to solve this problem……