Information Technology Reference
In-Depth Information
Before using English words, you will need to build a simple world model of facts
about this blocks world in Prolog. Each block can be assumed to have a color, a
size, and a certain shape (a cube, a pyramid, a wedge, ...). Also, each block is
located somewhere in the scene. To simplify matters, suppose that the robot lives
in a two-dimensional world with these properties:
A block is located either on the table or on another block.
Each block is on at most one other block (which must be a cube) and has at most
one other block directly on it.
The surface of the table is divided into some number (say, 5) of contiguous areas,
ordered from left to right.
Each block on the table is located in exactly one of these areas, and each table
area has at most one block directly on it.
With these assumptions, the locations of blocks can then be represented using a Prolog
predicate located_on ( block , location ), where block is a block and location is either a cube
or one of the table areas. Then a second Prolog predicate area_left_of ( area 1 , area 2 )is
used to state that area 1 is the area on the table immediately to the left of area 2 .
1.
Build a world model that expresses basic facts about colors, sizes, shapes,
and locations of some blocks in a scene. Include within your documentation
a drawing of the blocks-world scene that corresponds to that world model.
2.
Write clauses defining the predicates beside (
, which holds when block x
and y are both on the table in two adjacent areas, and above (
x , y
)
x , y
)
, which holds
when block x is somewhere above block y .
3.
Show that your world model works properly by getting Prolog to answer some
queries about it. (These queries should not use English noun phrases.)
Once your world model is working satisfactorily, you are ready to consider English
noun phrases and the blocks they refer to in your scene. Here are some example
queries using English noun phrases:
- np([a,wedge],B).
- np([any,small,green,block],B).
- np([a,pyramid,on,a,big,cube],B).
- np([a,cube,beside,the,orange,wedge],B).
- np([a,cube,below,an,orange,wedge,on,a,red,block],B).
(This is ambiguous: is it the cube or the wedge that is on the red block?)
 
Search WWH ::




Custom Search