Reference no: EM13920533
Objectives: For this assignment, you'll learn how to use Prolog to write recursive programs with lists and backtracking.
Problem: There are three parts to this assignment. They are all related.
Part I) (see the included file "chess.pl")
Consider the problem of chess moves of a Knight on a 5x5 chess board. (For now, we shall simplify our problem to just a 5x5 chess board. The solution is the same when we expand it to a 8x8 chess board.)
Starting at position A (3,3), a Knight can move to any position B. Its rule is that a Knight can move 1 step in the x-direction and 2 steps in the y-direction in one move, or 2-step in the x-direction and 1 step in the y-direction.
The predicate "move1( (X1,Y1), (X2,Y2) )" holds if a Knight can move from the position (X1,Y1) to the position (X2,Y2) in a single move. (See the file "chess.pl" for details.)
Your problem for part (I) is to define a new predicate "path( (X1,Y1), (X2,Y2) , N, P )" which holds if there exists a non-cyclic path P from (X1,Y1) to (X2,Y2) in less than N moves.
Part II) Using your solution to part (I), you are required to define a predicate "shortest( (X1,Y1), (X2,Y2) , P )" which holds if P is a shortest path from position (X1,Y1) to (X2,Y2).
Part III) Finally, you are required to define a predicate "visit ( (X,Y), P, N )" which holds if P is a path starting from (X,Y) from which a Knight can move and that the path ends in exactly N moves.
Attachment:- chess-in-prolog.zip
Explain the importance of standardized protocol or systems
: Explain the importance of standardized protocol or systems when a practice has multiple offices in a given geographic area and employees are expected to rotate among different offices.
|
Determine the percentage of assets
: Determine the percentage of assets that were provided by retained earnings. How much cash is in the retained earnings account?
|
Flexibility to identify many different information systems
: The case study company has provided you with the flexibility to identify many different information systems that are used by the employees. Some systems need strict access control while others should be available to everyone.
|
Implications of health economic concepts for health care
: Assess the value of health care professionals and decision makers understanding the discipline of health economics - Assess current economic trends that influence the cost, quality, and access to care.
|
Write recursive programs with lists and backtracking
: Objectives: For this assignment, you'll learn how to use Prolog to write recursive programs with lists and backtracking. Problem: There are three parts to this assignment. They are all related
|
Formulate a linear programming model and then solve it
: Formulate a linear programming model, and then solve it, to determine how many hours process 1 should be operated each week and how many hours process 2 should be operated each week.
|
Example of the coercive power of a manager
: Question 1: Write down an example of the coercive power of a manager? Question 2: According to the trait model, which of the following trait of leadership helps managers avoid acting selfishly, control their feelings, and admit when they have made..
|
Service companies that manage inventory
: Determine the types of inventories these companies currently manage and describe their essential inventory characteristics. Analyze how each of their goods and service design concepts are integrated.
|
Total liabilities and stockholders
: Total liabilities and stockholders' equity $3,640,500 It was determined at the date of the purchase that the fair value of the identifiable net assets of Conchita was $2,786,200.
|