lookicenters.blogg.se

Prolog program for block world problem
Prolog program for block world problem










prolog program for block world problem prolog program for block world problem

I think that the reason STRIPS is so popular is because it was one of the first planners to solve the frame problem (is that correct?).īesides, how am I supposed to move the blocks (take an action)and consequently change the status of my lists if Prolog doesn't permit variable assignments?

prolog program for block world problem

It was specially written to solve problems like the blocks world (I think it originally controlled a real robot who moved blocks from room to room or something like that). STRIPS is the Stanford Research Institute Planning System. I heard about the term STRIPS, but don't know what that means. We also report the results obtained using Simo, Relsat, or zChaff.% Assignment 1% state(Coyote_location, Standing_on, Stonehenge_position, Holding_cannon, Shot_roadrunner)% Coyote_location: where is the coyote?% Standing_on: what is the coyote standing on (the stonehenge or the ground)?% Stonehenge_position: where is the stonehenge?% Holding_cannon: is the coyote holding the cannon?% Shot_roadrunner: has the coyote shot the roadrunner?% the coyote climbing off the stonehengetransform( state(Location, stonehenge, Location, X, Y), climb_down, state(Location, ground, Location, X, Y)).% the coyote shooting the roadrunner with the cannontransform( state(X, ground, Z, yes, _), shoot, state(X, ground, Z, yes, yes)).% the coyote getting the cannontransform( state(tree, stonehenge, tree, no, X), grab, state(tree, stonehenge, tree, yes, X)).% the coyote climbing onto the stonehengetransform( state(Location, ground, Location, X, Y), climb_up, state(Location, stonehenge, Location, X, Y)).% the coyote moving the boxtransform(state(Loc1, ground, Loc1, X, Y), move, state(Loc2, ground, Loc2, X, Y)).% the coyote running to a new positiontransform(state(Loc1, ground, Loc3, X, Y), run, state(Loc2, ground, Loc3, X, Y)).% achieve(StartState, Endstate)% True if EndState can be achieved from StartState% also prints Steps (in reverse order)achieve( InitialState, GoalState ) :- achieve( InitialState, GoalState, ).achieve( State, State, _ ).achieve( InitialState, GoalState, StateList ):- transform( InitialState, Step, NewState ), \+member( NewState, StateList ), achieve( NewState, GoalState, ), display( Step ), nl.query1 :- achieve(state(mountain, ground, river, no, no), state( _, _, _, _, yes)).% a predicate to display a list in reverse order (as it's faster and easier to prepend than append to the accumulated list of moves.)display_list().display_list( ) :- display_list(T), nl, display(H).% achieveb/2, a predicate to display moves in the correct order.achieveb( InitialState, GoalState ) :- achieveb( InitialState, GoalState,, ).% achieveb/3 a predicate used by achieveb/2 to display a list in the correct order.achieveb( State, State, DisplayList, _ ) :- display_list( DisplayList ).achieveb( InitialState, GoalState, DisplayList, StateList ):- transform( InitialState, Step, NewState), \+member( NewState, StateList ), achieveb( NewState, GoalState,, ).% query2, the same as query1, but using achieveb/2 instead of achieve/2query2 :- achieveb(state(mountain, ground, river, no, no), state( _, _, _, _, yes)).You can test it by either constructing your own queries, or using the predefined ones (query1. Using the default SAT solver, namely mChaff. Of a SAT solver to compute answer sets-we run all experiments The ASP programs have been designed to be (in some cases, we provide the code usable with General enough to be used on different platforms (using the library clpfd)-though the code is The CLP programs have been designed for execution by Ultimately, the work in this research isĮxpected to lay the ground for transfer of concepts between the Of their implementations and suggesting criteria for choosing oneĪpproach versus the other. Respond to different problems, highlighting strengths and weaknesses

prolog program for block world problem

The objective is to identify how the solvers in the two domains Set Programming (ASP) and Constraint Logic Programming (CLP) In these pages we present experimental comparisons between declarativeĮncodings of various computationally hard problems in both Answer












Prolog program for block world problem