Self-test 3

How Prolog manipulates its stack

You are advised to complete your solution before you look at the answers.

Using the path/2 and route/2 procedures, show the states of the stack for the query route(4, 8). You should assume that the fact path(5, 8). has been added back into the program.

Solution

--------------------------------------------------------------------------

Navigation Menu

--------------------------------------------------------------------------