A Shapes World A micro world is a (computer) model of a restricted type of "reality". It is used (by artificial intelligence designers) to study the types of relations (spatial, stimulus, response, etc.) between elements of the world. A shapes world consists of various shapes (2-D in this case) and their relationships to one another. For our purposes, a shape is modeled in terms of three properties, its kind (square, rectangle, circle, etc.), its size, and its position. "Natural language" input to the system consists of "queries" of the following forms: Form: 'place' IndefArticle Color 'square' 'at' Number Number 'with' 'side' Number '.' Meaning: Add a square to the knowledge base at give (x,y) coordinates. Article may be either 'a' or 'an'. Color must be among the colors specified by the grammar (red, blue, green for now). The first Number is an X coordinate, the second is a Y coordinate. Form: 'place' IndefArticle Color 'rectangle' 'at' Number Number 'of' 'height' Number 'and' 'width' Number '.' Meaning: Add a rectangle... Form: 'place' IndefArticle Color 'circle' 'at' Number Number 'of' 'radius' Number '.' Meaning: Add a circle... Form: 'what' ( 'squares' | 'rectangles' | 'circles' | 'shapes' ) 'are' 'there' '?' Meaning: enumerate the specified objects. Form: 'what' 'color' Shapes 'are' 'present' '?' Meaning: respond with the colors. Form: 'are' 'there' 'any' Color Shapes 'present' '?' Meaning: respond with yes/no Form: 'how' 'big' 'is' DefArticle Shape 'at' Number Number '?' Meaning: respond with length for squares, height and width for rectangles, radius for circles Form: 'what' 'is' 'the' 'area' 'of' DefArticle Shape 'at' Number Number '?' Meaning: respond with the area of the named shape Form: 'where' 'is' Shape '?' Meaning: respond with the set of X and Y coordinates Form: 'what' Shapes 'are' 'to' 'the' ( 'left' | 'right' ) 'of' DefArticle Shape 'at' Number Number '?' Meaning: respond with the appropriate list Form: 'are' 'there' 'any' Shapes 'to' 'the' ( 'left' | 'right' ) 'of' IndefArticle Shape '?' Meaning: respond YES if there are any objects in class Shape such that right(left)most part of the first shape named is less(greater) than the left(right)most part of the second shape named, NO if not. Form: 'which' 'shape' 'is' 'smallest' '?' Meaning: respond with the name of the shape which is smallest in area. Form: 'which' Shape 'is' ( 'smallest' | 'largest' ) '?' Meaning: respond with the name of the shape which is smallest (largest) in area. Form: 'stop' '.' Meaning: return to Prolog