It is a normal chess game. In a chess problem, the start is the initial configuration of chessboard. The final state is the any board configuration, which is a winning position for any player. There may be multiple final positions and each board configuration can be thought of as representing a state of the game. Whenever any player moves any piece, it leads to different state of game.


The above figure shows a 3x3 chessboard with each square labeled with integers 1 to 9. We simply enumerate the alternative moves rather than developing a general move operator because of the reduced size of the problem.

Using a predicate called move in predicate calculus, whose parameters are the starting and ending squares, we have described the legal moves on the board.

For example, move (1, 8) takes the knight from the upper left-hand corner to the middle of the bottom row. While playing Chess, a knight can move two squares either horizontally or vertically followed by one square in an orthogonal direction as long as it does not move off the board.

The all possible moves of figure are as follows.

Move (1, 8)        move (6, 1)

Move (1, 6)        move (6, 7)

Move (2, 9)        move (7, 2)

Move (2, 7)        move (7, 6)

Move (3, 4)        move (8, 3)

Move (3, 8)        move (8, 1)

Move (4, 1)        move (9, 2)

Move (4, 3)        move (9, 4)

The above predicates of the Chess Problem form the knowledge base for this problem. An unification algorithm is used to access the knowledge base.

Suppose we need to find the positions to which the knight can move from a particular location, square 2.

The goal move (z, x) unifies with two different predicates in the knowledge base, with the substitutions {7/x} and {9/x}. Given the goal move (2, 3), the responsible is failure, because no move (2, 3) exists in the knowledge base.


In this game a lots of production rules are applied for each move of the square on the chessboard. A lots of searching are required in this game.

Implementation of algorithm in the knowledge base is very important.