Information Technology Reference
In-Depth Information
[ b , a , a ] is the situation where action a was performed twice and then action b
was performed, b being the most recent action.
Note that the situation [ a , b ] is not the same situation as [ b , a ] ; it might make a
difference which action is done first. For example, it is quite different to climb on the
box before grabbing the bananas than to grab for the bananas before climbing on the
box.
Using Prolog notation, performing action A in situation S (which must be a list of
actions) always results in the situation [A|S] , since the most recent action is listed at
the head of the list.
With this representation of a state, the various relevant aspects in our world are
represented as predicates that take a situation as an argument. Such predicates are
called fluents . (By convention, the situation is the final argument of the fluent.) So
instead of using a predicate like location( x , l ) , a final argument is added to make it
location( x , l , s ) , which is read as “item x is at location l in situation s .” Informally,
all the following sentences involving this fluent should work out to be true:
location(box,loc3,[])
(the initial location of the box)
location(box,loc3,[go(loc3)])
location(box,loc5,[push(loc5),go(loc3)])
location(box,loc5,[go(loc1),push(loc5),go(loc3)])
location(box,loc5,[go(loc7),
go(loc1),push(loc5),go(loc3)])
location(box,loc5,[go(loc5),go(loc7)
go(loc1),push(loc5),go(loc3)])
location(box,loc4,[push(loc4),go(loc5),go(loc7)
go(loc1),push(loc5),go(loc3)])
location(box,loc4,[go(loc2),push(loc4),go(loc5),go(loc7)
go(loc1),push(loc5),go(loc3)])
Note how the most recent push action in the situation determines where the box is
located (from loc3 to loc5 to loc4 ). After a push , the location of the box stays where
it is as other actions are performed (here, they are all go actions, but they could be
anything), until another push changes it again. The job is to write clauses for the
location fluent so that all these queries succeed.
 
Search WWH ::




Custom Search