Let the squares of the chessboard be represented by pairs of their coordinates of the form
[X; Y ], where both X and Y are between 1 and 8.
(a) Define the relation jump(Square1,Square2 ) according to the knight jump on the chess-
board. Assume that Square1 is always instantiated to a square while Square2 can be unin-
stantiated. For example:
?- jump([1; 1]; S).
S = [3; 2];
S = [2; 3];
(b) Define the relation knightpath(Path) where Path is a list of squares that represent a legal
path of a knight on the empty chessboard.
(c) Using this knightpath relation, write a question to find any knight's path of length 4
moves from square [2; 1] to the opposite edge of the board (Y = 8) that goes through square
[5; 4] after the second move.
Submit two (ascii) files. The first file should contain your
program which will include your rules for questions (a) and (b). The second file should contain
the query for question (c) and all corresponding answers. In addition, the second le should
contain ten more queries, and corresponding answers. These queries should demonstrate that
you tested your program on dierent cases. Your second le should be readable, containing
the queries on separate lines.
Must be done in 6 HOURS!