COS 512 Knight Chess Assignment


COS 512 Knight Chess Assignment

Question A

On a 8×8 chessboard we use the predicate sq(X,Y) to identify a position (where X, Y are the corresponding square’s co-ordinates).  A chess knight can move two squares in a left-right or front-back direction and then one square in a vertical fashion (

We have defined the knightpath/1 predicate in the following incomplete Prolog program, which succeeds if invoked with a list of squares which are a valid position sequence for a chess knight.

Fill in the (ten) blanks to complete the program.

Then, show a Prolog query which succeeds by invoking knightpath/1 with a list of at least four successive legal knight moves.

knightpath([sq(X,Y)]) :-



knightpath([S1,S2|R]) :-



jump(sq(X1,Y1),sq(X2,Y2)) :-


inboard(Y1), move(Dx,Dy),



X2 is X1+Sx*Dx,






___9___ (C) :-

0 < C,

___10___   .

COS 512 Knight Chess Assignment

Question Β

Consider the following as expressed in FOL:

Convert the above in CNF and use resolution (and refutation) to prove that:

Question C

The “Towers of Hanoi” is a legendary problem (

A token implementation of how to solve that problem in Prolog appears at:

An interesting approach to formulating this problem via FOL appears at pages 165-168 of a seminal book on AI, by Barr and Feigenbaum, which was published in the very early 80s and is now available at:

Study both approaches to the problem and describe how you would try to map the Prolog approach to the FOL approach and/or vice-versa. COS 512 Knight Chess Assignment

Need Help with a similar Assignment?

The post COS 512 Knight Chess Assignment appeared first on oneacademyessays.


Source link

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp