UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Representing spatial experience and solving spatial problems in a simulated robot environment Rowat, Peter Forbes 1979

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.

Item Metadata

Download

Media
831-UBC_1979_A1 R69.pdf [ 11.46MB ]
Metadata
JSON: 831-1.0051810.json
JSON-LD: 831-1.0051810-ld.json
RDF/XML (Pretty): 831-1.0051810-rdf.xml
RDF/JSON: 831-1.0051810-rdf.json
Turtle: 831-1.0051810-turtle.txt
N-Triples: 831-1.0051810-rdf-ntriples.txt
Original Record: 831-1.0051810-source.json
Full Text
831-1.0051810-fulltext.txt
Citation
831-1.0051810.ris

Full Text

9 t REPRESENTING SPATIAL EXPERIENCE AND SOLVING SPATIAL PROBLEMS IN A SIMULATED ROBOT ENVIRONMENT by PETER FORBES SOWAT M.Sc,, U n i v e r s i t y o f B r i t i s h C o l u m b i a , 1972 A THESIS SUBMITTED IN PARTIAL EULF.ILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY i n THE FACULTY OF GRADUATE STUDIES { De p a r t m e n t of Computer S c i e n c e ) We a c c e p t t h i s t h e s i s a s c o n f o r m i n g t o t h e r e q u i r e d s t a n d a r d - . THE UNIVERSITY OF BRITISH COLUMBIA O c t o b e r , 1979 ^ Peter Forbes Rowat ,1979 In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the Head of my Department or by his representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of C f r i A A ^ u ^ V SC L & A I C I The University of British Columbia 2075 Wesbrook Place Vancouver, Canada V6T 1W5 Date 11 Abstract This thesis i s concerned with s p a t i a l aspects of perception and action i n a simple robot. To t h i s end, the problem of designing a robot-controller for a robot in a simulated robot-environment system i s considered* The environment i s a two-dimensional tabletop with movable polygonal shapes on i t . The robot has an eye which 'saes' an area of the tabletop centred on i t s e l f , with a resolution which decreases from the centre to the periphery. Algorithms are presented for simulating the motion and c o l l i s i o n of two dimensional shapes in t h i s environment. These algorithms use representations of shape both as a sequence, of boundary points and as a region i n a d i g i t a l image. A method i s outlined f o r constructing and updating the world model of the robot as new v i s u a l input i s received from the eye. I t i s proposed that, in the world model, the s p a t i a l problems of path-finding and object-moving be based on algorithms that f i n d the skeleton of the shape of empty space and of the shape of the moved object. A new i t e r a t i v e algorithm for finding the skeleton, with the property that the skeleton of a connected shape i s connected, i s presented. . This i s applied to path-finding and simple object-moving problems. Fi.nally, directions for future work, are outlined. i i i TABLE OF CONTENTS I Int rod uction .......................................... 1 1.1 Aims and motivation . ..... . . . . . . . . . . . . . a . . . . .!,».... .1 1.2 The action cycle ............. * .............. , . 6 1*3 System overview ................................. ,10 1.4 System status ................................... 22 1.5 Reader's guide .................................. 23 XI Background Issues • • . . . . . . . . . . . . » . : < . . * > , • » . • '• . . . . i . * » • '• • 25 II. 1 a r t i f i c i a l i n t e l l i g e n c e i s a science with goals and paradigms 25 IX.1.1 The paradigms of A r t i f i c i a l Intelligence ...26 IX. 1,. 2 AI has pot e n t i a l l y r i c h relationships with many other f i e l d s 29 II.1.3 Understanding the world i s a prerequisite to doing mathematics 4 . . . . . . . . . . . . . . . . . . . . . 34 IX. 1.4 A theory of int e l l i g e n c e w i l l be primarily concerned with representations of the world .............................. 36 II.1.5 A theory of i n t e l l i g e n c e w i l l describe i n t e l l i g e n t systems at many di f f e r e n t l e v e l s ,. . .. ....... . . . . . . . ...... ....... ......... .39 II. 2 Simulating a robot i s a promising approach to A r t i f i c i a l Intelligence ........................ 41 11*3 The current AI t r a d i t i o n for the design of planning and problem solving ' systems i s not ea s i l y adaptable to my purpose . 4 . . . . 45 II.3. 1 An exegesis of some AI planning and problem-solving systems ................... .45 11.3.2 Criticisms of the Fregean t r a d i t i o n i n planning and problem-solving ............... .55 II. 4 A survey of closely related topics ............. 58 II*4.1 Previous robot simulations ................ 59 IX. 4'. 2 Three analyses of simple organisms ......... 62 11.4.3 Simulations based on animal behaviour . .... 65 IX. 4*4 Robot simulations based on decision theory .................................... 67 11.4.5 Cognitive maps ............................ 69 11.4.6 Spatial planning systems .................. 71 11*4.7 Systems for simulating . the motion of r i g i d objects ............................. 72 IX. 4. 8 Imagery ............ 76 I I . 4.9 Behavioural theories ...................... 77 III The simulated organism-environment system ........... 83 I I I . 1 The simulated environment, TABLETOP ............ 87 II I . 1.1 An overview of the simulation method ..... 87 III.1*2 The algorithms used in the simulation .... 97 III-1.2.1 The overlay problem 117 III.1.3 An example of TABLETOP performance 122 III.2 The simulated organism Utak and h i s tasks 128 III.2.1 Design considerations ......... .,128 i v I I I.2.2 The sensory-motor c a p a b i l i t i e s of Otak . . 1 3 0 III,. 2.3 Examples of Utak's sensory-motor experience ... , , . .... , ..... ... ... .» ... . 132 I I I , 2. 4 Examples of ta s k s f o r Utak 134 I I I . 3 An e x t e n s i o n and two g e n e r a l i z a t i o n s of TABLETOP ...... 135 IV Towards the design of a r o b o t - c o n t r o l l e r »I *........ 143 IV. 1 An analogy i . 143 IV,2 The p a r t s of an o r g a n i s m - c o n t r o l l e r ...... .. ... 147 IV, 3 The goal behaviour f o r an o r g a n i s m - c o n t r o l l e r . 1 4 9 IV.4 A f i r s t approach t o implementation ............175 IV. 4.1 D e f i n i t i o n of the world model ,.,.,......,..176 IV;l4>2 P e r c e p t i o n : accommodation to the f i r s t r e t i n a l impression . . . ^ , 1 7 8 IV, 4.2,1 Edge and region f i n d i n g .............179 IV.4;2.2 I n t e r p r e t i n g the f i r s t r e t i n a l impression .......................... 181 IV. 4.2.3 Accommodating the d e f a u l t world model to the f i r s t r e t i n a l impression 185 IV,4.3 P e r c e p t i o n : accommodation to subsequent r e t i n a l i mpressions ...................... 187 IV;. 4.4 accommodation, another approach ..........190 IV. 4,5 The s p a t i a l planner .,.,,.,.,,..,....,,.,,,192 IV.5 An a l t e r n a t i v e approach to implementation i.....193 IV. 6 Summary .................................194 V P a t h - f i n d i n g and the s k e l e t o n of a planar shape i..,,,196 V. I I n t r o d u c t i o n t o p a t h - f i n d i n g a l g o r i t h m s ........ 196 V.2 The s k e l e t o n 202 V, 2, 1 D e f i n i t i o n and p r o p e r t i e s ............. 203 V.2.2 Approximating the E u c l i d e a n plane ......... 206 V.2.3 Montanari's a l g o r i t h m .....................210 V. 2. 4 The new al g o r i t h m 214 V.2,5 R i d g e - f o l l o w i n g .V, i . ^ > i .->. . 219 V.2.6 Dsing p a r a l l e l i s m t o compute the s k e l e t o n . 2 2 4 V,2.7 Paths between o b j e c t s and s u p e r f l u o u s branches .................................. 224 V .3 Using the s k e l e t o n f o r p a t h - f i n d i n g ............ 226 V,3-1 D e s c r i b i n g a s k e l e t a l path ................ 228 V, 3. 2 O p t i m i z i n g a s k e l e t a l path ........... •» . .. 230 V.3.3 Comparison of s k e l e t a l and A* path f i n d i n g 233 V.4 Other a p p l i c a t i o n s of the s k e l e t o n ............. 233 V, 4. 1 Object moving i . ........... 234 V. 4.1.1 C i r c u l a r shaped o b j e c t of r a d i u s r ... 234 V,4,1.2 Other o b j e c t shapes i , , ... . 234 V.4,1.3 An L-shaped o b j e c t ................... 235 V.4.2 F i n d i n g empty space ....................... 236 V.4.3 F i n d i n g the s h o r t e s t d i s t a n c e between two shapes 2 36 V,4.4 F i n d i n g nearest neighbourhood r e g i o n s ,.,..237 V. 5 Summary ........................................ 238 V VI Summary, c o n c l u s i o n ^ and f u t u r e work ............... 240 VI. 1 Summary ... .. ......... ............ . . 240 VI. 2 Co n c l u s i o n 243 VI.3 Research problems ............................. 243 appendices ........ . . .................... ....... . ......... .246 a.1 T a B L E T O P user's manual .... . . ^ 2 4 6 A.2 A c o m b i n a t o r i a l lemma ............................. 249 A.3 On Funt's r i g i d shape r o t a t i o n a l g o r i t h m ......... 251 References ........... . . ............... v. ... .-M ............. . 258 v i LIST OF FIGURES F i g u r e 1.1 ............. 9 Fi g u r e 1.2 ................................ .................. 12 F i g u r e 1.3 13 F i g u r e I. 4 ................................................... 18 F i g u r e 1.5 ........,...;,.»........,...,,.,...,,.,..,....;... 20 Fi g u r e 1.6 .................................................. 22 F i g u r e I I I . 1 , ....... 91 F i g u r e I I I . 2 93 Fi g u r e I I I . 3 , 96 F i g u r e I I I . 4 99 F i g u r e I I I . 5 ...... .... . 103 F i g u r e I I I . 6 105 F i g u r e I I I . 7 107 F i g u r e 111*8 109 F i g u r e I I I . 9 110 F i g u r e III.10 112 F i g u r e III.11 116 F i g u r e III.12 120 F i g u r e III.13 121 F i g u r e I I I . 14 123 Fi g u r e III.15 .................................... * . . . 1 3 3 F i g u r e IV.1 ................................................ 150 F i g u r e IV.2 ................................................ 151 F i g u r e IV. 3 . 178 F i g u r e IV.4 ..,.,.,,.....,...184 Fi g u r e IV.5 185 Figu r e V.I ,.. ,. 198 F i g u r e V.2 201 F i g u r e V.3 .............................. ...... ....... 207 F i g u r e V.4 , 208 F i g u r e V.5 .,. 210 F i g u r e V.6 211 Fi g u r e V.7 , 214 F i g u r e V. 8 .....................218 Fi g u r e V. 9 ......................... ,., 221 Figu r e V.10 223 F i g u r e V.11 ........ 227 Fi g u r e V.12 .... ....... 229 F i g u r e V.13 231 F i g u r e A3.1 , 252 v i i Oh the mind, mind has mountains; c l i f f s of f a l l F r i g h t f u l * sheer, no-man-fathomed. Gerard Manley Hopkins ££k£2£i e l e m e n t s I would l i k e to acknowledge my enormous debt to Richard Rosenberg, who has su p e r v i s e d me, and who has g i v e n me a d v i c e , encouragement and support beyond a l l e x p e c t a t i o n s of duty throughout the many years I have spent on the Ph.D program. I wish to thank Alan Mackworth f o r s e r v i n g on my t h e s i s committee and f o r always being ready t o l i s t e n and to give me advice and encouragement; Harvey Abramson* Ray R e i t e r , Bob Wpodham, and John Y u i l l e f o r s e r v i n g on my t h e s i s committee; Gordon McC a l l a , B i l l Havens, Rachel G e l b a r t , B r i a n Funt, Mike • Kuttner, • Roger Browse, Jan Mulder, and Randy Goebel f o r many h e l p f u l d i s c u s s i o n s ; Nona and Gwen f o r drawing the diagrams; and above a l l Nona, with Ruby, Lena and Taku, f o r standing by me through a l l these y e a r s , s u p p o r t i n g ma i n every imaginable way, and f o r being t h a i r own d e l i g h t f u l s e l v e s . . 1 CHAPTER I INTRODUCTION 1.1. Aims and motivation This thesis i s animated by a desire to understand the connection between perception and action. Every day we do such simple things as avoiding a l l obstacles in crossing a cluttered room navigating through an unfamiliar house making and executing a mental plan to go to the. l o c a l shop or cross a campus moving an awkward piece of furniture around a house. Likewise our pet dogs and cats are good at navigating through t h e i r s p a t i a l world. For an organism to do such tasks -so e a s i l y , what computational processes are required? Here you w i l l f i n d the beginnings of an answer to t h i s question, which may be refined i n any one of a dozen directions; The question as stated is too nebulous to be given a meaningful answer; to delineate i t more precisely I opted to Inlntroduction 2 proceed as follows: 1. Design and implement a simulated robot world which r e f l e c t s to a certain extent the s p a t i a l aspects of a cluttered room or the floorplan of a house. . 2. Specify a class of tasks of a s p a t i a l nature which the robot might reasonably be expected to solve i n t h i s world. 3.. Design computational processes which enable the robot to handle these tasks i n a reasonably i n t e l l i g e n t manner. This, in summary, has been my research program. The simulated robot world i s c a r e f u l l y designed to enforce a n o n - t r i v i a l treatment of the interaction between perception and action. The robot's sensory input from distant parts of the environment i s either non-existent or very inexact and fuzzy, in accord with r e a l world organisms; yet plans have to be made and actions executed. I am thus squarely confronted, a l b e i t very crudely, with the problem of acting in the. face of incomplete and inexact knowledge. In the simulated robot world i t i s possible for the executed actions to be inexact i n a s i m i l a r l y fuzzy manner, just as i n the r e a l world.. So f a r , however, I have suppressed t h i s feature, i n order to ease the achievement of the overriding concern: the creation of a functioning robot-controller. This thesis i s also animated by the b e l i e f that i t i s of fundamental importance to understand the computational processes involved in s p a t i a l problem solving. There are several l i n e s of Inlntroduction 3 argument t o encourage t h i s b e l i e f . F i r s t of a l l , s p a t i a l r easoning must be one of the most fundamental a b i l i t y we possess, s i n c e we i n h a b i t a s p a t i a l world and i f we co u l d n ' t s o l v e s p a t i a l problems we would always be bumping i n t o t h i n g s ! We are a l s o superbly good at i t . For in s t a n c e , we c o n t r o l l a r g e r e c t a n g u l a r shapes on winding roads or i n parking l o t mazes, and a b a l l - p l a y e r c o n t r o l s the v e l o c i t y and s p i n of a sm a l l round o b j e c t with f i n e p r e c i s i o n . Second* s p a t i a l r easoning s a t i s f i e s the c r i t e r i a proposed by [Marr, 1 9 7 6 ] to guide the ch o i c e of a r e s e a r c h problem i n AI., " I f one b e l i e v e s t h a t the aim of i n f o r m a t i o n - p r o c e s s i n g s t u d i e s i s to formulate and understand p a r t i c u l a r i n f o r m a t i o n - p r o c e s s i n g problems, then i t i s the s t r u c t u r e of those problems t h a t i s c e n t r a l , not the mechanisms through which they are implemented* Th e r e f o r e , the f i r s t t h i n g to do i s to f i n d problems t h a t we can s o l v e w e l l , f i n d out how to s o l v e them, and examine our performance i n the l i g h t of t h a t understanding* The most f r u i t f u l source of such problems i s o p e r a t i o n s t h a t we perform w e l l , f l u e n t l y , r e l i a b l y , (and hence unconsciously) , s i n c e i t i s d i f f i c u l t t o see how r e l i a b i l i t y could be achieved i f there.were no sound u n d e r l y i n g method." S p a t i a l r e a s o n i n g i s a problem that we s o l v e " w e l l , f l u e n t l y , r e l i a b l y " and l a r g e l y u n c o n s c i o u s l y ; t h e r e f o r e i t ' i s a worthwhile r e s e a r c h o b j e c t i v e . T h i r d , t h e r e i s an e v o l u t i o n a r y argument. The simple c r a y f i s h runs mazes; b i r d s don't bump i n t o f o r e s t l e a v e s and branches; an orca whale races through a k e l p bed without tou c h i n g a s t a l k ; a mouse w i l l r a r e l y f a i l to reach i t s cheese or a dog i t s bone; the monkey swings from branch to branch.. So, as "ontegeny r e c a p i t u l a t e s phylogeny", one might well expect I a l n t r o d u c t i o n 4 s p a t i a l reasoning to underly our higher mental f a c u l t i e s . As an aside, the minuscule brain of the hummingbird solves a devastating s p a t i a l problem: given a meadow with a profusion of flowers, each variety having di f f e r e n t nectar-producing propertias, the humming bird appears to maximize net energy input while foraging and simultaneously minimizes the time expended [Sass et a l , , 1976/]. A t r u l y amazing piece of computation by a very small brains Fourth, there i s a developmental argument. Young children solve s p a t i a l problems such as the c l a s s i c a l monkey and bananas problem before they can t a l k , and the newborn babe, only a few hours o l d , w i l l react appropriately to a moving object, f l i n c h i n g i f i t comes dangerously close, and continuing to follow i t with eye-movements i f i t passes behind a stationary object [ Bower, 1974 ]. F i f t h , our language i s permeated by s p a t i a l metaphors. Consider the word "permeate" just used. Does i t not evoke a vi s u a l image consisting of " s p a t i a l metaphors", "permeating", in a very physical sense, "our language"? Does not a visual image accompany every sentence one utters? Even the most abstract type of language uses s p a t i a l metaphors. For instance, one "builds" an argument "on" a firm "foundation"; one "arrives at" a conclusion; Sixth, there are many anecdotes concerning the use of s p a t i a l reasoning and vis u a l imagery in making fundamental s c i e n t i f i c discoveries. For instance, the paper models of I•Introduction 5 Pauling f o r the alpha-helix, and of Watson and Crick for the DNA molecule; Faraday's v i s u a l i z a t i o n of magnetic l i n e s of force as narrow tubes curving through space; Kekule's discovery of the structure of the benzene molecule by his v i s u a l i z a t i o n of a ri n g of snake-like, writhing, chains, each seizing i t s neighbour's t a i l ; and in mathematics, Hadamard has documented many instances where a problem was apparently solved by visual imagery.. These arguments i n favour of s p a t i a l reasoning inexorably lead one to propose the hypothesis that the mechanisms required for s p a t i a l reasoning may well underly other a b i l i t i e s that have developed l a t e r i n evolution, for instance the use of language.. The o v e r a l l structure of my thesis may now be summarized.. I lay out a research program and describe the progress made on several f r o n t s . The o v e r a l l implementation goal i s to build a functioning robot-controller for the simulated robot.. The implemented parts are described in d e t a i l . For those parts not yet implemented, th e i r theory and design i s sketched in some depth, to the point at which, i n some cases, further progress can only be made through an attempt at implementation. After a l l i s said and done, t h i s i s the feature that distinguishes A r t i f i c i a l I n t e l ligence, as actually practised, from a l l other i n t e l l e c t u a l d i s c i p l i n e s : the development of theory through program implementation. Iaintroduction 6 1,2 The action cycle The information-processing component of any organism that physically interacts with the outside world must consist of three d i s t i n c t parts: sensory receptors, action effectors, and an intermediary that relates the senses and the actions.. My main in t e r e s t i s i n a s u f f i c i e n t design for the intermediary, which in t h i s thesis w i l l be referred to as the robot-controller. The intermediary could of course be n u l l but that r e s u l t s i n a very uninteresting organism which could not long survive in i t s world. In my case, the design of the intermediary, the robot-controller, i s constrained by the requirement that the organism exhibit reasonably i n t e l l i g e n t behaviour; (Intelligent behaviour w i l l be taken as a primitive judgment and analyzed no further.) The major task of a robot-controller, i n order to improve the organism's survival chances, i s to build a world model: a model of the outside world.. In information-processing terms, a world model i s a data base of facts which, together with inter p r e t i v e procedures, enables the prediction of future sensory input. Eguivalently, i t i s a data structure and procedures for making predictions about the outside world* A good world model makes correct predictions most of the time. The purpose of a world model i s to allow the construction of plans and thus to better achieve the organism's goals. Building a world model i s an inductive task, using sensory inputs as the I•Introduction 7 p r i m i t i v e items of evidence. Thus the world model of an organism i s a f u n c t i o n of the design of i t s r e c e p t o r s , and furthermore can never be assumed to be c o r r e c t - the true nature of the o u t s i d e world i s f o r e v e r unknowable. As a consequence, d i f f e r e n t organisms b u i l d very d i f f e r e n t world models. To an octopus, f o r i n s t a n c e , whose sense of touch can only s i g n a l s u r f a c e t e x t u r e and c u r v a t u r e , a s m a l l smooth perspex sphere i s i n d i s t i n g u i s h a b l e from a long smooth perspex c y l i n d e r having the same curva t u r e [Wells,1978]. The i n t e r f a c e between an organism and the o u t s i d e world i s d e f i n e d by the organism's sensory r e c e p t o r s and a c t i o n e f f e c t o r s , and i s n e c e s s a r i l y always sloppy. T h i s may be taken as an i n t u i t i v e l y obvious f a c t , or may be supported by the f o l l o w i n g i n f o r m a t i o n - t h e o r e t i c arguments. On the sensory s i d e one may argue as f o l l o w s . F i r s t , at any moment i n time a f i n i t e organism can only r e c e i v e a f i n i t e amount of i n f o r m a t i o n , whereas there i s c e r t a i n l y an unbounded amount of i n f o r m a t i o n which c o u l d be detected a t any one time and moreover, i f one b e l i e v e s e i t h e r t h a t the f e a t u r e s of the o u t s i d e world are continuous* or t h a t the o u t s i d e world i s i n f i n i t e , or both, then there i s an i n f i n i t e amount of sense-able i n f o r m a t i o n . T h i s i s a s p e c i a l case of the more general f a c t that a small f i n i t e organism i n a l a r g e or unbounded world could n e i t h e r c o n t a i n nor r e c e i v e a l l the p o t e n t i a l l y sense-able i n f o r m a t i o n a v a i l a b l e from the o u t s i d e world* A more p r a c t i c a l argument: by the very design of n a t u r a l sensory r e c e p t o r s , a l l i n p u t i s d i g i t i z e d , I n l n t r e d u c t i o n 8 hence i s an approximation to q u a n t i t i e s t h a t are g e n e r a l l y taken to be continuous. On the a c t i o n s i d e , one may argue as f o l l o w s . . The very statement t h a t the r e s u l t of an a c t i o n was i n c o r r e c t , or s l o p p y , i m p l i e s the e x i s t e n c e of a world model which was used as a standard of comparison f o r the outcome of the a c t i o n . There are two p o i n t s here* . F i r s t , a world model i s never one hundred percent exact, so the p r e d i c t e d outcome may be simply wrong. Second, supposing the world model i s exact, the:computation of the outcome of an a c t i o n may r e q u i r e an unbounded amount of time.. But i n the o u t s i d e world l i f e goes on and a c t i o n s must be taken, so the computation must be cut o f f i n a f i x e d amount of time - and so mistakes are i n e v i t a b l e . The d i s c u s s i o n so f a r i s summarized i n f i g u r e 1 .1 . Our r o b o t - c o n t r o l l e r f u n c t i o n s , a t the top l e v e l * by the p e r p e t u a l r e p e t i t i o n of t h e : a c t i o n c y c l e , a loop c o n t a i n i n g three p a r t s : p e r c e p t i o n , p l a n n i n g , and a c t i o n . In our r o b o t - c o n t r o l l e r these three processes are performed i n s e r i a l order, whereas i n most l i v i n g organisms they are presumably performed i n p a r a l l e l . While I am d i s c u s s i n g organisms i n g e n e r a l , l e t me i n t r o d u c e the f o l l o w i n g terminology: the t o t a l sensory ( v i s u a l , t a c t i l e , o l f a c t o r y , a u d i t o r y , .,.) i n p u t a t any i n s t a n t of time i s c a l l e d a sensory, ( v i s u a l , t a c t i l e * olfactory,, a u d i t o r y , , . . . ) impression, f o l l o w i n g David Hume* In summary, then, the a c t i o n c y c l e occupies a fundamental p o s i t i o n i n the i n f o r m a t i o n - p r o c e s s i n g of any organism.. The ImIntroduction PLAN MODEL -MOTZG&_ OUTPUT S L 0 P P y I N r tr k r ACE fe I Gr-LLfLE EJL THE ACTION CYC e l u c i d a t i o n of i t s s t r u c t u r e , main task of my resea r c h program chapters IV and V. 10 f o r the simulated robot, i s the My progress i s d e s c r i b e d i n I-3 System overview The system c o n s i s t s of th r e e main programs: TABLETOP, t h a t simulates the o u t s i d e world; OTAK, that simulates the robot; and PPA, the r o b o t - c o n t r o l l i n g program. TABLETOP s i m u l a t e s a f r i c t i o n l e s s t a b l e t o p with a po l y g o n a l r e s t r a i n i n g boundary;. There may be a r b i t r a r y p o l ygonal shapes on the t a b l e t o p , some f i x e d and some movable. These shapes c o n s t i t u t e the o b j e c t s of the o u t s i d e world* The t a b l e t o p boundary w i l l be r e f e r r e d to as the verc[e t o avoid c o n f u s i o n l a t e r . There are never any holes i n a f i x e d or movable o b j e c t . On t h i s simulated t a b l e t o p the everyday laws of p h y s i c s h o l d : t h a t i s t o say, the shape of an o b j e c t remains i n v a r i a n t d u r i n g motion, and i f the path of a moving object i s obstru c t e d by another o b j e c t or the verge then the moving o b j e c t comes to an immediate s t a n d s t i l l with a small gap between i t and the of f e n d i n g o b s t r u c t i o n . The concepts of mass and momentum have not been implemented, though there would be l i t t l e d i f f i c u l t y i n doing so. Consequently there are no " s t a r t up" or "slow down" times a s s o c i a t e d with robot movements, and when a wide moving o b j e c t c o l l i d e s with an o b s t a c l e near one: of i t s l a t e r a l I n l n t r o d u c t i o n 11 extremities no terminal rotation of any kind i s simulated: the object simply comes to an immediate halt. UTAK simulates the robot, Utak*, who i s represented as a dimensionless point and i s free to move anywhere there i s empty space. Though dimensionless, he: cannot s l i p between two adjacent objects which have point-to-point, point-to-edge, or edge-to-edge contact* He can grasp an adjacent movable object, and can move with and release such a object. An example, task environment including Utak i s shown in figure 1.2... Utak senses his environment with an eye having a li m i t e d f i e l d of view and having a variable resolution: fine in the centre (the "fovea") and progressively coarser towards the periphery,* . The eye may be thought of as a TV camera, suspended at the top of a stalk sticking v e r t i c a l l y up from Utak, with the camera pointing d i r e c t l y downwards at the tabletop and i t s f i e l d of view centered on Utak.. Thus the eye gets a two-dimensional view of part of the tabletop and an image of Utak always appears at the centre of the f i e l d of view* The r e t i n a l geometry of the eye i s shown in figure I*3(a). Each l i t t l e square constitutes a r e t i n a l f i e l d * a n ^ covers a certain area of the task environment depending upon Utak's iRather than always r e f e r r i n g to the "robot" and using the pronoun " i t " , I w i l l usually refer to "Utak", who may be likened to a semi-intelligent dog, and use the pronoun "him". Of course, no sexual discrimination i s intended.^ Likewise no phylogenetic discrimination i s intended either: "Utak" and "him" are simply more pleasant ways to refer to what i s merely an abstract device embodied in a computer program used to probe very gingerly into the p r i n c i p l e s of cognitive science. I«Introduction 12 Fix ED PART ITION U T A K A MOVABLE 0 8 J - 6 C T Fl&VRE I.Z. A TASK ENVIRONMENT. FIGURE 1.3 (a) The r e t i n a l geometry. 0 o O o o O O 6 0 o O o o O o 6 1 2 2 2 2 2 2 2 2 »•> z / 2 2 2 2 2 2 2 2 2, 6 o O o • • • • E D E E o X o O o • • • • • • B E o % I o o o • • • • F J E E E E G 1 E O E E O E 2, V 1 0 6 O O • • • • • • E E • • • • • • • • © o 6 o o O o o o o o O © o O o O © © o O o o o o o O o 7 6 (o (o (o 6 4 FIGURE 1.3 (b) The integers i n the squares form the reitinal impression corresponding to, Utak's p o s i t i o n i n Figure 1.2. 14 position. Corresponding to each r e t i n a l f i e l d there i s a r e t i n a l c e l l , which re g i s t e r s a gray_level, or integer in the range 0 - 7 , that depends on the r a t i o of object to t o t a l area of the task environment covered by the r e t i n a l f i e l d . A r e t i n a l impression i s the structured set of graylevels registered by a l l the r e t i n a l c e l l s at one part i c u l a r instant i n time* .. The r e t i n a l impression received by Utak when in the situation of figure 1.2 i s shown i n figure 1.3(b). Utak also has eight " t a c t i l e " receptors, one in each of the eight basic compass directio n s , which allow him to sense the colour of an immediately adjacent object.. A t a c t i l e - impression i s the structured set of eight colors registered by the t a c t i l e receptors at one pa r t i c u l a r instant of time*'. In sum, then, Utak inhabits an outside world which may be likened to a tabletop with confining verges, where he can wander around and move objects, and where his sensory contact with t h i s world consists of a series of r e t i n a l and t a c t i l e impressions. It i s h i s problem to make sense of a l l t h i s sensory input (James' "blooming, buzzing confusion") and create a "world model" f o r planning purposes. That i s a major problem for Utak's brain, the robot-controlling program. The class of tasks given to Utak consists of path finding ("Go to the north-east corner") and object moving tasks ("Push the square movable object into the next room").. The statement of a task may require considerable changes to Utak's world model., Consider, for instance, the object-moving task just Inlntroduction 15 mentioned. I f Otak has so far seen a square movable object but has only explored what he thinks i s one end of a single room, his world model before the task statement w i l l simply consist of a room with one square movable object i n i t ; but after "understanding" the task statement his world model w i l l include an extra room with a doorway which connects i t to the room he's currently i n at a position consistent with h i s accumulated sensory experience to date. PPA, the robot-controller, i s divided into three parts: ACCOM, SPLAN, and ACT. PPA i s an acronym fo r p_erceive, p_lan, act; the three parts of the action cycle.. ACCOM accepts a r e t i n a l impression and modifies (accommodates) the current world model in the l i g h t of t h i s new evidence; SPLAN i s the s p a t i a l planner and i s responsible for always maintaining a v a l i d plan to achieve the current task by creating a new plan or by updating an old one; while ACT simply computes from the current plan the next action to be executed. . A world model, a task, and a plan are defined at a l l times in PPA, whatever Utak's actual s i t u a t i o n , including the moment before Utak "opens his eye" and receives his f i r s t r e t i n a l impression. . So far,; the following defaults have been used. The world model i s taken to be a large empty square centred on Utak's i n i t i a l position. The default task i s to explore the assumed world, which means " c o l l e c t evidence: (i;e. sensory input) to confirm the current world model".. If the default task re s u l t s i n the s p e c i f i c task of, say, "go to the.north-east Ialntroduction 16 corner", then the current plan would consist of walk actions to the hypothesized position of the north-east corner. Other possible defaults are "sleep" or "fi n d food". , I have not considered problems of motivation or drive. These are c l e a r l y important and involve decision-making and rewards. The archetypal problem consists of an organism hunting for food i n an environment whose food-supplying c h a r a c t e r i s t i c s are partly known. The organism i s getting hungry (food or fu e l running low); what i s the best s u r v i v a l strategy for t h i s organism? There i s a large s c i e n t i f i c l i t e r a t u r e devoted to such problems in the f i e l d s of decision theory and game theory. For me, these problems are secondary to the basic questions of representing the s p a t i a l world and solvinq s p a t i a l problems. The ACCOM program, responsible for understanding incoming sensory impressions, divides into two parts, ACC-INIT and ACC-SOB. ACC-INIT accomodates the i n i t i a l default world model to the very f i r s t r e t i n a l impression while ACC-SOB ca r r i e s out a l l subsequent accomodations of the world model to incominq sensory impressions. The s p a t i a l planner SPL&N depends on a subsystem c a l l e d SHAPE to solve path-finding and object-moving problems... SHAPE makes extensive use of the world model. The:basic world model i s maintained in a format of points and lines specified by means of Cartesian coordinates and w i l l sometimes be referred to as the Cartesian world model or the Cartesian represent ation. SHAPE functions by projecting and re-projecting a l l or part of I«Introduction 17 the C a r t e s i a n world model onto a d i g i t a l array (the s c r e e n ) . P a t h - f i n d i n g and object-moving problems are s o l v e d i n simple cases from one p r o j e c t i o n on the screen; more i n t e r e s t i n g cases r e q u i r e s e v e r a l p r o j e c t i o n s . A p r o j e c t i o n of the C a r t e s i a n r e p r e s e n t a t i o n onto t h i s d i g i t a l a r r a y w i l l sometimes be r e f e r r e d t o as an image r e p r e s e n t a t i o n . The most important p a r t of SHAPE i s the c o l l e c t i o n of a l g o r i t h m s f o r s o l v i n g p a t h - f i n d i n g and object-moving problems., These are based upon the concept of the s k e l e t o n of a two dimensional shape. A more d e s c r i p t i v e but more cumbersome term f o r i t i s the symmetric a x i s transform of a shape; To get an i d e a o f what the s k e l e t o n of a shape looks l i k e , examine the shape and i t s s k e l e t o n drawn i n f i g u r e 1.4. I found that the s k e l e t o n was a u s e f u l t o o l f o r p a t h - f i n d i n g problems, and would be a u s e f u l h e u r i s t i c f o r object^moving problems provided a l g o r i t h m s c o u l d be devised t o compute i t . I t turned out t h a t , f o r reasons given i n chapter V, the p u b l i s h e d s k e l e t o n algorithms were u n s a t i s f a c t o r y . L u c k i l y , one of these provided a good base from which I was able to d e r i v e a s a t i s f a c t o r y s k e l e t o n a l g o r i t h m . There i s a very nice mathematical d e f i n i t i o n of the s k e l e t o n of a shape;; Consider the s e t of a l l c i r c l e s t h a t l i e t o t a l l y w i t h i n the shape and p a r t i a l l y order them by i n c l u s i o n ; the s k e l e t o n i s then d e f i n e d to be the l o c u s of the c e n t r e of a l l maximal c i r c l e s i n t h i s s e t . In a d d i t i o n , each point of the s k e l e t o n has a s s o c i a t e d with i t the r a d i u s of the:maximal c i r c l e I • I n t r o d u c t i o n F.I &UR £ X.4-, _/_We_4.K.£4ETOH OF A SHAPE. 19 with centre at that point; t h i s i s known as the guench function. However, the skeleton algorithm that I use does not compute exactly the skeleton as I have just defined i t . . . This i s because the c i r c l e s used i n the mathematical d e f i n i t i o n are drawn using the.familiar Euclidean metric for the distance between two points i n a plane, whereas my algorithm uses a quasi-Euclidean metric to approximate the Euclidean distance. . Dsing t h i s quasi-Euclidean metric, the skeleton can be computed in a very " l o c a l " manner. Consequently I s h a l l , when . necessary, distinguish between a Euclidean skeleton, as defined above, and the d i g i t a l skeleton, as computed by my algorithm*. The difference between the two can be observed by overlaying the Euclidean skeleton of 1.4 on the d i g i t a l skeleton of figure 1.5. The skeleton of a shape i s the key idea behind the s p a t i a l planner. It has a very i n t u i t i v e appeal and can be used to solve more than just path-finding and object-moving problems. For instance, i t can also be used to solve . the following problem, otherwise known as the find§E§S§ problem [Sussman,1973J. Given a two dimensional shape that you want to put down on a cluttered surface, where do you place i t ? The theory and algorithms concerned with the skeleton of a shape are worked out in chapter V. To complete t h i s overview of P P A , the t h i r d and f i n a l component i s ACT, the executive program that computes the next action for Utak from a completed plan. This i s not e n t i r e l y t r i v i a l because the size of the next action has to be a function I«Introduction p i lc h i ; » * * (A \ X I P ! 2 . 21 of the confidence Otak has i n the d e t a i l s of the world model i n the v i c i n i t y of h i s c u r r e n t p o s i t i o n and of the accuracy with which he can execute an a c t i o n * The speed at which one runs through a room c l u t t e r e d with f u r n i t u r e depends both on how w e l l one can r e g i s t e r the p o s i t i o n s of the items and on how well one can c o n t r o l one's movements. To summarize t h i s s e c t i o n : I have o u t l i n e d the major components of PPA, the r o b o t - c o n t r o l l e r , and I have presented an important u n d e r l y i n g concept, the s k e l e t o n of a two dimensional shape. The accompanying f i g u r e 1*6, which i l l u s t r a t e s t h i s stage of PPA's design, may be regarded as a f i r s t order e l a b o r a t i o n of the a c t i o n c y c l e of f i g u r e 1.1. I.4 System s t a t u s A l l p a r t s of the system have been designed, t o v a r y i n g degrees of d e t a i l , and some p a r t s have been implemented., The TABLETOP and OTAK s i m u l a t i o n programs, which execute a c t i o n s and produce t a c t i l e and r e t i n a l i m p r e s s i o n s , have been implemented and are d e s c r i b e d i n chapter I I I . The c u r r e n t s t a t u s of the other p a r t s of the system, namely ACCOM, SPLAN, and ACT, i s d e s c r i b e d i n f u l l i n chapter IV. Of the two subparts of ACCOM, ACC-SOB has been designed while ACC-INIT has been designed and implemented. A f u l l implementation of the s p a t i a l planner SPLAN has not been attempted, but the o v e r a l l design of SPLAN and i t s major subpart SHAPE i s complete*, SHAPE 'S most fundamental ^ I n t r o d u c t i o n 22 TlirT/NAL. UTAK T * € O 0 T S \ & £ W O R L \ > f«\oTtof\ O O T P y T Ac c o ^ S P L A N / j V / STRUCTURE A C T P L A N F l GURE I. 6 23 operation, the skeleton-finding computation, i s complete and implemented; that i s the main algorithmic contribution of t h i s thesis. Taking the engineering view towards Al, I make two contributions in t h i s thesis. One i s an e f f i c i e n t system for simulating the motion of r i g i d two dimensional shapes, the other i s the design and p a r t i a l implementation of a s p a t i a l planner that finds paths and produces plans for moving two dimensional shapes around on a f l a t surface. 1.5 Reader's guide Chapter I I , consisting of two parts, i s concerned with background issues. The f i r s t part concentrates on giving an overal l view of the whole Al enterprise:while the second part reviews numerous pieces of work from Al and i t s s i s t e r d i s c i p l i n e s that are c l o s e l y related to my own., Chapter III describes the design considerations and algorithmic d e t a i l s of the simulated robot world, while chapter IV covers the whole robot-controller design., I include in chapter IV a number of task scenarios that my robot-controller, when f u l l y implemented, i s designed to be. able to execute. . Chapter V describes the theory and algorithms f o r computing the skeleton of a two dimensional shape, and i t s usefulness for pathfinding and object moving problems. The concluding chapter VI recapitulates the foregoing, discusses my contribution to the Al enterprise, and I"Introduction 24 describes future directions of research. The appendices include a user's manual f o r the TABLETOP simulation, a combinatorial lemma required in chapter V, and some proofs concerning the simulation system of Funt [1976] required i n section 11*4.7* If you want to see a new i t e r a t i v e algorithm for computing the skeleton read section V.2.4. For a new application of the skeleton, to pathfinding, read section 7,3. I f you want to see algorithms for simulating the TABLETOP world read section III.1. The. o v e r a l l design of a robot-controller i s outlined in chapter IV. F i n a l l y , i f you want a general review of A r t i f i c i a l Intelligence, read the f i r s t three sections of chapter I I . . The l a s t section of chapter II contains a l i t e r a t u r e review.„ I"Introduction 25 CHAPTER-II BACKGROUND-ISSUES In t h i s chapter my purpose i s t o b r i e f l y sketch the nature of A r t i f i c i a l I n t e l l i g e n c e and then to review r e l a t e d work i n A r t i f i c i a l I n t e l l i g e n c e and other f i e l d s . I I . J A r t i f i c i a l I n t e l l i g e n c e ^ i s a s c i e n c e - w i t h g o a l s and para diqms A r t i f i c i a l I n t e l l i g e n c e i s the computer age expression of man's e t e r n a l urge, to understand h i s mind and consciousness. Less p o e t i c a l l y , i t i s a s c i e n t i f i c d i s c i p l i n e . w h o s e goals are to make computers more u s e f u l and to d i s c o v e r and understand i n computational terms the t h e o r i e s and p r i n c i p l e s t h a t underly i n t e l l i g e n c e , i r r e s p e c t i v e of whether the: i n t e l l i g e n c e i s d i s p l a y e d by man, animal, or computer. The reader w i l l note a s c h i z o p h r e n i c tendency here: on the one: hand i t i s an en g i n e e r i n g d i s c i p l i n e - [Michie,1978] d e f i n e s i t as "the !The name i s unf o r t u n a t e , f o r i t i s not the c u r r e n t end-point i n a p r o g r e s s i o n t h a t goes animal i n t e l l i g e n c e * human i n t e l l i g e n c e , a r t i f i c i a l i n t e l l i g e n c e , ...!*! .... as many a layman seems to th i n k on f i r s t hearing the name. Nei t h e r i s i t concerned with computer based support systems f o r men i n space, as one s c h o l a r seemed to t h i n k . (How about computer cognology?) Also, s i n c e one cannot denote a p r a c t i t i o n e r by the us u a l scheme of appending " - i s t " to the s u b j e c t ' s name, one i s f o r c e d to use cumbersome terms such as " r e s e a r c h e r i n A r t i f i c i a l I n t e l l i g e n c e " . IlaBackground Issues 26 p u r s u i t of e n g i n e e r i n g g o a l s through machine p r o c e s s i n g of complex i n f o r m a t i o n i n terms of human concepts" - while on the other hand i t i s an i n t e l l e c t u a l d i s c i p l i n e , concerned with understanding i n t e l l i g e n c e i n computational terms, and so perhaps i s more a k i n to philosophy and psychology than other areas of study. I I . J..J. The paradigms of A r t i f i c i a l I n t e l l i g e n c e : I f A r t i f i c i a l I n t e l l i g e n c e i s a s c i e n c e then what are i t s paradigms J. Kuhn, 1962 i]? As [ Masterman, 1970 i] pointed out, Kuhn used the word "paradigm" i n many d i f f e r e n t senses, so we s h a l l i n t r o d u c e : each sense as necessary. In a s o c i a l sense* A r t i f i c i a l I n t e l l i g e n c e has been around as a c l e a r l y d e f i n e d group of communicating workers s i n c e a 10 person summer s c h o o l was held on the s u b j e c t i n 1955. . So A r t i f i c i a l I n t e l l i g e n c e i s a young s c i e n c e and perhaps s t i l l a b i t s e l f - c o n s c i o u s as a r e s u l t . As f o r the e x i s t e n c e of a g e n e r a l l y accepted view of the s u b j e c t (metaphysical paradigms or "Weltanschauung"; these are what get overthrown i n s c i e n t i f i c r e v o l u t i o n s ) i n i t i a l l y t h e r e was h a r d l y one at a l l except f o r the b a s i c b e l i e f t h a t an understanding of i n t e l l i g e n c e would be achieved through computational s t u d i e s . , T h i s has now been s t a t e d as the P h y s i c a l Symbol System Hypothesis by [Newell and Simon* 1 976 i}: "a p h y s i c a l symbol system has the necessary and s u f f i c i e n t means f o r g e n e r a l II«Background Issues 27 i n t e l l i g e n t action". Very soon the c e n t r a l importance of search was generally accepted, and t h i s too has been enshrined by Newell and Simon as the Heuristic Search Hypothesis: "The solutions to problems are represented as symbol structures. A physical symbol system exercises i t s i n t e l l i g e n c e in problem-solving by search - that i s , by • generating and progressively modifying symbol structures u n t i l i t produces a solution structure." Now the generally accepted core topics of A r t i f i c i a l Intelligence can be summarized as [Nilsson,1974 ]: representation of knowledge, search, common-sense:reasoning and deduction, and computer languages and systems appropriate for investigating the f i r s t three topics.. Going down one l e v e l * what are some of the instrumental paradigms, or generally accepted tools of A r t i f i c i a l Intelligence? The computer and programming languages are, of course, the sine g j ia npn of A r t i f i c i a l Intelligence* There are however some more s p e c i f i c , widely used, tools i n the Al'ers t o o l k i t . . One such i s the production system s t y l e of program design. A production system consists of a c o l l e c t i o n of situation-action rules plus a scheme for choosing which rule to ( apply next. Any| production system can be vxewed as a generalization of a behaviouristic stimulus-response system. Another i s the semantic net approach; here a system i s designed as a data structure of labelled nodes and connecting arcs together with arc-traversal algorithms. This approach i s , h i s t o r i c a l l y , d i r e c t l y derived from a s s o c i a t i o n i s t psychology. HaBackground Issues28 The last t o o l we w i l l mention i s the most well established of them a l l , with a long i n t e l l e c t u a l history behind i t , and the object of some controversy: f i r s t order predicate calculus, which i s taken d i r e c t l y from t r a d i t i o n a l mathematical l o g i c . . What are some of the defining problems of A r t i f i c i a l Intelligence? As examples, anyone who uses a computer in attempting to: understand natural language, play games such as chess, control a robot, understand a TV image of a real world scene, or understand speech, i s considered to be working in A r t i f i c i a l Intelligence. What are some of the current hot problems in A r t i f i c i a l Intelligence? Here i s a l i s t , c u lled from [McCarthy,19773 and [ Simon, 1977 J . • the problem of cooperating with others* or overcoming t h e i r opposition - t h i s i s a task which even the youngest infant handles very well [Donaldson,1978 ] . . • the ac q u i s i t i o n of knowledge [ Winston, 1970 i], [ Winston* 1 978 g. • reasoning about concurrent events and actions., B expressing knowledge about space, and the locations, shapes and layouts of objects i n space. a the r e l a t i o n between a scene and i t s two dimensional image -this i s the visi o n problem, currently being attacked by many workers, f o r instance, [Barrow and Tenenbaum,1 9 7 8 J . . B reasoning with concepts of cause and can* a f i n a l l y , the problem of representation - what knowledge enables a system to create a representation and operators for IlaBackground Issues 29 a new and u n f a m i l i a r problem? T h i s r e p r e s e n t a t i o n knowledge i s to be d i s t i n g u i s h e d from knowledge of how to s o l v e a problem. In summary, I have o u t l i n e d t h i s s c i e n t i f i c f i e l d known as " A r t i f i c i a l I n t e l l i g e n c e " by d e s c r i b i n g i t from s e v e r a l Kuhnian viewpoints* I I . J_. 2 AI has p o t e n t i a l l y r i c h - r e l a t i o n s h i p s with many, other f i e l d s There are many r e l a t i o n s between A r t i f i c i a l I n t e l l i g e n c e and other f i e l d s of study. For example, one might expect t h a t work on g e t t i n g a machine to understand language would form a s u b f i e l d of l i n g u i s t i c s proper, whereas i n f a c t t h i s f i e l d of r e s e a r c h has a somewhat c o n t e n t i o u s r e l a t i o n s h i p with t r a d i t i o n a l l i n g u i s t i c s * T h i s r e l a t i o n s h i p i s the t o p i c of an enduring, acrimonious debate - an example of competing paradigms, a l a Kuhn, due to d i f f e r i n g research programs. As another example, psychology and A r t i f i c i a l I n t e l l i g e n c e have enjoyed a somewhat l o p s i d e d r e l a t i o n s h i p . The more v o c a l advocates of A r t i f i c i a l I n t e l l i g e n c e b e l i e v e t h a t A r t i f i c i a l I n t e l l i g e n c e r e s e a r c h i s of monumental importance f o r psychology [Minsky and Papert,1972 J , whereas most of the p s y c h o l o g i c a l community has simply ignored A r t i f i c i a l I n t e l l i g e n c e * . The reasons f o r t h i s schism seem t o stem l a r g e l y from d i f f e r e n c e s i n methodology [ M i l l e r , 1 9 7 8 J - another example: of competing r e s e a r c h paradigms. In order to keep h i s s c i e n c e well founded IIoBackground Issues 30 on f a c t s , and hence s c i e n t i f i c a l l y r e s p e c t a b l e , the p s y c h o l o g i s t i s concerned t o produce f a l s i f i a b l e t h e o r i e s , t h a t i s , t h e o r i e s with demonstrably true e m p i r i c a l consequences. On the other hand, the A r t i f i c i a l I n t e l l i g e n c e r e s e a r c h e r i s concerned to produce f a l s i f i a b l e comp_utational t h e o r i e s , mechanisms and computations with demonstrably t r u e e m p i r i c a l consequences. The d i f f e r e n c e i s that the l a t t e r i s not so much concerned with the e m p i r i c a l f a c t s o f human mental a b i l i t i e s , which by and l a r g e are taken as i n t u i t i v e l y obvious, but with the e m p i r i c a l f a c t s of computation. For i n s t a n c e any proposed mechanism which encounters a c o m b i n a t o r i a l e x p l o s i o n or otherwise runs i n t o l e r a b l y slowly on any a c t u a l or p o t e n t i a l computer i s unacceptable. Thus an alg o r i t h m t h a t i s e x p o n e n t i a l l y slow i n the domain of i n t e r e s t i s u n l i k e l y to be ac c e p t a b l e i n the lo n g run.. To conclude: A r t i f i c i a l I n t e l l i g e n c e i s not so a r t i f i c i a l a f t e r a l l - i t i s grounded on the e m p i r i c a l , n a t u r a l , f a c t s of computation. One might expect there to be some contact between animal behaviour s t u d i e s and A r t i f i c i a l I n t e l l i g e n c e , f o r at l e a s t two reasons. F i r s t the behaviour of animals i s simpler and t h e r e f o r e the c o n s t r u c t i o n of computational processes s u f f i c i e n t to d u p l i c a t e i t should be e a s i e r . . (When I say that the behaviour of B d u p l i c a t e s the behaviour of A, I mean t h a t t h e r e i s no s i g n i f i c a n t observable d i f f e r e n c e between the behaviour of B and of A, as i n the Turing t e s t or i n Bridgeman's operati o n a l i s r a . ) Second, the e v o l u t i o n of human behaviour ( i * e . IIsBackground Issues 31 i n t e l l i g e n c e ) can be t r a c e d through many grades of animal behaviour J e r i s o n , 1973 3- Consequently one might expect t h a t subsystems t h a t had already been shown to d u p l i c a t e aspects of animal behaviour o c c u r r i n g e a r l i e r i n the e v o l u t i o n a r y r e c o r d c o u l d be used as b u i l d i n g b l o c ks i n the c o n s t r u c t i o n of systems t h a t d u p l i c a t e a s p e c t s of human behaviour.. In f a c t , apart from a very few s t u d i e s reviewed l a t e r , there has been e s s e n t i a l l y no c o n t a c t between the two f i e l d s ; In p a s s i n g , l e t me d e s c r i b e a t r a d i t i o n a l problem f o r problem-solving systems t h a t does come from animal behaviour s t u d i e s - the monkey and bananas problem. A hungry monkey i s i n a room with a bunch of bananas hanging from the c e i l i n g and a box i n the corner; how does the monkey get h i s food? T h i s problem was s o l v e d by Kohler's chimpanzees [Kohler,1925 ]; t y p i c a l l y the chimpanzee p i l e d up three or f o u r boxes i n a m a r g i n a l l y s t a b l e p i l e t o get the bananas. A r t i f i c i a l I n t e l l i g e n c e and neurophysiology have a l s o , perhaps s u r p r i s i n g l y , almost no r e l a t i o n s h i p at present.„ To A r t i f i c i a l I n t e l l i g e n c e r e s e a r c h e r s , neurons are simply another way of implementing a l g o r i t h m s ; Some very e a r l y work on n e u r a l nets by [ Kleene, 1956 j} and [Moore, 1956 ], which was based on the now outdated M c C u l i o c h - P i t t s model of the neuron, branched o f f from A r t i f i c i a l I n t e l l i g e n c e and developed i n t o automata theory. More re c e n t work by [Marr, 1976 fj on v i s i o n i s c l e a r l y r e l a t e d to the.known f a c t s about the v i s u a l c o r t e x , while some aspects of the " I n t r i n s i c Images" of [Barrow and Tenenbaum, 1978 ] are very s i m i l a r t o the s t r u c t u r e of the columns i n the v i s u a l c o r t e x . IlaBackground Issues 32 The n e u r a l net idea has been developed f u r t h e r by a p h y s i o l o g i s t [ B r i n d l e y , 1969 ij and by mathematical b i o l o g i s t s , e.g. lErmentrout and Cowan, 1 9 7 8 . Since human neurophysiology has a l s o evolved, the comments about e v o l u t i o n of behaviour i n the preceeding paragraph can be taken over almost word f o r word, with neurophysiology s u b s t i t u t e d f o r behaviour throughout. On a deeper l e v e l one might expect a r i c h two-way r e l a t i o n s h i p between A r t i f i c i a l I n t e l l i g e n c e and neurophysiology or i t s very c l o s e c o u s i n , neurobiology. Take the case of v i s i o n . I f c e r t a i n computations are found to be s u f f i c i e n t f o r v i s i o n , then the q u e s t i o n f a c i n g neurophysiology i s "Where and how are these computations being c a r r i e d out i n the CNS?" Conversely, i f the human v i s u a l system i s found to compute c e r t a i n f u n c t i o n s , the question f a c i n g A r t i f i c i a l I n t e l l i g e n c e i s "Why i s the CNS computing these f u n c t i o n s ? " As another example, c o n s i d e r the phenomenon of h a b i t u a t i o n . H a b i t u a t i o n i s a gradual decrease i n the amplitude or p r o b a b i l i t y of a response to repeated p r e s e n t a t i o n of a p a r t i c u l a r s t i m u l u s . H a b i t u a t i o n i s u b i q u i t o u s i n nature and i s the simplest type of l e a r n i n g . I t has f e a t u r e s i n common with other kinds of l e a r n i n g and i s sometimes a component of more complex l e a r n i n g . , Consequently, an understanding of the mechanisms of h a b i t u a t i o n could be used to b u i l d mechanisms f o r other types of l e a r n i n g . I t s b i o l o g i c a l mechanisms are being slowly teased out by n e u r o b i o l o g i s t s I Kandel, 1 978 i]. On the one hand, i t i s easy from the A r t i f i c i a l I n t e l l i g e n c e viewpoint t o propose many methods of implementing II*Background Issues 33 habituation; the obverse of t h i s i s that i n A r t i f i c i a l I ntelligence one should prefer a learning mechanism which, at some l e v e l of description, i s consonant with the known facts of habituation. There i s a strong r e l a t i o n between A r t i f i c i a l Intelligence and philosophy. This i s not surprising in view of the fact that A r t i f i c i a l Intelligence has to consider some, of the major t r a d i t i o n a l problems of philosphy., In designing almost any A r t i f i c i a l Intelligence system commitments have to be made about the nature of knowledge, how knowledge i s obtained, how i t i s represented and used, and the r e l a t i o n between knowledge and action. The connection between philosophy and A r t i f i c i a l Intelligence i s considered by [ Sloman, 1 978 s], [Dennett,1978a], [Burks,1978J, and others*. [McCarthy et al.,1978] have described a formalism for expressing "knowing that" and used i t to solve two r i d d l e s involving knowledge : about knowledge. McCarthy, in some recent papers [McCarthy,1977a,b,c], has made inroads on philosophy by approaching many t r a d i t i o n a l philosophical problems from the A r t i f i c i a l Intelligence viewpoint. . In summary, i t seems that whereas the influence of philosophy i s s l i g h t , the A r t i f i c i a l Intelligence viewpoint promises to have an enormous influence on philosophy. I have sketched the actual or potential interactions between A r t i f i c i a l Intelligence and l i n g u i s t i c s , psychology, animal behaviour* the neurosciences, and philosophy. Thus does A r t i f i c i a l Intelligence tread i t s own well-defined path through !!•Background Issues 3 4 the maze of modern s c i e n c e , with the p o t e n t i a l f o r e n r i c h i n g and being enriched by many other f i e l d s of the s c i e n t i f i c endeavour. II> 1> 3 Oa der s t and in g the world i s a - p r e r e q u i s i t e -to doing mathematics An e a r l y dream of A r t i f i c i a l I n t e l l i g e n c e r e s e a r c h e r s was t o prove s i g n i f i c a n t mathematical theorems; There was, i t seemed, a p e r f e c t t o o l j u s t w a i t i n g to be. used: p r e d i c a t e c a l c u l u s , a formal system which can express a l l of mathematics, and i n which p r o o f s proceed by the mechanical a p p l i c a t i o n of deduction r u l e s . Put the formal system i n a computer, and l e t i t run! The ensuing c o m b i n a t o r i a l e x p l o s i o n was u n c o n t r o l l a b l e , and i t i s now c l e a r t h a t any d i r e c t use of a formal system i n the t r a d i t i o n a l manner of mathematical l o g i c i s doomed to f a i l u r e . Moral - a new t o o l i s u s e l e s s u n t i l one has l e a r n t how to use i t . In r e t r o s p e c t , one can say that i t was q u i t e unreasonable t o expect such a scheme to succeed.. Consider the words of H i l b e r t , who was p e r s o n a l l y r e s p o n s i b l e f o r s e v e r a l f o r m a l i z a t i o n s of mathematics [ H i l b e r t , 1927 ij: No more than any other s c i e n c e can mathematics be founded by l o q i c alone; r a t h e r , as a c o n d i t i o n f o r the use of l o g i c a l i n f e r e n c e s and the performance of l o g i c a l o p e r a t i o n s , something must a l r e a d y be given to us i n our f a c u l t y of r e p r e s e n t a t i o n , c e r t a i n e x t r a l o g i c a l concrete o b j e c t s t h a t are: i n t u i t i v e l y present as immediate experience p r i o r to a l l thought. I f l o g i c a l i n f e r e n c e i s to be r e l i a b l e , i t must be p o s s i b l e t o survey these o b j e c t s completely i n a l l t h e i r p a r t s , and the f a c t t h a t they d i f f e r from one another* and t h a t they f o l l o w each other, IIoBackground Issues 35 or are concatenated, i s immediately given i n t u i t i v e l y , together with the objects* as something that can neither be reduced to anything else nor requires reduction. Clearly H i l b e r t had no i l l u s i o n s about the use: of a formal system f o r discoverinq mathematical theorems., My own i n t u i t i o n i s that the objects of one's thought - noesgs - which are being "surveyed" when proving a mathematical theorem, are e s s e n t i a l l y the same as the noeses involved in manipulating objects in the external world, or in making mundane plans f o r action in the world. This i s said by [Kleene,1952, p.51, using a quote from Heyting j]: "There remains for mathematics no other source than an i n t u i t i o n , which places i t s concepts and inferences before our eyes as immediately clear.. This i n t u i t i o n i s nothing other than the faculty of considering separately p a r t i c u l a r concepts and inferences which occur regularly i n ordinary thinking." Consequently my guess i s that no r e a l l y s i g n i f i c a n t achievements i n mechanical theorem proving are l i k e l y to occur u n t i l we know how to get machines to handle the r e a l world. It i s well known that there are problems with using a formal system to model mathematical truth* One possible approach might be to use two formal systems, each of which can refer to and hence approximate the other. In one.direction t h i s leads to a reconsideration of Minsky's "models of models" problem fMinsky,1969,p.4263, i n another dir e c t i o n to p r a c t i c a l proposals for representation theory., [McCarthy,1977a,p.5 ] suggests how an approximating formal system might be II»Background Issues 36 constructed. II..1.4 A theory of i n t e l l i g e n c e w i l l be primarily - concerned with representations of the-world As i s already clear, any theory of int e l l i g e n c e w i l l above a l l be concerned with representations. At a very gross l e v e l , [McCarthy and Hayes,1969$ c l a s s i f y representations of the world by their adequacy. A representation i s called metaphysically adequate i f the world could have that form without contradicting the f a c t s of the aspect of r e a l i t y that inte r e s t us. For instance, a quantum t h e o r i s t could, in p r i n c i p l e , represent i t by a giant quantum mechanical wave equation.. But such a representation cannot even express a p r a c t i c a l fact such as " t h i s book i s red". A representation i s epistemologically. adequate i f i t can express a l l the p r a c t i c a l f a cts about the world. F i r s t order l o g i c - a formal system - i s a candidate epistemologically adequate representation* It can express propositional knowledqe but f a i l s on some other kinds of knowledge, such as notions of cause and a b i l i t y . ^ A representation i s h e u r i s t i c a l l y adequate i f i t represents the p r a c t i c a l facts and can be used to compute answers to problems. Only representations of the world that are pot e n t i a l l y h e u r i s t i c a l l y adequate are of di r e c t i n t e r e s t to A r t i f i c i a l I ntelligence, and henceforth I consider only these. The amount of search involved i n solving a problem depends c r i t i c a l l y on the representation of that problem.. For example II»Background Issues 37 [ Amarel, 1 968 (J c o n s i d e r e d the M i s s i o n a r i e s and Cannibals problem [MSG] and worked through s e v e r a l d i f f e r e n t r e p r e s e n t a t i o n s . _ The most p o w e r f u l . r e p r e s e n t a t i o n c o u l d s o l v e a c o n s i d e r a b l y more gene r a l problem than the o r i g i n a l problem, and the s o l u t i o n to the s i m p l e s t M&C problem dropped out of i t with almost no search at a l l . The quest i o n a r i s e s , how could a system be programmed t o f i n d a new r e p r e s e n t a t i o n f o r a problem, i n which the s o l u t i o n w i l l be found with only a l i t t l e search? T h i s i s what happens when one "sees" the s o l u t i o n to a problem. I t c o u l d be s a i d t h a t t h i s i s merely moving the focus of the search from f i n d i n g a s o l u t i o n of the problem to f i n d i n g a good r e p r e s e n t a t i o n of the problem._ However, the advantage of a good r e p r e s e n t a t i o n i s t h a t i t may be a p p l i c a b l e t o many other problems;. Moral - develop as many d i f f e r e n t viewpoints as po s s i b l e * Humans have a remarkably good r e p r e s e n t a t i o n f o r the th r e e - d i m e n s i o n a l world surrounding us: the r e s u l t of an eons-long e v o l u t i o n a r y search. Any competent problem s o l v e r w i l l have access to s e v e r a l r e p r e s e n t a t i o n s f o r a problem. , J. Minsky , 19751] c i t e s the example of an auto-mechanic r e p a i r i n g a c a r , who uses e l e c t r i c a l , mechanical, and v i s u a l r e p r e s e n t a t i o n s to solve a problem., We are a l s o endowed, through e v o l u t i o n , with s e v e r a l r e p r e s e n t a t i o n s of the o u t s i d e world, witness the d i f f e r e n t p a r t s of the c o r t e x devoted to v i s u a l , a u d i t o r y , and t a c t i l e r e p r e s e n t a t i o n s of the world* There i s a l s o p s y c h o l o g i c a l evidence f o r these m u l t i p l e r e p r e s e n t a t i o n s . For i n s t a n c e , !!•Background Issues 38 I Posner,1 972g presents evidence based on reaction time experiments for the existence of d i s t i n c t representations corresponding to d i f f e r e n t modalities.. [Bower,1974] suggests that an infant i s born with an wholistic, multimodal object concept which i n the course of development d i f f e r e n t i a t e s into many d i s t i n c t representations. For a problem solving system, the: question i s , what interactions should occur between different representations? This i s largely an unexplored question* Minsky suggested that an i n t e l l i g e n t system be organized as a c o l l e c t i o n of int e r a c t i n g schemata 2., A schema consists of a bundle of " s l o t s 1 1 , one for each member of a c o l l e c t i o n of closely related features. In the absence of evidence to the contrary, the slot s of a schema assume default values.. A schema i s also likened to a mini-theory for a small part of the world. If one wishes to handle schema theory in f i r s t order l o g i c , i t might be worth pointing out that the r e l a t i o n between a schema and i t s default values i s si m i l a r to the r e l a t i o n between a formal system and i t s standard model in logic, just as the integers are the standard model for any formalization of arithmetic* In view of the requirement of multiple representations for zMinsky used 'frame', but I prefer to follow [ Simon, 19771], who pointed out that 'schema' i s a more appropriate term, l o r two substantial reasons. . F i r s t , the term has been widely used in the Al and psychological l i t e r a t u r e i n the sense with which i t was introduced by B a r t l e t t in 1932; second, 'frame' already has a well-defined technical meaning in the Al l i t e r a t u r e . II»Background Issues 39 a problem solver, Ninsky's schema theory should perhaps be augmented by allowing every schema to have many di f f e r e n t representations* This might be done as follows. Each small aspect of the world may have d i s t i n c t verbal, vi s u a l , auditory, t a c t i l e or olfactory schema. There are associations between verbal schema, between v i s u a l schema, etc.; i n addition the verbal schema for one small aspect of the world may evoke i t s vis u a l schema, which may evoke i t s auditory schema, etc. To summarize t h i s section: any functioning robot-controller must use a h e u r i s t i c a l l y adequate representation of the world, that i s , a world model which reduces to a minimum the search time required to produce a plan or to solve other frequently encountered problems. I I . 1> 5 A theory of i n t e l l i g e n c e w i l l describe i n t e l l i g e n t systems at many d i f f e r e n t l e v e l s A c l o s e l y related issue concerns how to describe a complex information processinq system. Marr and Poggio[1976] argue that the information processing of a system such as the central nervous system needs to be understood at four nearly independent l e v e l s of description: (1) that at which the nature of a computation is expressed; (2) that at which the algorithms that implement a computation are characterized; (3) that at which an algorithm i s committed to p a r t i c u l a r HaBackground Issues 40 mechanisms; and (4) that at which the mechanisms are realized in hardware. In general, the nature of a computation i s determined by the problem to be solved, the mechanisms that are used depend upon the available hardware, and the p a r t i c u l a r algorithms chosen depend upon both the nature of the computation and on the available mechanisms; For example, consider the Fourier transform.. The theory of the Fourier transform i s well understood, and i s expressed independently of the p a r t i c u l a r way in which i t i s computed. One l e v e l down, there are several algorithms f o r implementing i t . For instance, the Fast Fourier Transform* which i s a s e r i a l algorithm based upon the mechanisms of the d i g i t a l computer, and the algorithms of holography, which are p a r a l l e l algorithms based on the mechanisms of laser optics, can both be used to implement the Fourier transform., The meta point to be made about describing a complex system, i s that while the gory d e t a i l s of algorithms and mechanisms are of great importance, the ess e n t i a l thing i s to understand the nature of the computation enforced by the problem that i s being solved.. + + + To summarize t h i s section, I have: b r i e f l y outlined A r t i f i c i a l Intelligence by examining i t from l i s Background Issues 41 several Kuhnian viewpoints; • argued that i t i s necessary to know how to understand the world before one can hope to know how to do more sophisticated tasks such as mathematics; • pointed out that any theory of int e l l i g e n c e must be primarily concerned with representations of the world, and secondarily w i l l describe any i n t e l l i g e n t system i n many di f f e r e n t ways. I I . 2 Simulating a robot i s a promising aEjiroach to A r t i f i c i a l I ntelligence A l o t of work in A r t i f i c i a l Intelligence i s devoted to problems which people find i n t e l l e c t u a l l y challenging* that i s , problems which require extensive use of one's conscious reasoning a b i l i t i e s . Thus almost by d e f i n i t i o n they are problems that people are not i n general good at.. But there are many problems that people solve e a s i l y and unconsciously every day - and therefore solve well - and i t i s the pr i n c i p l e s l y i n g behind the solution of these "easy" problems which are of most fundamental inter e s t to any budding theory of i n t e l l i g e n c e . So one has the somewhat paradoxical conclusion that only those problems that are: i n t e l l e c t u a l l y uninteresting . to one's conscious awareness are of fundamental interest to A r t i f i c i a l Intelligence* But therein l i e s the greatest hope for optimism, for then i t i s much easier to be objective about the subject !!•Background Issues 42 matter and not be led astray by i n t u i t i v e ideas about the functioning of one's own consciousness, a d e v i l i s h l y f a l l i b l e source of guidance. After a l l * the.greatest s c i e n t i f i c progress has occurred i n the "hard" sciences, where i t i s very easy to be objective about the subject matter. Vision and speech-understanding are examples of "uninteresting" problems which are now major subfields of A r t i f i c i a l Intelligence. Since the whole human mind i s such an impressive and unfathomable a phenomenon, most work in A r t i f i c i a l Intelligence has been devoted to some small aspect of i t . , But i t i s quite l i k e l y that there are basic p r i n c i p l e s of i n t e l l i g e n c e involved in how the various aspects, e*g.„perception, memory, planning, action, or speech, are woven together.. Further* these might reasonably be expected to appear in simpler organisms i n simpler form. Thus the complete simulation of some very simple organism would be a worthwhile, study in A r t i f i c i a l Intelligence, for instance, a simulation of a s t a r f i s h , or c r a y f i s h , or t u r t l e . However there i s a problem here, i n that even though a great deal i s known about many aspects of many d i f f e r e n t organisms, no-one has put together a l l the information about one single organism.. It should be added that there are simple creatures, most notably Aplysia, or sea hare, which have been extensively investigated by neurobiologists [Kandel,1976 ] and would therefore be good candidates for the f i r s t serious simulation of a complete l i v i n g creature. The other suggestion i s to invent some simpler world and organism and work out a l l the d e t a i l s of IlaBackground Issues 43 the o r g a n i s m - c o n t r o l l i n g program. TodaJ. 19623 c a r r i e d t h i s out from the p s y c h o l o g i s t ' s p o i n t of view, and more r e c e n t l y Dennettf1978J suggested t h i s i n the context of a p h i l o s p h i c a l c r i t i q u e of A r t i f i c i a l I n t e l l i g e n c e . T h i s i s the path I have fol l o w e d , with emphasis not so much on problems of c o n t r o l but r a t h e r on problems of s p a t i a l r e p r e s e n t a t i o n . This approach i n v o l v e s methodological problems* One has to make many a r b i t r a r y d e c i s i o n s i n c o n s t r u c t i n g both the s i m u l a t i o n and the o r g a n i s m - c o n t r o l l i n g program. In the s i m u l a t i o n , the world and the robot should on the one hand s a t i s f y some c r i t e r i a of " n a t u r a l n e s s " or " a n i m a l - l i k e - n e s s " , and on the other hand be c o m p u t a t i o n a l l y f e a s i b l e t o simulate and cheap enough that e x t e n s i v e experimentation can be done to observe the performance of the bug using v a r i o u s o r g a n i s m - c o n t r o l l i n g programs. The de s i g n of the o r g a n i s m - c o n t r o l l i n g program should on the one hand r e f l e c t i deas d e r i v e d from observation of a c t u a l c r e a t u r e s , from the a n a l y s i s provided by psychology, as f a r as i t goes, from s t u d i e s i n animal behaviour, and from i n t u i t i o n based on one's own i n t r o s p e c t i o n , while on the other hand i t cannot avoid being c o n s t r a i n e d by the m a t e r i a l being used to c o n s t r u c t i t ; namely the a r c h i t e c t u r e of the machine i n which the:program runs, and by the concern t h a t i t , too, should be co m p u t a t i o n a l l y f e a s i b l e t o run. In f a c t the. most one can do i s to s e t t l e upon some a r b i t r a r y design f o r the robot world based on some unstated c r i t e r i a of " n a t u r a l n e s s " and proceed with the design of the HaBackground Issues 44 c o n t r o l l i n g program. And when t h a t i s designed and buil t , ; how i s i t to be judged? Again, given an a r b i t r a r i l y designed simulated robot world t h i s i s * s t r i c t l y , an i m p o s s i b l e task s i n c e t h e r e i s nothing t o compare i t with. One has to r e l y on i n t u i t i v e n o t i o n s of " n a t u r a l n e s s " , " i n t e r e s t " , or "elegance". T h i s p o s i t i o n would be improved i f two o r more d i f f e r e n t designs f o r the o r g a n i s m - c o n t r o l l i n g program were b u i l t * f o r then at l e a s t an i n t e r - d e s i g n comparison could be made. Or even b e t t e r i f the simulated robot world could be s e r i o u s l y compared with an a c t u a l organism i n i t s n a t u r a l environment, as proposed above, f o r then the performance of the: c o n t r o l l e r c o u l d be compared with the behaviour of a r e a l organism* And f i n a l l y , even i f some i n t e r e s t i n g p r i n c i p l e s are uncovered i n the course of b u i l d i n g a whole s e r i e s of c o n t r o l l i n g programs f o r v a r i o u s simulated robot worlds, there i s always the p o s s i b i l i t y t h a t a q u a l i t a t i v e : d i s c o n t i n u i t y p r i n c i p l e i s at work which would say roughly t h a t the simulated robot worlds used are so much simpler than the whole human/environment system t h a t no i n t e r e s t i n g p r i n c i p l e t r u e at the l e v e l of complexity of the simulated robot worlds i s going t o c a r r y over to the h i g h l y complex human/environment system. In c o n c l u s i o n , the road t o knowledge v i a robot s i m u l a t i o n s t u d i e s i s strewn with methodological potholes; but the route i s obvious and promises t o l e a d t o new v i s t a s ! IlaBackground Issues 45 II.3 The c u r r e n t A l t r a d i t i o n f o r the design of planning and problem s o l v i n g - systems i s not e a s i l y adaptable to my purpose My r e s e a r c h i s , i n part, a r e a c t i o n a g a i n s t the u s u a l Al approach to the design of planning and problem-solving systems. T h i s approach i s so widespread t h a t i t may j u s t i f i a b l y be c a l l e d a t r a d i t i o n . Extending the terminology of iSloman,1971g, we c a l l i t the Freqean t r a d i t i o n . The s e r i e s of programs LT [Newell, Shaw, & Simon,1957] - GPS [Newell & Simon,1963] -BLOCKS [Winograd,1972 ] - STRIPS [ F i k e s , Hart, & N i l s s o n * 1972 ] -HACKER [ Sussman, 1975 i] - NOAH [ S a c e r d o t i , 1977 9 - EL [ Stallman S Sussman,1977] - DESI [ McDermott, 1 978 ] TMS [ Doyle , 1 978 i] e p i t o m i z e s t h i s t r a d i t i o n . . One's everyday behaviour i s i n t i m a t e l y r e l a t e d to one's ongoing p e r c e p t i o n and a c t i o n s , yet these systems say nothing about p e r c e p t i o n and only very l i t t l e about a c t i o n , i . e . . e x e c u t i n g a p l a n . , The purpose of t h i s s e c t i o n i s t o a m p l i f y and j u s t i f y t h i s complaint, suggest a remedy, and show why, t e m p o r a r i l y , I shun t h i s t r a d i t i o n . . II,3. J An exegesis of some Al p l a n n i n g and p r o b l e m - s o l v i n g systems LT, the l o g i c t h e o r i s t , was given the task of proving the f i r s t 52 theorems i n the P r i n c i p j a Mathematica- of Whitehead & R u s s e l l . A l l these are theorems i n the s e n t e n t i a l c a l c u l u s . , To generate subproblems i t used s u b s t i t u t i o n s , detachment* and IlaBackground Issues 46 forward and backward c h a i n i n g , and to reduce the search space s i z e i t used matching and s i m i l a r i t y t e s t s . I t proved 38 of the 52 theorems and f a i l e d on 14 . Most of these f a i l u r e s were due to time and space l i m i t a t i o n s . , LT i s , h i s t o r i c a l l y , very important i n A l . . The techniques i n t r o d u c e d i n LT are widely used i n A l and are i n c o r p o r a t e d i n t o most modern Al programming languages. I t s importance l i e s , however, not so much i n the techniques invented by Newell, Shaw, and Simon, - these are undeniably important t e c h n i c a l c o n t r i b u t i o n s - but r a t h e r i n the type of problem attempted, and i n the type of s o l u t i o n which was found acceptable* In Kuhnian terms, Newell* Shaw, and Simon e s t a b l i s h e d a paradigm which was f o l l o w e d by mainstream A l f o r the g r e a t e r part of a decade, and which s t i l l c a s t s a s i g n i f i c a n t shadow i n the c u r r e n t A l scene* . The f o l l o w i n g year [McCarthy,1 9 5 8 J p u b l i s h e d a proposal f o r an Advice Taker program. T h i s program was to be able to reason v e r b a l l y and be able to accept advice* To i l l u s t r a t e i t s f u n c t i o n i n g he considered the everyday type problem of c o n s t r u c t i n g a plan t o get from the desk i n one's home to the a i r p o r t . The b a s i c i d e a was t h a t f o r a program to be capable of l e a r n i n g something i t must f i r s t be capable of being t o l d i t . That may seem l i k e a r e s p e c t a b l e b a s i s , but there are reasons to b e l i e v e i t i s not q u i t e the r i g h t way t o develop an i n t e l l i g e n t system. One o f t e n becomes very competent at some s k i l l without being able t o express i t i n words or being able t o accept v e r b a l a d v i c e about i t . V e r b a l e x p r e s s i o n of a s k i l l comes a f t e r , not II«Background Issues 47 before, the ac q u i s i t i o n of competence at the s k i l l . To give a very personal example^ I have two daughters aged 6 and 8 who can now sk i p r o f i c i e n t l y - yet they have been t o l d , verbally, nothing about technique; t h e i r only instruction has consisted of having t h e i r hands held for several hours on beginners' slopes. The Advice Taker proposal influenced several l a t e r programs. The program of [ Black, 1964 3, the program QA3 of [ Green, 19 6 9 §, the MICROPLANNER language of [ Sussman, Winograd, & Charniak,1971J, and STRIPS a l l leaned heavily on the Advice Taker. Indeed the functioning of MICROPLANNER closely follows the outline on pp. 406-409 of [ McCarthy, 1 9583. GPS, another landmark in A r t i f i c i a l Intelligence [Newell and Simon,1963], i s a program whose design goal was to simulate human thought. It handled a variety of i n t e l l e c t u a l tasks, such as the missionaries and cannibals task, some integration problems, proving theorems in the f i r s t - o r d e r predicate calculus, and the monkey and bananas problem*. GPS deals with a task environment consisting of objects which can be transformed by various operators; i t detects differences between objects; and i t organizes the information about the task environment into goals. Each goal i s a c o l l e c t i o n of information that defines what constitutes goal attainment, makes available the various kinds of information relevant to attaining the:goal, and relates the information to other goals.. There are three types of goals: IIoBackground Issues 48 Transform o b j e c t A i n t o o b j e c t B, Reduce d i f f e r e n c e between o b j e c t A and o b j e c t B, Apply - operator Q to o b j e c t A. B a s i c a l l y , GPS achieved a goal by u s i n g a means-ends h e u r i s t i c to r e c u r s i v e l y set up subgoals whose attainment would l e a d to the attainment of the i n i t i a l g oal. . Meanwhile there was another l i n e of work emanating from s t u d i e s i n mathematical l o g i c . , The c o n t r i b u t i o n s from [Gilmore, 1960 ], [Prawitz,1960 ], [Davis,1963 ], and o t h e r s , a l l aimed to mechanize mathematics* T h i s e f f o r t was c o n s o l i d a t e d by the r e s o l u t i o n p r i n c i p l e of I Robinson, 1 965 i ] . At i t s s i m p l e s t , i n p r o p o s i t i o n a l l o g i c , the r e s o l u t i o n p r i n c i p l e says t h a t from the two c l a u s e s AvB and - I A V C one may deduce BvC. BvC i s c a l l e d the r e s o l v e n t of AvB and - i A v C . The f u l l r e s o l u t i o n p r i n c i p l e may be s u c c i n t l y d e s c r i b e d i n terms of t h i s example as f o l l o w s . G e n e r a l i z e i t by a l l o w i n g e x t r a d i s j u n c t i o n and p r e d i c a t e symbols and l i f t i t t o the f i r s t order p r e d i c a t e c a l c u l u s , so t h a t f r e e v a r i a b l e s may appear as arguments of the symbols A, B, C,.... Introduce a matching algorithm - known as u n i f i c a t i o n - to compute s u b s t i t u t i o n s f o r v a r i a b l e s such that the arguments of A i n the f i r s t c l a u s e become i d e n t i c a l with the arguments of A i n the second c l a u s e , i f t h i s i s p o s s i b l e . a t a l l . The r e s u l t i n g r u l e of deduction i s the r e s o l u t i o n p r i n c i p l e , and can be proved to be: complete f o r the f i r s t order p r e d i c a t e c a l c u l u s - t h a t i s , any provable w e l l formed formula (wff) can be deduced by s u f f i c i e n t l y many IIsBackground Issues 49 applications of the resolution p r i n c i p l e . The resolution p r i n c i p l e thus reduces mechanical theorem-proving to one rule of inference which subsumes, by the mathematically elegant u n i f i c a t i o n algorithm, the substitutions, matching, and s i m i l a r i t y tests of LT. However, there:remains considerable choice i n deciding what pair of clauses and what pair of predicate symbols (technically, l i t e r a l s ) to resolve together. The question of search strategy was studied by [Kowalski,1969].. He derived search strategies for resolution that generalized the A* algorithm of [Hart, Nilsson, & Raphael,19683, and stated conditions under which these strategies were admissible and optimal. However, his strategies are independent of the semantics of the clauses and l i t e r a l s under consideration* and conseguently the search space i s not s i g n i f i c a n t l y reduced despite the mathematical elegance of the strategies. Hopes of being able to control the: size of the search space rose when the programming languages MICRO-PLANNER, CONNIVER, and QA4 appeared. In these* i t i s possible to recommend that, i n trying to prove a wff of a certain type, other facts of ce r t a i n r e s t r i c t e d type should be t r i e d f i r s t . However t h i s f a c i l i t y does not* in general, s u f f i c i e n t l y reduce the search. [Reiter,1972J proposed the use of models i n theorem prover to help control the search, basing his approach on the geometry theorem proving machine of I Gelernter, 1959t]. ,. His proposal was to present to the theorem prover a model of the axiomatic system involved. In addition he proposed a set of HaBackground Issues 50 procedures for extracting information about the model when required by the theorem prover, and a f l e x i b l e , general, interface between such a semantic subsystem and the purely syntactic l o g i c a l system. So far, t h i s has not led to any s t a r t l i n g breakthrough. There s t i l l seems to be no generally accepted way of using semantics to control the size of the. search space in a theorem prover., In summary, the resolution p r i n c i p l e may be somewhat negatively characterized as elegantly exposing the combinatorial explosion which seems to be inherent in any straight-forward attempt to do mechanical mathematics based on Fregean formalisms. The frame - problem arises whenever a theorem prover i s used to reason about actions. This was f i r s t done by [Green,1969] i n the QA3 program, a resolution theorem prover. Suppose you have a system of axioms that describes a s i t u a t i o n i n the world - a world model - and perhaps have deduced some facts about t h i s s i t u a t i o n . . For example, i f A, B, and C are blocks, two axioms might be (ON A B) and (ON B C), and an obvious deduction i s (ABOVE A C ) . If the effect of an action i s modelled by changing the system of axioms then after the action one cannot be sure, formally, which of the previous deductions are s t i l l true and which are now f a l s e . One seems to need axioms saying that certain f a c t s remain unchanged when the effects of an action are modelled. This i s exactly what Green did. Every predicate had an extra argument position for a state-variable - a s i t u a t i o n a l fluent in the terminology of [McCarthy & Hayes,1969] - which II«Background Issues 51 assumed a new value whenever an action was executed in the world model; An action was modelled by at least two axioms. One axiom described the dire c t e f f e c t s of an action and the others said, loosely, that those axioms describing attributes of objects of the world model that are not d i r e c t l y affected by the action, are s t i l l true after the action* However, between the m u l t i p l i c i t y of axioms describing the world model, the axioms describing both the effects and non-effects of each action* and the inherent i n e f f i c i e n c i e s of a resolution theorem prover, QA3 was only able to handle the simplest of problems.. In any but the most t r i v i a l tasks, i t would be quickly overcome by the combinatorial explosion. Let us c a l l MICROPLANNEE, CONNIVER, and QA4 the procedural languages. They represent an advance over QA3 as follows._ They do not use state variables. In CONNIVER and QA4 each c o l l e c t i o n of axioms that describes a p a r t i c u l a r situation i n the world i s maintained as a context, and whenever the e f f e c t s of an action are modelled, a new context i s sprouted from the old*. So far, the only devices used for modellinq the effects of an action -in other words, for sprouting a new context - have been the addition and deletion of facts (axioms) from a context, even though more powerful methods are available i n the procedural languages. STRIPS [Fikes and Nilsson* 1971g can be described as the successful marriage of GPS and the theorem proving approach. The problem space consists of an i n i t i a l world model, a set of HaBackground Issues 52 operators which affect the world model, and a goal statement. STRIPS attempts to f i n d a sequence of operators which w i l l transform the i n i t i a l world model into a model in which the goal statement i s true. A world model i s represented as a set of wffs in the f i r s t - o r d e r predicate calculus* In the robot problems to which STRIPS was i n i t i a l l y applied, an operator corresponds to an action routine whose execution causes changes in the surrounding r e a l world. An operator consists of a precondition wff, which must be s a t i s f i e d in a world model for the operator to be applicable, and a function which describes how the world model i s to be changed when the operator i s applied. This function i s specified by two l i s t s , the add l i s t and the delete l i s t . The e f f e c t of applying an applicable operator to a given world model i s to delete from the model a l l those clauses s p e c i f i e d by the delete l i s t and to add a l l those clauses s p e c i f i e d by the add l i s t . , STRIPS begins by applying a resolution theorem prover to attempt to prove that the goal wff GO follows from the i n i t i a l world model MO. If the proof succeeds then GO i s t r i v i a l l y true i n the i n i t a l world model. Otherwise the uncompleted proof i s taken to be the "difference" between MO and GO. Next, operators that might be relevant to "reducing" t h i s difference are sought. These are the . operators whose effects on world models would allow the proof to continue. The precondition wffs of the relevant operators are then taken to be new subgoals, and STRIPS i s applied recursively to these. A search strategy i s used to !!•Background Issues 53 control the order i n which relevant operators are applied. STRIPS terminates when a sequence of operators has been found which transforms MO into a world model in which GO i s true. STRIPS was l a t e r extended by storing generalized plans in a tri a n g l e table format { Fikes, Hart, Nilsson, 1972 [J. . This was used in two ways: to allow similar problems to be. solved without re-planning, and to as s i s t in monitoring the progress of the robot in the course of executing the plan. in i n t e r e s t i n g guestion arises concerning the a b i l i t i e s of STRIPS. There are problems STRIPS can solve and there are very s i m i l a r problems STRIPS cannot solve; at the.same time STRIPS has a perspicuous structure. This naturally suggests the question: i s there an intere s t i n g and useful way to characterize those problems - world model plus goal wff - actually solvable by STRIPS? HACKER [Sussman,1975J i s also concerned with producing plans but works by a process of debugging almost right plans, or s k i l l a c q u i s i t i o n . . HACKER i s endowed with several databases of assertions. One contains a l l the BLOCKS world knowledge required i n the course of solving a BLOCKS type problem, while others contain information about programming techniques, types of bugs, types of patches for bugs, and techniques for summarizing bugs. HACKER starts with a dumb i n i t i a l t r i a l procedure for the task. The t r i a l procedure executes, and i f i t f a i l s a "process model" of the state of the computation at the point of f a i l u r e i s constructed. HACKER then examines t h i s to IIoBackground Issues 54 d i s c o v e r why the procedure. f a i l e d . That i s t o say, HACKER attempts t o c l a s s i f y the bug i n t o one of s e v e r a l known types. I f the attempt i s s u c c e s s f u l then HACKER*s b u i l t - i n knowledge about bug-types i s used t o propose a m o d i f i c a t i o n to the t r i a l procedure; The process of " t r i a l and patch bug" i s then repeated, i t e r a t i v e l y * u n t i l a s a t i s f a c t o r y procedure i s obtained. I f an attempt to c l a s s i f y a bug f a i l s , then HACKER b a s i c a l l y r e s i g n s ; Otherwise, HACKER ends with a f u l l y debugged procedure t h a t can s u c c e s s f u l l y s o l v e any of a c e r t a i n g e n e r a l c l a s s o f b l o c k s world t a s k s . Loosely speaking, HACKER compiles a procedure from a database of a l l the necessary f a c t s and advice. The important c o n t r i b u t i o n of HACKER was not i t s p l a n n i n g a b i l i t y - i t wasn't good - nor even i t s l e a r n i n g a b i l i t y - which was of a d i s t i n c t l y new type - but the t e c h n i c a l i d e a of r e t a i n i n g the reasons why a c e r t a i n a c t i o n was performed or why a new piece o f code was added t o a procedure.. T h i s i s the id e a u n d e r l y i n g the dependency-directed b a c k - t r a c k i n g of the system EL of [ Stallman & Sussman,1977], and was developed f u r t h e r i n the TMS system of [Doyle,1978J. Ne i t h e r STRIPS nor HACKER cou l d o b t a i n the op t i m a l s o l u t i o n to the f o l l o w i n g problem i n the BLOCKS world.. There i s a t a b l e t o p and three blocks A, B, C. A and B r e s t on the t a b l e and C l i e s on A, The goal i s to b u i l d a tower A on B on C, with C on the t a b l e . These systems f a i l because the goal i s s t a t e d as (AND (ON A B) (ON B C) ) , and both STRIPS and HACKER proceed IIoBackground Issues 55 to attack each subgoal independently. Achieving either of the ON subgoals i n t e r f e r e s with achieving the other; If you f i r s t put A on B r you can't put B on C; i f you f i r s t put B on C (which is on A), you can't put A on B. This i s an example of inte r a c t i n g subgoals; [Sacerdoti * 1 9 7 5 J r [Tate r 1 975 ], and [Warren,1975 ] a l l wrote systems to handle such problems; I w i l l b r i e f l y sketch NOAH, Sacerdoti's system.. NOAH builds a network of goals and subgoals* represented as a procedural network. The subgoals reguired to achieve a goal are stored in a p a r t i a l order; a temporal order i s imposed only when necessary to resolve a c o n f l i c t between brother subgoals., NOAH constructs a plan to achieve a goal i n a layered fashion by expanding one subgoal at a time* keeping a careful watch for possible interactions, u n t i l primitive actions are reached* In t h i s way a f u l l y detailed plan i s constructed before execution begins; errors are handled by re-planning to achieve the f a i l e d subgoal and patching the new plan into the o r i g i n a l procedural net. To summarize: NOAH i s a very elegant system which represents a current peak i n the technology of planning systems for a BLOCKS type world* II*3.2 Cr i t i c i s m s of - the Fregean t r a d i t i o n - in planning and problem-solving The AI t r a d i t i o n , based upon Fregean formalisms, can be c r i t i c i s e d on two le v e l s : one i s purely technical, the other i s philosophical.. On the technical l e v e l there are at least three II"Background Issues 56 c r i t i c i s m s . F i r s t , there i s the d i f f i c u l t y encountered i n reasoning about a c t i o n s * T h i s i s the frame problem, d e s c r i b e d p r e v i o u s l y . . Second, there i s the d i f f i c u l t y encountered i n h a n d l i n g a c o n t i n u a l incoming stream of p o s s i b l y c o n t r a d i c t o r y f a c t s , an a b i l i t y r e q u i r e d of any organism that r e c e i v e s sensory i n p u t from a changing o u t s i d e world. T h i s might well be termed the accommodation problem: how to accommodate a database of axioms to an incoming stream of evidence about the p e r p e t u a l l y changing o u t s i d e world. T h i r d , there i s no known semantics f o r a changing database of axioms - T a r s k i - K r i p k e : semantics o n l y apply t o s t a t i c axiom systems* In a d d i t i o n * i f one i s i n t e r e s t e d i n reasoning about the n a t u r a l numbers which i s presumably the case i f one i s t r y i n g to automate mathematics --i t would be w e l l to r e c a l l the well-known f a c t t h a t no Fregean formal system can f u l l y capture the concept of the n a t u r a l numbers. L a s t l y , t h e r e are many d i f f i c u l t i e s encountered i n t r y i n g t o reason about causes, a b i l i t i e s * and knowledge about knowledge i n a Fregean formalism. On a more p h i l o s o p h i c a l l e v e l , the act of w r i t i n g down a Fregean formula i m p l i e s an attempt t o capture a t i m e l e s s , a c t i o n l e s s aspect of the world; yet i n Al one i s above a l l concerned with a c t i o n and change., I t ' s as though the "dimension" of a Fregean formula i s of the wrong type f o r the problem being t a c k l e d - j u s t as i n p h y s i c s , dimension theory demands t h a t the dimension type of a formula match the dimension type of the phenomenon d e s c r i b e d by the formula. IlnBackground Issues 57 At t h i s point I must c a l l a halt. A continuation of this l i n e of argument leads to deeper waters 3 than I care to enter at t h i s point, and, to do i t j u s t i c e , would take.far more space and time than can be afforded i n t h i s thesis. In developing a robot-controller one i s , primarily, concerned with reasoning about actions and with continually accommodating the world model to the sensory input stream of evidence; secondarily one desires computationally e f f i c i e n t , or at least tractable, algorithms for carrying out these processes. Throughout the exegesis I pointed out that, i n e f f e c t , the combinatorial explosion has not been brought under control. For some sp e c i a l proof procedures, "Cook & Reckow, 1974 ij and [Tseitin,1968J have given t h i s a more precise statement. Without introducing any special terminology, t h e i r r e s u l t theorem 10 i n J.Cook & Reckow, 1974 ] - can be re-stated as follows: For i n f i n i t e l y many n, there exists a theorem with n clauses for which the number of steps in i t s shortest proof i s at l e a s t exponential i n (log(n) squared). Thus one may conclude that the evidence, so f a r , from studies of complexity suqgests that the computational reguirements of ^Because i t leads to the conclusion that the metaphysics of Platonism, as found in the philosophical t r a d i t i o n which s t a r t s with Plato and continues with Descartes, Kant* Frege, Russell, and modern analytic philosophers, i s suspect. A new metaphysics can be based on the notion of "process" as i n Whitehead's Process and r e a l i t y : This i s part of another great t r a d i t i o n , largely ignored by modern philosophers, which can be traced from A r i s t o t l e through medieval philosophers to Bergson, Whitehead, Husserl, and others. II«Background Issues 58 resolution theorem-proving are of an intractable nature. There i s , however, an important open problem here. As already mentioned, i Kowalski, 1969 jj derived h e u r i s t i c search algorithms for theorem-proving that were generalizations of A*. But [ Mart e l l i , 19771] analyzed the worst case behaviour of A*, found i t was 2**n, and replaced A* by a new algorithm B whose worst case behaviour was n**2, a s i g n i f i c a n t improvement; The obvious open question i s : can M a r t e l l i ' s analysis and improvement of A* be carried over to Kowalski's search algorithms? In conclusion, I hope that the knowledgeable reader has some notion of why I f e e l that the Fregean t r a d i t i o n in Al planning and problem-solving systems i s , perhaps, on the wrong tracks, and consequently can understand why, in my research, I have chosen to take another approach. II.4 A survey of closely related topics -The purpose of t h i s section i s to provide a f a i r l y comprehensive survey of closely related work, and a b r i e f description of two related topics, namely imagery and behavioural theories.. I s t a r t with the l i t e r a t u r e on analyses and simulations of organisms. There are many such studies, a l l more or less independent, and each with i t s own particular orientation. I have t r i e d to c l a s s i f y them according to their emphasis, but no IIoBackground Issues 59 mutually exclusive c l a s s i f i c a t i o n seems possible. The headings I have chosen are: • functioning robot simulations; • analyses of simple organisms, without simulation; * studies based on animal behaviour; • applications of decision theory; • cognitive maps. The in c l u s i o n of cognitive maps here may seem a l i t t l e out of place, but a moment's consideration* of the fac t that a l l such studies are concerned with how an animal or man finds i t s way around i t s environment, shows that i t i s quite appropriate. I then proceed to the .lit e r a t u r e on s p a t i a l representation and reasoning* This f a l l s e a s i l y i n t o two c l a s s i f i c a t i o n s : • s p a t i a l planners conceived as p o t e n t i a l tools for architects and others; • systems for simulating the motion of r i g i d bodies. There i s , i n addition, one published system f o r path-finding [ Thomson, 1977i], which I do not include here since i t i s more appropriately covered in my section V.I on path-finding. Similarly I do not review the l i t e r a t u r e on the skeleton here since that i s done in section V. 1. Ii*4.1 Previous robot simulations [Nilsson & Raphael, 19671] simulated a robot and i t s environment i n order to study the key problems i n designing and II«Background Issues 60 c o n t r o l l i n g a robot. T h e i r l a t e r design of Shakey, the SHI robot, was based on t h i s p r e l i m i n a r y e x p l o r a t i o n . T h e i r simulated robot r e s i d e s on an a r b i t r a r i l y l a r g e checkerboard c o n t a i n i n g both movable and nonmovable o b j e c t s . . The robot can move forward, turn r i g h t or l e f t , and sense when i t "bumps i n t o " an o b j e c t . , I t s t o r e s i n f o r m a t i o n about the: l o c a t i o n and p r o p e r t i e s of o b j e c t s i n i t s environment and uses i t s sensory i n p u t s t o e s t a b l i s h , c o r r e c t , or update t h i s i n f o r m a t i o n . The robot can make s p e c i f i e d changes to i t s environment by pushing the a p p r o p r i a t e movable o b j e c t s . The design of the simulated system c o n t a i n e d s e v e r a l important b a s i c f e a t u r e s t h a t any r e a l robot i n a much r i c h e r environment would need. These i n c l u d e the robot's model of i t s environment, a p r o b l e m - s p e c i f i c a t i o n language f o r communicating with the robot, a h e u r i s t i c problem-solving program, and a robot executive program f o r o v e r a l l c o n t r o l . The t a s k s c o n s i s t e d of "goto" and "pushto" problems. Plans to solve these tasks were c o n s t r u c t e d by using Moore's maze-solving a l g o r i t h m on the a r r a y of l o c a t i o n s . The robot could sense the contents of the square immediately i n f r o n t of i t , and use t h i s to c o r r e c t the world model* Of the p u b l i s h e d s t u d i e s t h a t I know of, t h e i r s i s the c l o s e s t t o mine i n terms of o v e r a l l aims and design.. However, my simulated world, Utak's sensory equipment, and Utak's r o b o t - c o n t r o l l e r are a l l more: s o p h i s t i c a t e d than the corresponding p a r t s o f t h e i r system* II^Background Issues 61 Becker and Merriam ([ Becker, 1972 ], [Becker & Merriam,1973], I Merriam, 1975 fj) simulated a robot cart in a two dimensional world which used a sophisticated eye with a fovea to pick up information about i t s surroundings. I n i t i a l l y a c i t y street environment was used but subsequently a "Martian" landscape was used. This eye could either gather coarse information from a large area or could "zoom" down and obtain detailed information from a small area, and could change i t s focal point. Thus the eye could be used for two c o n f l i c t i n g tasks: keeping a ' lookout for new objects, and focussing down on one.object to get more detailed information.. This c o n f l i c t was resolved by the eye-controlling program which took into account such factors as drive, salience of an object, progress, e f f o r t . . . , and which produced a natural-looking scan path when looking at a street scene. The design of the eye-controlling program was unfortunately not specified. The eye could also track a fixed object when the robot moved* The l a t e r simulation of the environment took into acount the f i n i t e size of the robot chassis and simulated the visu a l occlusion of, for instance, Martian h i l l s by Martian mountains. A long term memory was used which stored no s p a t i a l information. Theirs i s a more sophisticated simulation of the world and a di f f e r e n t eye, but no design of the robot executive* or report of the simulated robot executing a goto or pushto task, appears to have been published. IlaBackground Issues 62 II.4.2 Three analyses of simple organisms Each of these analyses approach the behaviour of an organism from a d i s t i n c t point of view.. Simon's paper i s a game theoretic analysis of the s u r v i v a l of an organism in an environment in which he derives one equation r e l a t i n g organism to environment; Toda's paper i s i n the same vein but uses decision theory; while Becker i s concerned with the structure of a representation for external events and how t h i s structure should develop over time. [Simon,1956] considered a s i m p l i f i e d organism with c i r c u l a r v i s i o n , with a single need - food - and only three kinds of a c t i v i t y : resting, exploration, and obtaining food. It has to survive on a plane with iso l a t e d point sources of food* He derived an equation showinq how the chances of survival of the organism depended on four parameters, two describinq the environment and two describinq the orqanism, assuming the organism behaved in the obvious " r a t i o n a l " way.„ Thus he found that an organism in i t s natural environment requires only very simple perceptual and choice mechanisms to s a t i s f y i t s several needs and to assure a high probability of i t s survival over extended periods of time. He also showed how multiple qoals could be. s a t i s f i e d with a very simple choice mechanism. This analysis was achieved without the use of u t i l i t y functions as in decision theory. Simon's analysis cast serious doubts upon the usefulness of then current economic and s t a t i s t i c a l theories of r a t i o n a l behaviour as bases for explaining the c h a r a c t e r i s t i c s IIoBackground Issues 63 of human and other organismic r a t i o n a l i t y . . (And from t h i s d i s s a t i s f a c t i o n sprang f o r t h LT & GPS?) As a device to u n i f y the v a r i o u s ways i n which psychology views man ( p e r c e p t i o n , l e a r n i n g , m o t i v a t i o n , emotion, . . . ) , [Toda , 196 2J s t u d i e d the design of a s o l i t a r y robot on a d i s t a n t p l a n e t . The r o b o t ' s job i s to c o l l e c t uranium randomly d i s t r i b u t e d on the s u r f a c e , and the robot o b t a i n s energy from e a t i n g a c e r t a i n fungus that grows at random l o c a t i o n s on the s u r f a c e * The b o d i l y design* p e r c e i v i n g program, and c h o i c e program were a l l considered. The c h o i c e program has to choose what d i r e c t i o n to t r a v e l i n at each moment* , Extending Simon's approach, a d e c i s i o n - t h e o r e t i c a n a l y s i s based on maximizing the amount of uranium c o l l e c t e d i s given and a c h o i c e s t r a t e g y s p e c i f i e d . The e f f e c t of o b s t a c l e s on the c h o i c e s t r a t e g y and how v a r i o u s approximations c o u l d reduce the computational e f f o r t r e q u i r e d are a l s o c o n s i d e r e d . The robot uses no s t o r e d r e p r e s e n t a t i o n of the environment. [Becker, 1973 ] analyzed a simple robot world i n what I c a l l "Baconian" terms. The robot observes events as they happen and then t r i e s t o induce, i n t r u e Baconian s t y l e , r e p r e s e n t a t i o n s to p r e d i c t such events i n the f u t u r e , . (My system may be s a i d to f u n c t i o n i n "Popperian" style.), He proposed a r e p r e s e n t a t i o n and a system of processes by which the robot c o u l d s t o r e and manipulate the experience i t gained through i n t e r a c t i n g with i t s environment.. The world c o n s i s t s of a smooth s h e l f on which c o l o u r e d b l o c k s may be placed and manipulated, a simple movable li«Background Issues 64 square eye with 9 square r e t i n a l f i e l d s , and a hand t h a t appears i n the eye as a 1 X 1 red square. . The world obeys the laws o f p h y s i c s . A h i s t o r y i s kept of motor commands and of query commands with t h e i r sensory answers. From t h i s h i s t o r i c a l r e c o r d the robot t r i e s t o induce a s e m a n t i c - n e t - l i k e r e p r e s e n t a t i o n , which i t uses to p r e d i c t the outcome of f u t u r e a c t i o n s . Becker's approach i s based on one simple i d e a : t h a t i f B fo l l o w e d A i n the past, an orqanism should remember t h a t f a c t , so t h a t the organism can expect B t o f o l l o w A i n the f u t u r e . Becker's approach i s very i n t e r e s t i n g not because i t succeeds, but because i t c l e a r l y i l l u s t r a t e s the d i f f i c u l t i e s a s s o c i a t e d with a Baconian approach* These appear r i g h t a t the s t a r t of h i s a n a l y s i s . F i r s t , given the c o n t i n u a l stream o f k e r n e l s (motor commands and sensory i n p u t ) , there i s the problem of d e c i d i n g which k e r n e l s are s i g n i f i c a n t . I f t h i s d e c i s i o n i s attempted a t too low a l e v e l of r e p r e s e n t a t i o n , as, I c l a i m , Becker does, i t ends up being based on g u i t e a r b i t r a r y c r i t e r i a . (Just as a h y p o t h e t i c a l Baconian s c i e n t i s t could make a m i l l i o n o b s e r v a t i o n s i n a s i t u a t i o n , but s i n c e t h a t i s not f e a s i b l e , must decide somehow which ones are of i n t e r e s t . ) Second, supposing a s i g n i f i c a n t k e r n e l has been chosen, there i s the problem of d e c i d i n g how many nearby k e r n e l s may have a c a u s a l r e l a t i o n to the chosen one and should t h e r e f o r e be s t o r e d as p a r t of t h i s 'event'. What i f two c a u s a l l y r e l a t e d k e r n e l s are separated by l a r g e periods of time, as might occur i n o b j e c t II«Background Issues 65 o c c l u s i o n problems? Becker has no s a t i s f a c t o r y s o l u t i o n to t h i s problem, which might be termed a 'windowing' problem. T h i r d , s e v e r a l numerical s c a l e s are i n t r o d u c e d and manipulated on an ad hoc b a s i s to provide measures of c r i t i c a l i t y , c o n f i d e n c e , c o s t e t c . , which are used t o enable r u l e s (derived from events) to be g e n e r a l i z e d , or d i f f e r e n t i a t e d i n t o d i s t i n c t s u b r u l e s . These apparently a r b i t r a r y numerical s c a l e s are a very u n s a t i s f a c t o r y f e a t u r e ; In sum, a very i n t e r e s t i n g proposal, but mainly f o r i t s f a u l t s and not f o r i t s successes. I I . 4._3 S i m u l a t i o n s based on animal - behaviour [Ludlow,1976J d e s c r i b e s a model animal which was designed t o s i m u l a t e aphid behaviour. T h i s model i s only concerned with a l t e r n a t i o n s between s e v e r a l d i f f e r e n t types of behaviour, e.g. walking, f e e d i n g , probing, f l y i n g , wingspreading. The model i s based on the concepts of c e n t r e s , d r i v e s , and r e c i p r o c a l i n h i b i t i o n between c e n t r e s . . For each a c t i v i t y t h e r e i s a separate centre* The c e n t r e s i n h i b i t each other. When a p a r t i c u l a r c e n t r e i s a c t i v e the i n h i b i t i o n from i t i s s u f f i c i e n t l y strong t o suppress an e q u a l l y s t i m u l a t e d r i v a l ; but the c e n t r e f a t i g u e s ; . In such a system only one c e n t r e i s a c t i v e at a time (although i t i s p o s s i b l e f o r s e v e r a l c e n t r e s to be a c t i v e c o n c u r r e n t l y , such a c o n f i g u r a t i o n i s u n s t a b l e ) . . The system e x h i b i t s h y s t e r e s i s : once an a c t i v i t y i s s t a r t e d i t w i l l p e r s i s t f o r a p e r i o d even when the d r i v e l e v e l necessary to IlaBackground Issues 66 e l i c i t the a c t i v i t y has been reduced by the performance.. This would seem to be a necessary feature of any organism which can execute many d i f f e r e n t behaviours, to prevent thrashing. This approach might usefully be incorporated i n an AI system c o n t r o l l i n g several d i f f e r e n t behaviours. [Friedman,1967J analyzes and extends the Lorenz - Tinbergen theory of i n s t i n c t i v e animal behaviour by adding "Selection of Releaser Mechanisms" to the executive control hierarchy. The computer simulation of a small animal (ADROIT) that moves i n a plane with a small number of c i r c u l a r obstacles was programmed, with a control program designed along the l i n e s of the afore-mentioned theory, . ADROIT avoids obstacles when en route to a goal by reading the angles and ranges to the edges of cylinders. The structure of the "Behavioural Unit" to carry out a "go to" command was exhibited. No representation of the world was involved. [Arbib & L i e b l i c h , 19771] are concerned to bridge the gap between human memory studies and the psychological l i t e r a t u r e on animal learning and conditioning.. The major reason for the huge research e f f o r t on animal behaviour has been the Thorndike -Pavlov - Bitterman theory that the underlying processes of learning are the same i n a l l animals, including man [ Bitterman, 1975 ]; consequently th i s i s an important direction of research.. They propose a theory of how an orqanism couples i t s memory structure to i t s s p e c i f i c action routines so that i t may operate in i t s s p a t i a l environment in an i n t e l l i g e n t manner. II»Background Issues 67 They adopt a world model i n the form of a graph with nodes c o n t a i n i n g d r i v e - r e l a t e d i n f o r m a t i o n and edges c o n t a i n i n g sensorimotor f e a t u r e s . The theory s p e c i f i e s the general d r i v e dynamics, the way i n which the world model i s updated, and the way i n which the r a t decides where t o move next i n the world. T h e i r theory e x p l a i n s some experimental r e s u l t s t h a t r e l a t e r a t l e a r n i n g and s p a t i a l behaviour* •LI'H'H Robot -simulations based - on d e c i s i o n - theory [Jacobs & K i e f e r , 1 9 7 3 ] c o n s i d e r t h e . decision-making component of a robot that operates i n a po o r l y known environment, where each a c t i o n may have many p o s s i b l e outcomes. An approach based on maximizing the expected u t i l i t y r e s u l t i n g from each d e c i s i o n i s developed. The d e c i s i o n to execute a p a r t i c u l a r a c t i o n i s viewed as a move i n a game a g a i n s t the environment; the outcome of an a c t i o n i s the environment's move i n the game* The estimated u t i l i t y of a d e c i s i o n i s eval u a t e d by backing up from the t e r m i n a l stages of a plan, using the f a c t t h a t the u t i l i t y assigned to a set of u n c e r t a i n outcomes i s the expected value of t h e i r u t i l i t i e s . The d e c i s i o n t h a t maximizes the expected u t i l i t y i s chosen, This approach i s used to c o n t r o l a simulated i n s e c t - l i k e robot which seeks food, c o l l e c t s m a t e r i a l f o r a nest, and may be stung by an enemy. The rob o t ' s task i s t o b u i l d a nest. The task i s not e x p l i c i t l y r epresented to the robot but i s s p e c i f i e d through the u t i l i t y f u n c t i o n s f o r e a t i n g , adding m a t e r i a l t o the nest, f i n d i n g m a t e r i a l , and being IlaBackground Issues 68 stung. L i k e w i s e , e a t i n g i s not represented as a goal except through i t s u t i l i t y f u n c t i o n and i n f a c t with the u t i l i t y used e a t i n g w i l l never occur i f the time s i n c e the p r e v i o u s meal ever exceeds a c e r t a i n bound - so the poor robot w i l l s t a r v e . However, the (negative) g o a l of s t a r v a t i o n i s not represented e i t h e r . No s t o r e d r e p r e s e n t a t i o n of the environment i s used. [ C o l e s et a l . , 19753 and [Feldman & S p r o u l l , 19771] apply d e c i s i o n theory to symbolic problem s o l v i n g . . T h e i r r e s p e c t i v e examples are e s s e n t i a l l y e q u i v a l e n t and can be s t a t e d as a modified v e r s i o n of the monkey and bananas problem. In t h i s v e r s i o n s e v e r a l boxes are a v a i l a b l e to be pushed under the bananas but not a l l are s u i t a b l e , and the monkey i s provided with a device f o r sensinq " s u i t a b i l i t y " from a d i s t a n c e . U n f o r t u n a t e l y the device i s not r e l i a b l e and may give f a l s e p o s i t i v e and f a l s e negative answers. A l l the a c t i o n s of the monkey - walking* pushing, c l i m b i n g , sensing s u i t a b i l i t y - have energy c o s t s . The technigues of d e c i s i o n theory are used to f i n d the best s o l u t i o n s t r a t e g y , using a u t i l i t y f u n c t i o n d e f i n e d i n terms of energy c o s t . The u t i l i t y f u n c t i o n i s used to r e v e a l t r a d e o f f s among v a r i o u s s t r a t e g i e s f o r a c h i e v i n g v a r i o u s g o a l s , t a k i n g i n t o account such f a c t o r s as r e l i a b i l i t y , the complexity of steps i n the s t r a t e g y , and the value of the g o a l . It i s a l s o used t o formulate s o l u t i o n s t o the problems of how to a c g u i r e a world model, how much plann i n g e f f o r t i s worthwhile, and whether v e r i f i c a t i o n t e s t s should be performed. Feldman & S p r o u l l d i s c u s s many other p o s s i b l e a p p l i c a t i o n s of IIsBackground Issues 69 decision theory i n robot problem solvers. Feldman and Sproull's paper supports their claim that "a combination of decision-theoretic and symbolic a r t i f i c i a l i n t e l l i g e n c e paradigms offers advantages not available to either i n d i v i d u a l l y " . However, although I can't yet pinpoint i t exactly, I confess to a gueasy fe e l i n g when applying p r o b a b i l i t y theory to symbolic reasoning. The basic d e f i n i t i o n of the theory i s the pro b a b i l i t y of an event, defined as "the l i m i t i n g value of the r e l a t i v e frequency of occurrence of the event i n a long sequence of observations of randomly selected situations in which the event may occur" [ Parzen, 1960 i]. . Philosophically t h i s i s very unsatisfactory.. Bayes' theorem, an important r u l e : f o r computing conditional p r o b a b i l i t i e s , i s even more unsatisfactory.. The task of c l e a r l y delineating these d i f f i c u l t i e s and proposing a new d e f i n i t i o n of probability i s beyond the scope of t h i s thesis. A l l that can be said i s that there are many inklings around, and in chapter IV I w i l l give some indication of the d i r e c t i o n required* These simulations serve to confirm Simon's conclusion that t r a d i t i o n a l decision theory i s not appropriate to the analysis of behavioural systems. I I . 4. 5_ Cognitive maps A t r a d i t i o n a l f i e l d of psychology i s concerned with cognitive maps ([ Trowbridge , 1913 ], [ Tolman, 1948 ], [Moore & IIsBackground Issues 70 Golledge, 1976 ], j_ Kuipers, 19781]) . A person's cognitive map i s the knowledge a person has about the s p a t i a l structure of large-scale space. Thus the topic of cognitive:maps i s relevant to my work. The functions of a cognitive map are to assimilate new information about the environment, to represent one's current position, and to answer route-finding and r e l a t i v e - p o s i t i o n problems.. It i s b u i l t up from observations made:as one trave l s through the environment. [Kuipers, 1978 ] presents a computational model (the TOUR model) of the cognitive map that uses multiple (5) representations for the cognitive map, and builds up knowledge by observations and by interactions between the separate representations. Whereas TODR gains new knowledge by discrete observations at a small number of fixed places, Utak gains new knowledge by receiving a new r e t i n a l impression at a new position and resolving the differences between the actual impression and the predicted r e t i n a l impression by modifying the hypothesized shape of the environment* Utak's skeleton of the environmental empty space i s very s i m i l a r to Kuiper's cognitive map when regarded as a network of routes. Whereas TOUR i s only concerned with c i t y - s t r e e t networks and not at a l l with shape, PPA e x p l i c i t l y represents the two dimensional shape of the environmental space. In sum, Kuiper's work i s somewhat complementary to mine. IIsBackground Issues 71 I I . 4 . 6 S p a t i a l p l a n n i n g systems [ Eastman, 1973 i] reviews c u r r e n t programs and d e s c r i b e s a new program, GSP, f o r s o l v i n g two dimensional s p a t i a l arrangement t a s k s . Given a space S (e.g. a l a r g e r e c t a n g u l a r room), s e v e r a l s m a l l e r r e c t a n g u l a r design u n i t s (DOs) (e.g. the p a r t s of a computer), and s e v e r a l S - r e l a t i o n s between the DDs (e.g..an edge-adjacency reguirement or a s i g h t - l i n e reguirement f o r the op e r a t o r ' s desk), the problem i s to f i n d an arrangement of the DUs i n the space S which s a t i s f i e s a l l the S - r e l a t i o n s . The o v e r a l l design of GSP i s as a b a c k t r a c k i n g d e p t h - f i r s t search. V a r i o u s h e u r i s t i c s are d e s c r i b e d which improve the se a r c h , d e r i v e d from the S - r e l a t i o n s . An important p a r t of GSP i s the l o c a t i o n proposer which, when given an arrangement of some of the DDs i n S, proposes l o c a t i o n s f o r a new DU which are c o n s i s t e n t with the arrangement a l r e a d y made; Only arrangements i n which the s i d e s of the DUs are a l i g n e d with the s i d e s of S are c o n s i d e r e d . f P f e f f erkorn, 1975 |J d e s c r i b e d another s p a t i a l planner, DPS, which r e l a x e d the r e s t r i c t i o n t h a t a l l shapes b e : r e c t a n g u l a r by a l l o w i n g non-convex polygonal shapes, and which allowed a new type of s p a t i a l c o n s t r a i n t on an arrangement: a path c o n s t r a i n t , which says t h a t a l l the empty space i n the arrangement must be connected. DPS uses a r e p r e s e n t a t i o n of space occupancy of an arrangement i n which convex polygons are the p r i m i t i v e s ; Some are marked empty and some are marked occupied. These convex IlnBackground Issues 72 polygons are c a l l e d space blocks. Each space block i s in turn represented as a set of sides, and each side as a set of points. When a new shape i s added to an arrangement every space block intersected by a side of the new shape i s broken into two separate space blocks and the occupancy marked accordingly. The location proposer e s s e n t i a l l y proposes a l l the corners of empty space blocks. . As i n GSP the constraints are used to guide- the search* . Both systems explore a search tree of space . layouts where the branching factor at each node i s controlled by the location proposer and by other h e u r i s t i c s which decide i n what order to try f i t t i n g new shapes.. The primitive shape concept used i s a convex polygon represented as a l i s t of boundary points. Their main f a u l t from my point of view i s that these systems are concerned only with object placement, not with path-finding or object moving,. I I . 4 . 7 Systems for simulating the motion of r i g i d objects [Baker,1973 J , d i s s a t i f i e d with conventional methods for s p a t i a l simulation, desired one i n which the s p a t i a l relationships of points were e x p l i c i t . . To t h i s end he presented the design of an i t e r a t i v e array of logic c i r c u i t s which could simulate the continuous r i g i d t r a n slation or rotation of arbitrary shapes, and implemented a simulation of t h i s array. The system consists of a rectangular array of l o g i c a l c i r c u i t s , II«Background Issues 73 each r e p r e s e n t i n g a u n i t square. Each c i r c u i t has a l o c a l c o o r d i n a t e system to keep t r a c k of a s i n g l e p o i n t as i t c r o s s e s the square. I t s path may be a s t r a i g h t l i n e or a c i r c u l a r a r c . On reachi n g the s i d e of a square, c o n t r o l and modified l o c a l c o o r d i n a t e s of the point are passed t o the neighbouring square. An o b j e c t i s represented as a c o l l e c t i o n of p o i n t s (where f o r t e c h n i c a l reasons the minimum d i s t a n c e between p o i n t s must be gr e a t e r than the square r o o t of 2 (root2)) , and i t s motion simulated by f o l l o w i n g the paths of a l l the c o n s t i t u e n t p o i n t s . The system was not developed t o handle c o l l i s i o n s . „ [Funt,1976] argues that a computer program can d e r i v e b e n e f i t s from the use of analogues i n the same way th a t people do.. To t h i s end, he implemented a system WHISPER.. The purpose of t h i s system was t o s o l v e two dimensional blocks world s t a b i l i t y problems by the use of a s o - c a l l e d analogue. I w i l l not comment on h i s arguments concerning the:use of analogues; from my p o i n t of view WHISPER was intended to be a performance system f o r s i m u l a t i n g r i g i d o b j e c t motion under the i n f l u e n c e of g r a v i t y . The input t o WHISPER i s a two dimensional a r r a y of c o l o r e d squares on which the s i d e view of a c o n f i g u r a t i o n of d i s t i n c t l y c o l o u r e d , a r b i t r a r i l y shaped, b l o c k s has been drawn. T y p i c a l l y the corresponding r e a l world s i t u a t i o n c o n t a i n s many i n s t a b i l i t i e s and under the i n f l u e n c e of g r a v i t y would immediately c o l l a p s e , i n a f l u r r y of block motions and i n t e r a c t i o n s : r o t a t i o n , c o l l i s i o n , s l i d i n g , and f r e e f a l l * II»Background Issues 74 WHISPER s i m u l a t e s t h i s c o l l a p s e on the input array and produces as output the same array but with the block p o s i t i o n s updated t o d i s p l a y t h e i r p r e d i c t e d f i n a l r e s t i n g p l a c e s . . The s i m u l a t i o n makes ex t e n s i v e use of a r e t i n a which resembles the human r e t i n a i n some r e s p e c t s . Under c o n t r o l of the main program which knows about g r a v i t y , the block motions and i n t e r a c t i o n s are computed through the use of s e v e r a l o p e r a t i o n s on the r e t i n a , i n c l u d i n g f i n d i n g c e n t r e of area, f i n d i n g c o n t a c t s between b l o c k s , v i s u a l i z a t i o n of r o t a t i o n , and f i n d i n g symmetry; The r e t i n a c o n s i s t s of a c i r c u l a r a r r a y of non-overlapping c i r c u l a r r e t i n a l f i e l d s , or bubbles. The bubble s i z e i n c r e a s e s with d i s t a n c e . from the r e t i n a l c e n t r e . . Each bubble has an a s s o c i a t e d processor, so t h a t the whole r e t i n a i s conceived of as a f i x e d number of pr o c e s s o r s o p e r a t i n g i n p a r a l l e l and communicating only with t h e i r immediate neighbours. Funt's r e t i n a i s s i m i l a r i n t h i s r e s p e c t to Baker's i t e r a t i v e array o f automata. Only the c o l o r of an o b j e c t becomes known to WHISPER'S main program, while an o b j e c t ' s shape and other p r o p e r t i e s r e s i d e i n the diagram; WHISPER'S movement p r i m i t i v e s are simple and a f t e r a few simulated motions the d e p i c t i o n of an o b j e c t on the array d i s i n t e g r a t e s i n t o a multitude of s m a l l i s o l a t e d p i e c e s . A p r e c i s e demonstration of t h i s f a c t appears i n appendix A.3. The c o n c l u s i o n i s t h a t the s i m u l a t i o n of r i g i d motion provided by WHISPER i s not s u i t a b l e f o r my purpose.. H Howden, 1969 i] c o n s i d e r s the sofa-moving task; t h a t i s , II*Background Issues 75 produce a plan for moving a two dimensional shape from one.place to another when constrained to remain within the walls of a surrounding, and i n general non-convex, two dimensional shape. The edges of the walls and of the sofa are represented as l i s t s of points using chain-encoding [Freeman,1974]; conseguently i t i s easy to simulate r i g i d object motion. I t i s not, however, so easy to detect the intersection of the sofa and the walls. I am not convinced that the algorithm as described i n t h i s paper w i l l work, though i t can be extended to do so. Presumably the author used such an extension* since.he reported on a running program. In a pre-execution step, the points of the wall are sorted into an array of buckets, which, i n the extended algorithm, must be probed twice for every point on the perimeter of the sofa* , So the wall array i s usually referenced 2 * (length of sofa perimeter) times for every i n t e r s e c t i o n t e s t performed*. A sofa-moving plan i s produced as follows. At any (integral) point within the walls there i s a small number of possible actions of t r a n s l a t i o n or rotation which may be applied to the sofa; the permissible actions are those for which the intersection t e s t f a i l s . The plan i s produced by executing an undirected, looking backwards, he u r i s t i c search through the state space entailed by the set of permissible actions at each point., That t h i s scheme performed at a l l i s somewhat surprising - apparently i t did, on some poorly s p e c i f i e d examples. It would perform p a r t i c u l a r l y badly i n the simplest case - a small sofa within a large empty II«Background Issues 76 containing space. II . 4; 8 Imagery Mental imagery i s relevant because the SHAPE subsystem of PPA can be viewed as a model of mental imagery even though that was not the goal of SHAPE'S design., Mental imagery has been discussed i n the psychological l i t e r a t u r e by \_ B a r t l e t t , 1932 i ] , [ Hebb, 196 8 ], [Piaget,1954 §, iShepard,19783 and many others. This i s how Shepard, iii the conclusion of h i s recent review, presents the current status of mental imagery i n psychology: I submit that there are both l o g i c a l and analogical processes of thought, and that processes of the l a t t e r type, though often neglected i n psychological research, may be comparable in importance to the former. By an analogical or analog process I mean just t h i s : a process in which the internal states have . a natural one-to-one correspondence to appropriate intermediate states in the external world. . Thus, to imagine an object such as a complex molecule rotated into a d i f f e r e n t orientation i s to perform an analog process i n that half way through the process, the i n t e r n a l state corresponds to the external object i n an orientation half way between the i n i t i a l and f i n a l orientations. And this correspondence has the very r e a l meaning that, at t h i s half-way point* the. person carrying out the process w i l l be es p e c i a l l y fast i n discriminatively responding to the external presentation of the corresponding external structure in exactly that s p a t i a l orientation. The intermediate states of a l o g i c a l computation do not in general have t h i s property. Thus, a d i g i t a l computer may calculate the coordinates of a rotated structure by performing a matrix m u l t i p l i c a t i o n . But the intermediate states of t h i s row-into-column c a l c u l a t i o n w i l l at no point correspond to - or place the. machine in readiness for - an intermediate orientation of the external object. !!•Background Issues 77 To summarize: thanks to the searching reaction time experiments of Shepard and his colleagues, the notion of analogical thought process now has a firm piece of evidence to rest on. I have already mentioned the apparent importance of mental imagery in s c i e n t i f i c and mathematical discovery; i n addition one could j u s t i f i a b l y interpret H i l b e r t ' s "concrete objects" (p. 34) as v i s u a l imagery. There i s currently a debate over whether the notion of mental imagery can be used as a s c i e n t i f i c a l l y respectable explanatory construct. The main protagonists have been [ Pylyshynj 1 9 7 3 , 1976?} and [Kosslyn and Pomerantz, 1977 ij. This cannot be discussed here.. The l a t e s t word i n t h i s debate, and a review, i s provided by [Anderson,1978J. II.4.9 Behavioural theories In attempting to design a robot c o n t r o l l e r one i s , e s s e n t i a l l y , developing a behavioural theory* . Thus i t i s worth taking a brief look at work in t h i s area. [Hebb,1949] developed a cell-assembly theory of behaviour, which has been extended by [Good, 1965 ], [ Bindra, 1976 ], and others. It i s intended to be a physiological theory of thought. He approaches his theory from two directions: the: psychological facts of attention and orientation, and the then current facts of neurology. Hebb describes a cell-assembly as a "tridimensional l a t t i c e - l i k e assembly of c e l l s , that I have supposed to be the basis of perceptual integration." Again, he HaBackground Issues 78 w r i t e s , assemblies are " d i f f u s e , a n a t o m i c a l l y i r r e g u l a r s t r u c t u r e s t h a t f u n c t i o n b r i e f l y as c l o s e d systems, and do so only by v i r t u e o f the time r e l a t i o n s i n the f i r i n g of c o n s t i t u e n t c e l l s . . . An i n d i v i d u a l c e l l or t r a n s m i s s i o n u n i t may enter i n t o more than one assembly, at d i f f e r e n t times..., At any one moment, the a c t i o n of an assembly may be considered to be on an a l l - o r - n o n e b a s i s " [ p. 196-7iJ. . [ Bindra,1976J extends and d i v e r s i f i e s the c e l l - a s s e m b l y theory and i n t r o d u c e s a new concept, the pexgp. A pexgo u n d e r l i e s the " c u r r e n t l y e x c i t e d , d i s t i n c t i v e n e u r a l o r g a n i z a t i o n t h a t u n d e r l i e s the i d e n t i f y i n g response made i n r e l a t i o n t o a stimulus e n t i t y , as w e l l as the awareness ( s u b j e c t i v e experience d e s c r i b e d as percept or image) of t h a t s t i m u l u s e n t i t y . " Though s u g g e s t i v e , the cell-assembly/pexgo theory i s at an i n s u f f i c i e n t l y p r e c i s e stage of development to be of any d i r e c t b e n e f i t . The f a u l t of the Hebb-Bindra theory i s perhaps t h i s : i t t r i e s t o e x p l a i n human thought d i r e c t l y i n terms of (the po o r l y known) neuronal s t r u c t u r e , which might be l i k e n e d to t r y i n g to e x p l a i n a b i g computer program such as an o p e r a t i n g system or Winograd's SHRDLU d i r e c t l y i n terms of machine code, by-passing a l l mention of PLANNER, PROGRAMMER, LISP, s t a c k s , assemblers and a l l the other wonderful d e s c r i p t i v e vocabulary of computer s c i e n c e * In other words, the d i f f e r e n c e i n d e s c r i p t i v e l e v e l , the gap between neuron and thought, i s too grea t to be bridged by one s i n g l e r e d u c t i o n i s t theory. A r t i f i c i a l I n t e l l i g e n c e , IIsBackground Issues 79 using the language of computer s c i e n c e , i s i n an i d e a l p o s i t i o n to b u i l d the r e q u i s i t e i n t e r m e d i a t e t h e o r i e s . [ M i l l e r , G a l a n t e r and Pribram, 1960 ] a l s o sketched out some ideas on behaviour; t h e i r most s p e c i f i c s u g g e s t i o n was the importance of "TOTE" u n i t s ( t e s t ; operate, t e s t , e x i t ) i n executing plans. The TOTE concept i s r e l a t e d t o the n o t i o n of a FAP ( f i x e d a c t i o n p_attern) , which i s used by e t h o l o g i s t s t o d e s c r i b e animal behaviour and to t r a c e the e v o l u t i o n of behaviour. In pondering why computers have had so l i t t l e success i n c a r r y i n g out human i n f o r m a t i o n p r o c e s s i n g t a s k s , [ M i l l e r , 1 9 7 4 ] concluded, f i r s t , t h a t the reason i s because there i s no s a t i s f a c t o r y theory of c o g n i t i v e o r g a n i z a t i o n , and second, t h a t the best hope f o r progress i s to develop a theory to handle the s t r u c t u r e of the p h y s i c a l world. My work i s a small step i n the d i r e c t i o n of M i l l e r ' s second c o n c l u s i o n . + + + So what can I conclude from our survey of the l i t e r a t u r e ? I w i l l s t a r t with the negative c o n c l u s i o n s and proceed i n a p o s i t i v e d i r e c t i o n . F i r s t of a l l , though many of these s t u d i e s look s u p e r f i c i a l l y s i m i l a r t o our p r o j e c t , few have any p o s i t i v e content from our viewpoint* The l e s s o n s to be l e a r n t are mainly "don't"s.. Here they are. HaBackground Issues 80 • Hebb - Bindra - don't t r y to do too much with one theory • Jacobs & Kiefer - don't try to apply decision theory d i r e c t l y to behaviour a Coles, Feldman & Sproull decision theory and A r t i f i c i a l I ntelligence don't r e a l l y mesh together • Ludlow, Friedman - ir r e l e v a n t because they model behaviour without a world model a Becker & Merriam - they get bogged down i n simulation d e t a i l s ; no functional robot-controller designed or implemented, a "Baconian" Becker - don't use the Baconian approach to representing experience. * Simon* Toda - in t e r e s t i n g high l e v e l analyses of r a t i o n a l behaviour, but ir r e l e v a n t at our l e v e l of synthesis* m Imagery - t h i s i s an acceptable notion; any model of i t i s of interest.. My model of i t arises as a side e f f e c t of a system designed for s p a t i a l reasoning. Of the three studies on the simulation of r i g i d motion. Baker's i s promising but not carried far enough, Funt's simulation i s not satisfactory after the f i r s t few moves, while Howden's i s computationally rather expensive f o r use as an experimental t o o l . When i t comes to s p a t i a l planning, Eastman and Pfefferkorn get bogged down i n he u r i s t i c search because HaBackground Issues 81 t h e i r underlying representation of space i s inadeguate, and Howden's approach r e s u l t s i n a combinatorial explosion. More p o s i t i v e l y , Nilsson & Raphael's i s i n t e r e s t i n g , but only as a precursor of my own work. This leaves only Kuipers, who models common-sense knowledge of large-scale space, and Arbib & L i e b l i c h , who model a rat's cognitive map. Kuipers showed how fragmentary pieces of information about one's s p a t i a l environment can be integrated i n the course of experience to form a graph-like cognitive map.. Arbib & L i e b l i c h used a graph for t h e i r world model and showed how i t could be modified as a r e s u l t of innate drives and of external rewards. The lesson to be learnt here i s that a world model in the form of a graph i s a promising idea* * This i s not incorporated in the design of PPA but obviously should be taken up as soon as possible* I w i l l now summarize t h i s chapter on background issues., I f i r s t delineated the nature of t h i s modern science. A r t i f i c i a l I ntelligence; then I described the importance of, and interaction between, representation and search i n any theory of i n t e l l i g e n c e ; then I presented my own approach to the subject. The next section sketched the t r a d i t i o n a l A r t i f i c i a l Intelligence approach to planning and problem-solving, and found II«Background Issues 82 i t to be wanting for my purposes; while i n the l a s t section I reviewed the l i t e r a t u r e on s i m i l a r projects but found there to be a notable lack of positive content, only cautionary t a l e s . A l l told, the reader should now have a good fee l i n g for the background to my work; l e t me now advance to the f i r s t embattlement. IlaBackground Issues 83 CHAPTER III THE SIMULATED ORGANISM-ENVIRONMENT SYSTEM This system i s the basic experimental t o o l f o r my research. I t provides sensory input for, and accepts motor output from, a simulated organism that I c a l l Utak. Only the functional input-output c h a r a c t e r i s t i c s of th i s system are d i r e c t l y relevant to the rest of my thesis. For t h i s purpose you need only read the.rest of t h i s introductory section and section 111*2.2, and peruse the examples i n sections III.1.3 and III.2.3, The aim of t h i s chapter i s to describe the simulated organism-environment system and to describe the tasks that such an organism, i f endowed with a competent organism c o n t r o l l i n g program, might reasonably be expected to solve. . The system i s called TABLETOP. It simulates the physical motion on a smooth tabletop of objects which have the form of polygonal planar shapes. The tabletop i s bounded by a verge so that an object can never f a l l o f f . An object moves only when Utak i s both holding t h i s object and executing a pushto or turn command* The physics involved i s e s s e n t i a l l y t r i v i a l : (a) The shape of an object i s invariant under tr a n s l a t i o n and rotation. (b) If a motor command to go a certain distance:in a certain d i r e c t i o n would resu l t i n Utak c o l l i d i n g with an object or the verge, then he halts a short distance before the f i r s t IIIaThe simulated organism-environment system 84 i n t e r s e c t i o n of his path with such an obstacle* (c) S i m i l a r l y , i f Utak i s grasping an object and i s executing a push command that would resu l t i n the object or Utak c o l l i d i n g with some obstacle, then Utak and the object come to an immediate halt a small distance before the point at which the t h i s c o l l i s i o n would have occurred. (d) When Utak i s grasping an object he and the object are, temporarily, considered as one new object.. (e) Utak can go between two neighbouring objects only i f the width of the gap between them i s greater than a c e r t a i n minimum value. To put i t i n a nutshell, TABLETOP simulates the; permanence and impermeability of the shape.of physical objects. In building the TABLETOP system I aimed to produce an experimental tool that was inexpensive to use. I was not concerned to find exact solutions to c o l l i s i o n problems. Thus, the approximate solutions to c o l l i s i o n problems that the TABLETOP system computes are quite s u f f i c i e n t for my purposes. In section III.3.1 I sketch one way that TABLETOP could be extended to compute exact solutions* Previous simulations of the physics of planar polygonal shapes (reviewed in 11*4.7 above) have either been incomplete, i n c o r r e c t , or computationally expensive to use, whereas my TABLETOP system i s complete, correct' to within certain l i m i t a t i o n s which I specify l a t e r , and e f f i c i e n t . By complete I mean that both motion and c o l l i s i o n s are handled* _ TABLETOP i s III«The simulated organism-environment system 85 cheap to use, has been used extensively, and has proved to be a viable experimental t o o l * The design of TABLETOP i s based on the use of two representations f o r objects, the Cartesian and the d i g i t a l . . The Cartesian representation of an object s p e c i f i e s the shape of the object by a l i s t of points where each point i s sp e c i f i e d by two positive r e a l numbers. The points are the.points of i n f l e c t i o n on the boundary of the shape., An edge i n the Cartesian representation of an object i s a pair of consecutive points in the l i s t . Utak himself has a Cartesian representation* or position, consisting of a single pair of positive reals., In addition, Utak has an absolute orientation* Note that I am here ref e r r i n g to the simulation of Utak, not the robot-controller for Utak. The TABLE i s a two dimensional array where each entry corresponds to a square i n a two dimensional grid of squares covering the surface of the:simulated tabletop. Each object has an associated colour, one of the l e t t e r s A,B, ... Z. Two objects may have the same colour, and the verge always has the colour 'B'. Now imagine the.Cartesian representation of an object with colour c superimposed on the TABLE g r i d . . The d i g i t a l representation of the object i s defined to be the set of squares of TABLE that l i e within, or are intersected by the edges of, the Cartesian representation of the object. A l l sguares in the d i g i t a l representation of an object are assigned the object's IIIaThe simulated organism-environment system 86 colour c. The d i g i t a l representation of an object i s also c a l l e d the projection of the object onto the TABLE. Utak has a d i g i t a l representation, or projection; consisting of the square of TABLE that contains his position. The colour assigned to t h i s square i s the BUGMARK, an asterisk on the CRT display of TABLE. His Cartesian position l i e s outside the Cartesian representations of a l l the objects on the tabletop. Normally his projection, also, i s outside a l l the d i g i t a l representations of a l l the objects, but i t can happen that i t l i e s within the projection of an object that he i s currently grasping or has recently letgo. Utak, a l l the objects, and the verge are projected onto the TABLE array when TABLETOP i s i n operation. . The TABLE array can be displayed on a screen for a human user to watch. Remember that Utak does not "see" t h i s display; his vi s u a l input i s described i n subsection I I I . 2 . 2 . This chapter i s organized as follows. Section III . 1 describes the TABLETOP simulation system. This includes the method used* the problems encountered, and t h e . s p e c i f i c a t i o n of the requisite algorithms.. Section III.2 discusses the design and c a p a b i l i t i e s of Dtak, and includes examples of his sensory-motor experience. In the f i n a l section (III.3) an extension and generalizations of TABLETOP are considered.. I t i s shown that an important part of the TABLETOP simulation i s e a s i l y adapted for p a r a l l e l computation, and that the TABLETOP method generalizes to three (or more) dimensions. Also, i t i s III«The simulated organism-environment system 87 shown how to extend TABLETOP to obtain exact answers to c o l l i s i o n problems. III. 1 The simulated environment, TABLETOP -This i s an independent system that simulates the ef f e c t of motor commands issued by Utak. It i s i n s t r u c t i v e for a user to s i t down with TABLETOP and attempt a task such as manipulating an 'L* shaped object through a narrow doorway.. The L-shaped object problem i s the archetypal task for Otak. Indeed, in Kuhnian terminology, t h i s i s the paradigm problem f o r t h i s approach to understanding s p a t i a l i n t e l l i g e n c e . When, or i f , progress i n the construction of the organism-controlling program for Otak has advanced to the point where Otak i s able to solve t h i s problem autonomously then I believe that n o n - t r i v i a l advances w i l l almost c e r t a i n l y have been made towards understanding the nature of some computations that are of fundamental importance for successful organisms., At that point i t w i l l be of great inte r e s t to i n t e r p r e t the known facts about b i o l o g i c a l brains i n terms of these„computations. 111*1^1 A.D. overview of the - simulation - method A s l i d e i s the simplest action of Otak. This i s the movement of Otak along a l i n e segment, It i s simulated by sequentially checking each square of the TABLE grid that i s intersected by Otak's position as he moves along the l i n e III«The simulated organism-environment system 88 segment. I f a non-empty (coloured) sguare of TABLE i s encountered before the end of the l i n e segment, then f i r s t the point of interse c t i o n with the obstructing sguare i s found, second the halting position of Utak i s obtained by backing o ff s l i g h t l y from t h i s point. This i s done by taking a point a small distance € back along the l i n e segment from the point of int e r s e c t i o n . If the Cartesian representations of two neighbouring objects are so close that no empty sguare of TABLE l i e s between the i r d i g i t a l representations then Utak i s unable to s l i d e between the two objects* When Utak i s not grasping an object he can only execute a s l i d e action or a grasp action. Utak can grasp an object i f he i s not already grasping some object and i f his d i g i t a l representation i s adjacent to a square in the object's d i g i t a l representation. Two squares are adjacent i f they are horiz o n t a l l y , v e r t i c a l l y , or diaqonally adjacent. Thus there are: eight TABLE squares adjacent to Utak's d i q i t a l representation* When Utak i s qrasping an object he can only execute pushto, turn, or letgo actions. In t h i s state the r e l a t i v e position of Utak's Cartesian representation and the object's Cartesian representation remains invariant under tra n s l a t i o n — caused by pushto actions — and rotations -- caused by turn actions. However, whereas Utak's d i g i t a l representation i s always a single sguare, an object's d i g i t a l representation may appear to change rather d r a s t i c a l l y i f the size of the TABLE squares i s of IIIaThe simulated orqanism-environment system 89 the same order of magnitude as the size of the object* The simplest example of t h i s e f f e c t i s given by an object whose Cartesian representation i s a square of exactly the same s i z e as the TABLE squares. I f t h i s object's Cartesian representation i s exactly aligned with a TABLE square then i t s d i q i t a l representation i s just that TABLE square, but i f the object i s moved diagonally a small distance then i t s d i g i t a l representation becomes a larger square consisting of four TABLE squares. Suppose that the user of TABLETOP requests a pushto action whose intent i s to move the grasped object i n a straight li n e through distance d i n direction 8. The angle 9 i s measured clockwise from some fixed direction* , The following method i s used to compute the distance d» actually traversed before a c o l l i s i o n , i f any, occurs, d i s the intended distance, d' i s the achieved distance. B a s i c a l l y the method i s to scan the area of TABLE that would be swept out by the object i n the course of the t r a n s l a t i o n . The distance to the nearest obstacle found, i f any, determines the achieved distance. F i r s t the current d i g i t a l representations of Dtak and of the object are erased. Then the achieved distance for Utak i s computed, just as for the s l i d e action. The achieved distance for the grasped object i s computed as follows* F i r s t the leading edges r e l a t i v e to the d i r e c t i o n 9 are determined. These are the edges of the Cartesian representation whose outward normal has a d i r e c t i o n i n the range (6-90°, e+ 90°). . As the III»The simulated organism-environment system 90 object i s moved, each, leading edge sweeps out an area in the shape of a parallelogram* . Each such parallelogram i s to be imagined as superimposed on the TABLE gri d . The:parallelograms for an L-shaped object subjected to a p a r t i c u l a r pushto action are shown in figure:III*1. For each leading edge E a scanning process i s started that scans those squares of TABLE that l i e within or i n t e r s e c t the parallelogram PE generated by E. For any scanned square that i s non-empty (coloured), the minimum distance from the edge E to the nearest point of the subpart of the square l y i n g within PE i s computed* Then distance DE i s defined to be d, i f no non-empty squares are found i n the scan, or else to be the minimum over the minimum distances for each scanned square. The minimum of the DE's for each leading edge E, less a small quantity 6, i s returned as the achieved distance for the object* F i n a l l y the o v e r a l l achieved distance d' i s the minimum of the achievable distances for the object and for Otak. Then both Utak and the object are re-projected onto the TABLE grid at the computed f i n a l position* . By construction, these new projections never overlap the projection of an obstacle. Now suppose that the TABLETOP user requests a turn action, whose intent i s to rotate the object grasped by Utak by £ radians about Utak's position U. Two methods w i l l be described for computing the angle actually rotated before a c o l l i s i o n , i f any, occurs. (J> i s the intended rotation, <J>' i s the achieved rotation. Both methods scan for obstacles i n the area that would be swept out by the object i n the course of rotation* The IIIaThe simulated organism-environment system FIGURE T I I . 1 91 Direction of movement 6 Left constrainin edge Original leading edge The four parallelograms form an L-shaped object subject to a particular PUSHTO action. Also shown are the Cartesian and d i g i t a l representations of the L-shape. Destination edge b) Features of a parallelo-gram generated by an edge during a PUSHTO action. Right constraining edge 92 angle to the nearest obstacle, i f any, determines the achieved rotation.. The f i r s t method finds a l l the obstacles whereas the second may miss a small one., Although the second method i s the one currently implemented, the f i r s t method, since i t p a r a l l e l s the method used f o r translation and may be of independent interest, i s described f i r s t . F i r s t the projections of Utak and the grasped object are erased; Since Utak's position does not change: i n a rotation, his motion does not d i r e c t l y contribute to the c o l l i s i o n computation. Then the leading segments of the edges of the object, r e l a t i v e to the centre of rotation U, must be determined. D e f i n i t i o n . For a clockwise rotation of an object about U, the leading segment of an edge E i s found as follows.. Consider the l i n e L c o l l i n e a r with E. Compute on the l i n e L the nearest point N to the centre of rotation U and draw an outward normal to E at the point N. Now take the semi-infinite h a l f - l i n e of L that l i e s to the l e f t of the outward normal at N, and form the inter s e c t i o n of i t with E. The r e s u l t i n g segment of E i s the leading segment of E. Note that the leading segment of an edge may consist of a l l or part of the edge, or be n u l l . The leading segments for a s p e c i f i c t r i a n g l e and points of rotation are shown in figure III.2. Lemma. For a clockwise rotation of an object about U, the leading segment of an edge E of the object has the property: for any point x on the i n t e r i o r of the leading segment, there i s a IIIaThe simulated organism-environment system FIGURE I I I . 2 Outward normal 6 CLOCKWISE ROTATION AN^ , = le a d i n g segment of edge AB. BNp = l e a d i n g segment of edge BC. CNg = le a d i n g segment of edge CA. Thus f o r r o t a t i o n clockwise about P there are 3 le a d i n g segments. For clockwise r o t a t i o n about Q there i s only 1 l e a d i n g segment: BC. This f i g u r e shows the le a d i n g segments of the t r i a n g l e ABC f o r two p o i n t s of r o t a t i o n . I f a clockwise r o t a t i o n about P i s intended, then the lead i n g segments are AN , BN^, CN^. I f an a n t i - c l o c k w i s e r o t a t i o n about P i s intended, then the le a d i n g segments are N^B, N^C, and N^A. I f a clockwise r o t a t i o n about Q i s intended, there i s only one le a d i n g segment: BC. I f an a n t i - c l o c k w i s e r o t a t i o n about Q i s intended, there are two lea d i n g segments: CA and AB. 94 rotation about U such that i f x* i s the new position of x, the arc xx' l i e s i n the exterior of the object. Proof. Pick a disc centre x, small enough that i t i n t e r s e c t s no other edge of the object, and so that i t does not contain an end point of the leading segment* Consider a rotation so small that the new po s i t i o n x' of x l i e s within the disc centred on x. Because x l i e s to the l e f t of the outward normal to E the direction of motion of x i s perpendicular to Ox and points into the exterior of the shape. Thus, the. arc xx' l i e s in the exterior of the object* . QED. In other words the leading segment of an edge E always sweeps out a new area of the. TABLE in the course: of a rotation. Depending on the angle of rotation and the. exact o v e r a l l Cartesian shape of the object, there: w i l l i n general be considerable overlap between the areas swept out by each leading segment., I have ignored the problem of eliminating multiple scanning of areas of TABLE i n a turn action. As the object rotates each leading segment sweeps out a four-sided area of space, The sides d i s t a l and proximal to the point of rotation are c i r c u l a r arcs, the other two sides are straight l i n e s . Hence I c a l l t h i s shape a doughnut s l i c e . , Note that i f A # B are the o r i g i n a l end-positions of the leading segment and A', B' are the f i n a l end-positions of the leading segment, then t r i a n g l e s ABO and A'B'O d i f f e r only by a rotation about 0. Each doughnut s l i c e i s to be imagined as superimposed upon the TABLE grid* The doughnut s l i c e s for the rotation of an III»The simulated organism-environment system 9 5 L-shaped object subjected to a p a r t i c u l a r turn action are shown i n figure III*3. For each leading segment S the TABLE squares that l i e within or intersect the corresponding doughnut s l i c e are scanned; For any non-empty scanned square the.minimum angle of rotation s u f f i c i e n t to cause a c o l l i s i o n between the leading segment S and the square i s computed, {This i s not a t r i v i a l computation;} For each leading segment S, the minimum i s taken over the angles computed for each obstructing square, and then the minimum of a l l these minimums, taken over a l l leading segments, gives the achieved rotation <>'• F i n a l l y , both Utak and the rotated object are re-projected onto the TABLE g r i d . That* i n outline, i s the simulation method used i n TABLETOP., The basic problems faced i n an implementation of t h i s simulation method are as follows.. •Tracing a l i n e -- the intended path i n a s l i d e act — the sides of a parallelogram i n a pushto action — the straight and curved sides of a doughnut s l i c e i n a turn action •Scanning a shape -- the Cartesian representation of an object, for projecting or erasing the object's d i g i t a l representation the parallelogram swept out by a leading edge in a pushto action -- the doughnut s l i c e swept out by a leading IIInThe simulated organism-environment system FIGURE III.3 Rotation about U. 6 An L-shaped object showing it s Cartesian and di g i t a l representations. For the centre of rotation, U, there are 5 leading seg-ments (CB, BA, AN, FE, EM) and 5 doughnut slices swept out during the action (BCC'B', ABB'A', NAA'N', EFF'E', MEE'M'). N is the point on AF closest to U, M is the point on ED closest to U. leading segment outer constraining arc 6' destination segment Features of the doughnut slice generated by rotating the leading segment AB about the centre of rotation U by angle 0. 97 segment in a turn action •Computing minimum distance from a leading edge to (a subpart of) an obstructing sguare •Computing minimum angle from a leading segment to (a subpart of) an obstructing sguare. III>1.2 The algorithms used in - the simulation In t h i s subsection I describe the:algorithms used to solve the. problems specified i n the previous subsection. There are two l i n e - t r a c i n g algorithms, one for straight l i n e s and one for c i r c u l a r arcs. I f i r s t describe how to trace a straight l i n e . As a prerequisite for t h i s one has to know the squares of the TABLE qrid containing the i n i t i a l and terminal points of the straight l i n e i n order to i n i t i a l i z e and terminate the tracing process c o r r e c t l y . This seemingly innocuous reguirement i s a l i t t l e t r i c k y to program because of the sp e c i a l cases that can occur such as alignment of the l i n e with the axes and coincidence of the l i n e with the grid l i n e s . . The code for tracing has to handle four cases, one for each guadrant of the direction of the l i n e ; I w i l l only describe the northeast guadrant case. Let the current sguare-be the square currently under consideration i n the l i n e - t r a c i n g procedure. The next current sguare can either be one up, one rig h t ; or diagonally up and right from the current square. This choice i s made by IIInThe simulated organism-environment system 98 computing whether the northeast corner of the current square i s l e f t of, right of, or on the l i n e . k comparison of the slopes of SP and SD, involving two mu l t i p l i c a t i o n s and one comparison, s u f f i c e s (figure III. 4). A c i r c u l a r arc i s traced in a similar manner. I f the arc traverses more than one quadrant i t i s broken into subarcs each traversing a l l or part of a single quadrant; When the arc or subarc traverses the northwest quadrant almost the same procedure i s used as for the case:of a l i n e whose direction i s in the northeast quadrant (figure III.4). As for the l i n e case, the next current square i s either one up, one righ t , or one diagonally up and r i g h t from the current square, and th i s choice i s made by computing whether the northeast corner of the current square i s inside, outside, or on the arc. This requires two mu l t i p l i c a t i o n s , an addition, and a comparison; There are several operations which may be applied to the squares that a l i n e passes through. The square coordinates may be added to a scan table for a scanninq routine or, i f the square i s non-empty and hence represents an obstruction, an intersection computation may be -executed and the l i n e - t r a c i n q procedure.abandoned. For the purpose of projecting the Cartesian representation of a concave object into i t s d i g i t a l representation on the TABLE ( b r i e f l y , drawing the object), and erasing i t l a t e r , the Cartesian representation i s decomposed into convex subparts. This i s done manually when the object i s f i r s t s p ecified. When III«The simulated organism-environment system F IGURE I I I .4 Tracing an arc i n the north-west quadrant. 100 the object i s drawn or erased each convex subpart i s drawn or erased separately. The d i g i t a l representation of a convex (subpart of an) object i s constructed row by row.. F i r s t the edges i n the Cartesian representation are traced, and the coordinates of the squares encountered are used to update a scan table that records the coordinates of the squares at the l e f t and r i g h t extremities of each row. Since the size of the scan table i s s u f f i c i e n t to cover only the v e r t i c a l extent of the convex shape, an o f f s e t i s also stored that s p e c i f i e s the row of TABLE that corresponds to the f i r s t pair of ( l e f t and right) scan table entries. The scan table i s then used to draw the d i g i t a l representation row by row. If the object i s fixed the scan tables are then, discarded. If the object i s movable, the scan tables and o f f s e t s are stored for l a t e r use when, or i f , the object i s erased f o r a pushto or turn action. A new scan table has to be constructed for each convex subpart every time the object i s redrawn. The parallelogram swept out by a leading edge i n a pushto action i s scanned i n almost i d e n t i c a l fashion (see figure I I I . 1 ) . The edges of such a parallelogram are traced i n the sequence: leading edge AB, l e f t constraining edge AA', r i g h t constraining edge BB', destination edge: A' B'., No obstructing square can occur along the edge AB. If an obstructing square i s encountered* while tracing the edge AA', then the minimum distance in the d i r e c t i o n e from the leading edge AB to the nearest part of the obstructing square that l i e s within the IIInThe simulated organism-environment system 101 parallelogram i s computed. This i s taken as the new value of d, the amount of the translation., Similarly i f an obstacle i s encountered while tracing BB'., If either or both of these cases occur then the position of the destination edge i s e f f e c t i v e l y moved closer to the o r i g i n a l position AB. Now the destination edge, at i t s possibly new position, i s traced and the scan table for the parallelogram i s complete.. The TABLE sguares within the parallelogram are now scanned and i f an obstructing square i s found the distance from the leading edge AB i n the direction 9 to the nearest corner of the obstacle i s computed. The doughnut s l i c e swept out by a leading segment in a turn action has one concave bounding l i n e — the inner constraining arc. However, since:a shape i s scanned row-by-row t h i s i s of no consequence provided the arc does not cross the v e r t i c a l l i n e through the point of rotation. I f t h i s condition holds then the doughnut s l i c e i s cut along t h i s v e r t i c a l l i n e (line UU' in figure III.3) and each part formed i s scanned separately.. The edges of a doughnut s l i c e are traced i n the sequence: leading segment AN, inner constraining arc NN', outer constraining arc AA', destination segment A'N'. No obstructing square can occur along AN. . If an obstructing square i s encountered while tracing the arc NN* then the minimum angle of rotation about 0* to the nearest part of the obstructing square within the doughnut s l i c e i s computed. This i s taken as the new value of the intended rotation., S i m i l a r l y i f an obstacle i s encountered while tracing AA'. I f either or both of these cases occur then the position III»The simulated organism-environment system 102 of the destination segment i s e f f e c t i v e l y rotated back closer to the o r i g i n a l position AN. Now the destination segment at i t s possibly new position i s traced and the scan table for the doughnut s l i c e i s complete. The TABLE squares within the doughnut s l i c e are scanned and c o l l i s i o n computations carried out i f any obstructing squares are found. F i n a l l y I must specify the c o l l i s i o n computations.. F i r s t I describe them f o r a pushto action, then for a turn action. The simplest case i s t h i s : when scanning the parallelogram swept out by a leading edge AB, an obstructing square i s encountered. The amount of movement of the object before AB c o l l i d e s with the nearest point P of the square must be calculated (figure III.5). This i s the distance to c o l l i s i o n for t h i s edge. The nearest point of a square i s one of the corners of the square. This nearest corner depends only on the quadrant of the leading edge so a simple table.lookup i s used to fi n d i t * . For instance, for a leading edge.in the northeast guadrant the nearest corner of an obstructing sguare i s the southeast corner. Let n be a unit vector in the direction of the outward normal to AB, l e t d be a unit vector i n the direction of motion, and l e t p be the vector AP. Then the distance to c o l l i s i o n i s given by the formula (E-n) / ( i - n ) <M If an obstructing sguare i s encountered while tracing a III»The simulated organism-environment system FIGURE III.5 - A formula f o r the distance from a  leading edge to the nearest point  of an obstructing square. 103 AB i s a leading edge l l C I < L. i- > 0 n = c o j > O PB = perpendicular distance from AB to P = p_.n | r = c o s * d f = (£.n) / (d.n) 104 constraining edge of a parallelogram, more c a r e : i s required to f i n d the distance to c o l l i s i o n . The nearest corner of the obstructing square may l i e outside the parallelogram or even on the opposite side of an extension of the leading edge. , When tracing the l e f t constraining edge of the parallelogram, four cases arise (figure III.6). (1) The nearest corner P of the obstructing square l i e s between the l e f t and r i g h t constraining edges. The distance to c o l l i s i o n i s the same as before, using equation (A) . (2) The nearest corner l i e s on the l e f t constraining edge. The distance to c o l l i s i o n i s the distance from A to the nearest corner. (3) The nearest corner l i e s to the l e f t of the l e f t constraining edge* The distance to c o l l i s i o n i s the distance from A along the l e f t constraining edge to the point P where the l e f t constraining edge: intersects the side of the square. (4) The nearest corner l i e s to the right of the right constraining edge. The distance to c o l l i s i o n i s the distance from B along the right constraining edge to the point Q where the right constraining edge interse c t s the III»The simulated organism-environment system FIGURE I I I . 6 105 ,3' Cases i n computing distance to c o l l i s i o n along a c o n s t r a i n i n g edge. AB = l e a d i n g edge. NC = nearest corner of o b s t r u c t i n g square. P = nearest p o i n t of o b s t r u c t i n g square. 106 side of the square. There are r e a l l y two subcases involved here depending on whether P and Q l i e on the same or adjacent edges of the square.. However, i t i s not necessary to go to the trouble of f i g u r i n g out the distance BQ since t h i s w i l l be computed under case (3) when the right constraining edge i s being traced. So i t su f f i c e s to return the distance AP. Notice that, when tracing the ri g h t constraining edge BB', case (4) [with r i g h t and l e f t transposed] could not occur (figure 111.6(5)). This i s because the distance AP would have been returned from an occurrence of case (3) when tracing the l e f t constraining edge, and so the ri g h t constraining edge would only be traced as f a r as B''. There are four cases when tracing the l e f t constraining edge* three cases when tracing the right constraining edge, and these are a l l repeated for each of the other three quadrants in which the leading edge may l i e . These 28 cases can be handled by one 2 x 4 x 4 decision table with one row of four n u l l entries. Now I describe the c o l l i s i o n computations for a turn action. Suppose that an obstructing square i s encountered when scanning the doughnut s l i c e swept out by a leading segment.. The amount of rotation of the object before the leading segment AN of an edge AB c o l l i d e s with some point of the square must be calculated (figure III.7). This i s the angle-to c o l l i s i o n for t h i s edge. The point of the square at which the c o l l i s i o n IIIaThe simulated organism-environment system FIGURE III.7 107 u c o s (-o) -- - C P. •«.)/£ cos V s * / r « j - cos"' - c s ' [* /r} AB = object's edge. AN = leading segment. U = centre of r o t a t i o n . P = obstructing point. P' = point which coin-cides with P at the nearest moment of c o l l i s i o n . r = UP = UP' . of = angle to c o l l i s i o n . _n—=-unit outward normal to AB. x = distance UN. FIGURE III.7. The diagram shows the point P', on the edge AB, which coincides with the point P at the moment of c o l l i s i o n . The formula shows how to compute PUP', the angle to c o l l i s i o n . 108 occurs i s the c o l l i s i o n point. I also c a l l t h i s the c o l l i s i o n corner since i t i s clear that the c o l l i s i o n point must be a corner of the obstructing square. Unfortunately i t i s not t r i v i a l to determine which" corner of the square; i s the c o l l i s i o n corner.. For instance, as the obstructing square varies over the squares within a doughnut s l i c e the c o l l i s i o n corner varies too. If the rotation i s clockwise and the obstructing square i s moved clockwise then the c o l l i s i o n corner of the obstructinq square moves in a clockwise direction r e l a t i v e to the centre of the obstructinq square.. I t i s possible to specify sets of candidate c o l l i s i o n corners as a function of the position of the centre of rotation 0 r e l a t i v e to the obstructing sguare*. The set of candidate c o l l i s i o n corners for a s p e c i f i c leading segment contains either two or three corners. Suppose axes are taken at the centre of the obstructing square and aliqned with the grid l i n e s . I f 0 i s on one of the axes there are two candidate c o l l i s i o n corners and i f U i s i n a quadrant between the axes there are three candidate c o l l i s i o n corners (figure 111*8). For instance, i f 0 l i e s i n the southwest guadrant the candidate c o l l i s i o n corners are the southwest, northwest, and northeast corners, and i f 0 l i e s on the south v e r t i c a l axis the candidate c o l l i s i o n corners are the southwest and northwest corners. Figure III.9 shows occurrences of each of the candidate c o l l i s i o n corners, for 0 i n the southwest guadrant. The anqle to c o l l i s i o n with an obstructing sguare i s determined by finding the angle to c o l l i s i o n with each of the , III«The simulated organism-environment system FIGURE III.8 109 MW.Nt.SE. —p w S6. This shows, for a clockwise rotation, how the set of candidate collision corners of an obstructing square varies as a function of the position of the centre of rotation relative to the axes of the square. This is the set of collision corners that must be considered i f the obstructing square is encountered during the scan of the doughnut sl i c e . Along the arcs are shown the edges or corner that may be involved i f the obstructing square is encountered when tracing a constraining arc. FIGURE III.9 For a clockwise rotation about the point U in the southwest quadrant relative to the axes of an obstructing square, this shows how each of the candidate co l l i s i o n corners could actually occur. Leading segment AB collides with the south-west corner, CD collides with the northwest corner, and EF collides with the northeast corner. A'B', C'D', and E'F' are the positions of AB, CD, and EF, respectively, at the moment of collision. 111 c o l l i s i o n corners separately and taking the minimum of the three (or two) angles. The c o l l i s i o n corner of the obstructing square i s the corner with the smallest a n q l e - t o - c o l l i s i o n . Given a leadinq segment AN of an edge AB being rotated about a point U, the angle to c o l l i s i o n with a point P i s found as follows. Let n be the unit vector in the d i r e c t i o n of the outward normal to AB, l e t x be the perpendicular distance from 0" to AB, l e t r be the radius UP, l e t £ be the vector UP, l e t P' be the point on AN which coincides with P at the moment when the c o l l i s i o n occurs, and l e t alpha be the angle to c o l l i s i o n (figure I I I . 8 ) . Then the following holds. alpha = /PUN - /P«UN cos (/PUN) = (p_/r) . (-n) = -(p.n)/r cos(/P«UN) = x/r alpha = arcos[ - (p. n)/r ] - arcos[x/r] (B) If an obstructing square i s encountered while tracinq the inner or oufter constraining arc, the c o l l i s i o n computation i s s l i g h t l y simpler. Instead of rotating the candidate c o l l i s i o n corner backwards to whe^ re i t s arc intersects the leading segment as in the:usual case, here one has to rotate the endpoint of the leading segment forwards to where i t s arc intersects a side of the obstructing square. The computation i s simpler because the sides of the square are aligned with the coordinate axes.. I describe t h i s c o l l i s i o n computation only f o r an example involving the outer constraining arc (figure I I I . 1 0 ) . . Suppose the point of rotation U l i e s i n the southwest guadrant r e l a t i v e IIIoThe simulated organism-environment system FIGURE III.10 112 AB = object's edge. AN = leading segment. U = centre of r o t a t i o n . A' = point of c o l l i s i o n with obstructing square, r = UA = UA'. a. ' vector UA. °f = angle to c o l l i s i o n = ^ A UA'. UW = perpendicular from U to c o l l i s i o n side of square, ri = unit outward normal from c o l l i s i o n side, x = distance UV^ COS ft: (SL).(-rs)* , t o i , ( - V r ) / l . ) FIGURE III.10 - The diagram shows the i n t e r s e c t i o n A' of an outer constraining arc with an obstructing square. The formula shows how to compute the angle of c o l l i s i o n . ' 113 to the axes of symmetry of the square, and the endpoint A of a leading segment AN c o l l i d e s with a side of the square. The side involved i s the c o l l i s i o n side, and i s s p e c i f i e d by the arc tracinq routine. In the example shown the c o l l i s i o n side i s the west side of the square. Instead of dropping a perpendicular from 0 to AN, for t h i s computation one drops a perpendicular from 0 to the c o l l i s i o n side, meeting i t at W. Let V be the perpendicular projection of A onto OW.. Then alpha, the angle to c o l l i s i o n , i s given by alpha = arcos[-UV/r] - arcos[ UW/r] (C) The arc tracing routine may, instead, specify that the arc enters the obstructing square at the corner P., The coords of P are known so the angle to c o l l i s i o n i s then simply given by alpha = 2 * arcosj AP/ (2*r) i] (D) When tracing the constraining arcs of a doughnut s l i c e at most two obstructing squares are encountered, since an arc-tracing routine i s abandoned as soon as an obstacle i s found. For such an obstructing square there are four d i s t i n c t r e l a t i v e positions of the centre of rotation 0, and for each of these there are three di f f e r e n t ways in which the arc may intersect with the.square. Each of these twelve cases reduces to one or other of the computations specified by equations (C) and (D). A 4 x 3 decision table s p e c i f i e s the correct procedure. ., + + + IIIaThe simulated organism-environment system ,11 4 To sum up t h i s section so f a r , I have guided you through a c o l l e c t i o n of algorithms s u f f i c i e n t to solve the basic problems involved i n an implementation of TABLETOP.. These include algorithms for scanning an object's shape, for scanning the parallelograms and doughnut s l i c e s swept out i n the course of pushto and turn actions respectively, algorithms f o r tracing straight l i n e s and c i r c u l a r arcs, and algorithms for computing the exact distance to c o l l i s i o n * or angle to c o l l i s i o n * for these two basic actions. The algorithms given above for the turn action i n TABLETOP requires inverse cosines and extensive . case analysis. . The former are not computationally cheap* the l a t t e r requires careful and time-consuming coding. Conseguently I used a quicker* but d i r t i e r and computationally more expensive, method of implementation; This i s the second method referred to on page 92. Namely, when an object i s to be rotated the turn procedure: actually implemented does the following. The d i g i t a l representation i s erased, the Cartesian representation rotated by 1 0 ° , and i t s new projection onto TABLE scanned for obstructing squares (without actually drawing the d i g i t a l representation). This i s repeated u n t i l an obstructing square i s encountered or the intended anqle i s achieved. I f an obstructing square i s found, a binary search i s carried out over the l a s t sub-angle of rotation u n t i l the achieved position i s located to within 2° accuracy. This method leaves open the p o s s i b i l i t y that some small III«The simulated organism-environment system 115 obstacle may be jumped over between the 10° test positions. This has not yet happened i n practice, partly because only very simple TABLETOP environments have been used that do not contain small i s o l a t e d obstacles, and partly because the size of the movable objects has not been s u f f i c i e n t l y large f o r an obstacle to be missed i n a 10° rotation* . The simplest configuration in which such an incident could occur would have Utak grasping the narrow edge of a 1 x 14 movable object or " s t i c k " , an obstacle whose d i g i t a l representation occupies a single sguare of TABLE at a distance of about 13.5 from Utak, and Utak executing a turn action of more than 10° towards the obstacle (figure III.11). An important implementation problem arises i n practice. When many pushto and turn actions are applied to a movable object, the Cartesian representation of the object becomes deformed due to cumulative f l o a t i n g point inaccuracies. Thus what was o r i g i n a l l y a sguare may at some la t e r time look l i k e the end view of a squashed cardboard box. To overcome t h i s problem three Cartesian s t y l e representations are used for an object, not just one; When the object i s f i r s t s p e c i f i e d a base representation i s set up.. This i s i t s o r i g i n a l Cartesian representation. After any arb i t r a r y sequence of actions the current Cartesian representation can always be represented as one rotation and one tra n s l a t i o n applied to the base representation. Since rotations are r e l a t i v e l y uncommon* and are computationally expensive, a rotated base representation i s also used. This consists of the III»The simulated orqanism-environment system FIGURE III.11 A This shows the simplest kind of s i t u a t i o n i n which a p o t e n t i a l obstacle (marked 'B') could be missed by the algorithm a c t u a l l y implemented. Utak i s holding a long s t i c k and when he executes a turn action to the r i g h t of at least 10°, the obstacle i s missed by the algorithm. 117 base representation rotated by the angle between i t and the current Cartesian representation; During a sequence of translations between two rotations, the Cartesian representation at the end of each translation i s derived from the rotated base representation that was computed at the last rotation.. When a rotation occurs a new rotated base representation i s computed d i r e c t l y from the base representation. The current Cartesian representation at t h i s point i s then obtained by one translation from the new rotated base representation. With t h i s scheme implemented the Cartesian representation of a movable object cannot deform* however many pushto and turn actions are applied to the object. One f i n a l problem remains to be considered. I l l * ! . 2; 1. The overlay problem A problem involving the inte r a c t i o n of Cartesian and d i g i t a l representations crops up occasionally when Otak i s holding and moving an object. I refer to the system formed by Utak and a held object as a sum object. When he f i r s t grasps an object his d i g i t a l representation i s necessarily outside and contiguous with the object's d i g i t a l representation; At that time, the Euclidean distance d between his Cartesian position U and the nearest point N on the object's Cartesian representation must have a value s t r i c t l y between 0 and 2*root2.. The distance III«The simulated organism-environment system 1 1 8 d remains i n v a r i a n t over a l l f u r t h e r movements of the sum o b j e c t u n t i l Utak executes a l e t g o a c t i o n f o l l o w e d by a s l i d e a c t i o n . When d < root2 i t i s c l e a r l y p o s s i b l e t o p o s i t i o n the sum o b j e c t such that the p o i n t s U and N i n the C a r t e s i a n r e p r e s e n t a t i o n s l i e i n the same square of TABLE. Consequently i t i s p o s s i b l e f o r the d i g i t a l r e p r e s e n t a t i o n of Utak t o c o i n c i d e with a square i n the h e l d o b j e c t ' s d i g i t a l r e p r e s e n t a t i o n . . T h i s i s of no concern while Utak cont i n u e s t o hold the o b j e c t s i n c e i t does not a f f e c t the computations i n v o l v e d i n pushto and turn a c t i o n s . The-problem a r i s e s i f t h i s s i t u a t i o n occurs immediately before Utak l e t s go of the o b j e c t . . Suppose he l e t s go and then t r i e s t o execute a s l i d e action,. . The s l i d e r o u t i n e f i n d s t h a t Utak's s t a r t i n g p o i n t l i e s w i t h i n a square belonging to the d i g i t a l r e p r e s e n t a t i o n of an o b s t a c l e , and t h e r e f o r e f a i l s ! I f there are empty TABLE squares next t o Utak's square then the f o l l o w i n g procedure handles the problem. 1 . Let the value of BUGSQUARE be the c o o r d i n a t e s of the TABLE square c u r r e n t l y occupied by Utak, l e t OLDBUGSQUARE be the value of BUGSQUARE at Utak's p r e v i o u s p o s i t i o n * l e t BUG MARK be the c o l o u r assigned to Utak's d i g i t a l r e p r e s e n t a t i o n on TABLE, and l e t OVERLAY be the o v e r l y i n g c o l o u r of the BUGSQUARE. The value of OVERLAY i s the c o l o u r empty except when the BUGSQUARE i s w i t h i n the held o b j e c t ' s d i g i t a l r e p r e s e n t a t i o n . , 2. A f t e r a pushto o r t u r n a c t i o n , f i r s t draw the grasped o b j e c t , then s e t OVERLAY = COLOUR-OF (BUGSQUARE) COLOUR-OF (BUGSQUARE) = BUGMARK 3. I f Utak i s about t o execute, a s l i d e and i f OVERLAY y* empty, then do: COLOUR-OF(BUGSQUARE) = empty OLDBUGSQUARE = BUGSQUARE Compute the r e s u l t of the s l i d e * III«The simulated organism-environment system 119 I f achieved position s t i l l l i e s within OLDBUGSQUARE then COLOUR-OF(OLDBUGSQU ARE) = BUGMARK else COLOUR-OF(OLDBUGSQUARE) = OVERLAY This procedure has proved s u f f i c i e n t in practice but does not solve the problem in general. In fac t the d i g i t a l representation of Utak can l i e a r b i t r a r i l y f a r within the d i g i t a l representation of the held object. This can arise i f there i s a long straight "canal" of width s t r i c t l y between 1 and 2 units i n the object's Cartesian representation.. Let the canal have length n+1. In one position of the object the canal may l i e astride a column of squares. Then Utak could s l i d e to the head of the canal and grasp the object there* . In another position of the object the canal may not straddle any whole TABLE squares, so that the canal does not appear i n the d i g i t a l representation; Now suppose that Utak has grasped the object in the f i r s t type of position and has l e t i t go i n the second type of position; When he wants to execute a s l i d e , Utak i s hopelessly trapped with n squares of the object's d i g i t a l representation between him and the empty TABLE squares outside. This i s i l l u s t r a t e d i n figure III.12. One solution that immediately springs to mind and can be ea s i l y implemented within the current TABLETOP philosophy i s the following. Before a grasp action can be executed the 20 closest sguares to Utak's square must be empty and some square in the rinq of 24 next closest squares must belong to the object's d i g i t a l representation; This i s shown i n figure III.13. This ensures that no point of the subseguent held object l i e s within III«The simulated organism-environment system 120 FIGURE III.12 FIGURE III.12 - (a) The Cartesian representation of an object, with a canal of width 1.5. (b) The object positioned so that the canal i s open i n the d i g i t a l representation. Utak i s able to s l i d e to the head of the canal and grasp the object there. (c) The object positioned so that the canal i s closed. If Utak now l e t s go the object, no s l i d e action can get Utak beyond the borders of h i s current d i g i t a l representation. He i s trapped. 121 •K ___________ 4 • FIGURE III.13 - One solu t i o n to the overlay problem i s shown.here. Before Utak can success-f u l l y ' grasp an object, two conditions must hold. (1) The 20 squares of TABLE closest to Utak must be empty. (2) At least one of the 24 squares forming a ring around the 20 closest squares must belong to the object's d i g i t a l representation. 122 root2 units of Utak's position, and thus that the above "overlay" problem cannot arise* Another solution would require that, i n the Cartesian representation of Utak and the object to be held, Utak was not within root2 units of any edge of the object. This however would require closest edge calculations i n Cartesian coordinates, a type of c a l c u l a t i o n that I wish to try and avoid as much as possible. Now I s h a l l show some examples of the TABLETOP program in action. I I I . 1.3 An example of TABLETOP p_erf or ma nee ; The:following pages, figure 111*14, show excerpts from a session with TABLETOP recorded during UBC s Open House 1979, s l i g h t l y edited. It shows the state of the TABLE array as a human user solved the L-shaped object problem* The f i r s t snapshot includes a statement of the task, which i s read by the user, not Utak! The subseguent snapshots show: • an action command issued by the user • the r e s u l t i n g state of the TABLE array, with the BUGMARK '*• showing Utak's d i g i t a l representation a the contents of the nine TABLE squares i n the 3 x 3 array centred on Utak. (Thus the centre square shows the contents of the OVERLAY variable.), B the typed response from TABLETOP. {I have added comments within braces l i k e t h i s . j IIIaThe simulated organism-environment system • T R A N S L A T E A B Y (-10 0) I . E . H O V E I T DP B Y 10 U N I T S B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B * B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 1 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B A B A B A B A B A B A A B B B B B B B B > O K F i£UKE III.IA-( G B A S P ) 12V B B B B B B B B B B B B B B B B B B B B B , B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B * B B A B B A B B A B B A B B A B B A A A B B B B B B B B B B B B B B B B B B B B B B B B B . B B B B B B B B B B B B B B B B B B B B B B B m * c» > G O T I T ! (PUSHTO 6.0 N) 125 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B , B B ' B B B B - B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B * & B B A A B B A A A A A A A B B A A A A A A A B B B B B B B B B B : B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B BAA .4A > H I T ! (PUSHTO 1.0 B) 126 B B B B B B B B B B 5 B B B B B B B B B B B B B B B B B B B B B B B B B B ^ B B B B \ B B B B B B B B B B A . ^ B B * A A B B A A A B B B B B B B B B B B B B B B B B B B B B B B B B B A A A B B A A A A B B A A A A B B A A A B IB A A B B B B B B B B * B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B . . A . A A . . A > HIT! i (PDSHTO 5-0 N) 127 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B ,. _ : B B B B B B A A ft A B B * A A A B B A A B B A A B B A A B B A A B B A A B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B. B B B B B B B B B B: B B B B B B B B B B B B B B B B B B B B B B B S B B B B B B B B B o A A . AA > O K 128 III.2 The simulated organism Otak and his tasks III.2.1 Design considerations Now that I have described the simulated environment, what kind of organism should be b u i l t to l i v e there, and what kind of tasks should the organism be required to execute? These two questions are cl o s e l y linked since, for example, you cannot expect a colour blind human to respond to t r a f f i c l i g h t s correctly unless other cues such as l i g h t position are available. More precisely, what kind of actions should the organism be capable of executing and what kind of sensory input should the organism receive from i t s environment? The kinds of input/output allowed to the organism, and the kind of task he i s required to solve, both mould to a certain extent the design of the mediating mechanism, or organism-controller, that l i e s between input and output; Asking these questions of design immediately raises many fact u a l and methodological questions. How animal-like should the organism be? If so, what animal? If not, by what c r i t e r i a are the design decisions to be made? I f the simulated organism i s to be l i k e some s p e c i f i c animal, exactly what sensory input and motor output messages does that animal's brain receive and send? Since I am interested in the prin c i p l e s of behaviour of animals and humans, the organism should d e f i n i t e l y be III-The simulated organism-environment system 129 animal-like. The subsequent questions about sensory-motor I/O are, unfortunately, v i r t u a l l y unanswerable; i n no case are a l l the relevant facts for one intere s t i n g animal known. One might, instead, f a l l back upon the gross behaviour of an animal, but again, in almost no case are a l l the relevant f a c t s known! This si t u a t i o n has recently improved. M.J.Wells has collected a wealth of information about the physiology and behaviour of the octopus [Wells, 1978 ], and E.R.Kandel has published a comparable c o l l e c t i o n of information about an even simpler creature, the marine s n a i l Aplasia [Kandel,1978]. With a view to receptor design, I have perused various known facts about receptors i n mammals, including v i s u a l receptor densities, receptive f i e l d sizes, and magnification factors i n the brain. One has to resort to c r i t e r i a of elegance, naturalness, and f i n a l l y , i n the AI approach, on the c r i t e r i o n of computational f e a s i b i l i t y . This i s in contrast to most other experimental sciences, where the f i n a l arbiter i s experimental f e a s i b i l i t y . . My attitude was well put by the philosopher Daniel Dennett when he wrote [Dennett,1978,p.104] 11 one does not want to get bogged down with technical problems in modeling the:cognitive e c c e n t r i c i t i e s of t u r t l e s i f the point of the exercise i s to uncover very general, very abstract p r i n c i p l e s that w i l l apply as well to the cognitive organization of the most sophisticated human beings. So why not then make up a whole cognitive creature, a Martian three-wheeled iguana, say, and an environmental niche for i t to cope with? I think such a project could teach us a great deal about the deep pr i n c i p l e s of human cognitive psychology, but i f i t could not, I am guite sure that most of current A.I. modeling of f a m i l i a r human mini-tasks could not III«The simulated organism-environment system 130 either. 11 Utak i s my three-wheeled Martian iguana and TABLETOP i s his niche. I l l * 2 . 2 The sensory-motor c a p a b i l i t i e s - of-Utak Utak can move in a straight l i n e , he can grasp a movable object, and he can push* turn, and letgo a held object. He has f i v e motor outputs, only one of which i s active at once. Thus the design of his motor output immediately contradicts one of the obvious features of the design of natural motor output. This i s the fact that exactly one output has to be active to execute an action, whereas large numbers of output l i n e s are active when a b i o l o g i c a l system acts. Indeed, an a l e r t b i o l o g i c a l system could be described as a pattern transducer that transforms a never-ending series of input patterns on millions of input l i n e s into another never-ending series of patterns on a s i m i l a r l y large number of output l i n e s . This, of course, i s very d i f f e r e n t from a t y p i c a l present-day computer which channels a l l information through a bottleneck formed by the single high-speed CPU. It seems unlikely that we can get close to understanding the computations occurring i n b i o l o g i c a l systems i f we allow the "bottleneck" design of current computers to influence our thinking. The v i s u a l sensory input i s somewhat more r e a l i s t i c , consisting of 160 input l i n e s from 160 r e t i n a l receptors., Utak IIIaThe simulated organism-environment system 131 gets a bird's eye view d i r e c t l y down on h i s immediate environment as though his eye were on a s t a l k . The r e t i n a l f i e l d s are arranged as follows: 64 i n a central fovea, 48 f i e l d s each 4 times the size of a foveal f i e l d i n an intermediate zone surrounding the fovea, and 48 f i e l d s each 16 times the size of a foveal f i e l d in an outer, peripheral, zone. Each r e t i n a l c e l l registers a 3-bit graylevel, or integer in the range 0-7, that r e f l e c t s the r a t i o of object to t o t a l area i n the part of the tabletop covered by the c e l l ' s f i e l d (figure 1.3). The. colour of an object i s ignored. a set of 160 graylevels constitutes one r e t i n a l impression. Object colours can be sensed via a t a c t i l e impression, which consists of the colours of the 8 adjacent squares to Utaki The Utak simulation computes a new r e t i n a l and t a c t i l e impression each time. Utak comes to a halt. To do so i t superimposes the array of r e t i n a l f i e l d s on T a B L E , centred on Utak's d i g i t a l representation* and computes the graylevels d i r e c t l y from the TABLE array. an action by Utak w i l l be reflected by a change in the r e t i n a l impression only i f the d i g i t a l representation of Utak or of an object held by him changes; More sophisticated v i s u a l sensory systems are easy to propose, but t h i s one i s computationally cheap and has s u f f i c e d so far,; The concepts of speed, mass, acceleration, and momentum have not been implemented., a s the reader w i l l see, the attempt to design an organism-controller for t h i s simple world raises an IIIaThe simulated organism-environment system 132 ample range of interesting and fundamental problems i n perception and action without the addition of these extra features. Nonetheless, the distance between successive r e t i n a l impressions may be viewed as a measure of speed i f one assumes that r e t i n a l impressions are received at a constant rate. I l l . 2.3 Examples of Utak^s sensory-motor experience Figure III.15 shows the r e t i n a l and t a c t i l e impressions received by Utak immediately prior to the f i r s t few actions in the performance of section I I I . 1.3. I l l - 2 . U Examples of tasks for Utak Here:I present a l i s t of tasks, in English, which I would expect a competent organism-controller f o r Utak to be able to handle.. Their method of presentation to Utak's organism-controller w i l l be described in section IV.2. "Go to the.northeast corner" "Go to the next room" "Go to the square" "Go round the square and return" "Push the square into the northeast corner" "Push the square into the next room" "Push the brick through the door" "Push the brick around the corner" "Push the L-shaped object into the next room" IIInThe simulated organism-environment system FIGURE III.15 c c ( c c c c c c ( c c c c c ( .(' c ( 16151413121 1 109 8 7 6 5 1 . 3 2 1 0 1 2 3 4 5 6 7 7|7 7 I 7 7 j 7 7(7 7|7 71 7 7 | 7 7J7 7|0 71 0 71 0 7| 0 7| 0 7J 0 7| 0 71 0 9 10 111213141516 . 16 717 01 0 0(0 01 0 710 01 0 0]0 0)0 7 I 7 OJ 0 0(7 0(7 0 I 7 OJ 7 0)7 017 0 * (ROLL 5.0 HE) > (4.24164 0.735398) * (THLOOK) 134. 1 6 1 5 1 1 * 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 ' 1 1 5 1 6 if f f ( c c ( c c ( c c c c c c c c c c ( - — 1 • • 1 1 1 0 1 0 I I 0 1 4 0 1 0 1 1 0 j 7 i o ' 0 | 0 | 0 1 0 0 j 0 iv j o " 0 | 0 | 0 1 0 0 1 0 : | 7 I 0 ' O J 0 | 0 | 0 0 1 0 | i 7 | o ' 7 | . 7 | 7 j 7* 717*1 I 7 1 0 J 0 | 0 | 7 | 0 0 I 0 1 | 7 | 0 0 J 0 | 0 | 7 0 | 01 1 7 J 0 J 0 | 0 | 0 j 7 0 j 0 ( | 7 | 0 01 0 | 0 | 7 0 1 0 | "» 1 1 0 | (J 1 i 0 . 1 0 I 2 B B B . * _ . - & 16 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 (* 3 2 1 0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 . 1 6 > N i l . * (ROLL 1 . 0 E) > ( 1 . 1 . 5 7 0 7 9 6 ) * (THLOOK) 135 When a compass direction appears in the task statement t h i s refers to Utak's own l o c a l orientation system, which need not coincide with the TABLETOP orientation. I t i s i n i t i a l i z e d when the f i r s t r e t i n a l impression i s received. Whatever dir e c t i o n he facing at that time becomes north i n his orientation system. I do not claim to have a system or even the outlines of a system that can handle a l l these tasks; I am presenting t h i s l i s t here to show the ultimate design goals for a robot^controller for Utak. III.3 An extension and two generalizations of TABLETOP The purpose of t h i s section i s to discuss issues that arise from the design of TABLETOP. These are not germane to the main argument of my thesis but are of some . interest i n t h e i r own ri g h t . They are also relevant to questions i n automatic assembly. The f i r s t issue concerns exactness. How accurate i s the TABLETOP simulation, and how, i f at a l l , could i t be extended to achieve exactness? For the moment I w i l l assume that the referent for the terms "accuracy" and "exactness" i s the usual Cartesian representation of shapes, using real numbers represented to a limited precision i n some computer. The motion of an object may, i n the worst case behaviour of TABLETOP, be halted i f a point of the moving object comes within root2 of a potential obstruction, whether or not a c o l l i s i o n would occur in Ilt«The simulated organism-environment system 1 36 t h e C a r t e s i a n r e p r e s e n t a t i o n . T h i s c a n o c c u r i f an edge o f t h e o b s t a c l e i n t e r s e c t s a TABLE s q u a r e : a r b i t r a r i l y c l o s e t o one c o r n e r and i f t h e p a t h o f O t a k , o r a p o i n t o f a h e l d o b j e c t , i n t e r s e c t s t h e same TABLE s q u a r e b u t a r b i t r a r i l y c l o s e t o t h e d i a g o n a l l y o p p o s i t e c o r n e r * . The TABLETOP c o l l i s i o n p o i n t may be a r b i t r a r i l y f a r f r o m t h e C a r t e s i a n c o l l i s i o n p o i n t , o r e v e n w o r s e , t h e TABLETOP c o l l i s i o n p o i n t may n o t c o r r e s p o n d t o a C a r t e s i a n c o l l i s i o n p o i n t * T h e s e c a s e s c a n a r i s e i f t h e l i n e o f a p p r o a c h o f O t a k , o r an o b j e c t , makes a n e a r - z e r o a n g l e w i t h a p o t e n t i a l o b s t r u c t i n g edge. How c a n t h i s s t a t e o f a f f a i r s be r e m e d i e d ? I n d e s c r i b i n g t h e p o s s i b l e c u r e s I r e s t r i c t a t t e n t i o n t o t h e c a s e o f a m o v i n g p o i n t (Otak) a p p r o a c h i n g an o b j e c t . , The f i r s t c u r e i s t h i s . , I n t h e c o u r s e o f p r o j e c t i n g o b j e c t s o n t o t h e TABLE a r r a y , w henever a TABLE s q u a r e i s e n t e r e d by an edge a p o i n t e r b a c k t o t h e t r a v e r s i n g edge i s s t o r e d a t t h a t s q u a r e . I f a s q u a r e i s e n t e r e d by s e v e r a l e d q e s a p o i n t e r i s s t o r e d f o r e a c h e d g e . . Then e a c h t i m e t h e p a t h o f Otak e n c o u n t e r s an o b s t r u c t i n g s q u a r e on t h e TABLE, t h e C a r t e s i a n r e p r e s e n t a t i o n ( s ) o f t h e edge (s) w h i c h c a u s e d t h i s s g u a r e t o be m a rked as an o b s t r u c t i o n i s ( a r e ) r e t r i e v e d . Then t h e C a r t e s i a n c o o r d i n a t e s o f t h e c o l l i s i o n p o i n t * i f a n y , a r e c o m puted by any s t a n d a r d l i n e i n t e r s e c t i o n a l g o r i t h m . The s e c o n d c u r e i s b a s e d on t h e i d e a o f r e p e a t e d l y p r o j e c t i n g C a r t e s i a n r e p r e s e n t a t i o n s o n t o t h e TABLE a t h i g h e r and h i g h e r s c a l e s o f m a g n i f i c a t i o n , e a c h t i m e r e - d e t e r m i n i n g t h e III»The s i m u l a t e d o r g a n i s m - e n v i r o n m e n t s y s t e m 137 o b s t r u c t i n g squares. The process h a l t s when the c o l l i s i o n p o i n t , i f any, has been found to w i t h i n the r e q u i r e d accuracy. I c a l l t h i s the focus method. To e x p l a i n i t I need some terminology. . A C - r e p r e s e n t a t i o n (R,C) i s a c o l l e c t i o n R of C a r t e s i a n r e p r e s e n t a t i o n s of one or more d i s t i n c t o b j e c t s , using some c o o r d i n a t e system C. A c o o r d i n a t e system C i s obtained by the a p p l i c a t i o n of a sequence of r o t a t i o n , t r a n s l a t i o n , and s c a l i n g o p e r a t i o n s to some f i x e d i n i t i a l c o o r d i n a t e : system. Let a window W on a C - r e p r e s e n t a t i o n (R,C) be a r e c t a n g l e of any s i z e or o r i e n t a t i o n . Say t h a t a C - r e p r e s e n t a t i o n (R,C) has been t a b l e d with r e s p e c t t o a g i v e n window W i f a) A l l p a r t s of R that l i e wholly o u t s i d e W are removed and any l i n e segment of R t h a t i n t e r s e c t s an edge of W i s r e p l a c e d by a l i n e segment t h a t t e r m i n a t e s at t h a t edge* In computer g r a p h i c s terms, R i s c l i p p e d * . b) The c o o r d i n a t e system C i s transformed i n t o a new system by • r o t a t i n g i t i n t o alignment with the edges of W, a moving the o r i g i n to the centre of W, • a p p l y i n g s c a l e f a c t o r s , one i n each c o o r d i n a t e d i r e c t i o n , so that the s i d e s of W c o i n c i d e with the s i d e s of TABLE. c) The C - r e p r e s e n t a t i o n (R,C) i s p r o j e c t e d onto TABLE. Suppose the c o o r d i n a t e system C* i s the IIIaThe simulated organism-r e s u l t of a p p l y i n g environment system 138 to a coordinate system C a series of several rotation, t r a n s l a t i o n , and scaling operations as i n b) above. Such a series can always be reduced to one rotation, one t r a n s l a t i o n , and two scalings., Let Q be a unit square in C'. Let Q' be the rectangle i n C that i s obtained by applying to Q, in reverse order, the inverses of the operations in the.series. Then the resolution of the coordinate system C i s defined to be the maximum of the lengths of the sides of Q in the o r i g i n a l system C, I c an now describe more precisely the focus meth od for finding a s accurately as desired the c o l l i s i o n point. i f any, between Otak's intended path and an obstacle. Let E be the c o l l e c t i o n EO of the o r i g i n a l Cartesian representations o f a l l the. obje cts and the verge in the environment, l e t C be the o r i g i n a l coordinate system CO, and l e t W coincide with WO r the sides of TABLE. Let 6 be the resolution required. CP1. T able the C-representation (R,C) with respect to the window W. Let (R ,,C) be the new C-representation* CP2,. Find a l l potential obstructing TABLE squares alonq Otak's intended path.. If there are none then exit with the messaqe "no c o l l i s i o n found". Otherwise, i f the resolution of C i s less than 6, then compute the point of c o l l i s i o n of the intended path with the f i r s t obstructing square encountered. Find the.coordinates of t h i s point i n the o r i g i n a l coordinate system CO and e x i t III«The simulated organism-environment system 139 with these coordinates for the point of c o l l i s i o n . Otherwise, continue.. CP3,. Take the smallest rectangle W1 that i s aligned with the d i r e c t i o n of motion of Otak and that contains a l l the po t e n t i a l obstructing squares found i n step CP2. Let (R,C)= (R« ,C) , the window W=W«, and go to step CPl. A magnification always occurs at step CP1 i f the new window w"' i s smaller than the previous window W. The rectangle W1 w i l l always be aligned with the coordinate axes except, possibly, the f i r s t time that CP3 i s executed* Thus a rotation i s executed in step CP1 at most once. This ro t a t i o n , permitted by allowing the window W» i n CP3 not to be aligned with the axes, i s necessary to handle one special type of case* Namely, the case where the potential obstructing squares form a diagonal across the TABLE array, as can happen i f an edge and Otak's path both extend approximately corner-to-corner and both l i e approximately p a r a l l e l to each other. A window aligned with the axes would not, i n t h i s case, be smaller than the current window, and consequently no magnification could occur. As a r e s u l t of this single rotation, the intended path of Otak i s always p a r a l l e l to one of the axes, say the v e r t i c a l . Suppose the TABLE grid has n unit squares along each side.. Then the rectangle W of CP3 w i l l have horizontal width one in every execution of CP3 after the f i r s t , since a l l the squares IIIoThe simulated organism-environment system 140 intersected by a v e r t i c a l l i n e l i e in a single column., The horizontal scale factor in CP1 w i l l therefore be n in every execution of CP1 after the. second. . Since n i s an integer greater than 1, a horizontal magnification occurs i n every execution of CP1 aft e r the second. This may seem l i k e a computationally expensive method to use* One reason I have sketched i t out i s because, i f the C-representation consists only of convex shapes, the projection onto TABLE can be done very fast with some simple p a r a l l e l hardware. I f such hardware was available, t h i s magnification method might become fea s i b l e . . Another reason i s that t h i s same method* i n simpler form, can be used to solve l i n e a r programming problems i n any dimension. A f i n a l reason i s that an extension of the focus method i s used in SHAPE, the sp a t i a l planner in the organism-controller of Utak. The p a r a l l e l hardware reguired consists of one component for each TABLE sguare. Given a l i n e L, i t s coordinates are broadcast to every component. Each component computes whether i t s corresponding TABLE sguare l i e s to the right of, to the l e f t of, or i s intersected by, the l i n e L. Let t h i s computation take one time unit. Then the projection of a convex shape S bounded by m l i n e s takes m time units, one for each l i n e , plus the time for one extra AND operation by each component. The AND operation i s t h i s . If a TABLE square l i e s to the right of* or i s intersected by, every l i n e of the. shape. S, then the corresponding component signals "inside S"; otherwise the III«The simulated organism-environment system 141 component signals "outside S". . One other question naturally arises. Can the design of TABLETOP be generalized to three or higher dimensions? The answer i s yes, provided the projection of an n-diraensional convex polytope onto a generalized TABLE array can be computed. The generalized TABLE consists of an n-dimensional array of unit hyper-cubes. The scan-table technigue used in TABLETOP for projecting a convex polygon onto the TABLE does not e a s i l y generalize to n dimensions.. To apply the scan-table technique i t must be easy to compute which hyper-cubes a hyper-plane passes through. In three dimensions t h i s i s the problem of determining, f o r each face of a polyhedron, which unit cubes the face i n t e r s e c t s . When the face i s obligue to a l l the coordinate axes there i s no simple algorithm corresponding to the l i n e - t r a c i n g algorithm i n two dimensions., Thus the scan-table technique does not seem to generalize. However, the method sketched above for computing i n p a r a l l e l the projection of a convex polygon onto TABLE generalizes e a s i l y . . For each hyper-plane one simply computes i n p a r a l l e l , for each unit hyper-cube of the n-dimensional array, whether the hyper-cube l i e s to the l e f t of, to the right of, or i s intersected by, the hyper-plane. One f i n a l AND operation for each hyper-cube completes the computation,. This method can also be used to compute.the hypercubes swept out by a leading hyper-plane in the course of a t r a n s l a t i o n , or to compute the segment of a hyper-sphere IIIaThe simulated organism-environment system 142 (generalization of a doughnut s l i c e ) swept out by (a part of) a hyper-plane i n the course of a rotation; In t h i s l a t t e r case one has to compute whether a hyper-cube i s inside, outside, or intersected by the surface of a hyper-sphere; Thus the basic TABLETOP method can be generalized to higher dimensions. + + + + + In t h i s chapter I have described the design of the TABLETOP simulation system, and gone into s u f f i c i e n t d e t a i l that the e s s e n t i a l problems to be handled in an implementation are clear. I have also shown how t h i s design could be extended to obtain more accurate c o l l i s i o n points, and how the two dimensional tabletop could be generalized to three or more dimensions.. In p a r t i c u l a r I introduced the focus method for obtaining more accurate c o l l i s i o n points. This w i l l reappear l a t e r in the design of SHAPE, the s p a t i a l planner. In conclusion, considerable programming e f f o r t i s required to simulate an environment as simple as a tabletop.. The advantages of such a system are that some of the problems associated with r e a l world sloppiness are avoided, no a d d i t i o n a l hardware i s required, and the sensory-motor experience of a prototype organism-controller i s e a s i l y reproducible. In the next chapter I describe a class of algorithms fundamental to the functioning of the organism-controller. III»The simulated organism-environment system 143 CHAPTER IV TOWARDS THE DESIGN OF A ROBOT-CONTROLLER The purpose of t h i s chapter i s to present an approach to the design and implementation of a robot-controller for Utak. As described i n the introductory chapter, any such design seems to reguire two parts, a data part c a l l e d the world model or cognitive map and a process part c a l l e d the action cycle. This l a t t e r consists of a loop containing the three subprocesses of perception, planning, and action. The chapter i s structured as follows. In the f i r s t section I present an analogy that i s useful in approaching the problem. In the second section I present the parts required of any robot-controller and in the t h i r d I present a scenario of the behaviour which any complete robot-controller f o r Utak should display to be acceptable. In the fourth section I describe the progress made in one approach to the design and implementation of a robot-controller, and in the l a s t section I describe an alternative approach to t h i s problem. IV.1 An analogy I st a r t with a thumbnail sketch of the well-known analogy between the s c i e n t i f i c method and the process of perception IVnTowards the design of a robot-controller 144 since t h i s was the s t a r t i n g point f o r my design of the ;organism-controller* Consider an experimenter investigating some phenomenon. He or she wants to understand the phenomenon and proposes an hypothesis. To test i t s v a l i d i t y t h i s hypothesis i s used to predict what w i l l be observed i f certa i n actions are done - an experiment. He or she c a r r i e s out the experiment and makes observations. I f the observations are almost exactly as predicted then the experimenter's degree of confidence or b e l i e f i n the hypothesis increases.. One then says that the hypothesis explains the observations. If the observations are not as predicted but the hypothesis can e a s i l y be modified to accommodate the observations, e.g. by changing a parameter* then the degree of confidence remains as before but in an improved hypothesis. If the observations are not as predicted and cannot be accommodated by simple parameter adjustment then the experimenter makes a str u c t u r a l change, i f possible, to enable the hypothesis to accommodate them.. If there is s t i l l an observation which the experimenter cannot currently explain by an hypothesis then i t i s noted but otherwise: ignored. With t h i s new hypothesis, or old hypothesis with higher confidence, the experimenter designs another experiment and makes more observations, accommodates the hypothesis to these, and so on* Eventually the hypothesis w i l l , i n p r i n c i p l e , be so well adjusted to the observations that the hypothesis w i l l be generally accepted as a useful description of one aspect of Nature. The hypothesis w i l l be consistent with IVaTowards the design of a robot-controller 145 a l l the observations so f a r , or in other words may be regarded as the truth at that p a r t i c u l a r time and place;. Note the :pragmatic nature of science: whatever theory i s most s a t i s f a c t o r y at a p a r t i c u l a r time i s used as a basis for action. For instance, Newtonian mechanics was an acceptable and immensely successful theory even though i t was known that i t could not explain the precession of the perihelion of Mercury., Now return to Otak in his simulated world. . At a l l times Utak maintains an hypothesis about the world, c a l l e d the world model.. Each part of the world model has an associated degree of confidence, and these degrees of confidence may vary from time to time* In general the degree of confidence associated with a p a r t i c u l a r part w i l l increase with time; only the occurrence of some guite unusual event w i l l cause i t to decrease. The experimenter i s Utak; the phenomenon to be explained i s the external world; the observations, or pieces of evidence, are provided by the series of sensory impressions impinging on Utak; and any hypothesis or world model must be consistent, as far as possible, with the series of sensory impressions.. At the very l e a s t , the current world model must be consistent with the most recent sensory impression. In t h i s analogy, £§_rception i s the act of accommodating the world model to explain the current sensory impression* while maintaining consistency as far as possible with previous sensory impressions. When there i s no externally imposed task, planning i s deciding on an experiment to gather more evidence to IV«Towards the design of a robot-controller 146 c o r r o b o r a t e the c u r r e n t world model. Acting, i s simply c a r r y i n g out the planned a c t i o n s . Each act w i l l be executed with a speed dependent on the degrees of c o n f i d e n c e a s s o c i a t e d with the p a r t s of the c u r r e n t world model most r e l e v a n t t o t h i s p a r t i c u l a r a c t . I f a l l p a r t s of the hypothesis have been c o r r o b o r a t e d to a high degree of confidence then i t may seem to Utak t h a t he knows the whole world, even though i n a c t u a l f a c t t h e r e may be c o n s i d e r a b l e d i f f e r e n c e between h i s hypothesis and the c u r r e n t s t a t e o f TABLETOP. In other words he may s t i l l be mistaken even when he seems t o know otherwise. I f t h e r e i s an e x t e r n a l l y imposed task which Utak must perform then provided the c u r r e n t hypothesis has some o v e r a l l minimal degree of b e l i e f , Utak w i l l c o n s t r u c t a plan to accomplish the task on the b a s i s of t h i s h y p o t h e s i s . Any sensory impression r e c e i v e d while c a r r y i n g out t h i s plan must,be accommodated by the hypothesis. T h i s c o n t i n u a l c y c l e of< p e r c e p t i o n * p l a n n i n g , and a c t i n g i s , of course, the a c t i o n c y c l e * When Utak i s given a task he f i r s t assumes a d e f a u l t world model* then opens h i s eye and r e c e i v e s the f i r s t r e t i n a l i m p r e s s i o n . He i n t e r p r e t s t h i s f i r s t sensory impression and m o d i f i e s the d e f a u l t world model to accommodate i t * Then he i n t e r p r e t s the task statement i n terms of t h i s world model, and j passes c o n t r o l to the planner which makes an i n i t i a l plan to accomplish the task. An a c t i s decided on by examining the f i r s t few a c t i o n s of the p l a n , and executed. Then another r e t i n a l impression i s r e c e i v e d , i n t e r p r e t e d and accommodated by IV«Towards the design of a r o b o t - c o n t r o l l e r 147 the world model, the plan modified i f necessary, and the next act produced and executed. This analogy with science constrasts with a naive Map-in-the-Head design. In t h i s , s p a t i a l knowledge resides in a structure isomorphic to a printed map and s p a t i a l reasoning occurs when the "mind's eye" examines t h i s structure. Such a proposal begs answers to many questions, the most important of which i s , perhaps: Who draws the map? This i s answered by the analogy with the s c i e n t i f i c method: By a process of hypothesis assumption and modification* using p a r t i a l evidence presented through the senses. IV.2 The parts of an organism-controller Any complete organism-controller for Otak must contain at least the following program steps. These can be stated here without specifying data structures or processes. A l l that i s needed i s a world model, a way to receive a r e t i n a l impression, and an action e f f e c t o r . INITIALIZATION STEPS • 1. Set the current world model equal to some default world model. 2. Receive the f i r s t r e t i n a l impression. 3. Analyze the r e t i n a l impression into regions and borders.. 4. Interpret the regions i n the r e t i n a l impression and id e n t i f y the image of Otak in the r e t i n a l impression. IVaTowards the design of a robot-controller 148 5. Modify the default world model to be consistent with the interpreted r e t i n a l impression. 6. Accept a task and interpret i t i n terms of the world model., This may require substantial modification of the world model, for instance the addition of an object i f one i s mentioned i n the task but no object i s " v i s i b l e " in the current r e t i n a l impression. PLAN 7. Construct a plan to achieve the task, usinq the s p a t i a l planner. THE ACTION CYCLE ACT • 8. Test whether the task i s complete*, If so, STOP. 9. Decide on the next action to take, by examining the i n i t i a l portions of the plan and the degrees of confidence associated with those parts of the world model close to the planned actions. 10. Execute the next action and receive the next r e t i n a l impression. PERCEIVE 11. Interpret the new r e t i n a l impression on the basis of the current world model, and modify the world model as necessary to make i t consistent with the: current r e t i n a l impression., 12. Is the plan s t i l l viable? If so go to 8. IVsTowards the design of a robot-controller 149 1 3 . , Otherwise, re-compute a l l or p a r t of the plan* as i n step 7 , and go to 8. The p a r t s of the a c t i o n c y c l e c o r r e l a t e with f i g u r e 1.6 as f o l l o w s . Steps 8, 9, 6 10 are c a r r i e d out by ACT. Step 1 1 , " p e r c e i v e " , i s c a r r i e d out by ACCOM. . Steps 12 & 13 are c a r r i e d out by SPLAN. A task statement as r e q u i r e d i n step 6 i s assumed to be presented as two parameterized world models, a s t a r t i n g and a g o a l world model; For example the world models co r r e s p o n d i n g to the task "Push the square o b j e c t i n t o the next room" w i l l have two rooms, a square o b j e c t , and a connecting doorway, the only d i f f e r e n c e between the s t a r t and g o a l world models being i n the p o s i t i o n of the sguare o b j e c t . The problem i n step 6 i s to r e c o n c i l e the c u r r e n t l y assumed d e f a u l t world model with the world model i m p l i e d by the task statement,; I make t h i s assumption t o circumvent the h a n d l i n g of n a t u r a l language i n p u t . IV. 3 The g o a l behaviour f o r an o r g a n i s m - c o n t r o l l e r The intended meaning of some of the task statements of I I I . 2 . 4 (page 134) i s i l l u s t r a t e d in f i g u r e IV. 1. T h i s shows the intended s i t u a t i o n s before and a f t e r each task but does not i n d i c a t e how the world model of Utak might change while executing a task. A d e t a i l e d s c e n a r i o of the intended behaviour of Utak as he c a r r i e s out one task appears i n f i g u r e I V .2 . , I t IV«Towards the design of a r o b o t - c o n t r o l l e r FIGURE IV.1 The meaning of task statements. I 150 i t A "GO TO NORTH EAST CORNER" "GO ROUND SQUARE AND RETURN" "PUSH SQUARE OBJECT TO NORTH EAST CORNER" "PUSH L-SHAPED OBJECT INTO NEXT ROOM" 151 s t a r t s with a summary on the f i r s t page (a), showing how the many pages of t h i s figure relate to executions of the action cycle* In the i n i t i a l TABLETOP si t u a t i o n S-1 (b), Otak i s located i n the area of the southwest corner, a square object l i e s in the northeast corner, and two thin horizontal obstacles separated by a small gap are i n the east half of the tabletop. The actual tabletop or "room" dimensions are 40X40. The default world model assumed by Otak before opening his eye is a sguare room of dimensions 36X36 centred on him (c). The f i r s t r e t i n a l impression i s shown i n (d) with the preferred line-segment interpretation superimposed on i t . . When th i s interpretation i s reconciled with the default world model, WM-1 i s obtained (e), containing a single small object o b j e c t l . Then the task statement i s received ( f ) , which r e a l l y consists of two subtasks.. Since there already i s a square object, o b j e c t l , in the current world model WM-1, t h i s i s immediately i d e n t i f i e d as the square object of the task statement* Thus no modification to WM-1 i s required by the task statement. If the statement had included, for instance, "go between the square.and the L-shape" then an L-shaped object would have had to be hypothesized in a position beyond the area covered by the r e t i n a . . A path i s planned i n the world model and a f i r s t action decided on (g). The size of the action* or equivalently the distance t r a v e l l e d between r e t i n a l impressions, i s proportional to the confidence with which the structure of the world model i s known.. This IV«Towards the design of a robot-controller FIGURE IV.2{a) Executions of the a c t i o n c y c l e . I (b) I n i t i a l s i t u a t i o n S-1. (c) Default world model ¥M-0 (d) F i r s t r e t i n a l impression RTI-1 . {e) F i r s t world model WM-1 {£•) Task statement (g) F i r s t plan, PLAN-1, and f i r s t a c t ACT-1 (h) New s i t u a t i o n S-2 (i) Next r e t i n a l impression RTI-2 (j) World model WM-2, plan PLAN-2 , act ACT-2 <k) S i t u a t i o n S-3 (1) R e t i n a l impression RTI-3 ,(m) World modal WH-3, completely new plan PLAN-3, a c t ACT <.n) S i t u a t i o n S-4 (p) R e t i n a l impression RTI-4 <g) World model WM-4, plan PLAN-4, act ACT-4 (r) S i t u a t i o n S-5 <s) R e t i n a l impression RTI-5 (t) World model WM-5, plan PLAN-5, act ACT-5 (u) S i t u a t i o n S-6 iv) R e t i n a l impression RTI-6 (w) World modal WM-6, plan PL AN-6 , act ACT-6 ' 53 > 30 RO'JND THE SQOARE OBJECT TO THE SE CORNER > * (TA.BLETOP) * B B B B B B B B B B B B B B B B 3 B 3 B B B B B B B B B B B B B B B B B B B B 3 3 8 * B 3 * B 3 * B B * B 3 * B C C C C B * B C C C C 3 * B C C C C B * B C C C C B * 3 B * B B * B B * B B * B B * B 0 * B B * B B. * B B * B B * B B B B B B B B B B B B B B B B B B * B B * B B * B 8 * B B * B B * B ' 3 * B B * B B * B B * B B * B B * B 3 * B B * B * ' . ' 3 * B B * B 3 * B B * B B * B B * B 3 * B 3 * B B B B B B 3 B B B B B B B B B B B B B B B B B B B B . B B B B B B B B B B B B B B 3 FIGURE I V . 2 (c ) The d e f a u l t w o r l d mode l WM-O. a A FIGURE I V . 2 (e) The w o r l d mode l WM-1 a f t e r t h e f i r s t r e t i n a l i m p r e s s i o n R T I - 1 r e c e i v e d . FIGURE IV.2 (d) Retin a l impression RTI-1. 7 i O o o O O SB 7 O o o O o O 7 o o o © o o © © o o o o o o © o i O o cnnnnnan o o o o / •••••••• •••••••• o o 7 i 0 o • • • • • • • E o o o o o •••nnnnc • • • • • • c n o o o i u o o © © o o o o o 1 V i # » » .9 p. to o • © _ 7 7 7 7 7 7 7 7 7 7 7 y 7 7 7 7 This shows the gray l e v e l s received by Utak's r e t i n a from the TABLETOP world. The ce n t r a l '7' i s the image of Utak. The ov e r l a i d dashed l i n e s show the line-segment i n t e r p r e t a t i o n . FIGURE IV.2 (f) Task statement "Go round the square object to the south-east corner". This may be translated as: "Find a square object." "Keeping the square object on your r i g h t , to to a point near the square object on the side away from your current p o s i t i o n " S t i l l keeping the square object on your r i g h t , go from t h i s point to the south-east corner." • • A FIGURE IV.2 (g) PLAN-1, ACT-1, superimposed on WM-1. The thickened l i n e s correspond to the l i n e segment i n t e r p r e t a t i o n of RTI-1. The other segments forming the boundary of the tabletop are hypothesized. * (BOLL 9.0 E) (TABLETOP) (THLOOK) * B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 3 B B 3 B B * B B '* B B * B B * B B * 3 C C C C B * B C C C C B * B C C C C B * B C C C C B * B B * B B * B B * B B * B B * B B * B B * B B * B B * B B « 3 B B B B B B B B B B B B B B B B B * B B * fl B * B B * B B * B * B * B B * B B * B B * B B * B B * B B * B " " B * B B * B B * B B * B B * B B * B B * B B * B B * B B • B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 3 B B 3 B B B F I G U R E | V . a (4.) S c W f c c - n S - A FIGURE IV.2 ( i ) Retin a l impression RTI-2 « 4-i I 6 0 a o o o b o o O o J 4 4- 0 6 0 0 o. 0 0 * 0 A i 0 0 0' d 0 d o' 0 th-! i * '& ' -1 i 0 0' 0 0 « 0 » 0 0 0° 0 0 0 d d 0 0° • •nnnnnn • • • • • • a n d 0° 0* o° 0 0 6 0 r 0 e 0 b 0 0° d •••••••• d d d 0° 0 0 i 6 n 0° 0° o 0 © 0 0 a 6 0 0 o6 0° 0* 0° 0' 0° d d -® 0 d i * 4 0 0 0 o 0 0° 6 0 0 o 0 1 4 0 0 0 0 0 © 0 0 0 0 The predicted graylevels are insc r i b e d i n the top r i g h t hand corner of a l l but the foveal r e t i n a l f i e l d s . The predicted l i n e segment i n t e r p r e t a t i o n i s shown by the over l a i d dashed l i n e s at the l e f t hand side and at r e t i n a l f i e l d ( ( o f ) . The only difference between predicted and actual graylevels occurs at ( y f l ) ; t h i s r e s u l t s i n a new l i n e segment i n t e r p r e t a t i o n overlaying both f i e l d s (*) and (G) . FIGURE IV.2 (j) World model WM-2, with PLAN-2 and ACT-2. The p o s i t i o n and shape of object 1 have been updated - i t i s no longer a square object. The previous plan, PLAN-1, had to be modified s l i g h t l y . • B B B B B B B B B B B B B B B B 3 B 3 B B B B B B B B B B B B B B B B B B B B B B B * B B * B B * B B * B B * B C C C C B * B C C C C B * B C C C C B * B C C C C B * B B * B B * B B * B B * B B * B B * B B * B B * B * B * B B * B B B B B B B B B B B B B 3 B B B B * B B * B B * B B * B B * B B * B B * B B * B 8 * B B * B B * B B * B B * B B * B " B * B B * B B * B B * B B * B B * B B * 3 B * B B B B 3 3 B D - B B 3 B B B B B B 3 B B B B B B B B B 3 B B 3 B B 3 3 3 8 B B 3 B B FIGURE. IV.2 (1) Retinal impression RTI-3. 7 o 7 o r O 7 7 o r o 7 O 7 o o o o o o © o o o o o 2l t t o e O o o o o o o o O • o • o o O o « o * o B o to o • o o « O e o o « 6 e o o O •••••••• •••aaooQ « o t> o « 0 • o o C? •••••••• • • • • • • 3 3 o o' o © o • a o • • • • • • • a o f 1 - * • o • o • • • • • • E W C C C C 3 E E n ¥• 0 o o o © e o « o o • c *> o o o 6 o © o « o a o *> o a o o a o a o o © o e o • o o o o o o O 6 o O o The actual gray levels differ in several places from the predicted gray levels (in the RH corner of each f i e l d ) . The row of O's across the top forces the north verge out by four units. The 2 and 6 in the top RH corner forces the introduction of a new object. Finally, the several differences at middle right force another change in the shape of object 1. FIGURE IV.2 (m) World model WM-3, with PLAN-3 and ACT-3. O B J E C T Z PLAN - *5 The north verge moved out by four units; object 2 is new and is square while the old object 1 can no longer be considered square; therefore, object 2 is assumed to be the square object of the task. * (BOLL 3.0 2) (T&BLETOP) (THLOOK) > (3. 1. 570796) • B B ' B B B B B B B B . B B B B B B B B B B B - B B B B B B B B B B B B B B B B B B B B B * B B * B B * B B * B B * B C C C C B * B C C C C • B * B ' C C C C B * B C C C C B * B B * B B *'B B * B B * B * B * B B * B B * B B * B B * B B * B B B B B B B B B B B B B B B B B B * 3 B * B B * B B * B - B * B B * 3 B * B B * B B * B B * B B * B B * B B * 3 B * B B * B B * B B * B . B * B B * B B * B B * B B * B B B B . B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B. 3 3 B B B B B F I G U R E j \ f . a gnD *^u.a+t*n S-(5& FIGURE IV.2 (p) Retin a l impression RTI -4. 7 7 7 1 7 7 T 7 7 y r 7 e> o o O a O o o CF o V o 0 0 0 0 o 0 •* D o * o • : 7 • * • o o O o o a o • o 0 o 0" *> o e 0 o 0" o a o « a o o e> O •••••••• o *> o o t> o o d »> o O O « o o O 0 o • o 7 L « o cf « a o o o o O o o 9 o o o o o O e o « o o a o 9 O The gray l e v e l differences on the right-hand side force the east verge to be moved out by two un i t s , and a new object, object 3, to be introduced. FIGURE IV.2 (q) World model WM-4, w i t h PLAN-4 and ACT-4. The east verge moved out by two u n i t s ; new obj ect 3 * ( R O L L 1 . 0 S ) > ( 1 - 3 . 1 4 1 5 9 3 ) * ( T A B L E T O P ) * B B B B B B B B B B B B B B B " B B B B B B B B B B B B B B B B B B B B B B B B B B B * B B * B B * B * B * B . B * B C C C C B * B C C C C B * B C C C C B * B C C C C B * B B * B B * B B * B B * B B * B B * B B * B B * B B * B B * B B B B B B B B B B B B B B B B B B * B B * B B * B B * B B * B B * B B * B B * B B * 3 B * B B * B B * 3 B * B B * B B * 3 B * B B * B B * 3 B * a B * B B * 3 B • • B B B B B B B B B B B B 3 B 3 B 3 3 3 B 3 B B B B B B B B B B B B B B B B B B B B B FIGURE IV.2 (s) Reti n a l impression RTI-5. 7 7 7 7 7 7 7 7 r 7 7 7 7 7 7 7 7 7 7 7 * 7 7 T 7 * 7 t 7 7* 7 / 7 7' 7 •» 7 7 7 7 7 7 V r 7' y 7 7 f 7 » 7 •» 7 * 7 7 7* ¥ / 7 7 y 7 7 . z_ —J o 6 H E E E S I E O E a n g E n a a a « o « • 7 b e • o o aaaEODDB • \ 7 i T « © o • o « o i 7 e o « o o o\ ;o ft o ' f 7 7 • o © —-o • O « 0 • • * o c o o e o * o o « o « 7 © (9 o O O e O o 0 o • —f~.—i 7 Once again, the gray l e v e l differences on the r i g h t -hand side force the east verge out by two units and a change i n the p o s i t i o n and shape of object 3. The gray l e v e l s for object 2 (just below centre) were exactly as predicted. FIGURE IV.2 (t) World model WM-5, with PLAN-5 A 0 O Q 3 6 C T i P L A M - 5 The east verge moved out by two un i t s ; shape of objects changed. n o * * * * * * * * • * T = 0. B B B B B B B B B B B B B B B B 3 B B B B B B B B B B B B B B B B B 3 B B B C C C C C C C C C C C C c c c. c B B B B B B B B B B B B B B B 3 3 077 DR = 0 B B B B 3. 20, 3 B B B B B 28T B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 3 B B B B B 3 B B B B B B B B B B B B B 3 B B B PICTURE iv\a(V) S t ^ a f t o n £-6 FIGURE IV .2 (v) R e t i n a l impression RTI -6 . o o 0 Z O 4| 7 7 0 o o ! e • O 4j 7 7 0 o 0 0 0 o 0 0 0 7 7 7 o o 0 o o o 0 7 0 o o o o 7 7 7 o o • • • E I H E O E 0 7 o 2 4- 4- •••••••• •••••••• •4- 7 / 7 0 o •••••••• •••••••• 0 7 0 o o o o o 0 0 0 7 7 -i o o o o o 0 0 7 l o o 0 O O A 7 7 0 o o O O 4 i i 7 7 The p r e d i c t e d gray l e v e l s are not shown here because only one d i f f e r e n c e between p r e d i c t e d and a c t u a l occurs: i n the Fovea at the l e f t hand end of object 3. This f o r c e s a very small change i n object 3. FIGURE IV.2 (w) World model WM-6. i V c = i t I » \ v \ V x The shape of object 3 changed very s l i g h t l y . 173 distance can also be regarded as a measure of speed with which Utak t r a v e l s , i f one makes the assumption that r e t i n a l impressions are received at a constant rate. The TABLETOP s i t u a t i o n S-2 after the execution of the f i r s t action i s shown i n (h) and the new r e t i n a l impression* RTI-2, received ( i ) . The two neighbouring graylevel values of 2 in the upper ri g h t hand side are.not as predicted by WM-1; consequently the position and shape of objectl must be changed to be consistent with RTI-2, while maintaining consistency with RTI-1. As a r e s u l t of t h i s change objectl i s no longer square and there i s some doubt as to whether i t should s t i l l be i d e n t i f i e d with the square object of the task statement.. There i s , however, no other v i s i b l e , p o t e n t i a l l y square, object with which the task's square object could be i d e n t i f e d , short of hypothesizing one in an a r b i t r a r y position beyond the area that i s or has been covered by the r e t i n a . Thus the known objectl i s retained, for the moment, as the task's square object. The new world model i s WM-2 ( j ) . The o r i g i n a l plan remains unchanged and another action is decided on. The new si t u a t i o n S-3 i s shown in (k) and the next r e t i n a l impression, RTI-3, obtained (1). This d i f f e r s considerably from the predicted r e t i n a l impression. New line-segment interpretations are derived and the world model WM-2 modified accordingly to obtain WM-3 (m). A new square object, object2, has been found and the shape of the supposed square object objectl turns out to be far from square. Thus the new object2 IVnTowards the design of a robot-controller 174 i s assumed to be the square object of the task statement., Also, the: position of the edge of the "room" i s not as expected and has to be moved out by four units. The planner i s c a l l e d and a new plan from the current position of Utak going around object2 and back to the southeast corner i s constructed.. Since there i s a gap between objectl and the side of the room, and since a path going via the gap should be shorter than going on the other side of o b j e c t l , the new plan goes through t h i s gap. Another action i s decided on and executed, resulting i n situation S-4 (n) and r e t i n a l impression RTI-4 (p) . . The graylevels of zero along the right hand side where fours were predicted r e s u l t s i n the east side of the room being moved out by two units.. The graylevel of one i s interpreted as a small object object3 against the east side. From the evidence presented in BTI-4 alone i t would be consistent to assume a small thin object not quite extendinq to the edge of the r e t i n a ; t h i s interpretation i s not consistent with the evidence from RTI-3 (which i s embedded i n the line-^segment interpretation obtained from i t ) , so instead object3 i s assumed., The new world model i s Wti-4 (q) ; the plan remains unchanqed, and an action decided on and executed. The new s i t u a t i o n i s S-5 ( r ) , with new r e t i n a l impression ETI-5 (s) * Again t h i s i s not quite as predicted; the east side of the room has to be moved out by two and the position and shape of object3 changed* In the accommodated world model WM-5 (t) , the . plan remains the same. The next s i t u a t i o n S-6 (u) and IVaTowards the design of a robot-controller 175 r e t i n a l impression RTI-6 are obtained after several intermediate actions* RTI-6 (v) shows c l e a r l y the gap between objectl and object3 which was only deduced from previous r e t i n a l impressions and the current world model WM-6 (w) c o r r e c t l y r e f l e c t s situation S-6,. Thus i n t h i s example no more accommodation can occur* so the remainder of the plan w i l l be executed c o r r e c t l y . IV.4 A f i r s t approach to implementation The idea i s to take seriously the analogy between science and perception* The world model consists of a c o l l e c t i o n of statements about the shape of the verge, the positions of objects on the tabletop, and the shapes of the objects.. Each statement i s to have an associated degree of confidence based on evidence co l l e c t e d from a series of r e t i n a l impressions. This degree of confidence i s to be used in the . accommodation process, to help determine to what extent old statements should be modified when new evidence i s received.. The statements give positions of end-points of l i n e s and other s p a t i a l facts in terms of a Cartesian coordinate system centred on Utak. A s p a t i a l problem i s to be solved by projecting a l l or part of the world model onto a screen — Utak's map-in-the-head -- then solving the problem there and t r a n s l a t i n g the. solution -- the plan — back into the Cartesian coordinate system. At a l l times there i s a world model and a plan, even though i n i t i a l l y these may be simple defaults* IV«Towards the design of a robot-controller 176 The'implementation of these ideas was approached i n the order given by the l i s t of program parts in IV.2. . Step 6, r e c o n c i l i n g a world model with a task statement, was i n i t i a l l y ignored on the basis that I could get by with simple path-finding problems that did not reguire r e c o n c i l i a t i o n of two world models. Steps 1-5 were accomplished and then step 7, the implementation of a s p a t i a l planner* was tackled. I found that current techniques f o r path-finding were not r e a l l y s a t i s f a c t o r y for my purposes and that an approach based on the use of the skeleton of a shape promised to be useful. .. This work i s described in the next chapter. . F i r s t I w i l l describe the world model. IV. 4._1 D e f i n i t i o n of the world model The data structure for a world model consists of a tree of nodes linked by r e l a t i o n s . The root of the tree i s a node corresponding to Otak, ca l l e d $org, which has one son, $floor, corresponding to the floorspace.. The sons of $floor correspond to the is o l a t e d objects on the tabletop., The node N corresponding to an object may in turn have sons i f the shape of the object i s complex and i s best described i n a h i e r a r c h i c a l manner. . A node corresponds to a shape on the tabletop and i s a l i s t consisting of the containing rectangle (the smallest rectangle aligned with the axes that contains the shape), the actual boundary shape as a c i r c u l a r l i s t of s t r a i g h t - l i n e segments, the IV«Towards the design of a robot-controller 177 shapes of any holes i f present, and a s u b l i s t consisting of the relations between t h i s node and i t s descendants i n the tree, i f any. Each node has i t s own coordinate system, and a r e l a t i o n between two objects s p e c i f i e s the t r a n s l a t i o n and rotation required to get from the coordinate system of one node to the other. . a r e l a t i o n i s simply a l i s t (nodel node2 offset) where the o f f s e t i s a t r i p l e consisting of the x- and y-translation and the r o t a t i o n to get from nodeVs coordinate system to node2's. In the implementation so f a r , the rotation has always been zero, By specifying the world model in t h i s manner i t i s easy to modify the world model to r e f l e c t the motion of Utak or the motion of an object caused by the motion of Utak.. M l that has to be done i s to modify one r e l a t i o n * . This tree representation can also be used to specify a complicated shape i n increasing l e v e l s of d e t a i l . Figure IV. 3 shows the world model tree for a tabletop situation* IV.4.2 Perception: accommodation to the f i r s t r e t i n a l impression When a r e t i n a l impression has been received i t must be analyzed to f i n d those regions which represent space and those which represent objects or verge. Then the object regions must be distinguished from the verge regions i n an interpretation stage so that f i n a l l y the world model can be modified to accommodate (explain) them. The: next three: sub-sections describe these operations (steps 3,4,5 of IV.2) . IVeTowards the design of a robot-controller FIGURE IV.3 VERGE "A (a) A world model, drawn on the Euclidean plane. Shape of OBI, with coordinate o r i g i n B. o f f s e t - Ri\ Shape of verge, with coordinate o r i g i n A Shape of 0B2, with coordinate o r i g i n C. (b) Tree corresponding to the world model of (a). 179 2. J. Edge and region finding A region i n the r e t i n a l impression i s a connected set of r e t i n a l c e l l s where a l l the c e l l s have a zero graylevel, or else a l l have a non-zero graylevel. a connected set on the retina i s defined using edge-adjacency. Two c e l l s are edge adjacent i f they have:an edge or part of an edge in common., Thus diagonally adjacent c e l l s are not edge adjacent. a region i s connected i f , for any two r e t i n a l c e l l s i n the region, there i s a chain of edge-adjacent r e t i n a l c e l l s which s t a r t s at one of the given c e l l s and fi n i s h e s at the other. The border between two regions has a dire c t i o n associated with i t , such that a t u r t l e , crawling along the border in t h i s d i r e c t i o n , would always f i n d the non-zero region on i t s right., Thus the (outer) boundary of a region with a non-zero graylevel would be traversed by the t u r t l e in a clockwise di r e c t i o n and any other boundary ( i . e . a hole) of the region would be traversed i n a counter-clockwise direction* The basic building block for finding the edges of a region i s the "inter-cell-edge" (ICE) which i s created between any pair of r e t i n a l c e l l s where the graylevel of one i s zero and the graylevel of the other i s non-zero* , a f i r s t scan of the r e t i n a l impression produces a l l the connected regions and marks the position of each ICE with a data structure linked to each member c e l l of the ICE. The next operation links the ICEs of one region into one or more d i s j o i n t c i r c u i t s . . Since more information i s needed for IV«Towards the design of a robot-controller 180 la t e r grouping operations, when an ICE i s being, traversed several extra pieces of information are added: the di r e c t i o n of traverse (N E S W), the graylevels of the c e l l s of the ICE, and the sizes of these c e l l s , the result being c a l l e d a chunk. The l a s t two items are needed l a t e r as evidence for the segments of the world model. Some ICEs l i e along the edge of the retina and sp e c i a l chunks have to be used. The l i n k i n g i s done by taking one ICE associated with the region in question and i t e r a t i v e l y finding i t s successors using the geometry of the r e t i n a l impression u n t i l a closed c i r c u i t i s formed. I f an ICE associated with the region s t i l l remains unlinked i n a c i r c u i t then another c i r c u i t i s started. This i s continued u n t i l a l l the ICEs are exhausted. Next, a grouping operator traverses each chunk-circuit and groups consecutive chunks having the same compass-direction into a segment, A segment i s a l i s t (pt1 pt2 dirn len type evidence) where pt1, pt2, dirn, len, specify the endpts, di r e c t i o n , and t o t a l length respectively of a straight l i n e segment. "Type" i s EXTERIOR or INTERIOR depending on whether the segment coincides with an edge of the retina or i s i n t e r i o r to the r e t i n a . "Evidence" i s a l i s t of pairs (graylevels c e l l - s i z e s ) derived from the component chunks, shortened by grouping i d e n t i c a l pairs together; The meaning of "evidence" here i s how well the l i n e segment was defined by the graylevels in the r e t i n a l impression. It i s intended to provide r e s t r i c t i o n s on how much the IVaTowards the design of a robot-controller 181 parameters of t h i s l i n e segment could be changed to accommodate subsequent r e t i n a l impressions without losing consistency with the current r e t i n a l impression.. The end re s u l t of t h i s operation i s a segment-circuit. Suppose a t u r t l e traverses an arbitrary closed c i r c u i t of straight l i n e s that nowhere crosses i t s e l f and counts 1 for every right-handed 90° turn and counts -1 for every left-handed 90° turn.. At the end of the t r i p the t o t a l w i l l be either 4 for a clockwise traverse or -4 f o r a counter-clockwise traverse. This i s also known as the Total Turtle Trip theorem;. In one f i n a l operation* each segment-circuit i s traversed once and the t o t a l t u r t l e turns computed. At the same time, the maximum number of consecutive segments that coincide with an edge of the re t i n a i s found. This i s c a l l e d "max-resegs" below. The f i n a l output of the edge and region finding stage i s a l i s t of regions, where . each region has on i t s p - l i s t the g r l - c l a s s , number of sguares, and a b o r d e r - l i s t of one or more borders. Each border i s a p - l i s t with properties name, segment-circuit, turtle-turns, max-resegs, and t h e i r values.. IV.4.2.2 Interpreting the f i r s t r e t i n a l impression -In the fovea of the eye a r e t i n a l c e l l with zero graylevel corresponds to floorspace* and a c e l l with non-zero graylevel, necessarily 7, corresponds to either an object, the verge, or to Utak himself. r In the peripheral parts of the eye a r e t i n a l c e l l with zero graylevel may correspond to an area of the tabletop IV«Towards the design of a robot-controller 182 which i s not e n t i r e l y floorspace, and s i m i l a r l y one with a graylevel of 7 may correspond to an area of the;tabletop which i s not e n t i r e l y object or boundary. „ In any one r e t i n a l impression the regions of zero graylevel are interpreted as floorspace;. Since a l l floorspace i s connected, i f two or more disconnected regions of zero graylevel appear in the r e t i n a l impression the interpretation must provide that these are connected* If a l l the floorspace regions have a segment coincident with an edge of the retina then no action needs to be done; i t i s assumed that they are connected.outside the area of the tabletop covered by the r e t i n a l impression. If one of the two or more floorspace regions i s completely surrounded in the r e t i n a l impression by a non-zero region then a passage must be hypothesized between the surrounded floorspace region and the nearest neighbouring floorspace region. The natural place to hypothesize such a passage, i n order to keep i t s length to a minimum, i s the l i n e of shortest distance between two floorspace regions. This l i n e of shortest distance can easily be found from the skeleton of the complement of the floorspace regions; t h i s w i l l be described in section V.4.2.. The non-zero regions are interpreted as either i s o l a t e d objects or verge. This i s straightforward i n two cases.. I f a non-zero region completely surrounds a zero region, and i s not i t s e l f surrounded by a zero region, then t h i s i s interpreted as the verge of the tabletop,; I f a zero region completely surrounds a non-zero region then t h i s l a t t e r region i s IVaTowards the design of a robot-controller 183 interpreted as an isolated object with a high degree of certainty. I f neither of these two cases holds then the max-resegs of the outer boundary of the non-zero region (the unigue border with turtle-turns=4) i s examined. Remember that "max-resegs" records the maximum number of consecutive segments of the border of the region that coincide with edges of the r e t i n a . . If i t s value i s zero, one or two then the region i s interpreted as an iso l a t e d object, otherwise as part of the verge.. Figure IV.4 i l l u s t r a t e s t h i s interpretation scheme. Any interpretation made in t h i s way i s subject to r e v i s i o n or a "double-take" when subseguent r e t i n a l impressions are received. A region i n i t i a l l y interpreted as an is o l a t e d object may l a t e r turn out to be more correctly interpreted as boundary, and vice versa. Figure IV.5 i l l u s t r a t e s a possible double take. IV.4.2.3 Accommodating the default world model to the f i r s t r e t i n a l impression The default world model with which Otak "wakes up" i s the simplest possible: a square floorspace centred on his position, and containing no i s o l a t e d objects., After the f i r s t r e t i n a l impression has been received and interpreted, t h i s world model must be modified (accommodated) to be consistent with t h i s r e t i n a l impression. F i r s t the interpreted r e t i n a l impression i s examined for what r e s t r i c t i o n s , i f any, the r e t i n a l impression places on the IVaTowards the design of a robot-controller FIGURE IV.4 Examples of.region i n t e r p r e t a t i o n . Max-resegs = 2 ISOLATED OBJECT Max-resegs = 3 Max -resegs = 4 Verge Verge FIGURE IV.5 A doubletake. In t h i s i n i t i a l p o s i t i o n the robot thinks i t i s close to the north edge of i t s environment. What the robot previously thought was verge i s re-interpreted as part of an i s o l a t e d object. 186 a c t u a l dimensions of the c o n t a i n i n g r e c t a n g l e of the $ f l o o r of the world model. One r e s t r i c t i o n i s computed from the r e t i n a l impression f o r each s i d e of the $ f l o o r ' s c o n t a i n i n g r e c t a n g l e , and c o n s i s t s of a value and a type. The type may be INTERIOR or EXTERIOR. I f INTERIOR, the r e s t r i c t i o n i s defined by a segment of the boundary of a f l o o r s p a c e r e g i o n which i s i n t e r i o r to the r e t i n a l impression; conseguently the p o s i t i o n of t h i s s i d e of t h e : c o n t a i n i n g r e c t a n g l e of $ f l o o r must be given by the value of t h i s r e s t r i c t i o n . I f the type i s EXTERIOR, the r e s t r i c t i o n i s d e f i n e d by a segment of the boundary of a f l o o r s p a c e r e g i o n which c o i n c i d e s with an edge o f the r e t i n a l impression; consequently the p o s i t i o n of t h i s s i d e of the c o n t a i n i n g r e c t a n g l e : o f $ f l o o r must l i e at or beyond ( i * e ; , f u r t h e r N, E, S, or W than) the value of t h i s r e s t r i c t i o n . The d e f a u l t $ o r g - $ f l o o r o f f s e t , i n i t i a l l y (0,0,0), and the s i d e s of the c o n t a i n i n g r e c t a n g l e of the d e f a u l t $ f l o o r , are compared with these r e t i n a l r e s t r i c t i o n s and modified as necessary to s a t i s f y them* Now t h a t the c o o r d i n a t e o r i g i n and c o n t a i n i n g r e c t a n g l e of the $ f l o o r i s f i x e d , other p a r t s of the world model can be computed. The next item i s to d e r i v e the a c t u a l shape of $ f l o o r . I f none o f the segments of boundaries of f l o o r s p a c e r e g i o n s c o i n c i d e with a r e t i n a l edge, or i n other words the whole of $ f l o o r appeared wi t h i n the r e t i n a l impression, then the boundaries of the f l o o r s p a c e r e g i o n s are taken as the shape of $ f l o o r . Otherwise, only p a r t s of the shape of $ f l o o r appeared IVnTowards the design of a r o b o t - c o n t r o l l e r 187 within the r e t i n a l impression. These are the: sequences of segments of boundaries of regions interpreted as verge, which l i e s t r i c t l y within the current r e t i n a l impression.. These segment sequences have to be linked up into one continuous segment c i r c u i t by creating hypothetical extensions to exis t i n g segments and by adding new hypothetical segments. . F i r s t the end segments of each sequence are extended to the containing rectangle, with the extensions marked as "HYPO" in the evidence l i s t s attached to these segments.. Second, hypothetical segments along the edges of the containing rectangle are introduced between each consecutive pair of segment sequences* also marked "HYPO", The shape of $floor i s then complete. Lastly, a node has to be created for each isolated-object region of the r e t i n a l impression, and added to the world model. Given an isolated-object region, i t s containing rectangle, the off s e t of i t s coordinate system from $floor, and i t s shape are a l l computed. The default world model has now been accommodated to the f i r s t r e t i n a l impression. IV.4.3 Perception; accommodation to - subsequent r e t i n a l im pressions Once a world model has been constructed that c o r r e c t l y i nterprets ("explains" i n the analogy with s c i e n t i f i c method) the r e t i n a l impressions received so f a r , i t i s used to f a c i l i t a t e the accommodation of subsequent r e t i n a l impressions. An o v e r a l l view of t h i s accommodation process w i l l now be IV»Towards the design of a robot^controller 188 described. Given the decided-on action, a predicted world model i s constructed, and from t h i s a predicted r e t i n a l impression i s produced by projecting the predicted world model onto an array structure topologically i d e n t i c a l with a r e t i n a l impression. This r e t i n a l impression d i f f e r s from a normal r e t i n a l impression i n that every r e t i n a l c e l l has a pointer back to the segment(s) of the world model which caused i t to have i t s assigned graylevel* After the action i s executed the actual r e t i n a l impression i s compared with the predicted r e t i n a l impression and the differences between the two used to indicate what l i n e segments and what parts of the world model must be modified to accommodate the new r e t i n a l impression. Given an action, the predicted world model i s constructed as follows.. If the action i s SLIDE (v) then the $org-$floor r e l a t i o n (r,9) i s replaced by (r-v , e ) . If the action i s POSHTO(v) and the object held i s o b j e c t i , then the $org-$floor r e l a t i o n i s replaced by (r-v,9) and the $floor-$objecti r e l a t i o n (s,$) i s replaced by (s+v,<J»). I f the action i s TURN(<t) then the $org-$floor r e l a t i o n becomes (r,6-fr) and i f Otak i s holding $objecti then the $floor-$objecti r e l a t i o n becomes (s,<t> + $) . From the predicted world model a predicted r e t i n a l impression i s computed as follows. Each line.segment in the shape of the f l o o r , verge, or an object of the predicted world model i s traced across the r e t i n a l f i e l d s of the eye and a pointer i s set from each r e t i n a l f i e l d intersected back to the intersecting segment. Any r e t i n a l c e l l not intersected by a IVaTowards the design of a robot-controller 189 segment of the border of an object i s labelled by the name of the. object which encloses i t , i f any, and given a graylevel of 7, else i t i s assumed to be part of $floor and given a graylevel of zero. The next step i s to compare the graylevels of the predicted r e t i n a l impression and the actual r e t i n a l impression, c e l l - b y - c e l l , and note any differences* The differences immmediately focus attention on those parts of the world model that must be changed.. Some differences can be.accounted for by changing the parameters of l i n e segments in the world model; others require more dra s t i c action.. For example i f a non-zero region i n the actual r e t i n a l impression has no overlap with any non-zero region i n the predicted r e t i n a l impression, then i t has to be interpreted and added to the world model as a new iso l a t e d object in just the.same way as a si m i l a r region i n the f i r s t r e t i n a l impression i s acommodated by the i n i t i a l default world model. This, i n outline, i s the accommodation process. In a " r e a l i s t i c " simulation where an element of randomness i s allowed in the e f f e c t of an action the differences between the; actual and predicted r e t i n a l impressions may arise from two sources of uncertainty: (1) New parts of the environment coming into view or old parts seen at higher resolution; (2) The action i s not as predicted. If only (1) i s allowed then any differences must be explained by modifying the world model; I f only (2) i s allowed the problem IVsTowards the design of a robot-controller 190 i s to recognize what position i n the world model could give r i s e to the actual r e t i n a l impression and thus deduce what actually happened., Since the difference between the actual and predicted effects of an action w i l l normally be quite small the problem i s one of computing the disp a r i t y between the two r e t i n a l impressions, say by trying the positions c l o s e s t to the predicted position. I f the difference i s too great for a dispa r i t y to be found then i t becomes a pure recognition problem to be approached, say, by matching features. I f both (1) and (2) occur together then the problem i s to fin d a match in the world model for as much as possible of the r e t i n a l impression, thus proposing a new position, and then modifying the world model to explain the remaining unmatched parts of the r e t i n a l impression. Although (2) i s easily incorporated i n my system, I have not attempted to handle t h i s p o s s i b l i t y . i.T»H»!i Accommodation, another approach The problem i s , given the current r e t i n a l impression, to modify the current world model as necessary to be consistent with i t . This can be broken down into three processes. The f i r s t process interprets the r e t i n a l impression, regarded as a structured array of graylevels, as a consistent c o l l e c t i o n of l i n e segments. The adjective 'consistent' implies that, l o c a l l y , the l i n e segments make sense or in other words form continuous l i n e s . Moreover straight l i n e s are preferred to li n e s with many changes of d i r e c t i o n . The: next process IV-Towards the design of a robot-controller 191 interprets the l i n e s formed by the l i n e segments as the (partial) contours of the verge or of an i s o l a t e d object. The t h i r d process extends these contours by rules of continuation to a complete world model.„ The l a s t two processes are straight-forward, the f i r s t one i s harder.. In more d e t a i l , the f i r s t process can be described as follows. In the fovea the graylevel of a r e t i n a l f i e l d i s 0 or 7 according as the corresponding TABLE square i s occupied or not. T r i v i a l l y , a l i n e segment i s inserted between each pair of adjacent c e l l s with d i f f e r i n g graylevels., In the middle part of the re t i n a the graylevels which can actually occur are 0,2,4,6,7. Each graylevel has a d i s t i n c t c l a s s of potential interpretations where an interpretation i s a 2X2 pattern of occupied and vacant squares. In the periphery a l l the qraylevels 0 , 1 , 7 can occur and the potential interpretations of a graylevel are s p e c i f i e d by classes of 4X4 patterns of sguares. Each assignment of a l i n e segment to a r e t i n a l f i e l d must be consistent with the assignements of neighbouring r e t i n a l f i e l d s , such that the l i n e segments constitute.a continuous l i n e and preferably a straight l i n e . Thus t h i s f i r s t process i s a problem of finding a consistent interpretation and can be tackled by the NC consistency algorithm of [Mackworth, 1977 ], by the relaxation algorithms of [ Zucker, 19771], or the improved backtracking algorithms of [ Gaschnig, 1 978 ij. The l a t t e r two processes, l i n e segment interpretation and continuation, can be handled as before. IV«Towards the.design of a robot-controller 192 IV. 4. 5 The s p a t i a l planner This i s the heart of the system;. This i s where path-finding i s done, where a plan for moving an object i s constructed and where the i n i t i a l task command i s interpreted. Given an interpreted task description, the s p a t i a l planner uses the current world model as a database and produces a structured plan as output. If the current world model r e f l e c t s the " r e a l world" outside the organism s u f f i c e n t l y c l o s e l y , or at least models closely enough those parts of the world model required for t h i s task, then a completely accurate execution of the plan w i l l r e s u l t in the successful completion of the task; The s p a t i a l planner does not produce plans from the world model d i r e c t l y , but i n d i r e c t l y via the screen* a 2-dimensional d i g i t a l array. Consider a simple pathfinding problem, "Go to the north east corner" f o r example. F i r s t the dimensions of a rectangular window which includes both the current position of Utak and the position of the destination are computed.. Then the world model i s projected through t h i s window onto the screen and each square of the screen marked as representing space: or with the name of the object ovarlaying i t . . Then a pathfinding algorithm i s used (cf* chapter 5) to f i n d a path from s t a r t to destination that only traverses c e l l s representing space., If t h i s f a i l s then other potential paths are considered. These arise where two adjacent squares of the array are marked with names of d i f f e r e n t objects or where a single sguare of the screen i s marked with the names of two or more objects. These IV»Towards the design of a robot-controller 193 positions can be used to trace possible paths between objects and, where such a position i s adjacent to squares representing space, to connect up these possible paths with other paths through space* I f the path between two objects i s required in more d e t a i l then a small rectangular window i s selected that includes only the potential passage between the objects.. Then the world model i s projected onto the screen again and t h i s part of the path traced at a higher resolution. The re s u l t i s included as a more detailed subpath i n the previous coarser path* IV. 5 An -alternative approach to implementation The implementation sketched above uses a representation for the world model based on the use of Cartesian coordinates and then computes, via projection onto a screen, the skeleton, a graph-like representation of the world model* The edges of t h i s graph represent routes i n the environment. A representation in terms of routes has been used by Kuipers to model a person's representation of large-scale (city) space, and by Arbib and L i e b l i c h to model a rat's representation of space. The natural suggestion, then, i s to use the skeleton as the basic representation for the world model* This depends on the fact that the: complete skeleton of a shape, consisting of the ske l e t a l graph plus the quench function, can be used to recover the o r i g i n a l shape in i t s entirety. The world model then IV»Towards the design of a robot-controller 194 consists of a graph, whose edges represent routes through the environment, together with a quench function defined on each edge. Pathfinding i s done d i r e c t l y on t h i s graph. One way to carry out perception i s to regenerate the o r i g i n a l shape in the predicted r e t i n a l impression and then match i t with the actual r e t i n a l impression. Any shape changes forced by the actual r e t i n a l impression are re f l e c t e d i n changes to the sk e l e t a l graph or the guench function. Alternatively, instead of doing matching on shapes, matching can be done on graphs. That i s , the skeleton of the spaces on the retina i s matched against the stored skeleton and changes made as appropriate to the stored skeleton. IV.6 Summary The design of the whole organism-controller i s of major importance for my project; I described i n t h i s chapter the f i r s t approach that I took, based on the analogy between the process of perception and the s c i e n t i f i c method, and the progress made in implementing i t . There are two outstanding problems inherent i n t h i s approach. One i s defining exactly what i s meant by the phrase " c o l l e c t i n g evidence f o r a feature of the world model", and the other i s defining a phrase such as "assigning a degree of confidence to a feature on the basis of the evidence". I approached the f i r s t problem by retaining with each feature both the graylevel values in the retina and the IV«Towards the.design of a robot-controller 195 r e t i n a l f i e l d s i z es, from which the feature parameters were derived.. In l i n e with the analogy, one can say that "the feature explains the graylevel values". The problem of defining a measure of confidence, showing how i t changes with the receipt of new evidence, and using the confidence values to control how the features are allowed to change when new evidence shows that a change must be made, i s an important and interesting problem that must be solved before completion of t h i s project i s possible.. This problem bears comparison with the legal problem of evidence in a court of law, where the degree of confidence in a statement depends upon the evidence presented. There i s one major requirement that remains to be described, namely algorithms f o r pathfinding and for making plans for moving an object. IV-Towards the design of a robot^controller 196 CHAPTER - V PATH-FINDING AND THE SKELETON OF A PLANAR SHAPE The purposes of t h i s chapter are to review path-finding algorithms, to motivate the use of the: skeleton for path-finding, to introduce a new algorithm f o r computing the skeleton, and to apply the skeleton to path-finding. 1-1 Introduction to path-finding algorithms The problem i s t h i s ; Given a description of shapes on the Euclidean plane i n terms of the Cartesian coordinates of points on the boundaries of the shapes and the li n e s between them, and given the coordinates of two points S and D outside a l l the shapes, describe a path from S to D that avoids a l l the shapes, i f such a path e x i s t s . Further requirements are that the path should be reasonably close to being optimal, and that i f an organism wanders s l i g h t l y from the correct path, either due to inaccurate movement or to avoid a small obstacle, i t should be easy to regain the correct path. A path-finding algorithm was incorporated i n the design of Shakey [Nilsson,1969J. This was based on the observation that i n a cluttered space an optimal path between two points consists of a sequence of l i n e segments connecting extreme points of obstacles; Thus one st a r t s with the extreme (convex) points on VaPath-finding and the skeleton of a planar shape 197 the obstacle boundaries and considers the set consisting of the l i n e s joining the pairs of extreme points together with l i n e s from the s t a r t i n g point S to the extreme points and with l i n e s from the extreme points to the destination point D. Any l i n e which i n t e r s e c t s an obstacle i s discarded, so that the remaining l i n e s represent a l l the " l i n e s of v i s i b i l i t y " in the s i t u a t i o n . A h e u r i s t i c search i s then used to find the optimal series of points connected by l i n e s of v i s i b i l i t y from S to D. Another approach to path-finding, but s t i l l using a Cartesian representation, was used by [ Thomson, 19771] for the path planning module of the JPL robot.. This was the approach I f i r s t took to the problem* The zero'th order approximation was the straight l i n e SD. The f i r s t order approximation was obtained as follows. Determine those shapes intersected by SD, i f any. I f none, then the straight l i n e SD i s the required path. Otherwise pick the obstructing shape nearest to S, c a l l i t B say, and compute four points L1,R1,L2,R2 on the periphery of B defined as follows. L1, R1 are the leftmost* rightmost points respectively of B as seen from S, while L2, R2 are the rightmost, leftmost points respectively of B as seen from D. There are now two candidate paths at the f i r s t order l e v e l of approximation: P11 = SL1 + L1L2 + L2D P12 = SR1 • R1R2 + R2D where the path segments SL1, L2D, SR1, R2D are known not to intersect object B.. See figure V.I. Now recursively apply the V«Path-finding and the skeleton of a planar shape AN/ 0/o(* APP<*OJ\cH To ?«VTH-199 above procedure to each of the segments SL1, L1L2, L2D, SR1, R1R2, R2D. Eventually the procedure stops , there being only a f i n i t e number of objects and only a f i n i t e number of points on the boundary of each object, with a perhaps long l i s t of possible paths. Each path can be evaluated in terms of t o t a l length, number of segments, t o t a l angle turned, etc., and the best one chosen. The disadvantages of t h i s d i r e c t approach to the path finding problem are the following* A) I t involves finding the intersections of p a r t i c u l a r l i n e s with every object and finding extreme points of those objects intersected, altogether an expensive computation in some cases. b) There i s no notion of " l e v e l of d e t a i l " * A l l objects of whatever s i z e are considered* and a l l l i n e s which form the boundary of a shape have to be scanned for i n t e r s e c t i o n finding. c) There i s no obvious way to generalize to object moving. An advantage of t h i s approach i s that i t can produce a description of a path i n " l e f t - o f object", "right-of object" terms. Another idea i s to project a l l the shapes onto a rectangular network of c e l l s , the screen of chapter IV for example, and convert the path-finding problem into a pure graph-traversal problem. The screen i s converted to a graph by inserting between every pair of adjacent or diagonally adjacent c e l l s an edge of the graph, where each edge i s assigned a length V«Path-finding and the skeleton of a planar shape 200 of r o o t 2 or one a c c o r d i n g as i t s endpoints are d i a g o n a l l y adjacent or not. I t i s forbidden to t r a v e r s e edges l e a d i n g to c e l l s t h a t do not represent f l o o r s p a c e . The s t a r t and d e s t i n a t i o n p o i n t s are mapped onto c e l l s S and D of the graph. The problem can now be r e s t a t e d as: f i n d the s h o r t e s t path from S to D along the edges of t h i s graph. This can be done by an a p p l i c a t i o n of the A* a l g o r i t h m of [ H a r t , N i l s s o n * S Raphael, 1 9 6 7 i ] , using t h e i r f u n c t i o n f=g+h to e v a l u a t e incomplete paths. .. For an incomplete path p t h a t c u r r e n t l y t e r m i n a t e s at a c e l l n> g(p) i s the sum of the l e n g t h s of the edges from S to n and h(p) i s the E u c l i d e a n d i s t a n c e from n t o D,. . T h i s a l g o r i t h m f i n d s the o p t i m a l path through the graph d i r e c t l y , but s u f f e r s from some disadvantages. These i n c l u d e : no obvious way to g e n e r a l i z e to handle.object moving; no easy way t o d i s c o v e r what o b j e c t s a s e c t i o n of the path i s p a s s i n g between; no d i s t i n c t i o n between t o p o l o g i c a l l y d i s t i n c t paths. In a d d i t i o n the a c t u a l search process i n v o l v e s a high number of "knowledge independent" c h o i c e s * As an extreme example of what I mean by "knowledge independence", witness the bucket phenomenon i l l u s t r a t e d i n f i g u r e V.2. In using h e u r i s t i c s e a r c h to go from S to D, the search goes s t r a i g h t t o the bottom of the bucket and g r a d u a l l y f i l l s up u n t i l suddenly i t overflows and r a p i d l y advances towards D. Worse cases can a l s o occur* F i n a l l y the s k e l e t o n of the shape of the empty space was c o n s i d e r e d . The i n i t i a l a t t r a c t i o n was t h a t the s k e l e t a l graph c o n t a i n s only the t o p o l o g i c a l l y d i s t i n c t paths between two V«Path-finding and the s k e l e t o n of a p l a n a r shape FIGURE V.2 The bucket phenomenon, which occurs when the A* search algorithm i s applied to a network representation of space. \ M / / / • / f x \ / / / ' \ \ \ » • • m • / / / ' \ \ \ • » . » # / / /'\ X N-\ \ \ x 202 positions. Two paths are topologicallY d i s t i n c t i f neither can be continuously deformed into the other. The search for a path then reduces to searching over the topologically d i s t i n c t paths. The choice points in the skeleton seem, i n t u i t i v e l y , to correspond to the choices we have to make i n navigating through obstacles., In addition there i s a great deal of information associated with the skeleton which can be used in other s p a t i a l problems., The optimum path, when r e s t r i c t e d to edges of the sk e l e t a l graph, i s not i n general the optimum path when no such r e s t r i c t i o n s are made; however, my i n i t i a l concern was to compute any reasonable path, not necessarily an optimal one. I- 2 The skeleton [ Blum, 1964 i], who ca l l e d i t the Medial Axis Function* was the f i r s t to introduce the skeleton of a planar shape.. Since then i t has been the topic of several investigations [Calabi and Hartnett,1968; Montanari,1968 ,1969; Rosenfeld and P f a l t z , 1 9 6 6 ; Pfaltz and Rosenfeld, 1967; and othersi] and has been c a l l e d the distance transformation, the gr a s s f i r e transformation* or the symmetric axis transformation. [Blum,1973 ,1974J has comprehensively analysed i t and written about i t s potential applications to the description of shape i n biology. VnPath-finding and the skeleton of a planar shape 203 !•2-1 Def i n i t i on and properties In the continuous Euclidean plane several equivalent d e f i n i t i o n s of the skeleton can be given; however when these are converted to algorithms to compute the skeleton on a rectangular network i f c e l l s , i t turns out that t h i s equivalence no longer holds. F i r s t the several equivalent d e f i n i t i o n s i n the continuous Euclidean plane w i l l be described, second Montanari's algorithm w i l l be derived from one of these d e f i n i t i o n s , t h i r d we w i l l see why t h i s algorithm i s unsatisfactory, and fourth we w i l l see how to augment Montanari's algorithm to provide a sa t i s f a c t o r y algorithm for the skeleton on a network of c e l l s . D e f i n i t i o n J . Interpret the boundary of the shape as a wavefront which propagates at uniform velocity into the i n t e r i o r of the shape. At certain points two or more sections of the wavefront emanating from d i s t i n c t points of the boundary meet and mutually extinguish themselves; the locus of these points of extinction i s the sk e l e t a l graph and the. time from the i n i t i a t i o n of the wavefront to the time of extinction i s the quench function. D e f i n i t i o n 2. The most concise d e f i n i t i o n f o r mathematical purposes i s probably t h i s . Consider the set of a l l c i r c l e s contained in the shape and p a r t i a l l y order them by i n c l u s i o n . Then the s k e l e t a l graph i s the locus of the centre of maximal V«Path-finding and the skeleton of a planar shape 204 c i r c l e s , and for each point on the graph the radius of i t s maximal c i r c l e gives the value of the quench function*. D e f i n i t i o n 3. At every point P of the plane define the function d to be the minimum distance from P to the shape: d(P)=min{ euc(P,Q) | Q 6 shape) where euc i s the euclidean distances. For every point P there i s at least one point Q 6 shape such that d (P)=euc(P,Q), while for certain points P* there are at least two d i s t i n c t points Q1, Q2 such that d (P*) =euc (P*, Q1) =euc (P*,Q2) . Q1, Q2 are contact points for P*. The locus of points with two or more contact points i s the s k e l e t a l graph and the value of the function d at each point of the graph i s the quench function., D e f i n i t i o n 4. Given a point P, a minimal path from P to the boundary of the shape i s a straight l i n e segment PR where R l i e s on the boundary. P i s defined to be a point of the s k e l e t a l graph i f i t does not belong to a minimal path of any other point; In the mountain metaphor, t h i s says that any point on a ridge-crest or peak does not l i e on the f a l l - l i n e of some higher point. This i s the d e f i n i t i o n used by [ Montanari, 1968 i ] ; D e f i n i t i o n 3 lends i t s e l f to the following v i s u a l i z a t i o n of the skeleton. Imagine the boundary of the shape as the shoreline: of an island, which everywhere r i s e s uniformly at an angle of 45° out of a calm ocean, thus forming a mountain range with peaks and ridges. It i s possible for three or more ridges VaPath-finding and the skeleton of a planar shape 205 to meet at a junction which i s not a peak. Holes in the shape are to be visualized as lagoons at ocean l e v e l * The projection of the ridges and junctions to the plane of the ocean i s the s k e l e t a l graph and the height of the ridge at each point, i*e* the function d, gives the quench function. Picture yourself standing on the crest of the ridge; in your immediate v i c i n i t y there are exactly two well-defined directions in which to travel along the ridge, "forwards" or "backwards"., Now stand at a junction ; three or more ridges meet there* providing three or more corresponding well-defined directions of t r a v e l . That i s the content of [Calabi and Hartnett,1968, Theorem 6].. Now return to a point on the ridge crest and note that there are exactly two l i n e s of steepest descent, or f a l l - l i n e s i n skiers parlance, from the ridge-point down to the ocean* The points where the f a l l - l i n e s from a ridge point or peak enter the ocean are c a l l e d contact points. Back at a junction again, where n ridges meet, note that there are n f a l l - l i n e s to the ocean, alternating with the ridges. That i s the content of [Calabi and Hartnett, 1968, Theorem 7iJ, At any junction there can be at most one ridge which ascends away from i t ; a l l the others must be descending from i t . This can be seen as follows. Suppose P i s a junction where 3 ridges meet. Let the three contact points be p* g, r on the circumference of the maximal c i r c l e centre P. . One may without loss of generality consider the skeleton generated by these three points alone* Consider the ridge which starts at P and V«Path-finding and the skeleton of a planar shape 206 passes midway between p and g. The guench function must decrease from P to the midpoint of p and g, since the distance pg i s le s s than the diameter of the maximal c i r c l e , unless p and g l i e on the ends of a diameter through P i In t h i s l a t t e r case the guench function increases at P as one begins to move out along the ridge. . Also, since pg i s a diameter, neither gr or rp can be a diameter, and hence the value of the guench function as one s t a r t s out along these other two ridges i s decreasing. X * 2.2 approximating the Euclidean plane To obtain the skeleton of a shape the euclidean distance between two ar b i t r a r y points i s reguired. But when the shape i s given as a d i g i t a l image, that i s to say as a rectangular network of c e l l s where each c e l l i s marked with a 1 (outside the shape) or a 0 (inside the shape), t h i s network can be treated as an approximation to the euclidean plane. By connecting each c e l l to a number of i t s neighbours and measuring distance between c e l l s by summing over a l l the l i n k s between them an approximation i s obtained. Figure V.3 shows 4-, 8-, 16-connected c e l l s and figure V.4 shows networks of 4-, 8-, 16-connected c e l l s . The n directions of the l i n k s i n an n-connected network w i l l be referred to as the major directions of the network. The higher the connectivity the better the approximation. Using only 4-connectivity, the:distance between two c e l l s in a network can be as much as 41% out from the euclidean distance, whereas with 8-connectivity i t can be 8% out V»Path-finding and the skeleton of a planar shape J? CoMNCCTED I t C O N N E C T E D F I G U R E ¥ 3 2 0 9 333 M i l CoN NJGCTED $ ' COW t V £ C T E D M E T WORK F I G U R E V *4. 209 and with 16-connectivity only 2.7% out. , Given two c e l l s i n a network, i f the l i n e connecting them happens to l i e p a r a l l e l to one of the major directions then there i s a unique shortest path between the two c e l l s , otherwise there w i l l be many shortest paths between them* This i s i l l u s t r a t e d in fiqure V*5* Note that there i s always a shortest path consisting of exactly two straight l i n e segments. V.2.3 Hontanari's algorithm Osing d e f i n i t i o n 4 above Montanari showed that the skeleton finding problem was equivalent to a certain optimal policy problem, and thus derived a two part algorithm which can be stated as follows. a) For each c e l l of the network f i n d the minimum distance to the boundary of the shape (the "height"), and find a l l the f a l l - l i n e s (necessarily at l e a s t one) from the c e l l to the boundary. b) C l a s s i f y as skeleton points those c e l l s which do not l i e on a f a l l - l i n e descending from any other c e l l . . The distance to the shape can be computed using an algorithm which requires only two passes over the network, which w i l l now be described. Divide the directions of the l i n k s between c e l l s into two classes, OPPEH and LOWER, as shown in fiqure V.6. The f i r s t pass i s in forward raster order and computes the minimum distance to the boundary when only l i n k s with UPPER directions are considered.. The second pass i s i n V«Path-finding and the skeleton of a planar shape FIGURE V . 5 S h o r t e s t p a t h s i n an 8 - c o n n e c t e d n e t w o r k . 210 (a) The u n i q u e s h o r t e s t p a t h f r o m P t o Q. £<!Xj (b) M u l t i p l e s h o r t e s t , p a t h s f r o m P t o Q. FIGURE V.6 u p p e r * , j p P e - ^ L ow e P< t o w E" r\ UPPER and LOWER d i r e c t i o n s of l i n k s "are considered i n the f i r s t and second passes r e s p e c t i v e l y of the i t e r a t i v e algorithm. 212 backward raster order and continues the minimum distance computation, adding i n those l i n k s with LOWER directions. This i s spelt out i n steps 1 and 2 of SKEL-3 below. Surprisingly, after these two passes the minimum distance at every c e l l i s correctly computed, even for c e l l s whose f a l l - l i n e ( s ) include l i n k s with both UPPER and LOWER directions. A proof of t h i s can be found i n [ Montanari, 1968 ]. Some: notation i s i n order. Let the. network c e l l s in forward raster order be P1,P2, ... ,Pn. C e l l s P i , Pj are neighbours i f there i s exactly one l i n k between them, and are HV-adjacent i f they are neighbours and th e i r l i n k i s horizontal or v e r t i c a l . . Let T i j = T(Pi,Pj) be the distance between Pi and Pj. In the case of an 8-connected network, the possible values f o r T i j are 1 and the sguare root of 2, and in a 16-connected network, 1, the square root of 2 and the square root of 5. OPPERJPil_ (LOWER (Pi).} denotes the c e l l s reached from Pi by traversing one l i n k i n an UPPER {LOWER} di r e c t i o n . Let NBBS(Pi)=UPPER(Pi) u LOWER(Pi) and l e t I be the c e l l s outside the shape. Di, the minimum distance from Pi to the boundary of the shape, i s to be computed for i=1,2, .... ,n* VaPath-finding and the skeleton of a planar shape 213 Algorithm SKEL-1. 1. [Forward raster scan3. For i=1,2, . ,n do I f Pi 6 I, Di=0 I f Pi £ I, Di= 0 0 i f UPPER(Pi) i s empty Di=min{ Tij+Dj | Pj e UPPER(Pi) } otherwise. 2. . [Backward raster scan.]. For i=n,n-1, ... ,1 do Di=min{ Di, { Tij+Dj | Pj e LOWER (Pi) } }; 3. [Define skeleton points].. SKEL={ Pi | Di ? Dk-Tik f o r a l l Pk 6 NBRS(Pi) }. Two skeletons computed with t h i s algorithm are shown in figure V*7. Note how they compare with t h e i r euclidean skeletons. As can be seen from t h i s example, t h i s algorithm suffers two d e f i c i e n c i e s * F i r s t , the output i s an unstructured set of points - no method i s provided to l i n k up the points into a graph structure. Second, the set of skeleton points i s in general disconnected, so that i t would be impossible to form a graph structure anyway. V.2.4 The new algorithm This l a s t deficiency can be remedied by using d e f i n i t i o n 3, which defines the skeleton to be the locus of points with at VaPath-finding and the skeleton of a planar shape F i g u r e V.7 .1 I I I I I I I I I I I I I I I I i I I I * * I I * I I * * * * * * * * * * * * * * I I * * * * * * * * * * *e* I I * * I I * * * * I I I I I I I I * * I I I I T X I I I I I I I I I I I * I I I I I I I I I I I I I I I I * * I I I I I I I I I I * * * * X I * I I * * * * * I I * * * * * * * * * * * * I I * * * * * * * I I * * * I I * * * I I I I I I I I I I * * I I I I I I I I I I I I I I I I * I I .1 I .1 I I I I I I I I I I I I I I I I .1 I I I I I I .1 I I I I I I I * * I I * * * * * * * * * * I I * * * * * * * * * * I I * * I I I I I I I I I I I I I I I 215 least two contact points. This suggestion can be:implemented as follows; F i r s t , while computing the minimum distance to the figure, compute also the contact points for each c e l l . Second, c l a s s i f y a l l c e l l s with at least two contact points as belonging to the skeleton; Since the f a l l - l i n e s and contact points of a c e l l cannot be defined u n t i l the f i n a l value of the minimum distance from the c e l l to the shape has been computed, they cannot begin to be computed u n t i l the backward raster scan of SKEL-1. Step 2 reguires an extra operation* another raster scan i s needed and step 3 must be replaced. This results i n the following algorithm. Algorithm SKEL-2. 1. [Forward raster scan],; For i = 1,2, •,•,;.. ,n do I f Pi 6 I, Di=0 I f Pi £ I, Di= oo i f OPPER(Pi) i s empty Di=min{ Tij+Dj | Pj e UPPER (Pi) } otherwise. . 2. [Backward raster scang. . For i=n,n-1, ... ,1 do Di=min{ Di, { Tij+Dj | Pj S LOWER (Pi) } }. Contacts (Pi) =U { contacts (Q) | Q 6 LOWER(Pi) & d(Pi)=T(Pi,Q)+d(Q) } 3. [Second forward raster scam], V«Path-finding and the skeleton of a planar shape 216 For i=1,2, ... ,n do contacts(Pi)=contacts(Pi) u U { contacts (Q) | Q 6 UPPER (Pi) & d(Pi)=T(Pi,Q)+d(Q) j 4. . [Define skeleton points J. SKEL={ Pi | number-of-contacts-of(Pi) > 1 j This improves matters a l i t t l e , f or i t c o r r e c t l y c l a s s i f i e s as skeleton points many points omitted by SKEL-1. . Rt the same time, unfortunately, at places i n the skeleton such as a straight corridor of even width, where SKEL-1 would compute a double row of skeleton points, SKEL-2 computes none. What i s needed i s the:introduction of points in between c e l l s of the array as skeleton points, as suggested by the examples of figure V. 7,. The obvious way to do t h i s i s to introduce a skeleton point between any two HV-adjacent c e l l s with d i s j o i n t sets of contact points* This doesn't work, however, because many pairs of HV-adjacent c e l l s , f ar from any rid g e - l i n e , have HV-adjacent contact points, and consequently many spurious ridge points would get introduced. Consequently a more conservative condition must be used. , Define two c e l l s of the network to be neighbourly i f they are i d e n t i c a l or are HV-adjacent, and two non-empty sets SI, S2 of c e l l s to be neighbourly i f there i s at least one neighbourly pair of c e l l s , one member of the pair from S1 and one from S2. The modified algorithm i s as follows; V»Path-finding and the skeleton of a planar shape 217 Alqorithm SKEL-3. Steps 1,2,3 as for SKEL-2. 4, [Create ridge points]. For a l l i,j=1,2, ... n, ( i < j) do i f not neighbourly (contacts (Pi) , contacts (Pj) ) then create-ridge-pt R i j between Pi and Pj. 5,. [ Define . skeleton points], SKEL= { a l l created ridge-points ] u ( Pi | number-of-contacts-of (Pi) > 1 j Figure V.8 shows the resu l t of using SKEL-3 on two examples.. 1*2.5 Ridge-foliowing The points of the skeleton w i l l be referred to as ridge c e l l s . A ridge c e l l may be either a c e l l of the o r i g i n a l network or a point created between two c e l l s of the o r i g i n a l network. The output of SKEL-3 i s an unordered c o l l e c t i o n of ridge c e l l s which, to be useful, must be organized into chains of linked ridge c e l l s ; I use the term ridge-following to refer to the operation, on a network to which SKEL-3 has been applied, of i n s e r t i n g l i n k s between ridge c e l l s and assembling three or more neighbouring ridge c e l l s into "junctions" so that the resulting c o l l e c t i o n of c e l l s , l i n k s , and junctions i s a connected graph structure c l o s e l y approximating the s k e l e t a l graph of the corresponding Euclidean shape. Return again to the mountain metaphor;. Imagine oneself straddling a ridge with one's l e f t and right feet just to the V«Path-finding and the skeleton of a planar shape c m 9 J5 ^ 'S "a 3 3 3 © d # i ® % # 3j? '3 4> % <» f» * § * 220 l e f t and ri g h t respectively of the crest, and observe the contact points of the f a l l - l i n e s which originate under one's l e f t and right feet and descend on opposite sides of the ridge. The positions of these two contact points vary continuously with one's position on the ridge crest, except when a crossover point, where three or more ridges meet, i s passed. The only exceptions to t h i s statement could occur when the:set of contact points includes an arc of a c i r c l e - but thi s cannot happen with polygonal figures or a d i g i t a l image. Conversely the point on a ridge-crest from which a f a l l - l i n e descends to a contact point on the shoreline varies continuously with the position of the contact point. In a network, t h i s says that two ridge c e l l s are to be linked only i f the i r contact points are the same or are neighbourly i n pairs. To make t h i s precise some more terminology must be introduced. A csquare i s a unit square in the: network with a c e l l at each corner. . Any of the.four corner c e l l s may be a ridge c e l l , and i n addition the centre of each side may be occupied by a constructed ridge c e l l . Thus a csquare may contain up to eight ridge c e l l s , and there are 28=256 possible different configurations of ridge c e l l s on a csquare.. This i s i l l u s t r a t e d in figure V.9. Two ridge c e l l s are contiguous i f they l i e on a common csquare. Only contiguous ridge c e l l s ever get linked together and when that happens l e t us say that they are crested and the l i n k between them i s a crest.. Now the condition for cresting two ridge c e l l s can be precisely stated: V«Path-finding and the skeleton of a planar shape FIGURE V.9 O A. O A. A CSQUARE i n a network. Each corner r e t i n a l c e l l may be c l a s s i f i e d as a r i d g e - c e l l and the t r i a n g l e s mark the positions of p o t e n t i a l constructed ridge c e l l s . 222 Two contiguous ridge c e l l s R1, R2 can be crested i f f t] points C11, C12 6 contacts (R1) and r| points C21, C22 6 contacts (R2) such that neighbourly(C11,C12) and neighbourly (C21,C22) . The basic scheme for inserting crests and forming junctions i s as follows* . A l l csquares i n the network are examined and the number of ridge c e l l s in each determined. Those with less than two are ignored. If a csguare has two ridge c e l l s then usually they w i l l be crested although there are exceptions. In t h i s way i t i s possible that one ridge c e l l may have crests to more than two other contiguous ridge c e l l s ; such a ridge c e l l i s c a l l e d a junction c e l l . If a csguare has three or more ridge c e l l s some pairs of ridge c e l l s w i l l be crested and/or a set of three or more ridge c e l l s may be grouped into a junction set. Examples of junction c e l l s and junction sets appear in figure V.10.. Now define a graph as follows. Every ridge-pt, j u n c t i o n - c e l l , or junction-set, i s a vertex, and every crest i s an edge of thi s graph. This i s always a connected graph and i s the s k e l e t a l graph of a connected region of a d i g i t a l image. Although there are 256 d i f f e r e n t csguare configurations t h i s reduces to exactly 51 d i s t i n c t cases after r e f l e c t i o n s and rotations are accounted for. A proof of t h i s f a c t appears in appendix A.2, together with a l i s t i n g of the 51 cases. A note on implementation of the arithmetic operations should be made here. A l l quantities involved in the computation V«Path-finding and the skeleton of a planar shape FIGURE V.10 224 of the skeleton on an 8-connected network are in the form a • b*root2 where a, b are integers, that i s to say they constitute an i n t e g r a l domain, so rather than use r e a l arithmetic a l l arithmetic and comparison operations are done using integer arithmetic on pairs of integers (a,b). In other words Gaussian arithmetic i s used* V. 2.6 Using parallelism-to compute-the skeleton The above algorithm computes the skeleton i n four raster scans, including one for forming junction sets and i n s e r t i n g crests. [Montanari,1968] gives an algorithm which proceeds by wave-front expansion i n p a r a l l e l and i s equivalent to SKEL-1. The algorithm SKEL-3 can be modified to compute the skeleton in a similar p a r a l l e l fashion. V.2.7 Paths between objects and superfluous branches With t h i s new algorithm there i s an edge of the s k e l e t a l graph emanating from every corner of a d i g i t a l image. This i s correct, i n accordance with the d e f i n i t i o n of the skeleton. When the shapes involved have long straight l i n e s aligned with the.axes as borders, t h i s i s of no concern. But when the shapes are rotated s l i g h t l y , many corners appear in a d i g i t i z a t i o n and many superfluous edges appear in the s k e l e t a l graph. There are two ways to handle t h i s problem, depending on the si t u a t i o n . I f there are several isolated objects (an archipelago) , and one i s only concerned to f i n d a route through the archipelago, then the VaPath-finding and the skeleton of a planar shape 225 only edges that need to be retained are those along which the skeleton points have contact points on d i s t i n c t objects. I refer to these as inter-object edges, and the remaining edges as in t e r n a l edges. The internal edges can be discarded and the search r e s t r i c t e d to the inter-object edges. On the other hand, i f one has to find paths from place to place within a single complex connected shape, a l l the edges are i n t e r n a l since the contact points of every skeleton point a l l l i e : on the same surrounding object. Various pruning strategies are available. I f the contact points of an edge remain the same and are very close together, and the value of the guench function goes to zero (not a minimum greater than zero, as would occur in a passageway), then t h i s edge may be removed. This handles the case of small steps introduced by the d i g i t i z a t i o n of a l i n e at approximately 45°., The threshold number used to decide when two contact points are "very close together" controls the size of bay that i s represented i n the s k e l e t a l graph. I f one contact point of an edge remains constant while the distance from th i s contact point to the other contact point decreases, and the value of the quench function on the edge goes to zero, then t h i s edge may be removed. This handles the case of an edge introduced into the skeleton by a small step in the d i g i t i z a t i o n of a s l i g h t l y i n c l i n e d straight l i n e . V» Path-finding and the skeleton of a planar shape 226 V,3 Using the s k e l e t o n f o r p a t h - f i n d i n g Use of the s k e l e t o n of the shape d e l i n e a t e d on a network promised t o overcome most of the o b j e c t i o n s to the use of h e u r i s t i c search f o r p a t h f i n d i n g . F i r s t assume t h a t the s t a r t c e l l S and the d e s t i n a t i o n c e l l D l i e on the s k e l e t a l graph* , Then a path from S t o D along the s k e l e t a l graph i s c e r t a i n l y a s p a t i a l path.. In s e a r c h i n g f o r a path through the s k e l e t a l graph* the j u n c t i o n c e l l s and j u n c t i o n s e t s are the only p l a c e s where a c h o i c e i s needed. To s i m p l i f y t h i s s e a r c h the pathgraph, homomorphic to the s k e l e t a l graph, i s d e f i n e d as f o l l o w s . , The v e r t i c e s of the pathgraph correspond to the j u n c t i o n s ( c e l l s or sets) of the s k e l e t a l graph, and an edge between two v e r t i c e s of the pathgraph corresponds to the c h a i n of c e l l s i n the s k e l e t a l graph between the corresponding j u n c t i o n s . A s k e l e t a l graph and i t s corresponding pathgraph i s shown i n f i g u r e V.11. Now a l l the t o p o l o g i c a l l y d i s t i n c t s p a t i a l paths from S t o D are found by using a standard graph t r a v e r s i n g a l g o r i t h m on the pathgraph, with c o n s i d e r a b l y l e s s search than when the network o f c e l l s i s searched d i r e c t l y . I f the s t a r t S or d e s t i n a t i o n D are not on the s k e l e t a l graph then the n e a r e s t p o i n t s to S and D on the s k e l e t a l graph, S* and D', must f i r s t be found. T h i s can be done by f o l l o w i n g the f a l l - l i n e at t h a t p o i n t upwards u n t i l t h e . s k e l e t a l graph i s encountered. Then proceed as b e f o r e . I f i t happens t h a t s e v e r a l p o i n t s on the s k e l e t a l graph are e q u a l l y c l o s e to S or to D, then the p a t h f i n d i n g a l g o r i t h m r e q u i r e s a t r i v i a l V«Path-finding and the s k e l e t o n of a p l a n a r shape FIGURE V . l l A s k e l e t a l graph and i t s pathgraph. 228 modif i c a t i o n . V, 3.. 1. Describing a s k e l e t a l path A path spe c i f i e d by a path through the s k e l e t a l graph can be naturally described i n terms of the objects of the world model. For instance in figure V.12 the path from S to D can be described as (move ( (keep-right-of ob1) 5 (keep-left-of ob2) ) d1) (turn r i g h t 45°) (move ( (keep-right-of ob3) & (keep-left-of ob2) ) d2) (move ( (keep-right-of ob3) & (keep-left-of ob5) ) d3) (move ( (keep-right-of ob4) & (keep-left-of ob5) ) d4) (turn r i g h t 60) (move ((keep-right-of ob6) & (keep-left-of ob5) ) d5). Such a path description can be generated from the.skeletal graph by examining the two contact points of each r i d g e - c e l l on the path. One belongs to the nearest object on the l e f t hand side and the other belongs to the nearest object on the right hand side. So long as no two d i s t i n c t objects on the screen run into each other, that i s to say there i s always a channel of s p a t i a l c e l l s between d i s t i n c t objects, then the membership of the contact c e l l s of ridge c e l l s can only change at junctions and therefore the description of ridge c e l l s along any one edge of the pathgraph remains constant. VaPath-finding and the skeleton of a planar shape 229 FIGURE V.12 S k e l e t a l path between o b j e c t s . The skeleton allows a " n a t u r a l " d e s c r i p t i o n to be e a s i l y derived. 230 V.3.2 Opt imizinq a sk e l e t a l path The example in figure V.13 shows that i t i s necessary to consider optimizing a s k e l e t a l path. I f 9 i s the angle between consecutive corridors in the fi g u r e , then the length of the optimized path i s sin(9/2) times the length of the unoptimized sk e l e t a l path, a considerable improvement i f 9 i s , say, 45° since in that case the optimized path i s approximately 0.1 as long as the s k e l e t a l path. In certain s p e c i a l cases, the optimization can be carried out roughly as follows.. Let S,D be the start and destination of the s k e l e t a l path to be optimized, and define a function e on the s k e l e t a l path by e(p)=perpendicular distance from p on the ske l e t a l path to the straight l i n e SD. As p varies from S to D fi n d the maximum of the function e(p)-g(p); i f t h i s i s not positive nothing needs be done, for i n this case the straight l i n e SD i s the shortest path from S to Di Otherwise l e t the maximum be at P* and apply t h i s algorithm recursively to the paths SP* and P*D. Unfortunately t h i s method cannot be carried out i n general* The problem here might be christened the rope-tightening problem, described as follows. Given an environment of arbitrary two dimensional shapes on a tabletop* two points S, D at vacant spots, and a rope l a i d out from S to D along a sk e l e t a l --or arb i t r a r y - - path: compute a description of the curve assumed by the rope when tension i s applied at S or D, any slack being taken up as required. Preferably the solution V«Path-finding and the skeleton of a planar shape I P A T H S k C L G T A L >* v . p<\ Tq \ FIGURE V.13 Example i l l u s t r a t i n g the need to optimize a s k e l e t a l path. 232 should be stated in terms of an array of c e l l u l a r automata.. One obvious strategy i s to move the path i n the d i r e c t i o n of the centre of curvature at positions where the:absolute value of the radius of curvature has a l o c a l minimum. The l o c a l minima of the radius of curvature correspond to the bends in the rope and the effect of moving such points inwards towards the l o c a l centre of curvature i s to smooth out these bends., The radius of curvature at a point p of the path can be found by a l o c a l operator that looks at a small set of adjacent points of the path centred on p (say f i v e neighbouring points).. Then one pass along the whole path determines the l o c a l minima of the radius of curvature* If such a point i s already adjacent to a point of an obstacle on the same side as the radius of curvature i t cannot be moved any further. Otherwise each point B of l o c a l minimum i s moved to the closest grid point B * i n the d i r e c t i o n of the centre of curvature. I f the adjacent points to B in the path were A, C, then the adjacent points to B' in the new path remain A, C. The process i s now repeated u n t i l either the. path i s s t r a i g h t , with i n f i n i t e radius of curvature at a l l points, or else the only points of i n f l e c t i o n occur where the path goes round an extreme point of an obstacle, the path being straight otherwise. What I have just sketched i s a relaxation algorithm for obtaining a curve whose second derivative i s zero everywhere except f o r points where the curve contacts an obstacle.. In ef f e c t i t simulates the rope-tightening. V«Path-finding and the skeleton of a planar shape 233 7.3.3 Comparison of s k e l e t a l and A*- path finding The complexity of both i s l i n e a r in the number of c e l l s in the network, except that the constant of l i n e a r i t y i s much greater i n the s k e l e t a l case.. This i s clear for A* since the number of nodes expanded by A* i s bounded by the number of c e l l s in the network. In the case of s k e l e t a l path-finding there are two parts to consider, finding the s k e l e t a l graph and searching the graph. The f i r s t operation i s l i n e a r in the number of c e l l s and i n the second, the number of nodes expanded by a graph traversal, algorithm i s bounded by the number of c e l l s . On the other hand a s k e l e t a l path has a natural description in environmental terms. If the use of parallelism i s considered, then i t i s l i k e l y that the s k e l e t a l path-finding method comes out well. If the raster scan algorithm for the skeleton i s replaced by a p a r a l l e l wavefront-expanding method, i t takes w wave-front expansions when the maximum value of the quench function i s w. A l l the ridge-crest l i n k s can be computed i n one p a r a l l e l operation, except for some junction sets where two operations would be required. I-i* Other applications of the skeleton The skeleton can also be applied to findinq a path for moving an object, findinq empty space, and other problems.. I describe each application i n turn. V«Path-finding and the skeleton of a planar shape 234 V,4.1 pbjeet moving -Suppose there i s an environment of obstacles and an object to be moved from one position to another,, The simplest shape for which a path can be found by the skeleton i s a c i r c l e . V. 4. 1.1. C i r c u l a r shaped object of -radius r F i r s t find the pathgraph of the empty space and remove from i t any edge whose chain of c e l l s in the s k e l e t a l graph contains a c e l l at which the value of the guench function i s less than r. Then, i f the i n i t i a l and terminal positions of the c i r c u l a r shape are S and D, apply a h e u r i s t i c graph t r a v e r s a l algorithm to the pathgraph to find the shortest path from S to D that follows the arms of the s k e l e t a l graph.„ Since the guench function along t h i s path i s everywhere at least as great as r, the . c i r c u l a r shape can c e r t a i n l y be moved along t h i s path provided the centre of the shape i s kept on the:path.. V.4. JL 2 Other object shapes The basic idea of t h i s approach i s to fi n d the skeleton of the empty space, the skeleton of the shape to be moved, and work with the skeletons instead of the o r i g i n a l shapes. The condition for a shape to be contained within a space can be stated in terms of the skeletons as follows: (*) Let the quench function of the skeleton of the shape be g and the quench function of the skeleton of the empty space be r. Then f o r a l l points x of the skeleton of VaPath-findinq and the skeleton of a planar shape 235 the shape, there must exist at least one point y on the skeleton of the space such that the circle centre x radius q (x) is contained in the circle centre y radius r (y). Consider a lonq thin shape like a stick., By addinq semi-circular ends if necessary, its skeletal graph is a straight line segment. Clearly if this line segment can be kept aligned with the skeletal graph of the space while the shape is being moved then condition (*) is easily checked, since then points of the shape's skeletal graph lie on the space's skeletal graph. V. 4 . 1_-3 An L-shaped object This is an awkward problem for humans at the:best of times and in retrospect it was perhaps overly optimistic to think that a clean approach to its solution could be obtained through the use of skeletons. Although the skeleton does provide a clean approach to the problem of a circular shaped object, I have not yet found a useful application of it to the.problem of moving more complex shaped objects.. The L problem can be viewed as Requiring the simultaneous solution of two interacting sabprobleras. ,r Namely, since each arm is a rectangular stick, first solve the problem of moving a stick though the doorway. Then, tackle the L problem by simultaneously solving two problems of moving a stick through the doorway, one from each arm of the L, with the complication VoPath-finding and the skeleton of a planar shape 236 that any movement of one st i c k causes a movement in the other., V.4.2 Finding empty space An i n t e r e s t i n g application of the skeleton i s to the findspace problem: f i n d space on a cluttered tabletop to put down another object. This i s the FINDSPACE problem of Sussman i 1973*3. The position of the maximum sized c i r c u l a r spaces on the tabletop can be found d i r e c t l y from the guench function of the skeleton of the empty space. This i s done by traversing the s k e l e t a l paths and finding the l o c a l maxima of the guench function. If the c i r c l e with radius equal to the maximum of the quench function i s s u f f i c i e n t to contain the extra object then the problem i s solved; i f not, the positions of the maximal c i r c l e s within the space are good candidates f o r the position of the extra object. V.4.3 Fin ding the shortest distance - between two-shapes Given two iso l a t e d planar shapes, a shortest straight l i n e between them can be found by means of the skeleton in the following way. F i r s t f i n d the skeleton of the empty space surrounding the shapes, an-d retain only those edges of the s k e l e t a l graph having one contact point on each shape. These are the inter-shape edges.. Then, find a point P on the inter-shape edges at which the guench function takes i t s minimum value. The straight l i n e joining the two contact points of P i s then a shortest straight l i n e between the two shapes. VaPath-finding and the skeleton of a planar shape 2 37 i; Rather than developing the extensive mathematical machinery necessary to make the above description rigourous, I off e r the following. i n t u i t i v e j u s t i f i c a t i o n . At every point on an inter-shape edge one can draw a c i r c u l a r disc centred at that point, radius the guench function there, and with one contact point on each shape. As the inter-shape edges are traversed the disc expands and contracts in radius. The minimum value of the radius of t h i s disc i s assumed at one or more points of the inter-shape edges. At such a point the l i n e connecting the contact points of the disc must be a diameter of the disc, and moreover i s a l i n e of shortest distance between the edges. V.4.4 Finding nearest neighbourhood regions Let P be a c o l l e c t i o n of points in the plane.. The nearest neighbourhood of a point p S P consists of a l l points x on the plane such that x i s closer to p than to any other point i n the c o l l e c t i o n P. The nearest neighbourhoods of a c o l l e c t i o n of points i s also known as the Voronoi diagram or D i r i c h l e t t e s s e l l a t i o n [Green & Sibson,1978§. Consider the skeleton of the plane with point objects p,q,r,... corresponding to the points of P. Lemma. The edges of the s k e l e t a l graph of the space surrounding the points P form the boundaries of the nearest neighbourhoods of the points of P. Proof sketch. Every point of the plane i s e i t h e r equidistant from two or more points of P, or else i s closer to one point VaPath-finding and the skeleton of a planar shape 238 than to any other point of P. In the f i r s t case:the point l i e s on the s k e l e t a l graph of the space surrounding the points of P, in the second case the point i s in the nearest neighbourhood of some point of P. Let x be a point in the sk e l e t a l graph of the space surrounding the points of P, with contact points p,q 6 P. Thus x i s not a vertex of the sk e l e t a l graph. In any a r b i t r a r i l y small neighbourhood of x, there are points closer to p than to any other point of P, points closer to g than to any other point of P, and points of the sk e l e t a l graph. . Hence x i s a boundary point of the nearest neighbourhood of p and of the nearest neighbourhood of q.. S i m i l a r l y , i f x i s a vertext of the ske l e t a l graph with contact points p,q,r,.,., x i s a boundary point of the nearest neighbourhoods of p,g,r,..,... Thus the skeleton of a c o l l e c t i o n of shapes i s a generalization of the boundaries of the nearest neighbourhood regions of a c o l l e c t i o n of points.. V.5 Summary In t h i s chapter I sketched various approaches to path-finding and proposed one based on the use of the skeleton of the shape of the empty space. In order to implement th i s l a t t e r approach I developed a new i t e r a t i v e algorithm for the skeleton that i s guaranteed to compute a connected skeleton from a connected shape. I sketched how the skeleton could be used as a h e u r i s t i c aid i n the solving of object-amoving problems, and V»Path-finding and the skeleton of a planar shape 239 showed how the skeleton could be applied to finding the shortest distance between objects and to finding nearest neighbourhood regions, With t h i s chapter on pathfinding I have spe c i f i e d a class of algorithms which can be used as a basis f o r the solution of pathfinding and object moving problems i n the s p a t i a l planner. Thus the outline design of the robot-controller i s complete.. V«Path-finding and the skeleton of a planar shape 240 CHAPTER VI SUMMARY, CONCLUSION, AND FUTURE WORK VI.! Summary After an introductory chapter, I reviewed at some length the nature of A r t i f i c i a l Intelligence, introduced the approach of simulating a made up organism, and reviewed several c l o s e l y related pieces of work. Then I described i n some d e t a i l a system for simulating an environment and the sensori-motor parts of an organism to inhabit i t . In chapter IV I sketched the ov e r a l l features of the control program of such an organism, basing i t on the notion of the action cycle, , One p a r t i a l l y implemented design was described and an alternative approach proposed., An important reguirement f o r any organism, in par t i c u l a r for i t s c o n t r o l l e r , i s a path-finding a b i l i t y . . To t h i s end I described in chapter V an approach to path-finding based on the skeleton of a shape. The skeleton, which was o r i g i n a l l y motivated by physiological considerations and f i r s t applied to shape description, i s also a useful tool for path-finding and as a heuristic for other s p a t i a l problems. I developed a new i t e r a t i v e algorithm to compute i t . Although the actual amount of computation to find the skeleton on a s e r i a l VI»Summary, conclusion, and future work 241 machine may be greater than that for other techniques for path-finding, i t reduces the h e u r i s t i c search required for findinq a route between obstacles.. So l e t me stand back and take stock.. What has been solved and what problems uncovered? How does t h i s work relate to other work? What contribution does i t make to the. A r t i f i c i a l I ntelligence enterprise? The advances contained i n t h i s work are threefold. (a) In the f i r s t place I e x p l i c i t l y l a i d out the features of the action cycle f o r a robot-controller; t h i s has not been done before. The implementation done thus f a r was based on the analogy between the process of perception and the s c i e n t i f i c method whereby one i s always acting on the basis of a c o l l e c t i o n of hypotheses and gathering evidence for these hypotheses in the form of sensory input data. (b) A s p a t i a l reasoning module i s an important and e s s e n t i a l part of any robot-controller.. I t makes plans for action on the basis of the current c o l l e c t i o n of hypotheses about the form of the environment. The second advance i s the development of a new approach to problems of s p a t i a l reasoning based on the use of the skeleton of a two-dimensional shape. When the environment has been drawn on an array of points l i k e a screen, an i t e r a t i v e algorithm reguiring a constant amount of computation reduces any pathfinding problem to a simpler graph-traversal problem.. Each VlaSummary, conclusion, and future work 242 edge of the graph corresponds to a path between two o b j e c t s , each node corresponds t o a j u n c t i o n of three or more paths, while the number of nodes i s reduced to a minimum. Thus the amount of h e u r i s t i c search i s reduced. There are other ways to do t h i s t h a t are based on a C a r t e s i a n r e p r e s e n t a t i o n of the shapes of o b j e c t s , which w i l l r e g u i r e much more search i f • the shapes i n the environment have much extraneous d e t a i l . , The method presented here c o u l d c l e a r l y be computed by a neuronal network. Thus i t i s i n t e r e s t i n g to ponder i f t h i s i s one of the a l g o r i t h m s a c t u a l l y used by the f u n c t i o n i n g mammalian b r a i n . Some: i n t e r e s t i n g t e c h n i c a l problems were uncovered i n t h i s approach.. One i s c a l l e d the r o p e - t i g h t e n i n g problem. When you have found one reasonable path between two p o i n t s , how do you t i g h t e n the path t o the s h o r t e s t p o s s i b l e way? The other t e c h n i c a l problem r e l a t e s t o e l u c i d a t i n g the f u l l d e t a i l s f o r moving an L-shaped o b j e c t through a doorway. I presented one s u g g e s t i o n f o r approaching the s o l u t i o n to t h i s problem. , (c) As d i s c u s s e d i n chapters I I and I I I there have been s e v e r a l robot s i m u l a t i o n programs w r i t t e n before and the f u l l d e t a i l s of my robot s i m u l a t i o n were d e s c r i b e d t h e r e . Mine i s the f i r s t to handle the movement and c o l l i s i o n of two dimensional shapes. . Of the p r e v i o u s two major robot s i m u l a t i o n s , Becker & Merriam used a C a r t e s i a n r e p r e s e n t a t i o n and N i l s s o n S Raphael used a d i g i t a l r e p r e s e n t a t i o n of shapes,. The C a r t e s i a n r e p r e s e n t s shapes as a s e r i e s of p o i n t s given by C a r t e s i a n c o o r d i n a t e s while the VlsSummary, c o n c l u s i o n , and f u t u r e work 243 d i g i t a l represents a shape d i r e c t l y as an array of points l i k e a screen., Of the previous r i g i d object motion simulations, Eastman and Pfefferkorn used Cartesian representations while Funt and Baker used d i g i t a l representations. My advance was to use a combination of the: Cartesian and the d i g i t a l representations to simulate the motion and c o l l i s i o n of objects on a tabletop. VI.2 Conclusion I began the thesis by asking what computational processes are reguired for s p a t i a l reasoning., My answer, and, b r i e f l y , the conclusion of the thesis, i s t h i s . Computational processes incorporating algorithms f o r computing the d i g i t a l skeleton of a planar shape may prove to be s u f f i c i e n t for the s p a t i a l reasoning of a robot-controller. VI.3 Research problems This consists of a l i s t of problems encountered i n the course of our project, that need further investigation. 1. Problems related to the simulated environment. (a) Extend TABLETOP to compute exact c o l l i s i o n points between robot or object and an obstacle. Two methods for doing t h i s were described in III.3, which should be implemented and tested. VlaSummary, conclusion, and future work 244 (b) Simulate p a r a l l e l operating hardware to carry out the TABLETOP simulation. (c) Generalize the TABLETOP simulation to three dimensions., (d) Design a more interesting environment.. T r i v i a l l y , t h i s can be done, for example, by allowing randomized action e f f e c t s ; less t r i v i a l l y , by allowing independently moving objects. Since any extension of the environment requires a corresponding increase i n the c a p a b i l i t i e s of the organism-controller, no such extension should be contemplated u n t i l the current environment i s competently handled by the current organism-controller. 2. Problems related to the organism-controller. (a) Alio;* a r e s t r i c t e d form of natural language input for the task•statement. (b) Design a more ' r e a l i s t i c * form of visi o n . (c) Implement the s p a t i a l planner. In p a r t i c u l a r , extensive experimentation with the L-shaped object problem i s required. 3. Problems related to the skeleton. (a) Implement skeleton algorithms that use 16-connected c e l l s rather than 8-connected c e l l s , and compare t h e i r performance with the algorithm for 8-connected networks and with true Euclidean skeletons. (b) Extend the skeleton algorithms to apply to three VI«Summary, conclusion, and future work 245 dimensions. The short d e f i n i t i o n of the 3D s k e l e t o n i s "the l o c u s of the centre of maximal spheres", and i n g e n e r a l the 3D sk e l e t o n i s a s u r f a c e not a l i n e . I t may, however, be of some use i n planning the movement of o b j e c t s i n t h r e e dimensions. VI«Summary, c o n c l u s i o n , and f u t u r e work 246 APPENDICES h-1 TABLETOP user's manual Run LISP, then type the following to bring up the TABLETOP system: (DISKIN RSR1:BASIC RSR1:SRW#LISP RSR1:ENVIRONMENT#5 C0H4:SRW#0H) (OHSENSE) A snapshot of the environment i s then displayed on the screen, and the bug can now be controlled by a small number of commands. After each command i s given the r e t i n a l impression and t a c t i l e impression of Otak are displayed. In the following commands, "distance" i s a posit i v e or negative number with a decimal point. "orientation" i s a compass di r e c t i o n (one of N,NE,E,SE,S,SW,W,NW) or a positive or negative number with a decimal point. A zero number means north, a posit i v e number means an angle measured clockwise from north, and a negative number means an angle measured anti-clockwise from north.. "radians" i s a positive or negative number, or one of the angles PI or PI/2. "degrees" i s a positive or negative number.. For both "radians" and "degrees", a positive number means a clockwise turn and a negative. number 247 means an anti-clockwise turn.. (SLIDE distance orientation) The bug moves approximately "distance" units in the di r e c t i o n "orientation". (HOLD) i f the bug i s immediately adjacent to a movable object then after t h i s command i s executed the bug and the adjacent object are cemented together and move as one r i g i d object.. The PUSHTO and TURN commands must now be used. (LETGO) Undoes the effect of HOLD. After t h i s command the bug can move fr e e l y again, by means of the SLIDE command. (PUSHTO distance orientation) The bug and the object held move as one r i g i d unit approximately "distance" units in the approximate d i r e c t i o n "orientation".. (TURN radians) The bug and the object held turn as one.rigid unit through an angle of approximately "radians" radians. (TURND degrees) The bug and the object held turn as one r i g i d unit through an angle of approximately "degrees" degrees. (WORLD integer) This sets up a new environment for the bug. . "integer" must l i e between 0 and 8. These are predefined environments; there are also f a c i l i t i e s for setting up an environment d i r e c t l y using the functions START-SRW, CREATE-OBJECT, and PUTPUSHER. Examples of th e i r c a l l i n g seguences can be found in HSE1:ENVIE0N#5. , 249 1.2 1 combinatorial lemma A csguare i s defined as a sguare with eight locations on i t , one at each corner and one at the midpoint of each side. Each location may be occupied or vacant. Thus the set S of a l l csguares contains 2e=256 members. Now consider the group G of rotations and r e f l e c t i o n s of a sguare into i t s e l f . G has eight elements, consisting of the i d e n t i t y , three rotations, and four r e f l e c t i o n s . . Each element of G acts as a permutation of the set S. Two elements of s1, s2 of S are eguivalent - i f there i s a group element g such that gs1=s2.. This i s an equivalence r e l a t i o n that divides S into a number of eguivalence classes. Lemma. The number of eguivalence classes of csguares under the group G of rotations and r e f l e c t i o n s of a csquare i s 51. Proof. By Burnside's lemma (see for example, [de Bruijn, 1964,p. 150 fj) the number of equivalence classes i s given where |G| denotes the number of elements of G, and, for each g, psi (g) denotes the number of elements of S that are invariant under g, that i s , the number of s6S for which gs=s., For the group G of r e f l e c t i o n s and rotations of a square, j G | =8. 3 = {I,R1„E2,R3,RR1 ,RR2, RR3, RR4} where I i s the i d e n t i t y , Ri,i=1,2,3 are the rotations, and RR j , j= 1,2,3,4 are the r e f l e c t i o n s . Then one has psi (I) =256; psi (R1) =psi (R3) =4 ; by p s i (g) 250 psi(R2)=16; psi (RR1) =psi (RR2) =psi (RR3) =psi (RR4) =32. Thus the number of equivalence classes i s 1/8{256 + 4 + 16 + 4+4*32}=408/8=51. QED. One representative from each equivalence class i s shown in figure A2.1. 2 5 T 0 f a ) F i g u r e &2. 1 0 m • • * *> 0 * • 0 at 0 0 • -4> * * at * 0 - -• • m m m m \ at • • • 0 m * 0 * 0 0 * • 0 m 0 * * 0 0 * * 0 0 at m m • * • * a* * m a» • * * . 0 0 0 * • 0 •t 0 0 * at m • 0 * 0 0 * 0 0 * m * * • • * at * • * • m * <• * • • * - • m * • at - <• 0 -m 0 0 * 0 0 * 0 0 * 0 0 * 0 a* 0 m * 0 *» m * m * m * • a* • m m *» . * m * * m * • m m * 0 m * 0 -m * 0 •0 G 0 * 0 * 0 0 * 0 0 * 0 0 * * * * # • * * at * • . * 0 0 • , 0 * * • • o • * m * 0 * 0 0 0 * * 0 0 * 0 0 * m 0 * 0 * 0 0 * 0 •> * m * m * * * • * • * • * 0 m * 0 0 0 0 •m . G * • * 0 0 - 0 0 * 0 0 * 0 0 * 0 0 # 0 * 0 0 0 0 * m * <m m * * * * * * * • * o * at 0 * 0 * • at * 0 • * 0 * 0 a 0 * 0 * * 0 * 0 251 A-3-On Funt's r i g i d s h ape rotation-algorithm Let a s i t u a t i o n be an arrangement of sguares on the WHISPER array and l e t a rotation be an ordered pair {centre of rotation, angle of rotation). A rotation transforms a s i t u a t i o n into a new s i t u a t i o n . This i s defined precisely as follows. Suppose a rotation rho={C,alphaj i s used to rotate s i t u a t i o n SIT1 into a new si t u a t i o n SIT2. . The transformation i s carried out by rotating each sguare Q i n SIT1 independently. The image square R of Q after rotation rho i s computed by the following method. Let P be the centrepoint of square Q., Now with centre C and radius CP, rotate P by amount alpha to a new position P' and determine which square of the array contains P'. This i s R, the image square of Q under rho., Note that the distance between R and P' may have any value up to root2/2. The transformed situation SIT2 consists of the set of a l l image sguares under rho. The simplest examples i l l u s t r a t i n g why the depiction of an object on the array disintegrates are shown i n figure A3.1 Note that the distance between the centres of two edge-adjacent sguares i s one whereas the distance between the.centres of two diagonally corner-adjacent sguares i s root2. Thus the centres of two edge-adjacent sguares, when rotated by 45°, can map into the same - square. This i s a Merge of two squares into one. S i m i l a r l y , the centres of two corner-adjacent squares can map 0 R \ Re SPLIT S T A G G E R E D ROT AXIOM S H R I N K I N G L E ^ * a»\Tt <. 5* < ^ S* fumttfcs t o 4 Q -• o ' . t j R F I G U R E fVi . i 2 53 FIGURE A3.1 (continued) 254 into two non-edge-adjacent squares i n a row., This i s a s p l i t between two previously adjacent squares. Given an i n i t i a l s i t u a t i o n and a sequence of rotations, the f i n a l - situation i s the s i t u a t i o n a r i s i n q after a l l the rotations of the sequence have been applied i n succession to the i n i t i a l s i t u a t i o n . . Let the centre-line of two squares be the l i n e joininq t h e i r centres., Let a n-square situation be a situ a t i o n with exactly n squares. Then the followinq lemmas hold. Merge lemma. For any two-square s i t u a t i o n there i s a sequence of rotations such that the f i n a l s i t u a t i o n i s a one-square s i t u a t i o n . . S p l i t lemma. For any two-square sit u a t i o n and a r b i t r a r i l y large number X, there i s a sequence of rotations such that the f i n a l s i tuation i s a two-square situation and the distance between the centres of the squares i s at least X. Three further lemmas are needed to prove the split/merge lemmas., Staggered rotation lemma.. In a two-square si t u a t i o n l e t the centre-line of the two squares l i e at some angle between the horizontal and 45°. Let the horizontal distance between t h e i r centres be n. Then two sequences of rotations can be found, each of which keeps the horizontal distance between the centres of the squares equal to n,» One has property (a) and one has 255 property (b) i n the corresponding f i n a l s ituations. (a) The centre-line of the two sguares i s horizontal. (b) The centre-line of the two squares makes an angle of 45° with the horizontal. The staggered rotation lemma e s s e n t i a l l y says that i f two sguares have a 45° centre l i n e and are separated by n intermediate sguares (n>0), then they can be rotated i n a staggered fashion so that they have a horizontal centre l i n e but are s t i l l separated by exactly n intermediate, sguares; and conversely. To be more precise, suppose that i n a two-square situation the coordinates of one square r e l a t i v e to the other are ( i x , i y ) . Then the axis distance between the squares i s m = Max {| ix j , | iy | j . The staggered rotation lemma then says that any two-sguare s i t u a t i o n can be transformed into any other in which the axis distance between the sguares i s the same.. Shrinking lemma. Given a two-square s i t u a t i o n with axis distance n between the squares, and suppose (m - 1)*root2 < n < m*root2 holds for some integer m > n. Then there exists a sequence of rotations such that i n the f i n a l s i t u a t i o n the axis distance between the squares i s m. (Proof: one 45° rotation plus one staggered rotation.) The proof of the merge lemma now follows by alternate applications of the shrinking lemma and the staggered rotation 256 lemma. Expanding lemma. Given a two-square s i t u a t i o n with axis distance m between the squares, and suppose n - 1/2 < m*root2 < n + 1/2 holds for some integer n > m. Then there exists a sequence . of rotations such that i n the f i n a l s i t u a t i o n the axis distance between the squares i s n. (Proof: one staggered rotation plus one 45° rotation.) The proof of the s p l i t lemma now follows by alternate applications of the expanding lemma and the staggered rotation lemma. Successive applications of the merge lemma prove the following Collapsing, theorem. Given any i n i t i a l s i t u a t i o n there i s a sequence of rotations such that the f i n a l s i t u a t i o n contains only one square. Conversely, the question i s whether t h e . s p l i t lemma can be generalized to multisquare situations. The answer i s yes. Spreading theorem. Given any situ a t i o n with S squares and given an a r b i t r a r i l y large number X, there i s a sequence of rotations such that i n the f i n a l s i t u a t i o n there are s t i l l S squares and the distance between any two squares i s at least X. Proof (outline). Pick a pair of squares with minimum axis 257 distance and take the centre of one of these as the centre of rotation for a l l following rotations. F i r s t j i g g l e each sguare in turn u n t i l a l l the sguares l i e on either of the two diagonal l i n e s through the centre of rotation. No merges must be allowed to occur in t h i s j i g g l i n g . An i n d i v i d u a l sguare can always be moved without moving any other squares, by picking a centre of rotation closer to that square than any other. In p a r t i c u l a r , •compact' sets of squares, as would occur in the o r i g i n a l depiction of an object, can be s p l i t up without any merges.. Now rotate 4 5° so that the diagonal lines are in the h o r i z o n t a l / v e r t i c a l position, then c a r e f u l l y stagger back to the diagonal position. The 45° rotation does the s p l i t t i n g , the staggering regains the standard position. Repeat t h i s u n t i l s u f f i c i e n t spreading has occurred. The c o l l a p s i n g and spreading theorems are enough to show that Funt's object rotation scheme cannot work.„ 258 R E F E R E N C E S [ Amarel, 1 968 ] Amarel,S. On representations of problems of reasoning about actions., In: D.Michie (ed.), Machine Intelligence 3, Edinburgh University Press, 1968. t Anderson, 1978 i] Anderson,J.R. Arguments concerning representations for mental imagery. Psychological review, 8 5(4), (July 1978), pp. 249-277. j. Arbib & Lieblich,1977 3 Arbib,M.A. , and L i e b l i c h , I . Motivational learning of s p a t i a l behaviour. In: J.Metzler (ed.). Systems Neuroscience, Academic Press, New York, 1977, pp. 221-239. [Baker,1973] Baker, Richard. A s p a t i a l l y oriented information processor which simulates the motions of r i g i d objects. A r t i f i c i a l Intelligence, 4 (Spring 1973), pp.29-40. [Barrow & Tenenbaum, 1 978 ] Barrow,H.G., and Tenenbaum,J.M. Recovering i n t r i n s i c scene c h a r a c t e r i s t i c s from images.. In: Hanson,A.R, and Riseman, E. M. , (eds.). Computer Vision Systems. Academic Press, New York, 1 978, pp. 3-26. , I B a r t l e t t , 19 32.] Bartlett,F.C. Remembering. Cambridge.University Press, 1932. [Becker,1 972 ] Becker, J.D. "Robot" computer problem solving system. Report 2316, Bolt, Beranek & Newman Inc., 1972. [Becker,1973] Becker, J.D. "Robot" computer problem solving system.. Report 2646, Bolt, Beranek & Newman Inc., 1973. [Becker,1 973 ] Becker,J.D. A model for the encoding of exp e r i e n t i a l information.. In: R.C.Schank and K.M.Colby, Computer models of thought and language, W.H.Freeman & Co., 1973., References 259 [Becker & Merriam,1973J Becker,J.D., and Merriam,W. "Robot" computer problem-solving system.. Report 2 6 4 6 , Bolt, Beranek & Newman Inc., 1 9 7 3 . t Bindra ,1 9 7 6 ] Bindra,D. A theory of i n t e l l i g e n t behaviour. John Wiley and sons, 1 9 7 6 . [ Bitterman, 1975 J Bitterman,M.E. The comparative analysis of learning., Science, J 8 8 ( 1 9 7 5 ) , pp.699 -709 . ".Black, 1968 i] Black,F. k deductive question-answering system.. In: M.Minsky (ed.). Semantic Information Processing, MIT Press, 196 8. t Blum, 1 9 6 7 ] Blum,H. A transformation for extracting new descriptors of shape. In: W. Walthen-Dunn (ed.),, Models - 'of the perception of speech and v i s u a l form. MIT Press, 1 9 6 7 , p p .3 6 2 - 3 8 0 . [ Blum, 1973g Blum, Harry. B i o l o g i c a l shape and v i s u a l science (Part I ) . J. Theoretical Biology, 3 8 J 2 1 (1973) , pp.205 -287 . [Blum,.1974 J Blum,H. A geometry f o r biology, i n : Mathematical Analysis of Fundamental B i o l o g i c a l Phenomena, i n : Annals New York Academy of Sciences 2 3 1 , pp.1 9 - 3 0 . . J. Bower, 1977 i] Bo wer,T.G.R. A Elil§£- of infant - development., W.H.Freeman, 1 9 7 7 . [ Brindley , 1969 i] Brindley,G.S. Nerve, net models of plausible size that perform simple learning tasks. Proc. , Roy.. S o c . London series B, J 7 4 ( 1 9 6 9 ) , pp. 1 7 3 - 1 9 1 . [Burks, 1978 i] Burks, A. W. , Computer science and philosophy. Logic of computers group tech. report 2 1 8 , Computer science department, 0.Michigan, 1 9 7 8 . . [Calabi & Hartnett, 1968 ] Calabi,L., and Hartnett,W.E. Shape recognition, p r a i r i e f i r e s , convex d e f i c i e n c i e s , and skeletons. American Math. Monthly, 75 ( A p r i l 1 9 6 8 ) , pp.335 -342 . References 260 {.Chien S Weissman, 1975 i] Chien, R.T., and Weissraan,S,. Planning and execution in incompletely specified environments...Proceedings Fourth International Conference on a r t i f i c i a l Intelligence, 1975, pp. 169-174. fColes et al.,197 53 Coles, L.Stephen, a . M.Robb, P.L.Sinclair, M.H.Smith, R. R.Sobeck. Decision analysis f o r an experimental robot with unreliable sensors.. Proceedings Fourth International Conference on a r t i f i c i a l i n t e l l i g e n c e , 1975, pp.749-757. [ Cook & Reckow,1974 j} Cook,S., and Reckow,R. On the lengths of proofs i n the propositiona1 calculus. Proceedings 6th Annual Symposium on Theory of Computing, ACM, 1974, pp.135-148.. [Davis,1963 ] Davis,M. Eliminating the irrelevant from mechanical proofs. Proc. symposia i n applied mathematics, 1.5 (1963), pp.15-30. [de Bruijn,1964] de Bruijn,N.G, Polya's theory of counting.. In: E.F.Beckenbach, Ed., Applied-Combinatorial Mathematics, John Wiley, New York, 1964. [Dennett, 1978a ] Dennett,D.C.. Commentary "Why not the whole iguana?". * The Behavioural and brain sciences 1(1) (1978), pp. 103- 104. [Dennett, 1978b ] Dennett,D.C.. Brainstorms. Bradford Books, 1978. [Donaldson, 1978 J Donaldson,M. Children's minds, Fontana, 1978. !. Doyle, 19 78 0 Doyle,J. Truth maintenance systems for problem-solving. . TR-4 19, MIT Al Lab., 1978. I Eastman, 1973 f] Eastmar, Charles M.. automated space planning, a r t i f i c i a l Intelligence, 4 1 1 1 (1973), pp.41-64.. [Eccles et al.,1977 J Eccles,M.J., McQueen,M. P.-G. and Rosen, D. . analysis of the. d i g i t i z e d boundaries of planar objects., Pattern Recognition, 9JH (January 1977) , pp. 31-41. . References 261 [Ermentrout & Cowan ,1978] Ermentrout,G.B. And Cowan,J.D. Large scale a c t i v i t y in neural nets, SIAM Journal of Applied Math.,1978.„ [Fahlman,1974] Fahlman, Scott E. A planning system f o r robot construction tasks. A r t i f i c i a l Intelligence, 5jil)_ (1 974) , pp. 1-49,. [Feldman & Sproull,1977] Feldman,J.A., and Sproull,B.F. . Decision theory and AI I I : the hungry monkey.. Cognitive. Science, 1 (1977), pp.158-192. [Fikes & Nilsson,1971] Fikes, R.E.., and Nilsson, N. J., STRIPS: A new approach to the application of theorem-proving to problem solving. A r t i f i c i a l Intelligence, 2 (1971), pp.189-208.„ [Fikes, Hart, & Nilsson,1972] Fikes,R,. E. Hart, P. E. , and Nilsson,N. J. , Learning and executing generalized robot plans. A r t i f i c i a l I ntelligence, 3 (251-288 1972), pp.. [Freeman, 1974 ] Freeman,H. Computer processing of line-drawing images. Computing Surveys, 6Jill (March 1974), pp.57-97. { Friedman, 1967 <] Friedman,L. I n s t i n c t i v e behaviour and i t s computer synthesis. Behavioural Science, 12_±2)_ (March 1967), pp. 85-1 08. { Friedman, 1977 ] Friedman, Leonard. Robot perception learning.. Proc.. Pattern : directed inferenee- systems workshop, SIGART Newsletter June (1977), pp.44-49. . j; Funt, 1 97 6 3 Brian V.. Funt., WHISPER: A computer implementation using analogues i n reasoning. Technical report no. 76-09, Department of Computer Science, University of B r i t i s h Columbia, 1976. [Gaschnig, 1978 ] Gaschnig,J.. Experimental studies of backtrack vs. Waltz-type vs. new algorithms for s a t i s f i c i n g assignment problems. Prog.second national conference CSGSI(1978), pp.268-277. Beferences 262 [Gass et al.,1976] Gass,C.L., Angehr,G., and Centa,J. Regulation of food supply by feeding t e r r i t o r i a l i t y in the rufous hummingbird., Can.. J. Zool. . 54, pp. 20 46-2054. , [ Gelernter, 1963 ] Gelernter,H. Realization of a geometry-theorem proving machine. In: E. A. Feigenbaum and J. Feldman (eds.).. Computers and Thought, McGraw-hill,1963. [Gilmore,1960J Gilmore.P.C. A proof method f o r guantification theory. IBM Journal for research and development, 4 (1960), pp. 28-35. [Good,1965] Good,I,J. Speculations concerning the f i r s t u l t r a i n t e l l i g e n t machine. In: F.L.Alt and M.Rubinoff (eds.). Advances i n computers, Vol.6, Academic Press, pp.31-88, 1965. [ Green, 19 69] Green,C. Application of theorem-proving to problem solving. IJCA1-69 (1 969) , pp. 219-237. [Green & Sibson,1978] Green, P.J., and Sibson,R. Computing D i r i c h l e t t e s s e l l a t i o n s in the plane. Computer Journal, 21_12)_ (June 1978), pp. 168-173. [Hart,Nilsson,Raphael,1968] Hart,P. , Nilsson,N , i , and Raphael,B. , A formal basis for the h e u r i s t i c determination of minimum cost paths.. IEEE Trans. Sys. Sci. Cybernetics,SSC-4, 2 (1968), pp.100-107. [Hebb,1949] Hebb, D.O. The Organization of Behaviour: a Neuropsychological Theory. John Wiley and Sons Inc., New York, 1949. [Hebb, 196 8,] Hebb,D.O. Concerning imagery. Psychological Review, 75 (1968), pp. 466-477. [Hilbert,1927] Hilbert,D. The foundations of mathematics. Reprinted i n : J.Van Heijenoort (ed.), From Frege t o G o d e l , Harvard University Press, 1967. . References 263 {Howden,1968] Howden, W. E. , The sofa problem. Computer Journal, JM (Hay to November 1968), pp.299-301. [Jacobs & K i e f e r , 1 9 7 3 3 Jacobs,*?., and Kiefer,M. Robot decisions based on maximising u t i l i t y . Proceedings Third International Conference on A r t i f i c i a l Intelligence, 1973, pp.402-410. [ Jerison, 1973] Jerison,H.J. The evolution of the brain and i n t e l l i g e n c e . Academic Press, 1973. . [Kandel,1976 f Kandel,E.R. C e l l u l a r basis of behaviour. W.H.Freeman, 1976. I Kandel, 1 979 jj Kandel,E.R. Behavioural - biology, of aplasia. W.H.Freeman, 1979. [Kleene,1956] Kleene,S.C. . Representation of events in nerve nets and f i n i t e automata. In: E.C»Shannon and J.McCarthy (eds.), Automata studies, Princeton U.P. [Kohler,1925] Kohler,W. The mentality of -apes. Translated by E.Winter and republished 1976 by Li v e r i g h t , New York. [Kosslyn & Pomerantz,1977] Kosslyn,S.M*, and Pomerantz,J.R.. Imagery, propositions, and the form of internal representations.. Cognitive Psychology, 9 (1977) , pp. 52-76. , [Kowalski,1969] Kowalski,R. Search strategies for theorem-proving, B.Meltzer and D.Michie (eds.). Machine - Intelligence 5, Edinburgh. University Press, 1970, pp.181-201. [Kuhn,1962] Kuhn,T. The structure of s c i e n t i f i c revolutions. University of Chicago Press, 1962. 1 Kuipers, 1977 i] Kuipers, Benjamin J. Representing knowledge of large-scale space. . Ph.D. Thesis, AI-TR-418, MIT AI lab., 1977. References 264 [Levi & Montanari,1970J Levi, G., and U.Montanari. A gray-weighted skeleton.. Information and Control, 1 1 (1970), pp.62-91. JLudlow,1976] Ludlow,A.R. The behaviour of a model animal. Behaviour, 58 (1976) , pp.131-172. J. McCarthy , 1968 ] McCarthy,J. Programs with common sense.. In: M. Minsky (ed.), , Semantic Information Processing. , MIT Press, 1968. {_ McCarthy , 1977 ] McCarthy,J. Epistemological problems of A l , Proceedings F i f t h International Conference on A r t i f i c i a l I n t e l ligence, 1977, pp.1038-1044. I. McCarthy & ilayes, 1 969 i ] McCarthy,J., ar.d Hayes,P.J.. Some philosophical problems from the standpoint of a r t i f i c i a l i n t e l l i g e n c e , B.Meltzer and D.Michie (eds.). Machine In t e l l i g e n c e 4, Edinburgh University Press, 1969, pp.463-502. [McCarthy et al.,1978] McCarthy,J., Hayashi,T., and Igarashi,S. On the model theory of knowledge. AIM-312, Stanford Al Lab., 1978.. [Mackworth,1977 ] Mackworth, A. K. On reading sketch maps, Proceedings F i f t h International Conference on A r t i f i c i a l I ntelligence, 1977, pp. 598-606. [Marr,1976] Marr,D. Early processing of vi s u a l information. P h i l . Trans.Roy. Soc.London, 275_(942)_ (October 1976), pp. 483-524. . 1Marr,1977] Marr, D. A r t i f i c i a l Intelligence - a personal view. A r t i f i c i a l Intelligence, H H (August 1977), pp. 37-48. [Marr & Poggio,1976] Marr,D. , and Poggio,T. From understanding computation to understanding neural c i r c u i t r y . AIM-357, MIT Al lab., 1976. [Marr; & Poggio, 1976 i] Marr,D., and T.Poggio. Cooperative computation of stereo d i s p a r i t y . , Science, 194 (15 October 1976), pp.283-287., References 265 I M a r t e l l i , 1977 jj Martelli,A.. On the complexity of admissible, search algorithms. A r t i f i c i a l Intelligence, 3(1). (February 1977) , pp. 1-13. I Masterman, 1970/] Masterman,M.. The nature of a paradigm.. In: I.Lakatos and A. Musgrave (eds.). C r i t i c i s m and the growth of knowledge, Cambridge U.P., pp.59-89,1970.. [ Merriam, 1975 ] Merriam, E. W. An experimental robot computer Problem solving system. Report 3108, Bolt, Beranek & Newman In c., 1975. t Michie,1 978 § Michie,D. Seminar at OBC, f a l l 1978., [Miller,1978 J M i l l e r , L . Has Al contributed to an understanding of human mind?. Cognitive Science, 2 (1978), pp.111-127. [ M i l l e r , 1 974 i] Miller,G.A. Needed: a better theory of cognitive organization.. IEEE Trans. On Systems, Man, and Cybernetics, SMC-4JJ1 (January 1974), pp.95-97.. J. Miller,Salanter, & Pribram, 1960 i] Miller,G.A. , Galanter,E., and Pribram,K.H. structure of behaviour. Holt,Rhiriehart 1960. j. Minsky 5 Papert, 1972 f] Minsky,M., and Papert,S.„ Al Progress Report.. AIM-252, MIT Al Lab. , 1972. : LMinsky,1975^ Minsky,M. A framework for representing knowledge. In: P.H.Winston (ed.)., The psychology of computer vi s i o n . McGraw-Hill, 1975. J. Montanari, 196 8 J] Montanari, 0*. A method for obtaining skeletons using a guasi-euclidean distance. Journal of the ACM, 1JL£4}_ (October 1968) , pp.600-624. . [ Montanari, 1969)3 Montanari, 0.. Continuous skeletons images. , Journal of the ACM, 1JLX41_ pp. 534-549. References Plans and the and Winston, from d i g i t i z e d ( October 1969), 266 [Moore,1956] Moore.E.F. Gedanken experiments on sequential machines. In: C.E.Shannon and J.McCarthy (eds.), Automata studies. Princeton University Press, pp.129-153., [Moore & Golledge,1976 J Moore,G.T., and Golledge,E.G. , (eds.),.. Environmental knowing: theories, research, and methods. Dowden,Hutchinson and Ross, 1976. 1 Moore, 19 75,3 Moore, Robert C. Reasoning from incomplete knowledge in a procedural deduction system. AI-TR-347, MIT AI Lab., 19 75. [Moran,1973] Moran, Thomas P. The symbolic nature of v i s u a l imagery, Proceedings Third International Conference on A r t i f i c i a l I ntelligence, 1973, pp.472-477. [Newell & Simon,1963] Newell,A., and Simon, H. A. GPS, a program that simulates human thought.. In: E. A. Feigenbaum and J.Feldman (eds.)., Computers and thought. McGraw-Hill. [Newell 5 Simon,1976] Newell,A., and Simon,H.A. Computer science as empirical enquiry: symbols and search. Communications of the ACM, 19 (3) (1976), pp. pp. 113-126. . [ Nilsson, 1974] Nilsson,N.J. A r t i f i c i a l Intelligence. IFIP Congress, Stockholm, Sweden (1974) , pp.. [Nilsson S Raphael, 1967,] Nilsson,N.J., and Raphael,B. , Preliminary design of an i n t e l l i g e n t robot.. Computer and information sciences, l l l l l (1967), pp.235-259. . [ Papert et a l . , 1970 ] Papert et a l . , Logo Memos, 1970-1971. [Parzen,1960] Parzen,E. Modern- p r o b a b i l i t y theory and i t s applications. John Wiley and sons, 1960. [Pfaltz,1967i] P f a l t z , J.L., and A z r i e l Rosenfeld. Computer representations of planar regions by the i r skeletons. Communications of the ACM, 1.0 (1967), pp. 119-122.. References 267 [Pfefferkorn,1975] Pfefferkorn, C.E. A h e u r i s t i c problem solving design system for equipment or furniture layouts. Communications of the ACM, 18J5). (May 1975), pp.286-297. [Prawitz, 1960 ] Prawitz,D. An improved proof procedure. Theoria, 26 (1960) , pp. 102-139. [Pylyshyn et al.,1978] Pylyshyn, Z. W. , E.W. , Elcock, M. „ Marmor, and P. „ Sander.. Exploration i n visual-motor spaces. Proc.. Second National Conference Canadian Society for Computational Studies of Intelligence, pp.236-243. i Eeiter,1972] Reiter,R.. The use of models i n automatic theorem-proving. Technical Report 72-09, Computer Science department,University of B.C., 1972. [Robinson,1965 ] Robinson,J.A. A machine oriented l o g i c based on the resolution p r i n c i p l e . Journal of the ACM, 1.2.(1). (January 1965), pp.23-41. [Rosenfeld & Pfaltz,1966] Rosenfeld, A., and J. L . P f a l t z . Distance functions on d i g i t a l pictures.. J. Pattern Recognition, 1 (1966), pp.33-?. [Rosenfeld & Kak,1976] Rosenfeld,A., and Kak,A.C. D i g i t a l Picture Processing. Academic Press, New York, 1976.J ISacerdoti, 1977 ] Sacerdoti, E a r l D.. A structure for plans and behaviour. Elsev i e r North-Holland, Inc., 1977. . [ Shepard, 1978] Shepard,S.N. The mental image. American Psychologist, (February 1978), pp. 125-137. [Simon,1956] Simon,H.A. Rational choice and the structure of the environment.^ Psychological Review, 63 (1956), pp.129-138. [Simon, 1977 ] Simon.H.A.. A r t i f i c i a l i n t e l l i g e n c e systems that understand. Proceedings F i f t h International Conference on A r t i f i c i a l Intelligence, 1977, pp.1059-1073. References 268 [Sloman,1971 ] Sloman, Aaron. Interactions between philosophy and A l : the role of i n t u i t i o n and non-logical reasoning i n i n t e l l i g e n c e . A r t i f i c i a l I ntelligence, 2 (1971), pp.209-225.. I Sloman, 1 978,3 Sloman,A. The computer revolution i n philosophy: philosophy, science, and models of mind. Harvester Press,~1978. I Stallman & Sussman, 1 977 jj Stallman,R.M., and Sussman,G. Forward reasoning and dependency-directed backtracking in a system for computer-aided c i r c u i t synthesis. A r t i f i c i a l I ntelligence, 9 (2) (October 1977), pp. 135. „ [ Sussman, 1973 U Sussman,G.J., The FINDSPACE problem.. AIM 286, MIT Al Lab., March 1973. [ Suss man, 1 975 jj| Sussmar.,G. . A computer model of s k i l l ; a c q u i s i t i o n . American Elsevier, 1975. I Sussman, Winpgrad , & Charniak, 1971 ij Sussman,G., Winograd,T., and Charniak,E.. Microplanner reference manual.. AIM-203, MIT Al Lab., 1971. f Tate, 1 97 5 i] Tate,A. Interacting goals and t h e i r use. Proceedings Fourth International Conference on A r t i f i c i a l I n t e l l i g e n c e , 1975, pp.215-218. J. Thompson , 1977 3 Thompsor.,A.M. . The navigation system of the JPL robot,Proceedings F i f t h International Conference on A r t i f i c i a l Intelligence, 1977, pp.749-757., [Toda,1962 ] Toda,M. The design of a fungus eater: a model of human behaviour i n an unsophisticated environment.. Behaviour, 7 (1962), pp.164-183. [Tolman,! 948 J Tolman,E.C. Cognitive maps in rats and men. Psychological Review, 55 (1948), pp.189-208. t Trowbridge, 1913 3 Trowbridge,C.C. On fundamental methods of orientation and imaginary maps. / Science, 88 (19-13), pp. 888-897., References 269 J. T s e i t i n , 1968 § Tseitin,G. S. . On the complexity of derivation in propositional calculus. In: A.O.Slisenko (ed.)., Studies in constructive mathematics and mathematical l o g i c , Part I I , 1968. I Warren,1974 J Warren,D.H.D. A system for generating plans. Memo 76, Department of computational l o g i c . University of Edinburgh, 1974. [Wells,1978] Wells,M. Octopus: physiology, and behaviour of an advanced invertebrate.. John Wiley and sons, 1978. [Winston,1970] Winston,P.H. Learning s t r u c t u r a l descriptions from examples. AI-TR-231, MIT AI Lab., 1970.. [Winston, 1978 ] Winston,P.H. Learning by creating and j u s t i f y i n g transfer frames. A r t i f i a l Intelligence, 10 (2)- (April 1978), pp. 147-172. j. Zucker, 1 978 ] Zucker,S.W. Local structure consistency and continuous relaxation. TR-78-11, Department of e l e c t r i c a l engineering, McGill University, 1978. R e f e r e n c e s 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            data-media="{[{embed.selectedMedia}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.831.1-0051810/manifest

Comment

Related Items