Member( on(X,Y1), Goals), Y1 \= Y % Block cannot be in two places % delete_all( L1, L2, Diff): Diff is set-difference of lists L1 and L2Ĭan( move( Block, From, To), ) :-Īdds( move(X,From,To),).ĭeletes( move(X,From,To),). Impossible( Goal, Goals), % Goal incompatible with Goals % NewGoals and OldGoals must be compatible % OldGoals is the union of NewGoals and OldGoals Regress( Goals, Action, RegressedGoals) :- % Regress Goals through Actionĭelete_all( Goals, NewRelations, RestGoals),Īddnew( Condition, RestGoals, RegressedGoals). Preserves( Action, Goals) :- % Action does not destroy Goals Select( State, Goals, Goal) :- % Select Goal from Goals Regress( Goals, Action, RegressedGoals), % Regress Goals through Actionĭelete_all( Goals, State, ). Preserves( Action, Goals), % Protect Goals Select( State, Goals, Goal), % Select a goalĬan( Action, Condition), % Ensure Action contains no variables % Goals true in StateĪppend( PrePlan,, Plan), % Divide plan achieving breadth-first effect % A means-ends planner with goal regression This is the complete program of a STRIPS style planner for a blocks world as illustrated in the book: % This planner searches in iterative-deepening style. Would anyone be willing to take a gander at the code to see if they can spot where there is faulty logic or if I made a mistake? ![]() I have tried several different implementations following it to the letter, but with no luck. I've noticed that a lot of the examples do not run to completion but instead seem to get stuck. "Prolog Programming for Artificial Intelligence - 3rd Edition" (ISBN-13: 978-0201403756) (1st edition 1986 by Addison-Wesley, ISBN 4-4) ![]() Following examples by Ivan Bratko on Artificial Intelligence in Prolog through his book:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |