Question: WRITE A PROLOG PROGRAM FOR MICE IN A MAZE Write, execute, and test a Prolog program to simulate a mouse traversing a maze. DESCRIPTION Use

WRITE A PROLOG PROGRAM FOR MICE IN A MAZE

Write, execute, and test a Prolog program to simulate a mouse traversing a maze.

DESCRIPTION

Use a predicate d/2 to specify the doors between rooms of the maze, e.g., d(a,b) means that there is a door linking rooms a and b. Assume that the mouse always starts in the room named enter, and that the room named exit has the only door out of the maze, although room exit may also have doors leading to other rooms.

WRITE A PROLOG PROGRAM FOR MICE IN A MAZE Write, execute, and

WHAT TO DO: Show all solutions and screenshots for the mouse running the maze in each test case. Use the following 5 test cases: (A) d(enter,b). d(b,c). d(b,e). d(d,e). d(c,d). d(e,f). d(e,exit). (B) d(enter,e). d(b,c). d(b,e). d(d,e). d(c,d). d(e,f). d(f,exit). (C) d(enter,e). d(b,c). d(d,e). d(c,d). d(e,f). d(g,e). (D) d(enter,e). d(b,c). d(d,e). d(c,d). d(e,f). d(c,exit). (E) d(enter,a). d(a,exit).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!