I just finished question 1 last night. I took 2 days off from work to sit with this assignment and honestly I'm struggling to turn a state space into prolog statements.

I have 3 problems:

1 Deciding on the terminal clause.

2 Understanding how prolog will iterate through the list to produce successor states.

3 Keeping track of what states I've covered.

So basically I don't know how to convert what I know about the state space into anything meaningful in Prolog.

I used depthfirst2 for question 1 as appears in the text book (can't remember which page). It is depth first search with iterative deepening. Not sure if I should try the standard depth first search; but with so little time remaining I think I'm going to leave my solution as is and tackle the other questions.

BTW: I copied the legal moves from the solution given for best first search in question 1. I didn't change anything regarding the legal moves.

Before I answer the next question I'm going to try some simple List Iterations with a terminal clause and try and wrap my head around how prolog attempts to find a solution. I think I figured out how to trace what prolog is doing last week and that might be key to understanding how prolog goes about finding a solution.