% Naive approach % states are simple atoms a, b, c, ... k. % moves or successor states are directly hardwired into code move(a,b). move(a,c). move(b,d). move(b,e). move(c,f). move(c,g). move(d,h). move(e,i). move(e,j). move(f,k). start(a). goal(j). goal(f). % solve(State, Solution_Path) % Start with ?- solve(a, Sol). solve(State, [State]) :- goal(State). solve(State, [State|Sol]) :- move(State, NewState), solve(NewState, Sol).