Tuesday, 12 February 2013

More realistic Strips example - 1


More realistic Strips example

The first step in creating a Strips planner is to construct a Strips-based repCONSTRUCTING
A resentation of the world, or world model. Everything in the world that is
WORLD MODEL

relevant to the problem is AXIOMS represented by facts, or axioms, in predicate logic.
PREDICATES Predicates are functions that evaluate to TRUE or FALSE. By years of AI programming
convention, predicates are usually written in uppercase.
Consider the problem of a robot named IT in a room, R1, who needs to go
to another room, R2, in the house shown in Fig. 2.4. In order to solve this
problem using Strips, the robot has to be given a way of representing the
world, which will in turn influence the difference table, a difference evaluator,
and how the add and delete lists are written. The world model in the
previous example was never formally defined.
A world model is generally built up from static facts (represented as predicates)
from a set of candidates, and things in the world, like the robot. The
robot’s name is in all capitals because it exists (and therefore is TRUE). Lowercase
identifiers indicate that the thing is a variable, that a real thing hasn’t
been assigned to that placeholder yet.
Suppose the robot was limited to knowing only whether a movable object
was in a room, next to a door or another movable object, and whether a door
was open or closed and what rooms it connected. In a programming sense,
there would be only three types of things in the world: movable_object
(such as the robot, boxes it should pick up), room, and door. The robot’s
knowledge could be represented by the following predicates:


INROOM(x, r) where x is an object of type movable_object,
r is type room
NEXTTO(x, t) where x is a movable_object,
t is type door or movable_object
STATUS(d, s) where d is type door,
s is an enumerated type: OPEN or CLOSED
CONNECTS(d, rx, ry) where d is type door,
rx, ry are the room
With the above predicates, the world model for the initial state of the world
in Fig. 2.4 would be represented by:


initial state:
INROOM(IT, R1)
INROOM(B1,R2)
CONNECTS(D1, R1, R2)
CONNECTS(D1, R2, R1)
STATUS(D1,OPEN)


This world model captures that a specific movable_object named IT
is in a room named R1, and B1 is in another room labeled R2. A door D1
connects a room named R1 to R2 and it connects R2 to R1. (Two different
CONNECTS predicates are used to represent that a robot can go through the
door from either door.) A door called D1 has the enumerated value of being
OPEN. The NEXTTO predicate wasn’t used, because it wasn’t true and there
would be nothing to bind the variables to.
Under this style of representation, the world model for the goal state
would be:
goal state:
INROOM(IT,R2)
INROOM(B1,R2)
CONNECTS(D1, R1, R2)
CONNECTS(D1, R2, R1)
STATUS(D1,OPEN)
Once the world model is established, CONSTRUCTING THE it is possible to construct the differ-
DIFFERENCE TABLE ence table. The partial difference table is:



This difference table says the robot is programmed for only two operations:
go to a door, and go through a door. The GOTODOOR operator can be
applied only if the following two preconditions are true:
 INROOM(IT, rk) The robot is in a room, which will be assigned to the
identifier rk.
 CONNECT(dx, rk, rm) There is a door, which will be assigned to the
identifier dx, which connects rk to some other room called rm.
The label IT is used to constrain the predicates. Notice that only the variables
dx and rk get bound when GOTODOOR is called. rm can be anything.
If GOTODOOR is executed, the robot is now next to the door called dx. Nothing
gets deleted from the world state because the robot is still in room rk,
the door dx still connects the two rooms rk and rm. The only thing that has
changed is that the robot is now in a noteworthy position in the room: next
to the door.
The difference table specifies that the GOTHRUDOOR operatorwill only work
if the robot is in the room next to the door, the door is open, and the door connects
the room the robot is in to another room. In this case, predicates must
be added and deleted from the world model when the operator executes.
When the robot is in room rk and goes through the door, it is now in room
rm (which must be added to the world model) and is no longer in room rk
(which must be deleted).
So far, the world model and difference table should seem reasonable, although
tedious to construct. But constructing a difference table is pointless
without an evaluation function for differences. (Notice that there wasn’t a
column for the difference in the above table.) The difference evaluator in
the travel example was Euclidean distance. In this example, the evaluator is
predicate calculus, where the initial state is logically subtracted from
the goal state. The logical difference between the initial state goal
state is simply:

:INROOM(IT, R2) or INROOM(IT, R2)=FALSE







No comments:

Post a Comment