Q: Are we allowed to use built-in Prolog predicates? A: You bet, as long as they do not mimic imperative programming constructs. There is a complete list of built-in predicates in Sections E.1 and E.2 of the SWI-Prolog reference manual (linked under our project spec) You may find the following list of allowable, built-in predicates particularly useful. var/1 -- Type check for unbound variable nonvar/1 -- Type check for bound term ground/1 -- Verify term holds no unbound variables free_variables/2 -- Find unbound variables in a term setof/3 -- Find all unique solutions to a goal @ Can you guide me in the right direction as to what test cases would be > good to test our program? I can't think of any other than the FCGF and > the MC (missionary cannibal) problem. Websites would be great if you > know of any that have examples of these types of problems. A: Here are some suggestions, where IS = [IL, IR] = initial state GS = [GL, GR] = goal state P = plan IL = initial left IR = initial right GL = goal left GR = goal right C = constraints M = maxplan length D = drivers The final 3 variables MUST be bound, and there are 5 test cases where one or more of them are unbound. Test your program on all 5 of these test cases and make sure it fails. The first 3 variables above need not be bound. You'll need one of these variables to be at least partially bound (and the others may be unbound or only partially bound themselves) in order for Prolog to be able to return any useful results. There are many combinations of those 3 variables where at least one is partially bound. Test on those cases. Then test cases where some parts of any of the above variables are bound to empty lists. Then try negative numbers...then try...and so on. ------------------------------ Q: In what order must we list the boatriders at each step of the plan? A: Let us agree to use Prolog canonical (alphabetical, for strings) ordering. Here's some code to do it, just plug it into your solution. sortsteps([],[]). sortsteps([X|Y],[T|Z]) :- sortstep(X,T), sortsteps(Y,Z). sortstep([],[]). sortstep([M|T],[M|ST]) :- sort(T,ST). How it works: ------------ try typing: sortsteps([ [go_right, farmer, chicken], [ go_left, farmer ], [ go_right, farmer, fox ], [ go_left, farmer, chicken ], [ go_right, farmer, grain ], [ go_left, farmer ], [ go_right, farmer, chicken ] ], Y). to see that Y is the sorted plan: Y = [[go_right, chicken, farmer], [go_left, farmer], [go_right, farmer, fox], [go_left, chicken, farmer], [go_right, farmer, grain], [go_left, farmer], [go_right, chicken|...]] ; How to use it in your code: --------------------------- If your plan predicate looks like: plan_transport(..., ...., ..., ..., ..., P) :- . the answer P is thus bound inside just change it to: plan_transport(..., ..., ..., ..., ..., SP) :- , sortsteps(P,SP). The webpage has been updated to reflect this, and so is the FAQ.