The Machine Plays Chess
 0080212212, 0080212220

Citation preview

T he P ergam on Chess Series ALEXANDER, C. H. O ’D. a n d BEACH, T. J. Learn C hess, V o lu m e i — First P rinciples L earn C hess, V o lu m e 2 — W i n n i n g M e th o d s

AVERBAKH, Y. C hess E n d in g s— E ssential K n o w le d g e

BARDEN, L. W . T h e R u y L op ez— W i n n i n g C hess w i t h i P - K 4

BOTVINNIK, M. A n a t o l y K a r p o v — T h e R o ad to th e W o r l d C h a m p i o n s h i p

GLIGORIC, S. a n d SOKOLOV, V. T h e Sicilian D e fe n ce

HOOPER, D. A C o m p l e t e D e f e n c e to 1 P - K 4 — A S tu d y o f P etro ff’s D e f e n c e

KEENE, R. D. T h e C hess C o m b i n a t i o n f r o m P hilidor t o K a r p o v

LEVY, D. N. L. (Ed.) Learn C hess f r o m t h e W o r l d C h a m p i o n s

O ’KELLY DE G A L W A Y , C O U N T A. T ig ra n P e tro s ia n — W o r l d C h a m p i o n

SUETIN, A. S. M o d e rn C hess O p e n in g T h e o r y

VUKOVIC, V. T h e A r t o f A t t a c k in C hess * D e n o te s n e w titles.

By T h e Sam e A u th o r:

Games Playing w ith C om puters 1972 First C o m p u ter Chess C onference (Ed.) 1973

The T urk

THE MACHINE PLAYS CHESS? by

Alex G. Bell

P E R G A M O N PRESS O X FO R D • N E W YORK • T O R O N T O • SYDNEY • PARIS • FR A N K FU R T

U .K .

Pergam on Press Ltd., H ead in gton Hill Hall, O xford 0 X 3 OBW, E ngland

U .S .A .

Pergam on Press Inc., Maxwell H ouse, Fairview Park, Elm sford, New Y ork 10523, U.S.A.

CANADA

Pergam on o f C a n a d a L t d . , 75 T he East Mall, T o ro n to , O ntario, C a n a d a

AUSTRALIA

Pergam on Press (Aust.) Pty. Ltd., 19a B oundary Street, R ushcutters Bay, N.S.W . 2011, Australia

FRANCE

Pergam on Press S A R L , 24 rue des Ecoles, 75240 Paris, Cedex 05, France

FEDERAL REPUBLIC OF GERMANY

Pergam on Press G m b H , 6242 K ro n b erg -T au n u s, Pferdstrasse 1, Federal R epublic of G erm an y

C opyright ©

1978 Alex G. Bell

A ll Rights Reserved. No part o f this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means: electronic, electrostatic, magnetic tape, mechanical, photocopying, recording or otherwise, without permission in writing from the publishers First edition 1978 Lib rary of Congress Cataloging in Publication Data

Bell, A. G. The machine plays chess? (Pergam on chess series) Bibliography: p. 1. Chess— D ata processing. 2. Chess— C o m p u te r program s. I. Title, GV1447.B44 1977 794.T7 77-24302 ISBN 0-08-02122 1-2 H ard cover ISBN 0 -0 8 -0 2 1 2 2 2 -0 Flexi cover

Printed in Great Britain by Cox & Wyman Ltd London, Fakenham and Reading

F O R M A G G IE L ’ordinateur rien remplacera la femme

Chess— is a foolish expedient for making idle people believe they are doing something very clever, when they are only wasting their time.

George Bernard Shaw I do not think therefore I am not.

Dr. Strabismus o f Utrecht This interest in chess program s is a serious defect in your character.

Anon

I

\

Contents PREFACE

ix

1. T H E T U R K

1

2. T O R R E S Y Q U E V E D O

8

3. T H E P A P E R M A C H IN E S

12

4. T H E F IR S T P R O G R A M S

26

5. T H E C R U N C H E R S

36

6. M A S T E R A T IF IPS

49

7. T H E K N O W L E D G E G A M E

66

8. T H E ST A T E O F T H E A R T

87

9. M A C H IN E T E C H N I Q U E

95

ADDENDUM

107

REFERENCES

111

IN D E X

113

Vii

Preface machine plays chess— or does it? Is it, for example, a genuine machine and not an elaborate fraud? If it is a genuine machine, does it play chess like a hum an player? And if it is really an unbeatable chess machine, what else might it be able to do? F o r well over a century chess machines have been built and the debate has raged over whether or not they are really playing chess. This book is a history o f the debate and o f some o f the people who have been involved, including such great com puter pioneers as Charles Babbage, John von N eum ann, Alan Turing, Claud Shannon and K onrad Zuse. All of these people were fundamentally searching for unemotional intelligence— intelligence free from passion or self-interest. The irony is that they had to be so extremely passionate in their attem pts to construct a dispassionate machine. H ad they not been so, I doubt that I would have found the subject so interesting, and this book would not have been written. At this point I should warn readers that they will not find out in these pages how to write a chess program, nor how to play chess. This is a book ab o u t people who have a passion for unemotional intelligence, written by someone who is by no means an unbiased observer. I hope that in writing it I have preserved something of the passion—and of the h u m o u r—that has been present during the evolution o f the subject. Those parts o f the book where I have struck a more serious note reflect my belief that writing chess programs is a field o f very pure research which not only reveals the strengths and weaknesses o f general-purpose electronic com puters, but can also tell us a great deal about ourselves and the way our brains work. W hether this knowledge is of value or not is not for me to say. W hat I do know and can say is that a com puter can match the ability o f a human chess player in chess with only ab o u t 10 per cent o f the ‘over the b o a rd ’ experience— and it does this using techniques which only remotely resemble the way a hum an chooses a move. As Bobby Fischer had about 10,000 hours ‘over the b o a rd ’ experience I find it pointless to speculate on the T

he

ix

x

The Machine Plays Chess?

date a machine will reach his level. All that is required to settle the question is 1000 hours of big machine time, and at this moment this will not be easily obtained. A big com puter costs about £1000 ( $1800) per hour, so it would cost about £ 1,000,000 ($1,800,000). So at the present time writing chess programs is just a hobby o f mine— as also was writing this book. I would like to thank the many people who have helped me to indulge and thoroughly enjoy this serious defect in my character. In particular Dr. Jack Howlett who gave 30 hours of machine time to develop M A STE R , a program which is currently the best in Western Europe, and also backed the organisation o f two C om puter Chess Conferences. Other people who helped me research this book include Lord Bowden, Alick Glennie, Dietrich Prinz, Donald Michie, Don Miguel Toros y Gallino, Fernando Garrido, Christopher Strachey, Jack G ood, R. V. Jones, Mikhail Donskoy, Hans Berliner, Ron Atkin, John Scott, Richard Cichelli, Alan Bond, Nils Barricelli, M artin G ardner, N o rto n Jacobi, Thom as Caswell, David Slate and Larry Atkin. F o r typing the manuscript my thanks to Jean Jones and M argaret Arkwright. A nd last but not least, thanks to my old team who designed and wrote M A S T E R — John Birmingham and Peter K ent plus John W aldron, who taught M A ST E R how to play, and Chris Osland, who often ran it and missed the booze. 1976 A. G. BELL

I

CHAPTER

1

The Turk I n 1769 the m ost famous chess-playing au tom aton o f all time was built by a 35-year-old engineering genius, Wolfgang von Kempelen, for the amuse­ m ent o f the Vienna Imperial Court. The au to m ato n was a life-size figure (see frontispiece), dressed in Turkish costume, seated behind a chest about 4ft (1 -2 m) long, 2 ft (0-6 m) wide and 3 ft (0-9 m) high on which was placed a chess board. The figure played chess with all-comers, moving the pieces with its left hand. Before describing the machine’s behaviour in greater detail it is im portant to realise that very few people, then or now, seriously believed the machine to be genuine. The moves it made were the product o f a hum an player and the fascination lay in trying to guess where the hum an was hidden; how he followed the game; how he made the a u to ­ m aton move the pieces with its left hand an d how (and this is most im por­ tant), given all these handicaps, the player still managed to win most of the games. K em pelen’s original intention was to dem onstrate a ‘telechiric’ (Gr. ‘distant h a n d ’) device, nowadays known as a waldo. The trick o f hiding the hum an m anipulator was merely to add spice to a genuine piece of very good engineering. Kempelen failed to appreciate that people have a funda­ m ental desire to be fooled and am azed— witness nowadays the pheno­ m enon o f U ri Geller. T o K em pelen’s consternation his conjuring trick was to become world fam ous an d his many, far more substantial achievements in hydraulics, acoustics and magnetism were doom ed to relative obscurity. The a rt o f conjuring, then and now, rarely depends on ‘the quickness of the hand deceiving the eye’. Term s such as legerdemain, prestidigitation, etc., are incorrect; they imply rapidity o f m ovem ent and absence o f equipment. M o st conjurers depend on apparatus, natural physical phenom ena and, m ost im portant, the focusing o f the attention o f the audience on some

1

2

The Machine Plays Chess?

activity so that other movements will be disregarded— the classic ‘mis­ direction o f attention’. Kempelen’s autom aton was to evolve through many levels o f misdirec­ tion in its long career. Even now precisely how it was done at every stage o f its career is not known but there is a wealth of detail to be found in contem porary descriptions by people who saw the machine in action. The Turk (as the machine was popularly known) was publicly exhibited between 1783 and 1838, a period o f 55 years. Although the descriptions over this length of time naturally differ in detail, nevertheless the essentials remain the same, a tribute to Kempelen that no one could significantly improve his design. When first shown to King Joseph II and the Vienna Imperial C ourt, Kempelen successfully gave the impression that the T urk was voice actuated! This was plausible because Kempelen had already built and demonstrated a machine that could talk. The machine had bellows, reeds and acoustic resonators, the ‘control signals’ were provided manually by moving a series of levers and it was reputed to have a remarkable per­ formance, being capable of articulating about 30 words— an impressive dem onstration o f Kempelen’s practical abilities and also his acoustical theories; theories of which he was proud and which he described in a book The Mechanism o f Human Speech.* So it is hardly surprising th a t people believed the T urk to be voice actuated, of course it was— but w hat a pity it couldn’t play chess of its own accord. The problem of hiding a hum an in the machine was already solved. All Kempelen needed was a good chess player to guide it. However, chess players are not necessarily midgets and, as will become apparent, a double­ double bluff was almost certainly the final result. Whilst on tour in the 1780s a typical performance by the machine was as follows. In 1784 the T urk was exhibited in London, at 8 Savile Row, Burlington Gardens. The audience paid five shillings each for admission— equivalent to paying about £10 nowadays. Some o f the best players in London had come to see and compete with the T urk but first the audience were allowed to see ‘how ’ the T urk worked. The au to m ato n was wheeled on to a stage and the many doors in the chest were all opened and shut whilst a candle was passed behind the chest. Finally the draw er at the bottom was pulled out, the chess pieces were taken out and set up for the first game. As the evening progressed and the Turk, to the accom panim ent * A b oo k th a t was studied avidly by my nam esake A lexander G r a h a m Bell.

The Turk

3

o f great grinding and crunching, had beaten a num ber of people, more and more doors were left open. Finally even the drawer at the bottom was left open. At the end o f the performance it became very difficult to imagine how a hum an could be hidden inside the machine— nevertheless one small com partm ent or an other was always closed so the audience left marvelling at how the operator inside had shifted his position with such agility and still m anaged to beat good chess players on a board which must be out of his sight. After Kem pelen’s death in 1804 the T urk was sold to a Bavarian musi­ cian, Jo h an n Maelzel, who also had considerable mechanical ability but excelled Kempelen in showmanship. The most famous performance given by the machine under Maelzel was when it played N apoleon at Schonbrunn Castle, Vienna, in 1809. A popular story o f this meeting concerned N a p o le o n ’s tendency to make illegal moves. Deliberately testing the powers o f the a u to m a to n he made a false move. The autom aton shook its head (it could do this), replaced the piece and motioned to N apoleon to move again. Highly amused, N apoleon played on— then made another false move. This time the machine removed the piece from the board and m ade its own move. N apoleon laughed and made another false move. The a u to m a to n raised its arm , swept all the pieces on to the floor and refused to continue. This story is alm ost certainly pure fantasy— nobody would have dared to treat N apoleon in such a fashion. There is another version o f this encounter which was circulated by Maelzel; this also is partly fabrication but is alm ost certainly nearer to the truth. A ccording to Maelzel the pieces were swept to the floor— but by N a p o ­ leon. From the start N apoleon refused to comply with the rules Maelzel had introduced. Unlike Kempelen, Maelzel insisted that the au to m ato n 's o p p o n en t should play on a separate board, both the opponent and the audience being outside a rope barrier. This was showm anship but N apoleon would have none of it— “ We fight face to face!” and so he did, losing the game badly. According to Maelzel, N apoleon returned later with a magnet which he placed on the chess board, someone had apparently told him that the a u to m a to n depended on magnets for its operation. Maelzel says that he removed the magnet and the machine then won again easily. In the third and last game N apoleon wrapped a shawl round the face and body of the T urk. Like m any other people he thought the operator was hidden inside the T u r k ’s body with his arm inside the T u r k ’s arm and following the game

4

The Machine Plays Chess?

through a spy-hole. Again the machine won easily and, at this point, N apoleon brushed the pieces from the board and walked out. There is no d o u b t that N apoleon did play the au to m ato n on three occasions and lost all the games. He had, in fact, been playing the Austrian chess master Allgaier, one of the great players of his time, who was also in a situation where he was not afraid to beat the Emperor. N apoleon had only a vague idea of his own chess ability due to the num ber o f sensible hypocrites and sycophants who lost to him on purpose in order not to incur his displeasure. The greatest com plaint by some o f these flatterers was that Napoleon was such a weak player that it was sometimes extremely difficult to lose w ithout arousing his suspicions— the art of hustling was then in its infancy. W hat such performances certainly proved was that an ability to play good chess has little, if any, relation to the decision-making p ro ­ cesses o f generals and politicians. Prince Eugene de Beauharnais, N ap o leo n ’s stepson via Josephine, was so intrigued after seeing this particular performance o f the T urk that he offered Maelzel the equivalent o f £25,000 if he would sell the au to m ato n and reveal its secret. The deal was made and the T u rk was taken to Italy where (typical o f N ap o leo n ’s nepotism) Beauharnais was the viceroy. The T urk languished in Milan until 1817. Beauharnais had lost interest when he discovered how it worked and he also had other, more pressing problems in the intervening years; notably a trip to Moscow and back in 1812 with his stepfather. Maelzel made a hire-purchase deal with Beau­ harnais in 1817 and took the machine on tour again. The players Maelzel employed in the next few years were many and varied, but always the best money could buy. They included Lewis, Williams and M ouret— wherever the Turk appeared it seemed that the local chess master would disappear. Unfortunately, although the au to m ato n was as successful as ever, Maelzel got behind with his payments and, threatened with a legal suit, left Europe in 1826 for the New World. Once again the Turk made headlines wherever it appeared. In America Maelzel employed a regular player, a young Frenchman named William Schlumberger, to decide the moves and no American player could defeat him. Schlumberger played for Maelzel for a b o u t 10 years and some of the best descriptions of the autom aton in action come from this period. Probably the best known (and most inaccurate) analysis was the one by Edgar Allen Poe who saw an exhibition o f the T u rk in 1836. Poe published his theory of how the machine worked but seems to have been unaw are of

The Turk

5

previous theories and experiments— in particular the alleged magnet and shawl experiments o f Napoleon. Poe believed that Schlumberger was hidden inside the body o f the Turk, viewing the board through a small hole. The analysis was incorrect in almost every detail except the identity of the player: There is a m an, Schlumberger, w ho attends Maelzel wherever he goes but who has no ostensible occupation. This m an is a b o u t m edium size with a rem arkable sto o p to his shoulders. W h eth er he professes to play chess or not we are not inform ed. It is quite certain, however, that he is never to be seen during the exhibition o f the Chess-Player, although frequently visible just before a nd just after the exhibition.

The other reasons Poe gave for his belief that a hum an was operating the machine are amusingly fallacious. Poe assumes, for example, that to build an unbeatable machine is not much more difficult than building a machine which wins m ost o f its games. Therefore, as the au tom aton was not invincible, it m ust be operated by a hum an! M ore practical argum ents were made by an American reporter who noted that when someone in the audience shouted ‘F I R E ! ’ the cabinet began to shake as though someone was trying to get out. Even more convincing p ro o f came with the tragic end of the T u rk ’s playing career. Schlumberger died o f yellow fever in 1837 on a visit to H avana. The au to m ato n was bought by a Mr. Ohe o f Philadelphia who sold it, in 1840, to Dr. J. K. Mitchell, who reassembled the machine as a curiosity to be exhibited in the Chinese Museum at Philadelphia. It per­ formed for a few weeks, but, without Maelzel’s showmanship and Schlumberger’s skill, it drew only small audiences. The illustration o f the au tom aton was draw n at this time when the Turk, retired behind a glass enclosure, gazed lifelessly over his chess board at the occasional curious visitor. Fourteen years later, at the age o f 85, it was destroyed in a fire on 8 July, 1854. Tw o other a u to m a ta were built in later years. ‘Ajeeb’ was dressed as an Egyptian and again cashed in on the popularity o f a machine apparently beating a hum an in an intellectual activity— hardly surprising th a t it won m any o f its games as it was guided, for a while, by the chess master Pillsbury. In Europe Ajeeb was possibly even more successful than the T urk had been; over 100,000 people saw the machine in the span o f 3 m onths when exhibited in Berlin in the 1870s— yet people nowadays still ask me w hat use is a machine th a t can play chess? ( 100,000 x £10 = £ 1,000,000

6

The Machine Plays Chess?

in 3 months.) A nother au tom aton ‘Mephisto' (guided by the chess master Gunsberg) actually won the first prize in an open tournam ent in 1878 after George McDonnel, the favourite, had withdrawn because the a u to m a to n ’s identity was not revealed. Alas none of these machines still exists. Ajeeb suffered the same fate as the Turk, lost in a fire in 1929 in America. And M ephisto? After a relatively short career of about 10 years it was broken up in England around about 1880. So how did these autom ata w ork? There still exists a wealth o f evidence, observation, theory and wild guesses. M uch of this material is conflicting and some of it deliberately misleading. People saw what they wanted to see whilst Maelzel and others misdirected their attention— but some details are consistent. Maelzel always allowed American audiences a supervised inspection of the T urk and his chest before a performance. As with K em ­ pelen, various doors and com partm ents were opened and closed in order to convince people that the player must be hidden in the bottom drawer. At the start of play the audience would have to withdraw behind a barrier— the drawer was opened and the chess pieces taken out. The player must have moved into the body o f the Turk. But how could he see the board? Unlike blindfold exhibitions these games were often played in silence. U nderneath the chess board were 64 small magnetic discs, each on a thread. The chess pieces were made of iron, so— obviously— the game could be, indeed must be, followed by observing the rise and fall o f these discs. Oddly enough Poe seems unaware o f these discs although Maelzel would have us believe that Napoleon suspected their presence and purpose. The movement of the arm and the grasping of the conical chess pieces was a genuine piece of pantographic engineering, parts of which can be seen in the illustration. Magnets were used to help the fingers hold the pieces. So the best analysis, indeed the one which has been believed for the last 100 years, is that Schlumberger (amongst other deformed chess masters) was partly in the T u r k ’s legs, partly behind the false back of the drawer, that he was following the game by watching discs move up and down and finally, that the T u r k ’s arm was moved by a telechiric device of levers and straps, requiring some expertise to operate into which Schlumberger had inserted his own arm. The problem with this, the accepted analysis, is the num ber of people who played for Maelzel in the period o f 1818 to 1820. At least six chess masters were employed in this period— all o f various shapes and sizes, all o f whom apparently had to learn to follow a game

The Turk

7

from the m ovem ent o f discs, all of whom had to learn how to move the pieces remotely and, m ost im portant, all o f whom had to win as many games as possible— the success at the box office depended on winning games far more than any other feature o f the performance. It seems to me extremely unlikely that it was necessary or desirable for the chess m aster to actually be inside the machine himself. It is far more likely that the operator was a trained boy (or very small adult) who followed the directions o f the chess player who was hidden elsewhere on the stage or in the theatre— the T urk was a ‘mind-reading’ act. Nowadays the techniques o f passing information non-verbally are better known. The simplest code for the T u r k ’s operator would be a set of signals for start, left, right, up, down an d stop. These signals can be made in a variety o f ways (hand in pocket, stance, head movements, etc.) particularly on a stage with audience kept back. It is certainly difficult to believe th a t any h um an who must perform efficiently (and therefore as comfortably as possible) would subject himself to the confines o f the T u r k ’s chest parti­ cularly if a boy could hide himself more easily within the machine. U n ­ fortunately we shall never know.

CHAPTER 2

Torres y Quevedo in 1852 in Santa Cruz, Spain, Leonardo Torres y Quevedo is co n ­ sidered by many people familiar with his work to have been the equal of Thom as Edison in the field of invention. Torres’ speciality was electromechanical devices; the next step forward in telechiric mechanisms after the levers and pulleys used by the so-called frauds of the T urk and other chess-playing autom ata. In his long career he designed and built a num ber of remotely controlled devices including a guidance system which successfully steered a boat through Bilbao harbour. Probably his most significant development was the guided torpedo. The problems o f keeping a torpedo at a constant depth and on a constant heading are not usually appreciated by the layman who apparently thinks (in both senses) that torpedos, like bullets, maintain a straight course by sheer inertia. In building a device to maintain a torpedo at constant depth (a pressure sensor linked to a horizontal rudder) Torres was struck by the ‘intelligence’ o f the mechanism. Admittedly the problem was restricted and specialised but his device could ‘solve’ the problem far more quickly and accurately than any human. In order to demonstrate more clearly that many other ‘intelligent’ activities can, if analysed, be reproduced by simple mechanical devices, Torres designed and built a machine to play the simple chess end game o f White King and R ook vs. Black King. I first became interested in the literature o f chess program s in 1962 and, during the intervening years, I came across many references to T orres’ chess machine which were downright contradictory; in particular Bowden (see C hapter 3) says the machine was made ‘in a b o u t 1890’, whereas Shannon gives ‘in 1914’; a difference o f 24 years and neither au th o r describes how the machine worked. I was therefore pleased to accept an Born

8

Torres y Quevedo

9

invitation from Senor D on Miguel Toros y Gallino to visit Spain in June 1974 and see T orres’ machine in action for myself. The machine is now in the Escuela Tecnica Superior de Ingenieros de Cam inos (The School o f Road W orks) o f the Polytechnic University, M adrid. Almost the first thing one notices is that it has a loudspeaker (see photograph) with which it can pronounce ‘check’ and ‘m ate’ from a gram ophone record; the principle is similar to the speaking clock on the telephone. The machine is beautifully preserved and still works. The hum an player has the Black king and this piece is moved by sliding it diagonally from the centre o f its square into channels between the squares, along the rank or file channel and then diagonally into the new square. The piece is mechani­ cally linked beneath the board and the machine can therefore follow the move and, if illegal, will object twice verbally and on the third occasion refuse to continue playing. In program m ing terms such sophistication is usually called ‘the icing on the cake’. I was more curious to know when the machine was built and, assuming legal play, precisely how it calculated its moves. Torres apparently built a prototype machine ab o u t 1890 which went through a num ber of sporadic refinements. His final version made its most publicised performance at the Paris World Fair in 1914 but it, understand­ ably, sank into oblivion on the outbreak o f World W ar I. So much for the discrepancy in dates. As Sherlock Holmes observed to Dr. W atson in The Case o f the Dancing M en , m ost clever things are simple when explained. T orres’ machine is no exception. T o begin with the machine was not ‘efficient’, it always checkm ated in the lower m ost row (see Fig. 1) and could take more than 50 moves to do this; technically the game is then drawn. The ‘algorithm ’ o f the machine is as follows, the board is divided into three parts: two ‘rook zones’ either side o f the two central files (Fig. 1). The machine asks the following questions in order and, if true, takes the corresponding action. It then waits for the opponents' next move. (1) If the Black king is in the same zone as the rook then move rook to opposite side o f board (the move in the diagram), else (2) if vertical distance between Black king and rook greater than one, then ro o k dow n one square, else (3) if vertical distance between kings greater than two then White king dow n one square, else

10

The Machine Plays Chess? ROOK 8

ZONE

WK

WR

7 6

ROOK

ZONE

BK

5

T h e worst starting position

•I

3 2 1

Checkmate row a

b

c

d

f

c

g

h

Fig. 1

(4) if horizontal distance between kings is odd then rook one square horizontally, else (5) if horizontal distance between kings is zero then rook down one square, else (6) king one square horizontally towards Black king. One of these questions must get a true answer (unless the last move by the opponent was illegal), so the machine is never lost for a response. Also these simple questions and responses show a fair degree of chess knowledge: (1) Defence; (2) and (3) A pproach; (4) Tem po; (5) Check and checkmate; and (6) Opposition. Nevertheless the strategy (now revealed) is seen to be simple and plodding. For example, a hu m a n opponent who is aware o f the ‘style’ o f the machine can, from the starting position in the diagram, force the machine to take 61 moves to effect the mate. The machine has other deficiencies; it always started with its king and rook in a8 and b7 (as shown) and allowed the opponent to choose only the initial square of the Black king. If the opponent chose a square in the top row (c, d, e, f, g or h8) then the dem onstrator had to transpose the Black king into the ‘equivalent’ square in the (a) file or the algorithm could not work. Torres’ daughter removed some o f these deficiencies and demonstrated

Torres y Quevedo

11

a m uch-improved version o f her father's machine at the Brussel’s World Fair in 1958 but (as far as I could ascertain in my schoolboy Spanish) the machine I saw was T orres’ original 1914 model. U nfortunately no literature appears to exist on the precise alterations. The probable reason for this is that by 1958 T orres’ machine had been superseded by the performance o f general-purpose electronic computers and is now a genuine museum piece which, unlike the Turk, has been fortunately preserved.

CHAPTER 3

The Paper Machines 1840, Charles Babbage, an English mathematician, had completed the design of his ‘Analytical Engine'. This machine, although never built, foreshadowed many of the features o f the modern electronic com puter, but its fate does not concern us at the moment. With most of the drawings and details of the Engine finished, Babbage— a rather conceited, arrogant m an— A

bout

began to meditate u p o n the intellectual means by which I had reached to such advanced a n d even to such unexpected results . . . I felt, however, that it w ould be more satisfactory to the minds of others, and even in some measure to my ow n, that I should try the power o f such principles as I had laid dow n, by assum ing some question of an entirely new kind, and endeavouring to solve it by the aid of those principles which had so successfully guided me in other cases. After much consideration I selected for my test the contrivance of a machine that should be able to play a game of purely intellectual skill successfully; such as . . . chess.

Babbage goes on to relate how he discussed this idea with other people: “ I endeavoured to ascertain the opinions o f persons in every class o f life and o f all ages, whether they thought it required hum an reason to play games o f skill. The almost constant answer was in the affirmative.” But Babbage did not agree with this opinion, he believed th a t “ every game of skill is susceptible of being played by an a u to m a to n ” and his p ro o f was roughly this: The autom aton is given a position in the game and it then asks the following questions: (1) Is the position legal? If not, complain. (2) Have I lost? If so, resign. (3) Have I won? If so, claim it. (4) Can I win in the next move? If so, make it. (5) Is opponent about to win? If so, prevent him.

12

The Paper Machines

13

(6) If neither o f us can win at the next move I must look for a move which gives me two different ways o f winning, my opponent can only block one way so I will produce situation (4) above. If all these cases fail the a u to m ato n m ust look ahead to three or more successive moves. N ow it would be nice to record that Babbage was the inventor o f the mini-max principle; the searching ahead through a tree o f possibilities which m ost m odern chess program s use. Unfortunately his p ro o f has logical flaws in it and is n o t very rigorous, these errors are mainly due to him only considering noughts and crosses as the game in question. Actually Babbage appears to have seen little difference between noughts a nd crosses and the much more complicated game o f chess: “ Allowing one hundred moves on each side for the longest game at chess, I found that the com binations involved in the Analytical Engine enormously surpassed any required, even by the game o f chess.” A t this point he was definitely talking th ro u g h his Victorian hat. A n o th er example o f how Babbage only groped with the right questions is the problem he raises o f w hat to do when the au to m ato n had two ways o f winning a game: “ In this case no reason existed within the machine to direct its choice: unless some provision were made the machine would attem p t two contradictory m otions.” The situation would be disastrous as a donkey starving to death between two equidistant bales o f hay. However, the old adage ‘First come, first served’ naturally resolves this ambiguity in the sequential machine and it is surprising that Babbage could not see this simple answer. Babbage never built his game-playing a u to m ato n because, as he put it, “ it w ould occupy too much o f my own time to contrive and execute the m achinery” . A fter this first, fumbling attem pt to mechanise the full game o f chess alm ost 100 years were to pass before the question was again discussed, but this time the questioners were men o f greater ability and accomplishment with the added advantage o f access to machinery and technology that Babbage w ould have envied and yet, oddly enough, probably have under­ stood. In 1939 the British Foreign Office established its D epartm ent o f C o m ­ m unications a t Bletchley, a town in Buckinghamshire ab o u t 50 miles north o f L ondon. The main purpose o f this innocently named departm ent was to intercept an d decode the enem y’s radio signals; in particular the G erm an

14

The Machine Plays Chess?

E N IG M A machine cipher. Some o f the best mathematicians, linguists and electronic engineers in Britain were gathered together, plus the two best chess players in the country at the time, Harry G olom bek and C. H. O ’D. Alexander. Their inclusion at the time was not entirely due to any chess ability. Nevertheless Professor R. V. Jones, the man who alm ost single handedly unravelled the G erm an radar defence system, later wrote: “ As regards the connection between chess playing and decipherment, this was very co n ­ spicuous to some of us during the W ar.” In order to unravel the G erm an defences Jones had much help from Bletchley, but how the G erm an codes were deciphered is not the subject of this book and even if it were, the place and time is still too shrouded in mystery; the technical docum entation of the machines built at Bletchley is, nearly 35 years later, still classified. W hat is known is that these machines, in particular the Collissi series, were forerunners o f the modern electronic computer. Unlike the generalpurpose com puter the Collissi were specialised in solving the statistical problems of decipherment, this they did with enorm ous speed and great success under the special security classification, T O P S E C R E T U L T R A .* Churchill himself so valued this source o f information that he considered it preferable to lose a battle than to com prom ise this vital source of Intelligence. Probably the most prominent mathematician at Bletchley was Alan Mathieson Turing, then in his early thirties. A m ongst Turing's many interests was a fascination for autom ata and the game o f chess; I. J. G ood, his main statistical assistant, later recalled “ Some o f our discussions were concerned with the possibilities o f machine intelligence, and especially with autom atic chess-playing. We agreed that the most interesting aspect o f this topic would be the extent to which the machine might be able to simulate hum an thought processes. O f course we did not overlook the notion o f a true search, with truncation and evaluation at quiescent positions. This procedure seemed obvious to us long before S hannon’s paper was published, and I made the mistake of thinking it was not worth publishing. We did not think of the alp h a-b eta algorithm, which was suggested by John M cC arthy much later and is not obvious.” And so there seems little d o u b t that the man-versus-machine chess* Collissi were still being used as late as 1957.

The Paper Machines

15

playing argum ent really began a t Bletchley with Turing playing a major role. One possible reason for his interest is that, despite his brilliance and depth of thought, he was an absolute duffer at the game. H arry G olom bek later com m ented on the irrelevancy o f IQ to chess ability: “ Conversely, I have also known some o f the w orld’s finest brains an d some of these, th o u g h passionately fond o f chess, have been pretty poor players. I used to know one o f the world's leading mathematicians and whenever we played chess I had to give him the odds o f a Queen in order to make matters more equal, and even then I always w on.” It is difficult to estimate T uring’s influence on the real work at Bletchley Park. His notebooks o f the time are now in a vault somewhere in London and are still classified; some o f the pages have, reputedly, drawings of chess positions with notes. Nevertheless his influence must have been significant as he was eventually awarded an OBE for his war work, a medal which he rather typically kept in a box o f odds and ends. A t the end o f the war Turing received a large grant from the British G overnm ent to build a general-purpose electronic com puter at the N ational Physical L aboratory near London. This machine, unlike the specialised Collissi, would be capable o f solving a variety o f problems, particularly in the im p o rtan t new fields o f atom ic weapons research and ballistics. Turing had published the m athematical concept of such a machine as early as 1936 but turning his ideas into a reality was not an easy task. Although there had been enorm ous advances in electronic technology during the w ar— particularly the pulse techniques o f radar—just how to use this new technology to build a general-purpose com puter was not at all clear. F o r example, the new machine would have to have an electronic ‘m em ory’ and the only candidates for this purpose at the time were the mercury delay line and the cathode-ray tube; both devices having been developed to overcome jam m in g o f night-fighter ra d ar systems (they did this by ‘remem­ bering’ a n d removing stationary objects, e.g. the surrounding terrain and ‘w indow ’,* and therefore displayed only moving objects— the possible target aircraft). In 1946 Turing did not believe that either o f these devices could be used as a perm anent mem ory to store information because the m em ory was transient, only lasting some few thousandths o f a second. In this practical respect T uring was wrong but his contributions to the newly developing theoretical subject o f Numerical Analysis are well recorded an d show th a t he had a firm grasp o f how com puters (built by * Strips o f tinfoil which gave similar echoes to a large aircraft.

16

The Machine Plays Chess?

other people) could be instructed to solve a variety o f mathematical problems. Turing's interest in Machine Intelligence, and mechanised chess in particular, was also maintained. A newspaper report in 1946 has this to say about his proposed machine, the A utom atic C om puting Engine (ACE). “ The machine is to be an improvement on the American E N IA C , and it was in the brain of Dr. Turing that the more efficient model was developed. Dr. Turing, speaking about the ‘m em ory’ of the new brain, said . . . ‘it will be able to retain for a week or more about as much as an actor can learn in an average play’.” In the same interview Turing discussed, for the first time in public, the possibility of such machines being able to play an average game of chess— “ that is a question we may be able to settle experimentally in about 100 years time” . Nowadays computers play better than average chess so Turing was rather pessimistic. But this belief is hardly surprising since many problems delayed the realisation of Turing’s ambitious A CE design and eventually, in 1949, he resigned from the G overnm ent and accepted the appointm ent of Assistant Director of the C om puting Laboratory at M anchester University. The reason for this move was that the University had a working com ­ puter with a sizeable, fast C.R.T. memory— 8 pages o f 64 words o f 20 bits.* Also, as no Director had been appointed, Turing could do whatever he liked with, what was then, one o f the most powerful com puters in the world. In 1951, Dr. (now Lord) Bowden of M anchester University decided to write a popular book about the new ‘Electronic Brains’. The public had become aware of these machines because of some astounding feats of moronic arithmetic, for example, calculating pi to 2000 places, and Bow­ den's book Faster than Thought was one of the first attem pts to explain the new technology to the layman. The book is still well worth reading because a quarter of a century ago there were probably only about twenty practising full-time programmers in England and all o f them were either at or visiting Manchester. Bowden asked all of them to contribute to his book and Turing, a pioneer in almost all aspects o f com puting, surprisingly elected to write about Digital Com puters applied to Gam es, in particular the game o f chess. Ever since his Bletchley days Turing had been developing a ‘p aper’ chess * This machine was built on a Collissi chassis. See C h a p te r 4 for m ore details.

The Paper Machines

17

machine. This machine was a set o f rules from which one could calculate, in the order o f a few minutes, an unam biguous move for any legal position. Developed in collaboration with an old Bletchley colleague, David Champernowne, Turing had m ade one attem pt to play this set of rules against a n o ther paper machine designed by D onald Michie and Shawn Wylie (also old Bletchley colleagues), but the game had proved too tedious to complete. In early 1952 Turing had a rough draft o f his paper for Bowden’s book and, like Babbage, he decided to put his ideas to the test— the resulting game is the first recorded chess game between man and machine. T uring only mentions the opponent as “ a weak player who did not know the system” . This nameless opponent was Alick Glennie, then 26 years old, a graduate o f Edinburgh University who was at M anchester in order to learn the technology and techniques of electronic com putation for his secret w ork on the British atomic weapons project. Glennie was (and still is) a highly talented program m er who later designed the first compiler; however, he still admits to being a weak chess player. Bowden in his book implies th a t this historic game took place before N ovem ber 1951 but Glennie, who arrived in July 1951, believes it was sometime in 1952. The location he remembers clearly; T uring’s office on the first floor o f the Royal Society C om puting Laboratory which was at the side o f the Schuster Physics Building (where R utherford first split the atom). As I rem em ber, he persuaded me over lunch to take part in his chess experi­ ment. I just h a p p e n ed to be there an d was willing to take part on the spur of the m o m e n t. It was played in the afternoo n, in his office, a rath er bare place with a small table untidy with paper. We had a chess board with pieces and T uring had his select rules w ritten on a b o u t six sheets o f p aper som ew hat mixed up with o th er paper. L a b o ra to ry gossip had told me that mechanical chess was one o f Turing's interests so there were very few preliminaries before we started to play. He did explain briefly w hat he w anted. Y ou can see the recorded game. It seemed to go ra th e r slowly a n d I think I got slightly bored as I was not a keen player and had n o t played m uch before o r since— I knew a few sta n d a rd openings but none of the finer points o f strategy. I was indeed a weak player: chess was for me a pleasant relaxation for odd m o m e n ts with o th er weak players. D u rin g the gam e T u rin g was w orking to his rules a nd was clearly having difficulty playing to them because they often picked moves which he knew were n o t the best. He also m ade a few mistakes in following his rules which had to be bac k track e d . This w ould occur when he was pondering the validity of W hite’s last move while I was considering my move. There may have been other mistakes in following his rules th at escaped notice— possibly they could be detected from

18

The Machine Plays Chess? the record of the game. He had a tendency to think he knew the m ove the rules would produce and then have second thoughts. He would then try to find the piece of paper containing that section of the rules, and to do so w ould start juggling with all his papers. We were playing on a small table which did n o t help. The game took 2 or 3 hours. T u rin g ’s reaction to the progress o f the play was mixed; exasperation at having to keep to his rules; difficulty in actually doing so; an d interest in the experiment an d the disasters into which W hite was falling. O f course, he could see them coming. I rem em ber it as a rather jolly aftern o o n a n d I believe T uring m ust have enjoyed it to o — in his way.

Glennie won the game at the 29th move. The position was (Fig. 2) and

Fig. 2

R - Q l wins the White queen so the program resigned ‘on the advice o f his trainer’ (Turing’s words). H ow did T uring’s program w ork? First Turing gave it the traditional ‘evaluation of m aterial’ P = l , N = 3 , B = 3 1/2, R = 5 , Q = 10, K = 1000. The program considered all W hite’s moves and all Black’s replies. If White could capture at this depth (i.e. one move ahead or, in com puter chess jarg o n , two plies ahead) because of a forced sequence then the cap­ ture, recapture sequence was followed until a ‘dead position’ was reached, i.e. no more captures or mates in the next ply. The resulting ‘dead posi­ tions’ were evaluated on a material basis of W/B and the “ most material winning or least material losing move” was made. In many positions, particularly in the opening, the above rule is a m ­ biguous, e.g. there is no distinction between the ‘best’ 12 o f the 20 possible opening moves. Turing overcame this with a ‘position play value’ as follows: All the White men plus the Black king have a position-play contribution for White.

The Paper Machines

19

(i) F o r the Q, R, B or N , count their mobility as (the square root o f the num ber o f legal moves it can make + 1 . 0 if it can capture) + ((if not a Q) 1.0 if defended + 0 .5 if defended twice or more). (ii) F or the K, count mobility as above + (1.0 if castling is possible, 2.0 if castling is possible at the next move, 3.0 for actually castling) — (N.B. minus) vulnerability which is the mobility of a friendly queen on the same square as the king. (iii) F o r the P's count + 0 .2 for each rank advanced + 0 .3 if defended by a piece (not a pawn). (iv) F o r the BK count + 0 .5 for check, 1.0 for threat of checkmate. Position play value is always calculated for resulting positions with similar material value. Finally, to simplify the calculations, the squareroots were rounded off and written on one o f T uring’s pieces of paper thus: 0 0

1 1

2 1.4

3 1.7

4 2

5 2.2

6

7 2.4

8 2.6

9 2.8

3

10 3.2

So now we can see how T uring’s machine calculated its opening move. First, no pawns forward one square give any possibility o f capture. O f the remaining 12 possibilities P - K 4 is best because from (i) Q = + 2 , KB = + 2 .2, K N = + 0 .3 = 4 .5; and from (ii) K = + 1 - 1 .4 = - 0 .4; and from (iii) K P = + 0 .4 —0 .3 (no longer defended by K) = 0 . 1; and the total is an increase in position play value o f 4 .2, an increase which is greater than th a t achieved by any o f the other 11 ‘aggressive’ opening moves. T o continue, the second move N -Q B 3 is calculated thus: from (i) Q N = + 0 .8 (added mobility) + 0 .5 (now defended twice) Q R = + 1.0 (mobility) QB = + 0 .5 (now defended twice) a n d from (iii) K P = + 0 .3 (defended by QN) giving a total increase o f 3. 1 which is again greater than the position-play value o f any other move. The third move, P -Q 4, is best because o f the increased mobility (2.6) of the Q an d QB. A nd so the game continues with white having little idea where or w hat anything is on the b o a rd ; it is quite defenceless against a fork, for example. T o the interested reader it is an illuminating exercise to recalculate the

20

The Machine Plays Chess?

moves of Turing’s paper machine. As an added incentive, note that one o f the moves chosen is in error—as Glennie said, Turing had a tendency to think he knew the move.

Game between Turing’s Machine and Alick Glennie N o random choices arose in this game. The increase in position-play value is given when relevant, an * indicates that all other moves have a lower value. TUROCHAMP

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

P-K4 4.2* N-QB3 3. 1* P-Q4 2.6* N-B3 2 .0 B-Q2 3.5* P-Q5 0.2 P-KR4 1 1. * P-QR4 1 .0* PxN B-N 5+ 2.4* PxP PxP B-QR6 - 1 .5 Q-K2 0 .6 R-KN1 1 .2* R-N5 B-N5 0 .4 0 0 -0 3.2* B-B6 B-Q5 BxB 0.7 K-Q2 R-N4 0.3 Q-Q3 B-N3 B-B4

G L E N N IE

P-K4 N-KB3 B-N5 P-Q3 N-B3 N-Q5 B-N5 NxN + B-KR4 P-B3 0-0 R-N1 Q-R4 N-Q2 N-B4 B-N3 NxNP N-B4 KR-QB1 BxN Q xP N-K3 N-Q5 N-N4 Q-R3 B-R4

The Paper Machines TUROCHAM P

27 R-N3 28 B x N 29 Q x P

21

G L E N N IE

Q-R5 QxB R -Q 1

Turing was fully aware o f the weaknesses of his paper machine, he rue­ fully described it as a caricature o f his own play, making oversights similar to his own because neither of them reliably chose the strong moves for analysis. Despite (or maybe because of?) this observation Turing believed it quite possible that a com puter chess program could be written that would be able to beat him and, after the Glennie game, he did begin to program the university com puter (variously called M A D M , Ferranti Mk 1 or M anchester M k 2) to play the game. But he was not a good programmer, his brilliant mind did not have the persistence or patience for the boring trivia required to make a big program work and also this was only a spare­ time project. He died in mysterious circumstances on 8 June 1954. The man who had done so much to pioneer com puting in Britain and had contributed enorm ously to the solving of E N IG M A , became an enigma of his own. In retrospect his death also marked the end o f a British superiority in com puter technology and software and America took her rightful place as the leader. Claud Elwood Shannon was born in Michigan in 1916. One of the great American pioneers in the development and application of electronic com ­ puting, his career resembled that o f Turing in m any ways— both men had spent a year before the war at Princeton with John von N eum ann (one of the world's greatest mathematicians who devised the Theory of Games and also developed the stored program concept; the fundam ental principle of the general-purpose machine). Both Turing and Shannon worked on autom ating crypto-analysis (code breaking) during the war and, possibly because of this, both were interested in machine intelligence in general and mechanised chess in particular— yet there is no record o f them ever meeting or discussing these com m on interests and experiences. In M arch 1949 Shannon gave a talk in which he described, for the first time and in much more explicit detail than Turing's later paper, how an electronic com puter could be instructed to play chess using a mini-m ax procedure, i.e. by looking ahead a b o u t three moves and backing up the best line on the basis o f a (necessarily) simple evaluation function. Some

22

The Machine Plays Chess?

of his proposals are described later in C hapter 9. M ore interesting are the points made by Shannon which have been relatively overlooked so far. Shannon defended the idea of a chess machine because “ although o f no practical importance, the question is of theoretical interest . . . chess is generally considered to require ‘thinking’ for skilful play; a solution of this problem will force us either to further restrict our concept of ‘thinking’ or to admit the possibility of mechanised th o u g h t” . Shannon did not define what is ‘a solution of this problem ’ but modern chess programs are quite strong players and convincingly dem onstrate mechanised thought. Like Turing, Shannon gave an example of a simple evaluation function which can be applied at quiescent (or dead) positions. He took the relative values o f K, Q, R, B, N and P as 200, 9, 5, 3, 3 and 1 respectively; he then penalised, doubled, backward and isolated (D, S, I) pawns as the loss of half a pawn and rewarded mobility (M) by adding one-tenth of a pawn for every legal move thus: Evaluation of position = 200(K -k) + 9(Q -q) + 5(R -r) + 3(B N -bn) + (P-p) + 0.1(M -m ) — 0.5(D -d + S-s + I-i). Note. Small letters are opponent’s pieces, etc. Shannon believed that such a simple evaluation function applied to a tree search o f 3 moves (or 6 plies) ahead would (a) take too long; at least 16 minutes and (b) still be a weak player. In these beliefs he was mistaken, tree searching does not have to be exhaustive because of the a lp h a -b e ta principle (again see C hapter 9) and also a program which searches 3 moves ahead can, with even the simple evaluation given by Shannon, often play surprisingly well— depth can overcome a vast am o un t of ignorance and 3 moves ahead, even nowadays, is a respectable depth. Shannon made suggestions as to how forcing lines can be followed deeper than 3 moves (e.g. always follow a sequence o f checks; always complete a sequence o f capture, recapture down to the quiescent, dead position, etc.) and only now are some of his proposals being implemented in an efficient manner. However, one proposal that has not, even now, been implemented efficiently is that the machine should be capable o f learning from its mistakes, i.e. never be beaten in the same way twice. M any modern chess programs overcome this weakness by having a store o f ‘book openings’ from which they select random ly their first 1 to (possibly) 10 moves before beginning to mini-m ax, i.e. generate, search, evaluate and back up.

The Paper Machines

23

A n other proposal by Shannon was intended as an alternative to bruteforce searching. However, this alternative strategy would require far, far more chess ‘knowledge’ than the simple “ value of pieces + mobility — pawn defects" that he had already discussed and “ would require a rather formidable analysis o f the game. Although there are various books analysing com bination play and the middle game, they are written for h u m an consum ption, not for com puting machines. It is possible to give a person one or two specific examples o f a general situation and have him understand and apply the general principles involved.” T o give a com puter this ability is, indeed, a ‘form idable’ task. Coming under the general heading of Machine or Artificial Intelligence this approach has not been very successful to date. Nevertheless Shannon believed that “ if this were done, a much more efficient program would result” . One final quote: “ It is not being suggested that we should design the strategy in our own image. Rather it should be matched to the capacities and weaknesses o f the computer. The com puter is strong in speed and accuracy and weak in analytical ability and recognition. Hence it should make more use o f brutal calculations than hum ans.” In retrospect Shannon was probably the first man to discuss the current controversy (and anti­ pathy) between the two approaches of Brute Force (or Crunch) and the School o f Knowledge. Finally, an anecdote by Richard Sprague which includes Shannon and von N eum ann. It is difficult to precis Sprague’s story about the last of the paper machines without losing much of its hu m o u r and how it also under­ lines the perpetual interest o f the press and the public in the subject, an interest which has continued from The T urk to the present day. T H E C H E S S P L A Y I N G C R C 102 BY R I C H A R D S P R A G U E * At the tim e o f the unveiling of the 102 in H a w th o rn e in 1951, the m anagem ent had obtained an O K from the Air Force for a publicity release on the machine before shipping it to the C am b rid g e Air Force Research L aboratories in Massachusetts. As Vice-President o f M ark etin g I arranged for a press conference and dem onstration at C R C , a n d several local m em bers o f the press attended. O ne was a reporter from the Hawthorne Daily News. He asked me, “ Just w hat is this device, anyw ay? W hat will it d o ? ” A fter I had ru n thro u g h m y prepared set of material, he said ,“ No, I mean really * F r o m Communication o f the A C M , July 1972.

24

The Machine Plays Chess?

what makes this machine different? C an it th in k ? ” I explained as best I could the analogy between h um an thought processes and logical operations in a pro g ram m ed com puter, but the reporter d id n ’t understand, and finally I asked him if he would consider chess playing as a thinking process. W hen he said Yes, 1 replied that the power of the stored program idea was so great that eventually com puters of this type would be able to play a decent game of chess. I emphasized that the p rog ram s would have to be written by experts and that machines would have to be a lot faster with much greater memory than the 102. Then he asked whether the c o m p u te r would always win if it played against a chess expert. I said that would depend on the program s, speed and memory, and whether a learning program was built into the machine. I said under these conditions the com pu ter might win often. The next day, Friday, a few lines appeared in the Los Angeles papers using o u r press kit material, and a story appeared in the Hawthorne Daily News saying that the C R C 102, an electronic brain which can think, was dem onstrated at C R C . The story misquoted me as saying that the 102 could play chess against a h um an being and would always win. T he other officers o f C R C were quite upset over this, but I assured them that I would call the reporter on M onday and get it all straightened out. I rem inded them that the Hawthorne Daily News circulation was rather limited. I d id n ’t know that United Press had som ehow picked up the H aw th o rn e p a p e r’s story and would release it all over the United States on Saturday. I was awakened on Sunday m orning by a telephone call from U nited Press in New Y ork wanting to know what C R C was going to do a b o u t the chess challenge out of W ashington, D.C. W hen I sleepily asked what chess challenge he was talking a b o u t, he said, “ You mean you haven't heard a b o u t some fellow nam ed Jacobs challenging your co m p u ter to a chess m a tc h ? ” The name Jacobs woke me up fast. One of o u r few com petitors in 1951 ( I BM had not begun, and Eckert & Mauchly were not com peting with the 102) was the Jacobs Instrum ent C o m p an y in Bcthesda, M aryland. D on Ja c o b s’ small general-purpose machine had us only a little worried. The reporter told me a b o u t the H aw th o rn e p a p e r’s story appearing in the Washington Post and J a c o b ’s offering to bet $1000 that he could beat the C R C in a chess match. Ja co b s’ strategy seemed obvious to me: gain attention and then ann o u n ce his general purpose com puter. The U.P. man asked me what we were going to do ab o u t the challenge and I said I would call him back. T hen 1 tried to reach one o f my colleagues for consultation, but they were all away for the weekend. 1 finally got hold of H arold Sarkissian and asked what we should do. H arold said, “ Y o u 're the Vice-President of marketing. Y ou figure it o u t.” So, I called the U.P. m an back a nd m ade the following rem arks. First, we would not be able to accept M r Jacobs' challenge on his terms. The c o m p u te r would obviously have to be fed each move m ade by Jacobs. Secondly, I said that it would take time to program the c o m p u te r to play chess and that we w ould need the assistance of som eone who had already been writing chess playing program s. I m entioned Claud S h an n o n of Bell Labs and J o h n von N e u m a n n o f Princeton.* I said that C R C would accept the challenge on the condition that either of those two men was allowed to help write the program s. T hird, I placed a condition on the m atch which would require Jacobs to inform the 102 in advance of the chess system he w ould use. * A uthor’s note: Turing, S h an n o n a nd von N e u m a n n all wrote chess program s. Von N e u m a n n actually gave a talk on the subject in San Diego in 1952, but no record o f this is available.

The Paper Machines

25

I thoug ht, in my naivete , that these conditions w ould end the matter, figuring that either the press or Jaco bs would d ro p it. I was wrong. The next day the U.P. printed tw o stories, the first m isquoting me as saying, “ O u r boy will take him a p a r t” , and that we were eager to meet Ja c o b s ’ challenge as long as C laude S h a n n o n or Jo h n von N e u m a n n w ould referee the m atch and if Jacobs would let us know his chess system a n d agree to a time limit on the m atch. The second article quoted Jacobs as saying he w ould agree to a m atch un der o u r terms, alth o u g h he would not give his system to the c o m p u te r because with that inform ation anyone could beat him. My telephone started ringing at 8.30 a.m. and d idn't stop for days. U nited Press and Associated Press called for follow-up stories. The M utual Newsreel o f the Air (radio) asked to interview me. CBS radio said they would send a crew out to ‘the brain facto ry ’ to do a taped broadcast. The producer of E d w ard R. M u rro w ’s ‘See It N o w ’ p ro g ra m pho n ed to ask w hether the 102 could be shipped to New Y ork to ap p ea r on the TV show. Life magazine w anted to set up a chess m atch in a giant hall somewhere in Los Angeles with a cover story titled ‘‘Life G oes to a Chess M a tc h ” . A local TV show w anted us to bring the 102 dow n to the H ollyw ood studio where the M.C. w ould play chess against the machine. (H e had sword swallowers and wrestling bears on the sam e show.) The producer o f the D ean M artin an d Jerry Lewis show asked if we could bring the c o m p u te r to the show so that Lewis could play chess with it. (Jerry w ould win o f course.) T o o u r surprise the public relations office for the Air Force in W ashington was delighted with the publicity. They had heard from the ‘See It N o w ’ producer and asked w h ether we could ship the machine to W ashington for a press conference there before sending it to N ew Y o rk for the M u rro w program . T o avoid the adm ission th a t the machine could never play chess, which would e m b a rra ss the Air Force, we decided to explain that while the co m p u te r would be able to play M r Jacobs, given en o u g h time to get ready, it was scheduled for far m ore im p o rta n t defense w ork at C am b rid g e Air Force Research Laboratories. Thereby we graciously ducked the matter. T o d a y c o m p u te r chess m atches are co m m o n p la c e ; the exaggerations of the 1950s fade a little. Still, the d re am of the 102 a n d Jacobs placed head-to-head in the center o f the cavernous Elks Hall in Los Angeles, the TV cam eras trained on them , J o h n von N e u m a n n there as referee, a n d Life magazine reporters and cam eras covering the event, has a certain appeal to it.

CHAPTER 4

The First Programs first chess ‘program ’ was that of Torres y Quevedo which has already been discussed. Although it is quite feasible (and more ‘efficient’) to build specialised machines to play chess and only chess, this would be extremely expensive. Most chess programs run on general-purpose com puters and the very first one was written by Dr. Dietrich G unther Prinz at M anchester University in 1951. Prinz had heard rum ours about the Sprague challenge: “ In a report to the Manchester Guardian (13 Novem ber 1951) Alistair Cooke mentioned an American firm which was said to have challenged any hum an chess player to a match against its electronic machine. However, inquiries in the United States failed to confirm this report and it seems that the first concrete approach to the problem is my work carried out on the machine installed at the University o f Manchester.” Before discussing what Prinz did let us take a closer look at this machine which played such a prominent part in the early days o f games-playing programs. The first Manchester University com puter was a small experimental machine that Professor F. C. Williams had built in 1948 to test his storage tube memory— however, “ The machine that I used for the chess program was the one built by Ferranti for the University. There is some confusion about names. The University wanted to call them M ark I and M ark II; for some time the Ferranti machine was known as M adam (at one occasion it was called ‘Joe’ by the Daily Express ); finally it was called Ferranti M k I. The next machine, Mk II, became the M ercury” — followed by ATLAS, M U 4 and currently (1975) the University is developing M U5. However, back to M A D M (the machine's correct name) and Prinz. “ The electronic store of this machine consisted o f eight cathode ray tubes or ‘pages’. Each page had 64 half words o f 20 bits each. The magnetic T

he

26

The First Programs

27

backing store consisted o f two drum s or ‘wheels’. Each wheel had 256 ‘tracks’ and each track corresponded to two pages. Transfers could be m ade between a half-track and a page (tube), or a full track and two consecutive pages, at a time.” So we have this picture o f the machine’s memory (Fig. 3). 1

2 3

256x2 pages on

32 W ORDS

backing score.

32 1

2

3

4

5

6

7

8

8 pages (C.R.T. ' s)

Fig. 3

Transfers from tube to track were called ‘up transfers’, from track to tube ‘down transfers’, because in the previous machine the magnetic drum store had been in a room above the electronics. So we see th a t this ‘big’ machine, which had in part attracted Turing to M anchester, consisted o f 256 words o f fast memory + 16K words on a (relatively) slow backing store. N ow adays BIG machines have a b o u t 1,000,000 words o f fast store alone, plus hundreds o f millions o f words on backing store. Because o f the small size o f the machine’s memory, Prinz made no attem pt to play chess— W h a t has been d o n e is a d e m o n s tr a tio n o f the ability o f the m ach in e to solve sim ple chess p r o b l e m s — o nly the sim plest case, th e ‘m a te in tw o ’ has been tre a te d , a n d even so, so m e o f the m oves p erm itted by the rules o f chess (d o u b le p a w n m oves, castling a n d th e ex ch an g e o f a p a w n for a piece on reaching the last row ) have been excluded to m a k e the p r o g r a m m e as sim ple as possible. Finally, the possibility o f a stale m a te was a d m itte d as a solution.

The first chess problem solved by the program was the one shown in Fig. 4 (White to move): This extremely simple problem “ took a b o u t 15 minutes to solve; most chess players could find the solution in less time than this” . Before the reader takes any com fort from this performance by a 25-yr-old machine I should mention th a t m odern machines can, on average, solve mate-in-two problem s in a b o u t a q u arter o f a second.

28

The Machine Plays Chess?

Fig. 4

The above problem was the only one ever solved by the machine— After establishing that it worked, it was never used again. The n u m b e r of machine users increased so much that there was not enough time left for frivoli­ ties. Besides, any chess problem even slightly more complicated than the one I used would probably have taken hours. In a chess problem, you have to go through all the branches of the trees; you cannot, as in chess playing, ignore the ones not likely to succeed.

One interesting pioneering feature of Prinz’s program is that the chess board had an ‘edge’ to it, i.e. it was actually a 10 x 10 board and, of these 100 squares, only the central 64 constituted the board proper whilst the remaining 36 were used to detect if a piece attem pted to move off the board. Unfortunately such a scheme does not prevent a knight making illegal moves; for example, the program would have generated the follow­ ing for a Black king knight in square 88— (67, 76, 96, 107? 109 ? 100, 80, 69) and only detected 96, 80 and 69 as border squares and hence illegal. When this problem was put to Dr. Prinz (in June 1975) he admitted it was a ‘bug' which had not been detected at the time but “ it is possible to play on a 10 X 10 board provided you split the knight move into two parts: one diagonal, one straight. You would have to test after each part whether the square reached is a border square and, if so, aban d o n it. O f course, I did not use this technique, it is clumsy and a 10 x 12 board* is much better.” I claim this ‘bug’ as the oldest ever detected. At the same time as Prinz was writing his chess problem solver, a school teacher from Harrow named Christopher Strachey was program m ing M A D M to play draughts. * See C ha p ter 9, M achine Technique.

The First Programs

29

Strachey had just visited N P L in 1950 to have a look at A C E a nd find out how it w orked ‘out o f sheer curiosity’. They were still putting it together after 4 years of h a rd w ork, but I was able to understand more or less how it was instructed and decided to write a p ro g ra m to play draughts. It so happened that the pilot A C E had a 32-bit w ord and there are 32 squares on a draughts board. I thought ‘How co n v en ien t’. As it tu rn ed out it was the first d raughts p rog ram ever written and, as the A C E only had 273 w ords for data and instructions, it was difficult and d a m n near killed me because o f the need to follow a sequence o f captures; just thinkin g it out and und erstanding it was very hard but ever since I’ve always had a clear picture of w hat recursion is ab o u t. U nfortunately the full program never r a n — they kept changing the m achine— so Mike W oodger suggested that I go to M anchester and try Alan T uring 's machine, the Ferranti Mk I. I had known A lan at Kings, C am bridge, before the w ar and so 1 asked him to send me a copy o f the instruction m an u al for the machine. He had written the m anual himself a n d when I got a copy I could see why it was famed for its incomprehensibility— people ju st w eren't used to reading really accurate descriptions an d this was exacerbated by A la n ’s slightly irritable assum ption that everyone was as intelli­ gent as himself. I visited M anchester to find out how M A D M worked and then went back to H a rro w to write the program . The program was a b o u t 19 or 20 ‘pages’ long before I actually tried it. I arrived with it one evening and Turing to o k me up to the machine ro o m and gave me a quick course on how to use the c o m p u te r— “ Y ou do this, this and this” — a n d then went away leaving me sat in front o f this e n o rm o u s m achine in a ro o m which looked like the control room of a battleship. A quite incredible experience particularly as the machine was, so I believe, w orth a b o u t £500,000. F o rtu n ately I had the m anual and was able to w ork it out slowly th ro u g h the night and got most o f the program working. T u rin g cam e back in the m orning an d asked if I had got anywhere and I said ‘O h, yes’. ‘G o o d sh o w ’ he answered enthusiastically and then told me that the biggest p ro g ra m th a t had w orked so far on the machine was only a b o u t half a page, i.e. a b o u t 40 times smaller th an mine! He made no apologies for letting this fool run in because he believed the only way to really learn how to program was to try problem s that were p ro b ab ly to o difficult anyway.

The results o f Strachey’s pioneering work, together with that of Turing and Prinz, are recorded in Bowden’s book Faster than Thought. Because draughts moves are very much simpler than chess moves it was possible to put both the program and the necessary position storage in the 8 pages of electronic store at the same time thus removing the need for dr um transfers ‘u p ’ and ‘d o w n ’. The result was a program that could ‘look a h ea d ’ 3 plies th ro u g h all possible alternatives and then make its choice (or mini-max) by valuing the final resulting positions in terms of material left on the board— all this in a b o u t 1-2 minutes. The program could play ‘fairly sensibly’ but one wholly unexpected difficulty app eared — Strachey discovered what is known as the ‘horizon effect’, an effect displayed by all program s which search to an a priori fixed depth. In chess program s it is most noticeable when an o p p o n en t’s pawn

30

The Machine Plays Chess?

has reached the seventh rank and is about to queen. This is an enorm ous gain in his material and, if possible, the program will check the opponent (in both senses) in order to push the evil ply of pawn prom otion beyond its look ahead. The trouble is that the checks are usually suicidal and, when all are exhausted, the pawn can often still queen. In order to avoid this problem Strachey implemented the ‘dead position', i.e. the machine continued to investigate moves ahead until it found two consecutive moves without captures. With this strategy the program played a ‘tolerable game’ until it reached the end game. After this first program Strachey gave up teaching and went full time into computing, particularly the design of machine languages. He even­ tually became Professor of C om putation at Oxford in 1971 but he never attem p ted to write a chess program because it’s too difficult. The nam e of this game is beating the best chess player in the world and the best program so far is just a box of tricks hiding inside the really incredible developm ent; the general purpose com puter. I agree w ith you that chess program s are an excellent way of investigating w hat com puters can and cannot do but I just happened to find c o m p u ter languages m ore interesting and certainly more feasible and worthwhile.

The work o f Turing, Prinz and Strachey on M A D M put Britain in the lead of chess program development during the early 1950s but this was short-lived. As Prinz has said there was little time for such frivolities and, with the death o f Turing, the subject virtually died out at Manchester. The first chess machine in America was built by Shannon soon after he gave his historic paper. This was a metal cabinet about the size o f a tea table and included some 250 relay switches. N am ed Caissac, after Caissa the goddess o f chess, it was very similar to Quevedo's machine in that it could play only the simpler end games, where it had the advantage o f a queen, a rook or two bishops. A special chess board, built into the top of the machine, had lights and electrical contacts in each o f the squares. It could, therefore, detect where the pieces were and indicated its own moves by flashing the appropriate pair o f lights. U nfortunately the algorithms for its play, in particular the king and two bishops vs king, have never been published. Shannon apparently got the message and for the last 20 years has successfully avoided the subject. The next step forward took place at Los Alamos. New Mexico— an establishment which is not too well known for indulging in frivolities. It is a fact that the modern electronic com puter owes much o f its early development to the need to solve the problems o f making atom ic bom bs

The First Programs

31

work. In 1944 the Los A lam os scientists decided that the best solution, indeed the only solution, to assembling a plutonium bom b was to use an imploding lens ot conventional explosive. Analytical methods could not simulate how the shock waves would behave in this device and the scientists had to use numerical m ethods requiring a vast am ount o f com putation (i.e. addition, subtraction, multiplication, etc.). Dr. John von N eum ann, then a mathematical consultant to Los Alamos, was ordered to bring into the laboratory the most advanced calculating machines available. These machines, built by IBM, were electro mechanical and could not be ‘program m ed' in the modern sense. They were delivered in crates and some curious physicists, unable to wait for the IBM assembly engineers, began putting them together and playing with them. This tendency to play with new, expensive equipm ent was not discouraged, indeed Dr. Oppenheimer, the Director, appreciated that it was a useful activity. Consequently more machines were ordered and brought in specifically for the physicists to play with, but only in their spare time. With the successful completion of the first bom b assembly the physicists realised th a t the new, fully electronic computers, in particular EN IA C , would help to produce smaller, more efficient bombs and, in 1946, von N eu m an n was given a grant to develop a powerful com puter for this purpose. One result of this work was the M A N IA C I com puter which was installed in Los Alam os a b o u t 1950, mainly to study the problems of designing hydrogen bombs. But the tradition o f playing with the com puters still continued and in the early 1950s five scientists (including Stanislaw Ulam, the man who had the key to making the hydrogen bom b small enough to carry in a bomber) began to make “ some experiments performed on a fast com puting machine (M A N IA C I— Los Alamos) on the coding o f computers to play the game o f chess” . The Los Alamos team decided to look 4 plies ahead (2 moves ahead). M A N IA C I was fast for its day but it would have taken about 2 hours to consider all possibilities at this depth in the full game. Consequently a simplified version o f chess was used— “ we play on a 6 x 6 board, omitting the bishops, and with six pawns on each side. (F or the first move we allow the pawn to move only one square ahead.) The game retains much o f the flavour o f real chess but is very much simpler. Castling is not perm itted; prom otion o f a pawn was allowed to take place as usual.”

32

The Machine Plays Chess?

All this reduced the average time for a move to ab o u t 12 minutes. The evaluation of a position was by (material + mobility) with material values as usual ( Q = 9 pawns, R= 5 pawns, etc.) and a pawn was equivalent to 8 legal moves. “ These criteria for evaluation seemed to us at the time extremely crude— but— we might say that our simple criteria turned out surprisingly well.” M A N IA C I played only three games. In the first game it played itself (White won) and revealed “ a mortal fear of checks, since its freedom after check was nearly nil and it tended to sacrifice material to avoid checks” . This, and some other weaknesses, were fixed and the improved program played game 2 against Dr. Martin Kruskal o f Princeton University, a strong player who offered it White plus odds o f a queen. The game ran for 10 hours. After about 15 moves Kruskal had made no gain and started calling his opponent ‘he’ instead o f ‘it’. At one point M A N I A C could have won but it chose badly and Kruskal was able to lay a three-move mating trap. The machine’s only way out was to lose its Queen— a decision over which it ‘thought’ for 20 minutes but “ which it did somewhat to the sadness of the authors (and all onlookers but one)” . A later official report of the event described the move as ‘heartbreaking’.* Kruskal eventually won on his 38th move. The third game was against a young lady who had no knowledge of chess. She was coached for a week and then, playing Black, became the first hum an to lose a game o f chess to a machine. A t move 18 she was faced with (Fig. 5)

Fig. 5 * The C O K O incident is even more heartbreaking. See C h a p te r 5.

The First Programs

33

and played P -Q 3 . M A N I A C now dem onstrated th at i f ‘h e ’ was male then he was a male chauvenist and, showing no chivalry, played

19 20 21 22 23

N-R3 + P-N5 + P x R (Q ) Q xP+ N-N5 + +

K-K1 K-K2 N-Q2 K -Q 1

A n d so “ with very little in the way o f complexity, we have at least entered the arena o f h u m a n play— we can beat a beginner” . The full 64-square game was tried later ( ca . 1956) on a faster machine, M A N I A C II, a n d achieved co m p a ra b le results. The next p ro g ra m o f note was developed a b o u t 1956 by Alex Bernstein, a m athem atician a n d strong a m a te u r player. The machine used was an IBM 704 which was capable o f a b o u t 10,000 instructions (add, subtract, com pare, etc.) per second, i.e. a b o u t 10 times faster than M A D M but still 1000 times slower th a n m o d ern machines. Bernstein’s pro g ram was, in both senses, extremely curious— it spent alm ost half its time asking questions (mainly because it had forgotten the answer). F o r example: “ T h e c o m p u te r painstakingly and single-mindedly considers square by square, giving the same minute attention to squares of little interest as to those o f key importance. It asks a b o u t each square whether it is occupied, by whose man, whether it is attacked, whether it is defended, w hether it can be occupied.” All this to o k a b o u t one-tenth o f a second and was repeated in the look ahead over 2400 times— an d usually obtaining the answer ‘n o ’. Personally I a m not fond o f this idea, the program asked too many irrelevant ques­ tions whereas the art o f p ro g ram m in g is simple c o m m a n d — the machine should ‘d o it’ until a limiting or satisfactory condition is reached. The reason Bernstein’s p ro g ra m asked these and other questions is that it had a very restricted depth and width. It could only search four plies ahead an d only consider (at most) seven alternatives at each ply. To choose the seven alternatives the program had what is now termed a ‘seven plausible moves selector’. It picked these moves on the basis o f a further eight questions. First it asked (1) A m I in check? If so list only ap p ro p ria te moves, i.e. capture check­ ing piece, block or move the king. If n o t in check then

34

The Machine Plays Chess?

(2) Arc any exchanges possible? If so can I gain material or should I move my man away. The questions continue: (3) If I have not castled, can I do so now? (4) C an I develop a bishop or knight? (5) C an I occupy an open file? ( 6 ) Can I place pieces on critical squares o f my pawn structure? (7) Can I make a pawn move? ( 8) Can I make a piece move? The machine asked these questions in the above order until it has found a m axim um o f seven plausible moves. Repeating the process to a depth o f four plies resulted in 2401 possible positions which were evaluated by gain o f material, defence o f king, mobility and control o f central squares. The best value was backed up the tree and the machine made its moves; the time taken for all this was a b o u t 8 minutes. The program was punched on ab o u t 8000 cards which were fed into the machine. In order to play the machine one had to punch a move on a card, put this card into a reader and press the start button. The machine's reply was o u tp u t on a lineprinter. Despite the fact that Bernstein’s program now appears a p o o r a p p ro a c h — wasting a great deal o f its allotted time asking questions and the in­ p u t/o u tp u t o f moves was archaic— it was this program t h a t first played “ a respectable and not-too-obvious game o f chess" Edw ard Lasker, the American chess master and author, played the machine twice. The first game was more o f an investigation; Lasker tested the program by putting six o f his men en prise— they could all be taken if the program was ‘s m a r t ’ enough to capture them in the correct order. He lost them all. Lasker then played a second time to win and did so inside 20 moves but (he later said) the program played a ‘passable a m a te u r gam e’ and with bigger, more powerful machines “ quite a strong game could be prod u ced — w ithout changing its method in principle” . All these first programs were ‘brute-force’ program s which, a p a rt from Bernstein's, made little or no pretence to simulate w hat happens in a good chess player's mind. One strikingly c o m m o n feature o f these prototype experiments is that all the a u th o r s — Prinz, Strachey, U la m a n d Bernstein— stated roughly the same co n c lu sio n : “ It appears that if this crude method o f pro g ram m in g were the only one

The First Programs

35

available it would be quite impractical for any machine to compete on reasonable terms with a com petent h u m a n being.”

Lord Bowden on Prinz “ It’s to o difficult.”

Strachey “ It is clear th a t even m uch faster machines— having, say, one micro­ second o rder times will not enable one to look m ore th an 3 moves a h e a d ” , i.e. 6 plies in their simplified version

Ulam et al. “ Even with m uch faster com puters th an any now in existence it will be impracticable to consider m ore th an a b o u t six half moves ahead, investigat­ ing eight possible moves a t each stage.”

Bernstein So despite all these successes (between 1951 and 1956), there was a distinct pessimism on the subject by people who had actually got the prog ram s to work. This pessimism was to last for a decade awaiting the discovery o f the a l p h a - b e t a principle.

CHAPTER 5

The Crunchers not quite true to say th at everyone who had written a chess program before 1957 was pessimistic. There was an attem p t to write a program which would simulate more closely h u m an chess-playing m ethods an d the authors o f this program were rather more hopeful. This was a research project by Herbert Simon, Allen Newell and Clifford Shaw o f the Rand C orporation and the Carnegie Institute o f Technology. Their program was very complex, very slow— it could take an h our over a move— and none o f its games was ever published. Simon summarised (in 1957): “ O u r program is fairly impressive in the very opening play when center control and development are at issue. I think at this stage we can rate it at the medium am a teu r level (about 1200 E L O rating or 75 British). But after that, it isn't so go o d .” Nevertheless Simon was uniquely optimis­ tic, he believed “ that within 10 years a digital co m p u ter will be the world's chess cham pion, unless the rules bar it from com petition ” . Well the years passed by and there were only a few desultory twitches in the subject. An American machine played a Russian machine (and lost), Barbara H uberm an appeared to show that simple end games were horribly difficult for com puters (this is dealt with more fully in C h a p te r 7) but, an d this was probably the biggest hold up, the new, more powerful co m puters were no longer dedicated to one program and it was difficult to ‘ta lk ’ to a program without making the machine ‘inefficient’, i.e. it would have to wait for its o p ponent's moves and this idling was a n a th e m a to the new half-breed o f com puter managers. Chess program s became programma non grata in the new, batch mode c o m p u ter systems. We now come to what is known in the subject as ‘the Dreyfus Affair’. In 1965 Professor H ubert Dreyfus was aware o f S im o n ’s optimistic statement o f 1957. Simon had later re-evaluated the M A N I A C II pro g ram at Los Alamos, the IBM 704 program o f Bernstein a n d his own, and come It

is

%

36

The Crunchers

37

to the m o re pessimistic (and realistic) conclusion th a t all three program s played mediocre chess. Nevertheless Dreyfus could not resist com m enting on Sim on's previous optim ism : “ Still no chess program can play even a m a te u r chess, a n d the world c h am p io n sh ip is only 2 years aw ay.” This c o m m e n t in Phenomonology and Artificial Intelligence was part of an attack on Artificial Intelligence in general. Dreyfus used the failure of chess p r o g ra m s in particular to m ake his case and plainly gave the impres­ sion th a t such p rogram s could be defeated by novices, even 10-year-old novices. U nfortunately for Dreyfus a new chess program was just being deve­ loped at the M a s s a c h u s e t ts Institute o f Technology an d he was invited to play it. The A.I. newsletter S I G A R T reprinted the game with no com m ent other th a n “ . . . no chess pro g ram can play even am a te u r chess . . . ” — H u b e rt L. Dreyfus, Dec. 1965.

White ( Dreyfus )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

P-K4 N-KB3 B-B4 N-B3 P-Q3 N-KN5 B-Q5 B-N3 BP x N N-R3 PxP P-B3 PxB NxN B-Q2 P-N4 R-KN1 PxP R-N3 PxB K-K2 Q-KN1

Black ( Program )

P-K4 N-QB3 N-B3 B-B4 0-0 N-QR4 P-B3 NxB P-KR3 P-Q4 B-KN5 BxN NxP QxN QxQP B-K2 P-K5 B-R5 + BxR + QxN P+ QxP P-KR4

38

The Machine Plays Chess? White ( Dreyfus)

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

B-B3 Q-B2 Q-B6 K-Q2 K-B2 K-N3 QxQ R-R1 B-K1 K-R4 P-N5 P-N4 KxP K-B5 K-B4

Black ( Program)

P-KN3 P-R5 Q -N 5 + QR-Q1 + Q xP+ Q-K3 + PxQ R-B5 R-B6 + P-R6 R -Q 5 + PxP+ R-R6 R-Q4 + P -N 4 + +

O f course all th at this game proved (to quote Professor Seym our Papert o f the M I T Artificial Intelligence G ro u p ) was that “ C o m p u te rs C a n ’t Play Chess— N o r C an Dreyfus” and everyone involved had a good laugh— well almost everyone! Dreyfus protested that he had been quoted o u t o f context, com plained of such tactics being used to discredit his argum ents and repeated his criticism o f the over-optimism o f chess programmers. This debate, in one form or another, continues to the present day but where Dreyfus went wrong is th at he implied th a t all chess prog ram m ers were over-optimistic. This is not, nor ever was, the case for the majority o f people who have written chess program s— generally these people are either non-commital or extremely pessimistic as to when a c o m p u te r will be world cham pion* a n d it is only a small faction that have caused problem s an d gained fame by irresponsible predictions. The program th a t had beaten Dreyfus was called M A C H A C K a n d was written by Richard G r eenblatt and D o n ald Eastlake. A p a r t from Dreyfus the program had played in a few local to u rn am en ts in the period F eb ru ary to M ay 1967 and had actually won a trophy in April. Against n o n - t o u r n a ­ ment players M A C H A C K could win a b o u t 80 per cent o f its games. * A t the 1974 C o m p u te r C hess W o r ld C h a m p i o n s h i p the m ajo rity o f o p in io n w as 1 9 8 3 + for a m a s te r chess p r o g r a m a n d p ro b a b ly never fo r a w o rld c h a m p io n .

The Crunchers

39

There were four main reasons for M A C H A C K ' s success. First: Greenblatt an d Eastlake were com petent, pragm atic program m ers and not ju st paper theorists. Second: as G r e e nblatt says, “ The environm ent in which this p r o g r a m has been developed is, we feel, more advantageous th a n for any previous chess p ro g ra m .” W h a t he m ea n t here was th at he had a dedicated, highly interactive machine (a P D P - 6 ) with good software facilities for editing and debugging the program which itself was written in a high-level assembly language. T hird: the a lp h a - b e ta principle was used to reduce the w o rk by a factor o f a b o u t 100. Finally: people who played the pro g ram would resign prematurely. They did not realise that although M A C H A C K was impressive in the opening and middle game, it was often incapable o f winning quite simple end games. Because it was written in a high-level language it was possible to give M A C H A C K a much more sophisticated ‘plausible-move generator’ c o n ­ taining a b o u t fifty conditions for choosing moves for further investigation. The num bers o f plausible moves (the ‘width o f search’) were variable and, for to u r n a m e n t play, were set to 15 at ply 1, 15 at ply 2 , 9 at ply 3, 9 at ply 4 a n d finally 7 at ply 5. At ply 5 the program applied its ‘evalu ation’ o f the position. If captures were present, i.e. the position was not ‘d e a d ’, then the pro g ram could recall the plausible-move generator to go deeper providing the line was forced. H aving evaluated a position as quiescent or dead the program would give it a ‘value o f the b o a r d ’, S, which was again quite complex: S = material balance + piece ratio + pawn structure + king safety + center control. Material balance was, as usual, the d o m in a n t term and was calculated from the following piece values: Piece

Value

Pawn K n ig h t Bishop Rook Q u e en K in g

128 416 448 640 1248 1536

Value relative to pawn 1

3.25 3.50 5 9.75 12

N.B. T h e loss of, for example, a queen an d knight was considered equi­ valent to losing the game. T h e piece ratio term was p ro b ab ly the first a tte m p t to m ake a prog ram take even o r near even exchanges when ahead a n d avoid them when

40

The Machine Plays Chess?

behind— incidentally, a piece o f advice which Dreyfus had not followed in his game with the program. The pawn structure gave (or took off) points for passed, isolated, back­ ward and doubled pawns; pawns also increased in value as they advanced being roughly equivalent to a minor piece at the seventh rank. The king safety term only applied when queens were on the board and was (eight times the rank o f the Black king minus eight times the rank of the White king). The p ro g ra m ’s king was therefore reluctant to move from the back rank whilst the o p p o n e n t’s queen was still in play. Centre control was probably the weakest part o f the program because it inhibited the program from moving pawns out o f the centre four squares

even in the end game. The resulting ‘value o f the b o ard' was then mini-maxed back up the tree, with a lp h a -b e ta cutoff, and M A C H A C K chose its move. Despite having a fair a m o u n t of ‘chess knowledge', n o b o d y claimed (least o f all Greenblatt) that the program th o u g h t like a h u m a n player. As Shannon had advised, M A C H A C K derived most o f its power from its lookahead in a machine capable o f 200,000 operations per second. But it was a powerful opening and middle game player with the ability to fool people into thinking that it ‘knew’ what it was doing in an intelligent activity. In 1967 this ability was not unique, a n u m b er o f program s had by then appeared which could fool people or make it difficult for them to know whether they were interacting with a machine or a n o th e r hum an. There was, for example, a draughts (checkers) playing program which, because the game is much simpler, could play up to almost world c h a m p io n level. A n o th er program (called ELIZA) was even more bizarre in that it could apparently carry on a conversation. Basically this program never volunteered any information but either asked a question or m ade a sympathetic, understanding comment. In the 1940s Turing had considered the question o f whether a machine could be said to be ‘thinking’. Turing wrote that the answer is essentially subjective and invented the Turing test to illustrate the point. In the Turing test a h um an investigator is sat at a teletype on which he can type anything he likes and something (either a n o th e r h u m a n or a machine) will type back a response. If the investigator c a n n o t tell whether the responses are from an o th e r h u m a n or a machine then, by an y sensible definition, the responder is ‘thinking’.

The Crunchers

41

In 1968 a student went into the AI office at M I T to use one o f the on-line teletypes. One o f these appeared to be free but had a note “ C o m p u te r time reserved by D an B o b ro w ” . The student sat down and linked to Bobrow ’s hom e terminal (so he thought, he actually linked to E LIZ A ) with the following conversation: STUDENT: : STUDENT: : STUDENT: : STUDENT: : STUDENT: STUDENT: :

MAY I USE Y O U R C O M P U T E R T I ME ? DO YOU W A N T TO USE MY C O M P U T E R TI ME? YES. I UNDERSTAND. A R E YOU C O M I N G IN T O N I G H T ? WH Y DO YOU W A N T TO K N O W IF I AM C O MI N G IN TONIGHT? BECAUSE I W A N T TO USE T H E C O MP UT E R! ! ! I SEE. WELL? W H A T DO YOU MEAN, “ W E L L ” ? WELL, WHAT' S Y OU R ANS WE R? LET’S E X P L O R E F U R T H E R W H Y YOU WA N T TO USE T H E C O MP U T E R .

After a further 10 minutes o f increasing frustration the student rushed to a telephone a n d dialled B o b ro w ’s home, rousing him from a deep sleep. S T U D E N T : W H A T T H E H E C K DO YOU T H I N K Y O U ’RE D O I N G ? B OBROW: W H A T DO YOU MEAN, W H A T T H E HECK DO I T H I N K I’M DOING?

So a t least one p r o g r a m had passed the T uring test with flying colours. N o w G r e e n b la t t’s program h ad also passed the test for the simple reason th a t people would resign against it; it obviously convinced some people t h a t it ‘k new ’ w h a t it was doing. M A C H A C K was n o t a b re ak th ro u g h but it did herald a break o u t of chess programs. Between 1967 and 1970 at least eight new programs app eared in the United States and, from 31 A ugust to 2 September 1970 there occurred, in connection with the Association o f C o m p u tin g M achi­ nery ( A C M ) C onvention in N ew Y ork, the first United States C o m p u te r Chess C ham p io n sh ip . Six p ro g ram s com peted in the event a n d it was won by a program written by David Slate, Larry Atkin an d Keith G orlen o f N orthw estern University. Their p ro gram , C H E S S 3.0 won all its three games. T h e following year eight program s com peted in Chicago in an o th e r

42

The Machine Plays Chess?

three-round ‘Swiss T o u r n a m e n t ’ a n d again C H E S S 3.5 won all its games— and again in 1972. C H E S S 3.6 h ad by then run up a perfect record o f nine consecutive victories although it was finding it more difficult to knock out its opponents. One o f its games in the A C M - 1972 to u rn a m e n t at Boston is o f particular interest because Samuel Reshevsky, a master player and former U.S. Title Holder, published an analysis in the New York Times* N ote C H E S S 3.6's style o f pawn wrecking. The relevant part o f the game is as follows: Slate/Atkin Northwestern University CDC 6400 C H E S S 3.6 1 P-K4

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

N-KB3 B-N5 0-0 N-B3 BxN + P-Q4 N xP B-N5 Q-Q3 QxB BxN QxQ P-QN3 P-KR3 P-N4 QR-Q1 NxR N-K3 P-KB4 K-N2 K-B3 P-B4

James Gillogly C arnegie-M ellon PDP - 10 TECH

P-K4 N-QB3 N-B3 B-B4 P-Q3 PxB PxP 0-0 B-KN5 BxN R-N1 QxB PxQ R-N5 B-K3 R-Q5 RxR K-N2 K-N3 K-N2 R-QN1 R-N4 R-QR4

* “ Analysis P u ts F ischer A h e a d o f I B M ” , 18 A u g u st 1972.

The Crunchers Slate/Atkin N o rth w estern University CDC 6400 C H E S S 3.6 24 P - K B 5 25 R - B 2 26 R - Q 2 27 P - K R 4

43

James Gillogly C arnegie-M ellon P D P -10 TECH B-Q 2 R-K4 P-Q R 3 P-B 4?

Fig. 7

28 29 30 31 32 33 34 35 36

N-Q5 NxQBP K-B4 PxP RxP P -R 6 + P-R5 + RxP KxB

BB3 BxP + P-KR4 P-R4 BxP K-N3 K x P /4 R-K7 —

Reshevsky’s analysis: T h e c o m p u t e r chess m a tc h in B o sto n p rov ed o n e th in g : c o m p u te r s have a long w a y to go befo re they b ec o m e in te rn a tio n a l g ra n d m a ste rs. But their g am e was an interesting e x p e rim e n t nonetheless. B lac k ’s reply o n the n in th m o v e o f . . . B - K N 5 was am azin g . B ut T E C H h ad c a lc u la te d t h a t its m o v e was n o t a blunder. It m u s t be realised t h a t if 10 B x N , Q x B , th e n : 11 Q x B , B x N , with a p lay a b le g am e. A n d w h e n W h ite c o n c lu d e d it w ould n o t profit fro m the a b o v e c o n t i n u a t i o n , it co rrectly c o n tin u e d 10 Q - Q 3 . O n the 11 m ove, T E C H allow ed its o p p o n e n t to b rea k up its king p a w n po sition . P r u d e n t w as 1 1 . . . P -B 3 (instead o f R - N l ) a n d if C H E S S 3.6 persisted

44

The Machine Plays Chess? in its a p p a re n tly intended c o n tin u a tio n o f 12 B x N, then 1 2 . . . P x Q ; 1 3 B x Q P x N 14 B x P P x P 15 Q R - N 1 K R -B 1 16 B x P R x P, with an even position. But that was really too m uch to expect fro m a c o m p u te r. T E C H was saddled with tw o d o ubled paw ns in the en d game. C hess 3.6 pressed its a d v a n ta g e reason ab ly well. C H E S S 3.6 displayed good ju d g e m e n t on its 18th tu rn w hen it re c a p tu re d the ro o k with its knight instead o f its ow n ro o k , realising th a t the kn ight co uld be better utilised at K3 th a n at QB3. W h ite ’s 20 P-K.B4 was a m echanical b u t useful stroke. It th re a te n e d to win the bishop with P -B 5 ch , an d T E C H , seeing it, m oved its king away. W h ite’s 25th move, R -B 2 , protected his* queen ro o k paw n. H o w did C H E S S 3.6 ever see that it was a tta c k e d by Black’s r o o k ? T E C H slipped o n its 27th m ove w hen it a d v a n ce d its queen bishop paw n. C o rrec t was 27 . . . P - R 3 with a n even position. W h ite ’s 28th move, N - Q 5 , was a star m ove for a c o m p u te r. B lack’s position was u n ten a b le fro m here on. T E C H ’s 30 . . . P - K R 4 was a go o d try b ut in­ sufficient. W h ite ’s 33 P - K R 6 c h , o n the o th e r h a n d , was a c o m p u t e r stro k e o f genius! O f course, 33 . . . K x P; 34 R x Pch w ould have finished it off right there. W hite was really c o n c e n tra tin g w hen it played 34 P -R 5 c h . A fter 35 R x P, T E C H could have resigned, b ut being a g o o d c o m p u t e r it foug ht until the b itter end.

In D ecember 1972, Jack G o o d (the Bletchley statistical assistant o f Turing) had the temerity to com m en t on Reshevsky's analysis. A t move 27 Black played P -B 4 “ and Reshevsky says that 27 P - R 3 would have given an even position. This seems undeniable for current chess programs, but it seems to me th a t White has an objectively won position.” Basically what G o o d proposed was th at the White knight could win the KB pawn via N -N 2-B 4-R 5+. This co m m en t was published in S IG A R T in F eb ru ary 1973 with an E d ito r’s N o te : “ I wrote a letter to Mr. Reshevsky, enclosing the c o rr e ­ spondence (of Dr. G o o d ) and saying, ‘It is alleged th a t “ 27 P - R 3 ” does not yield an even position as you said earlier but, assuming this is true, I d o n ’t believe you should be faulted for not realising that White m ay still have a winning advantage. After all, it was a position that occurred in the middle o f a uniformly p oor game (by master standards)’.” It is a curious note— I have never been sure exactly who o r what is being insulted— however Reshevsky replied (coldly) that he disagreed that the White knight could capture the paw n: “ Black can defend the K B P with 2 8 . . . K - B l , an d if 29 N - ( B 4 ) - R 5 , Black c o n t i n u e s . . . K - K 2 . Secondly, after 28 N - N 2 , Black equalises with 28 . . . P - K R 4 29 P - N 5 P x P 30 P x P P -Q 4 , etc. P.S. Until you can engage a G r a n d m a s te r o f * T h e best chess p r o g r a m s are all m asculine eventually.

The Crunchers

45

high repute, the c o m p u te r will never get anywhere. Samuel Reshevsky N EW Y O R K .” Meanwhile, dow n in Virginia and unaware o f Reshevsky’s response, Jack G o o d continued his investigation until 1 m onth after his first c o m ­ m ent: “ I now believe Reshevsky was right, in view o f the following line: 27 . . . P - K R 3 28 N - N 2 P - K R 4 29 N - B 4 P x P + 30 K - N 3 K - R 3 31 R - K 2 R - K 1. “ It would be interesting to know if Reshevsky saw all this or whether he ju s t used his ju d g e m e n t.” So much for w hat is prob ab ly still the most carefully analysed position in the history o f c o m p u te r chess, but the affair was not yet over. Hans Berliner, three times W orld Correspondence Chess C h a m p io n , was moved t o m ake a ‘meta c o m m e n t ’ as follows: T h o u g h I usually prefer to smile (benignly) w hen chess a m a te u rs discuss c o m p u t e r p ro b le m s, the discussion in the S I G A R T N ew sletter o f F e b ru a ry 1973 was a little to o m u c h for me. First o f all, I w o u ld th ink th a t Mr. G o o d w ould k n o w better th a n to challenge the ju d g e m e n t o f M r. R eshevsky when it com es to chess. I a m sure Mr. Reshevsky w o u ld have the g o o d sense n ot to get into a statistics d eb a te with Mr. G o o d . S econdly, such po sitions sh o u ld be analysed for the general public at a level c o m m e n s u r a t e with the play o f the c o m p e tito rs in the game. T o m easure the o u tc o m e o f a p osition by g r a n d m a s te r s t a n d a r d s w hen Class C players are involved is ludicrous. It is d o n e only in t o u r n a m e n ts when a gam e c a n n o t be finished a n d m u st be a d j u d i c a t e d , a n d I wince every tim e I am called up o n to do th a t. T hirdly, Mr. Fischer* a n d Mr. Reshevsky sh o u ld be inform ed th a t chess players o f great r e p u ta tio n a n d ability a re w o rk in g on the chess p r o g ra m m in g problem . T h e y m ay n o t w a n t to include me, since their jo in t over the b o a rd score against m e is 621H /- o w ev er, the creden tials o f Dr. M. M. Botvinnik o f the Soviet U n io n are im peccable. Besides being p r o b a b ly the greatest player o f all times (unless n o w eclipsed by Fischer), he has o u ts ta n d in g c o n tr ib u tio n s credited to him in the field o f electrical engineering. F u rth e r, I think all persons interested in chess p r o g r a m m in g o u g h t to be in fo rm ed th a t for an y o f to d a y 's chess p ro g ra m s, it w o u ld be im possible to en c o d e 90 per cent o f w h a t I k n o w a b o u t chess. T h e p ro b le m is th e usual se m a n tic d a ta base problem .

N o w Berliner’s second point had, in all fairness, been made by G o o d already, i.e. the position in question was ‘objectively w o n ’. Both men were aw are th a t chess p rogram s were, a n d still are, notorious for throwing away * “ U p till n o w th e y ’ve only h a d c o m p u t e r scientists d evelop ing such p ro g ra m s, a n d they w o n ’t get a n y w h e re until they actu ally involve so m e g o o d chess players.” B obby F isch e r, D e c e m b e r, 1972.

46

The Machine Plays Chess?

a won game. The most famous example o f this predeliction had occurred in the A C M T o u r n a m e n t o f 1971.

The Coko Incident In a game between C O K O III and G E N I E this position was reached after 27 moves.

Fig. 8

After 120 seconds’ calculation, C O K O offered a sacrificial pawn to pull the Black king out further: 28

P -B 5+

KxP

In fact C O K O had looked ahead 8 1/2 moves and seen the following mating sequence which it now played very quickly: 29

Q -Q 4 +

K-N4

(this move took 3 seconds an d C O K O , because o f Black’s K x P , had already announced the mate. The next 8 moves o f C O K O took less th an 1 second to be retrieved from its memory.)

30 31 32 33 34 35 36

K -Q 1+ P-N4 + Q-B3 K-B2 KxR K-B2 QxR

K-R4 K-R5 KR-Q1+ R-Q7 + R-Q1 + R -Q 7+ K-R6

The Crunchers

47

At this point G E N I E had th ro w n away two rooks to delay the inevitable. N o further distractions or delays were possible

37

Q-B3 +

KxP

As Reshevsky said, good com puters fight to the bitter end, and here’s the reason why:

38 39 40 41 42 43

K-Bl K-B2 K-Bl K-B2 K-Bl K-B2

P-KB4 P-B5 P-N5 P-B6 PxP PxR = Q

D o it n o w !? N o way, like the hero o f The Loneliness o f the Long Distance Runner, C O K O proves it has a mind o f its ow n:

44 45 46 47 48 49 50 51 52 53 54

K-B1 and G E N I E plods firmly back into the game . . . QxB+ K-Q2 Q xP + K-B1 Q -N 8 + K-B2 Q xP + K-B1 Q -R 8 + K-B2 Q-N8 + K-Q2 P-N6 Q -B 4 + Q-N6 QxQ KxQ P-K4 K xP P-K5 P-N7

A t this point C O K O 's au thors, Dennis C o o p e r and Ed Kozdrowicki, could stand it no longer a n d the program was resigned. After C O K O ’s display m any people would have said the game was subjectively drawn at this p o in t; G E N I E would have queened its pawn and then probably have spent the next 100 or so moves m ak ing irrelevant checks. In a later paper C o o p e r a n d K ozdrowicki adm itted th a t “ In early stages o f development, C O K O was actually winning games from casual players who did not realise t h a t (it) was unable to mate with a Queen and a R ook against a K ing in e n d g a m e .” This p h e n o m e n a o f playing very good middle games a n d then being unable to win a simple end game is still typical o f m ost chess

48

The Machine Plays Chess?

program s and has a simple explanation—end games are highly specialised a n d require hundreds o f hours for hum ans to become competent. C o m ­ puters are not specialised and it can cost £1000 per h o u r to run a program so the best thing is to try for a big tactical advantage in the middle game and thus avoid the more subtle specialities o f end games. This appro ach was, and still is, the overall strategy ado p te d by Slate and Atkin when writing C H E S S 4.0. T o return to the A C M tournam ents. The fourth took place at A tlanta, Georgia, in August 1973. The winner was (as usual) C H E S S 4.0; a c o m ­ pletely rewritten version which nevertheless showed its usual w orkm anlike style by messing up its o p p o n e n t’s pawns, advancing its own pawns and even playing out some simple end games to a win. Admittedly the competition appeared to be improving (very slightly) because C H E S S 4.0 finished this to u rn a m e n t with three wins and a draw, thus slightly blotting its perfect run. Still it was (and is) a remarkably consistent program and, in 1974, it entered the first W orld C o m p u t e r Chess C ham pionship as clear favourite to win. But this c h a m p io n sh ip had a num ber o f d ark horses, notably the Russian program K AISSA. There was also a program from England, the birthplace o f c o m p u ter chess, w hose name was M A S T E R .

CHAPTER 6

M ASTER at I FIPS T h i s ch ap ter is the story o f how a p oor but honest chess program eventually played in the W orld C ham pionship. In 1954 Professor Nils Barricelli was visiting Princeton University. The University was then a leader in the new field o f com puting mainly due to the presence o f von N e u m a n n and his development o f the (amongst others) M A N I A C machines. In a discussion with Reuben Fine, the well-known G r a n d m a s te r and psychologist, Barricelli said th at he intended to program a machine in o rder to beat Fine in chess. “ Professor Fine replied that he was sure the machine would play a p o o r game. W h ereupon we asked von N e u m a n n of his opinion. He agreed with Professor Fine on the grounds that the m achine was n o t even capable o f translating from a foreign language into a decent English.* I think that was a p oor argument, but that was anyhow his o p in io n .” In 1962 Barricelli arrived at Manchester University in order to use the Atlas co m p u ter, a machine with m any new features and probably, a t the time, the most powerful c o m p u te r in the world. His intention was to write a chess p ro g ra m which would be used to study certain theories o f evolution. I was at M anchester at the time having ju st finished a year o f com puter research. H aving also ju st got married I had turned my attention to the m u n d a n e problem s o f earning a living and was told that a Dr. Barry Chelly was looking for som eone to write a chess program for Atlas. My first j o b ever was to help write a ‘list legal moves’ generator for any chess position on a machine which was barely operational. C o o p e r an d Kozdrowicki have rem arked th at “ chess will persist, for the * V on N e u m a n n co u ld speak five languages fluently. Even m o re i m p o r t a n t — the r e m a rk is ex trem ely re le v a n t— chess has a language, a g am e is a c o n v e rsa tio n o f a kind.

49

50

The Machine Plays Chess?

problem is so exciting th at once a p rogram m er gets involved there is virtually no way he can be stopped". Personally I do not agree but I do remember th at working with Barricelli was an interesting experience which definitely sold me on a career in com puting although Manchester was an exciting place for com puter users in alm ost any subject at the time. The legal-move generator had to be as fast as possible because it would be used by symbio-organisms— numerical patterns in the machine which could reproduce and m utate— to test evolutionary theories. In order to survive and grow* these organisms had to learn how to play chess; this was their test in their battle for survival. At the time we did consider making the program play a game against a h um an (though I would stress that this was not the a im o f the project). W ithout reference to any literature we wrote a S h a n n o n - T u r in g lo o kahead (it is a very obvious model) and an evaluation function based purely on mobility. We spent a whole week on this and the results were discouraging — we could beat it easily. Nevertheless it was a useful program for testing the, then, very new Atlas and on one occasion it ran silent and deep for 20 minutes before making its opening move, P -K 4. At the time this was probably the first fully legal chess p ro g ra m to run in England (possibly the world) but Barricelli's grant ran out and, seeing no pecuniary future in the subject, I went off to earn a living doing som e­ thing useful. I was, however, left with the naive impression that a chess program could be built in three separate parts, namely: (a) list legal moves; (b) look a h e a d ; (c) an evaluation function. F o r the next 5 years I worked on systems at the Atlas C o m p u t e r L a b o r a ­ tory, mainly developing and extending an Algol Compiler. In 1967 it at last became possible to go ‘on-line’ to a p ro g ra m in the machine and I resurrected Barricelli's old program, cleaned it up, rewrote it in A L G O L and put it on the machine. This version was mainly a dem onstration program for the new on-line console. M uch o f the effort went into producing an agreeable input o u tp u t system— for example, the program would ask w hat colour the o p p o n e n t wanted, type ‘E H ? ’ if he entered an illegal move, o u tp u t its own move in descriptive form and, if required, print the current position o f the board. Its strategy was simple, it looked only 3 plies ahead and would accept almost any captures in that depth with weighting on swaps o f the more * In early tests the o rg a n ism s actually invaded the private p a rts o f the m ach in e a n d halted it.

M ASTER at IFIPS

51

powerful pieces, i.e. it would always swap a queen for a queen. If no captures were present it prepared to castle or mini-maximised its mobility. A slight modification prevented it from moving its queen in the first 5 moves. This p rogram , alth o u g h written in A L G O L , used the a lp h a -b e ta prin­ ciple a n d could respond alm ost immediately to the moves o f the oppo n en t — a n d it was fairly pathetic. O ne o f its first games was against Lord Halsbury, a weak player but one w ho knew how to get at a king side castled position— his Black queen went to K N 3 and then his bishop went to K R 6— it was all over in 20 moves. Nevertheless I felt th a t this strategy o f capturing as often as possible would fare quite well against other chess programs. Even in 1968 it was quite obvious th at chess program s could win massive material advantages and still not ‘k n o w ’ w hat to d o — M A C H A C K had clearly shown this failing on occasion. The only other chess p ro g ra m in England in 1968 was one written by J o h n Scott, then a 17-year-old schoolboy. His program actually played M A C H A C K at the E dinburgh IF IP S (International Federation of In fo rm atio n Processing) a n d ju st lost after a long struggle (see also C h a p te r 8). J o h n and I were present at a talk a few days later by Jack G o o d who analysed this game; in fact, we both rem em ber th at some o f the reasons given for J o h n ’s program choosing a move were, in o u r opinion, over-sophisticated. J o h n a n d I arranged to play o u r pro gram s against each other. I was interested to see how the simple strategy o f attrition at 3 plies would fare against a m ore sophisticated program . Only two games were possible because neither pro g ram could learn o r random ise equal possibilities. Here is one o f them

SCO TT ATLAS

1 2 3 4 5 6 7 8 9

P-Q4 P-K4 P-Q5 P-QB3 P-QN4 PxN PxB B-Q3 N-KB3

N-QB3 P-K3 B -N 5+ B-B4 N xP Q-B3 QxR Q xP PxP

attacks pawn mobility horizon effect mobility best capture horizon effect

inevitable

52

The Machine Plays Chess? SCOTT ATLAS

10 P x P 11 N-B3 12 B-Q2

Q xP Q xP N-B3

prepare 0 -0

It is a silly game with A T L A S clearly suffering from the horizon effect at moves 3 a n d 6 . Despite this S C O T T does not take full advantage, it failed to develop any pieces until move 8 and consequently got itself into trouble. So at the end o f 1968 I was fairly sure that chess program s might fool some people some o f the time but they really could not know, in any real sense, what they were doing, mainly because they were too shortsighted. Almost any chess player, provided he kept his nerve and never resigned, could— by following a simple plan o f swapping off—alm ost guarantee that even M A C H A C K would not beat him. So once again I went off to do something useful— to Paris this time where I finally learnt that any talent for writing program s has very little to do with the brave, new world o f computers. In 1972 I was back in England again and met J o h n Scott, w ho was doing a PhD , and his tu to r Dr. Alan Bond. N aturally we talked a b o u t chess program s and the recent happenings in the American A C M tournam ents. As we talked it became fairly obvious that in the intervening 4 years a num ber of new ideas had appeared on the scene. O ne idea was called ‘refutation', a technique which (like a lp h a -b e ta ) could vastly speed up the tree searching without any loss o f information (see C h a p te r 9— M achine Technique). Even more mysterious was a paper “ Multi Dimensional Structure in the G a m e o f C hess'’ by Ron Atkin, a maths lecturer at Essex University. U p to this point all chess program s had evaluation functions which were decidedly ad hoc , the program m ers had a ‘feeling in their water' th at certain features, material, mobility, control o f the centre, king safety, pawn structure, etc., were the most im portant and accordingly stuck them in the program with very little idea o f their precise effect. N o w here was a mathematician who, with lots o f squiggly things, appeared to have a pre­ cise mathematical evaluation function. U nfortunately neither J o h n n o r I could understand the paper— so why n o t get Atkin to talk a b o u t it. There were a few other new ideas I did not u n d e rs ta n d — a new, knowledge a p p ro a c h to solving end games a n d some psychological theories a b o u t how

Plate 2. T h e a u t h o r ' s d a u g h te r playing a m o d e r n chess m ach in e

Plate 3. T h e a u t h o r a n d son R ic h a rd o u tsid e R a m o n Lull’s cave o n M o u n t R a n d a (see C h a p t e r 7).

Plate 4. The

MASTER

team. Left to right: The author, Peter Kent, John

Birmingham

and John

W a ld ro n .

M ASTER at I FI PS

53

chess players think— so why not have a conference? If nothing else I might get some idea o f w hat was going on. The first C o m p u t e r Chess Conference took place at the Atlas C o m p u te r L a b o ra to ry in M ay 1973. A p a rt from inviting the speakers it was also obvious that the conference would have to d em on strate a chess program in some form a n d it is at this point in time that M A S T E R really got started. I had left my old pro g ram purely as an on-line demonstration.* Its evaluation was based simply on capturing plus mobility and, although it worked to a certain extent, had two noticeable weaknesses: ( 1) no value was given to an undeveloped piece, such as a ro ok or bishop, and ( 2) the queen tended to com e out too soon. These faults, combined with the horizon effect caused by a too shallow search, m ade the program very weak; in fact it never beat anybody. One o f the program m ers at Atlas, Peter K ent, h ad taken over the program and modified it to maximise the n u m b e r o f squares controlled. This, com bined with a few other improve­ ments, had p ro duced a much stronger p ro g ra m — as Peter later wrote T h e p r o g r a m c a p tu r e d if you gave it th e chance, m oved a piece if th rea te n ed , but still generally displayed no im ag in atio n . T h e c o m p u t e r o p e ra to rs used to play the p r o g r a m at night a n d write sarcastic c o m m e n ts o n the o u t p u t after w inning in 15 o r so m oves. I th en decided to try b u ildin g so m e so rt o f strategy into the p r o g r a m by giving the s q u a re s different values. Initially the ratio s were 3 for the central f o u r sq u a re s, 2 for the next ring o f twelve a n d 1 for all the rem ainder. T h e next night the best player a m o n g the o p e r a to rs tried playing the p r o g r a m expecting to win with his usual ease. T h e p r o g r a m o p en e d with the r a th e r aggres­ sive if u n s o u n d B la c k m a r g am b it. It th en developed all its pieces fairly rapidly, castled q u e e n side, d o u b le d its r o o k s o n the o p e n queen file a n d sto rm e d d o w n the b o a r d u sing b o th r o o k s a n d the q ueen, e n d in g the g am e with a m a te by its q u e e n o n the 8th r a n k a n d a ro o k on the 7th. T h e c o m m e n t on the o u t p u t the next m o r n in g was “ well it seems to w o rk n o w ” .

F r o m then on the o perators played more carefully and revealed th at the program , because it still only had a shallow search, still suffered badly from horizon effect. Nevertheless it did win a few more games and it was decided to use it as the d em o n stra tio n pro g ram at the conference. Well it d i d n ’t win a game, hardly surprising since it was up against much stronger players. Nevertheless several people noticed th a t the p r o ­ g ra m was usually achieving its m ain a im o f controlling the centre squares; in o th e r words, it was quite successful in doing w hat little it had been told * G e tt i n g a p r o g r a m ‘o n line’ is, even now , q u ite difficult b u t this fact was usually n o t a p p r e c i a t e d — a fte r all chess p r o g r a m s only play chess a n d are m isjudged a c c o rd ­ ingly.

54

The Machine Plays Chess?

to do but, from then on, it had no further direction other than a vague idea o f advancing its own pawns and blocking its op ponent's. Peter improved its sense o f purpose by m aking the program , as the game progressed, put less emphasis on controlling the fixed centre squares and more and more emphasis on controlling the squares aro u n d the enemy king, wherever he may be. Because o f m ini-m ax this also caused the program to protect the squares a r o u n d its own king far more effectively. This change from centre control to actively hunting the o p p o n e n t ’s king was very noticeable. A t this point a very energetic p ro g ra m m e r from Harwell Atomic Energy Research Establishment, J o h n Birmingham, became interested. He translated the program, plus all the new im prove­ ments, into PL/1 in a b o u t 6 weeks o f his spare time and also extended the depth o f the search. I would say at this point th at England at last had a program com parable to M A C H A C K and we ambitiously christened it M A S T E R — M inim ax a lg o r i th m t eSTER; if nothing else we had the patent on a good name. In M arch 1974 David Levy, the regular referee and one o f the organisers o f the American A C M tournam ents, rang me u p — did I know o f any good English chess program s? A nd, if so, would they like to enter the first IFIPS World C o m p u te r Chess C h am pionship which would take place at Stockholm in A ugust? So M A S T E R was entered, a n d for the first time we— John, Peter and myself—stopped developing the pro g ram sporadically ad hoc a n d seriously thought a b o u t how to improve it. One big problem was th at none of us was (or is) a good chess player and by then the pro g ram was beginning to beat us occasionally. So a fourth mem ber o f the team was recruited— J o h n W aldron, a sound county level player. F rom this point M A S T E R slowly began to copy W a ld ro n ’s style and, with the program now searching 6 plies deep plus a crude form o f a new technique (feedover), it to o k part in the first W orld Cham pionship. T o take p a r t in a W orld C h a m p io n s h ip a contestant merely has to arrive on time. This is comparatively easy for h u m a n s (except maybe Bobby Fischer) but much more difficult for computers. F o r a start, com puters— especially the really big ones— w ork 24 h ours a day, 7 days a week to pay for their keep. In M A S T E R ’S case we could only get a total o f 2 h ou rs sabbatical leave (in an IB M 360/195) for it to take part. A n o th e r problem is th a t c o m p u ters d o n o t travel well a n d are usually linked to the to u r n a m e n t by telephone o r teletypes. Finally c o m ­

M ASTER at IFIPS

55

puters do occasionally ‘crash', i.e. stop working, an d the rules allow only 20 minutes to recover from such situations and continue the game. All these problem s are time problem s which require a great deal of preparation to overcom e— the p ro g ra m , the links, the machine and the recovery p ro ­ cedures must all be as fast a n d as dependable as possible; if not then the p r o g ra m 's actual chess ability can count for nothing. (M an y chess p r o ­ gram m ers know more a b o u t recovery techniques th an the resident systems analysts.) M A S T E R 'S first game to o k place on the evening o f 4 A ugust 1974 and, to emphasise the peripheral problems, we were 1 h o u r late in establishing the link between o u r c o m p u te r (in Oxfordshire, England) and Stockholm. W hen we did get through, at 20.30 the first thing we asked was what was the o p p o n e n t — we had a vague idea that if it was C H E S S 4.0 then we would risk the time limits and m ak e M A S T E R search wider and longer than usual. The o p p o n e n t was T E C H 2, however, an o th e r American program with a steady, plodding nature, so M A S T E R was set to play fast (at a b o u t 45 seconds per move) a n d started as White. M A S T E R opened with the King's G a m b it and soon sacrificed a knight a la M U Z I O for heavy pressure. T E C H 2 gave up its queen for a further rook a n d bishop and, by move 40, the game had simplified (!?) to the following position (Fig. 8).

Fig. 8

By this time it was m idnight a n d M A S T E R h ad used up its q u arter ration o f half an h o u r ’s machine time. W e h ad the mistaken idea th a t an adjudica­ tion was a u to m a tic a t the com pletion o f 40 moves a n d requested one from the t o u r n a m e n t referee D av id Levy. N o t only were we mistaken a b o u t the

56

The Machine Plays Chess?

40-move limit but Levy said (correctly!) that if we did not continue then he would award the decision to T E C H 2. Convinced th at the position was ‘objectively’ drawn we stoked up the machine and ran on for an o th e r 48 moves. U nfortunately M A S T E R disagreed with us, it believed it was winning the game and disdained a draw by perpetual check (it would have done this if it th o u g h t it was losing). The final outcom e was th at T E C H 2 eventually co-ordinated its pieces, broke through and gave mate. T E C H 'S most infuriating habit in this game derived from its steady, plodding nature, it always to o k the same time over every move—even if the move was forced— so the game took until 03.30 to finish. A t the finish I had been on a phone for over 7 hours and began to appreciate the stamina, concentration (and hearing) required to take part in W orld Tournam ents. The next night we got lucky and played a n o th e r British program. This program , written by Bob Prinz, was relatively new to the game an d ‘blew u p ’ in the opening moves— it th o u g h t it had such a strong position th a t its evaluation function overflowed and it started to look for the worst moves it could play. There was also the idiotic irony o f the two prog ram s playing each other via long, expensive links to and from Stockholm when physically the machines were less than 50 miles apart. In the third round we were lucky again and played a Swiss program , TE L L . This program was also underdeveloped a n d the game was later analysed by a good player, David Pritchard, in the magazine Games and Puzzles. It is interesting to see just how good M A S T E R appeared to be at this point in its career— the point at which M A S T E R had played a b o u t 6 hours competitive chess. It is also interesting to read the chess experts’ opinions as to why the program s chose their moves. R O U N D 3. M A S T E R (white) vs. T E L L — A N A L Y S E D BY D A V I D P R I T C H A R D

1 2 3 4 5 6 7

P-K4 N-KB3 B-B4 P-B3 P-Q4 PxP K-B1!

P-K4 N-QB3 B-B4 P-Q3 PxP B-N5+ P-KR4

M ASTER at IFIPS

57

O ne can almost hear the c o m p u te r reason “ the king is on the king’s side a n d c a n n o t castle so I m ust a t t a c k ” .

8 9 10 11

Q -N3! BxP+ BxN Q -Q 5 M

B-N 5 K -Bl RxB

*

A mistake. P - Q 5 here wins a piece— b u t then com puters are only h u m an .. . . 11 12 13 14

... PxB N-B3 PxB

BxN R -R 1 BxN P-R 4

H as T E L L been told a b o u t moving r o o k ’s paw ns? 15 16

Q R -N 1 B -B 4

Q -B 1 Q -R 6 +

Clearly Switzerland, too, knows the old adage ‘never miss a check . . 17

K-K2

N - Q 1 (see Fig. 9)

Fig. 9

18

BxP+

It would be interesting to know ho w far ahead M A S T E R had been calculating a t this point. The sacrifice is certainly sound.

18 . . . 19 Q x P + 20 KR-N1

PxB K-B2 KR-N1

58

The Machine Plays Chess?

White was threatening 21

Q - B 7 + to win the K N P .

21

QR-N5

Preparing R - B 5 + when White would mate or win Black’s queen, so . . .

21 . . . 22 Q B7+ 23 R-K5 +

P-KN3 K-K1 N-K3

Black could give up here but C O M P U T E R S N E V E R R E S I G N .

24 Q x N P 25 R-N3 26 R x N + 27 Q-K7 + +

R -Q 1 Q xP K-B1

The game illustrates the very real precocity o f chess program s both in talent and speed. F o r example, how many beginners would play moves 7 and 8 ? M A S T E R really seems to know what it is doing but then blunders at move 11. The reason for this is that M A S T E R was undervaluing knights a n d also because o f the Black counter play

11 P-Q5 12 P x N

Q-Kl/2 Q xP

and Black has c o m m a n d o f the centre plus two squares next to W h ite ’s king— if the KN is lost then mate is threatened. All this was too vague and dangerous for M A S T E R ’S limited look ahead (3 moves on each side) and was rejected. The bishop sacrifice at move 18 gives white c o n ­ trol o f alm ost all the to p left o f the b oard and was so attractive th at it actually only to o k a b o u t 1 second to calculate, a very fast move even for a machine. O n the last night, having won two easy games, M A S T E R again met a tough opponent, R IB B IT from C anada. A t one p o in t in this game Peter Kent, who was in Stockholm, told us th a t if M A S T E R won th e n there was a chance th at it could play off for the c ham pionship but, unfortunately, T E C H 2 had been a costly game in sabbatical time a n d M A S T E R was set to play very quickly, missed its chances and gave away a piece. The position at move 54 was (Fig. 10) and Peter K ent asked me if M A S T E R was saying

M ASTER at IFIPS

59

Fig. 10

it w anted to resign. Actually the program had been bleating this message o u t for the previous 10 moves which ju st proves th a t com puters can resign but their a u th o r s rarely allow them to. The reason is simple— o f course the game is objectively lost b u t M A S ­ T E R had played 54 moves in a b o u t 17 minutes o f machine time and still had plenty o f time on its to u r n a m e n t clock. There are two possibilities still o p e n — W hite might blunder an d give stalemate or (if we delayed o u r forced replies) R IB B IT 's machine might crash and we could even win on a time default. U n fo rtu n a te ly the British d o not stoop to such low tactics, a n d with cries o f “ It’s taking p a rt th a t c o u n ts ! ” we rushed to o u r doom . R IB B IT quickly queened its paw n with a check a n d mated with Q - N 7 . I still w o n d e r if it could have d one it if the BK had been in Q N 8 to begin with, the urge to queen a pawn might have overridden a stalemate check b u t (as we shall see later) R IB B IT has w h a t N a p o le o n asked o f his generals, it’s a lucky program . A t the end o f the to u rn a m e n t, M A S T E R had won 2, lost 2 and, on o u r unofficial tie breaker o f ho w fast a pro g ram had won or how slowly it had lost, was placed a b o u t fifth o u t o f the thirteen contestants. Total machine time used 1 h o u r 57 minutes 27.3 seconds. D u r in g the t o u r n a m e n t we h ad not been linked directly to Peter K ent in S to c k h o lm b u t h ad been relaying o u r moves algebraically through L o n d o n where a n o t h e r chess p r o g r a m was also com peting in the t o u r n a ­ ment. This relay had caused us to use a voice code for the moves (ABLE, B A K E R , C H A R L I E , D O G , EA SY , F O X , G E O R G E , H O T E L ) and, oddly enough, we never sent o r received a bad move.

60

The Machine Plays Chess?

The troubles with this double link were time problems (not that this mattered after the T E C H game but it was never very clear if the total double transmission time was counted on o u r to u rn a m e n t clock). Also we had almost no idea what had been happening in the other games a n d no chance to modify the program between games. (In one game we had played 10 moves before finding out what we were playing.) At the end o f the to u rn a m e n t almost all we knew was that C H E S S 4.0 had been beaten for the first time in its to u rn am en t career and that the winner was K A ISSA, the solitary entrant from Russia. A bout a week later David Slate and Larry Atkin stopped over in Eng­ land on their way back to America. They had come second and even played KAISSA to a draw in an exhibition game after the to u rn a m e n t proper. With their recollections (and later, those o f Peter Kent when he returned) we were able to piece together what had happened in some o f the other games plus some o f the atmosphere. The most striking thing a b o u t a com p uter chess to u rn a m e n t really is the atmosphere. It is a noisy circus with the audience free to loudly co m m e n t upon, criticise or applaud the moves o f the contestants— a freedom which is fully indulged. A part from this noise there is the clatter o f teletypes, the hum o f the machines which are there ‘in person’ and people shouting moves into telephones. On to p o f all this noise and confusion the to u rn a m e n t referee, David Levy, was giving an official com m entary on the games as they progressed on big display boards. Levy is an International M aster who gives a unique performance on such occasions, he has a tendency to ask the a u t h o r o f a program why it has just played a move— usually a bad move. The a u th o r often squirms, mumbles and David Levy then announces loudly over the public address system: “ T H E A U T H O R SAYS H E D O E S N ’T K N O W W H Y HIS P R O G R A M P L A Y E D T H A T M O V E . ” All good stufT but computers, like elephants, never forget and perhaps one o f these days (a wishful thought) a program is going to ask Levy the same question. The real sensation o f the to u rn a m e n t was C H E S S 4 .0's first loss to a n o th e r program. This happened on the second night when its o p p o n e n t was C H A O S , an o th e r American entry. The following position was reached after 15 moves (Fig. 11). C H A O S played 16 N x P ! ! — a move which has been acclaimed as the “ finest ever made by a computer. White evaluates th a t his d o m in a tio n o f

M ASTE R at IFIPS

61

C H E S S 4.0

CHAOS Fig. 11

open lines is com pe nsation for a piece. This judgem ent is absolutely correct." O f course the piece is not sacrificed entirely and play continues in a very similar fashion to M A S T E R ' s sacrifice o f a bishop to T E L L .

16 . . . 17 Q x P +

PxN B-K2

C H A O S then developed quickly and put on the pressure

18 R-K1 19 B-KB4 20 QR-Q1

Q -Q 1 K-Bl R-R2

and, alth o u g h C H E S S 4.0 was defending well, C H A O S had a grip on the game which it never lost. T h e ending was an anticlimax. A t move 52 the position was (Fig. 12)

Fig. 12

62

The Machine Plays Chess?

a won game but C H A O S displayed a typical weakness o f chess programs by taking another 27 moves to effect the mate (it can be done in only nine moves: R - K 5 then W K x P and queen the rook pawn). This slow win was later to cost C H A O S the chance o f a playoff for second place. At the end o f the game, David Levy asked one o f the C H A O S a u th o rs why it had played the knight sacrifice only to receive the usual reply. However, the a u th o r was then heard to m um ble that he'd “ m ake d a m n sure th at it never does it again” . A part from the game there were other, more mechanical problems. T w o incidents th at occurred in ro und 3 were particularly amusing. The first again concerned C H E S S 4.0 who was playing O S T R I C H , yet an o th e r American program, which derives its nam e from the horizon effect. O S T R I C H runs on a dedicated N o v a c o m p u ter which is so small and mobile th at it was wheeled into the to u rn a m e n t hall and is driven with a dem ountable disc pack. A t move 31 the N o v a teleprinter began to give trouble and M onty N ew born, the a u th o r o f O S T R I C H , decided to remove the disc pack, get on a m o to r bike and try to find an o th e r N o v a com puter. Slate waited patiently in the to u r n a m e n t hall conjuring up visions o f N ew born roaring round Scandinavia trying to catch an o th e r N o v a c o m ­ puter and perform a mind graft in order to continue the game. Contestants are allowed 20 minutes in the event o f machine failure so O S T R I C H was only in slight trouble when N e w b o rn eventually stuck O S T R I C H ’s head into a n o th e r N o v a a n d was able to continue over a telephone link. Despite all these heroics O S T R I C H lost on the 48th move.* Meanwhile a second incident had taken place between K A ISS A , the Russian program named after the goddess o f chess, and C H A O S . T h e Americans had input a Russian rook move incorrectly at move 27 (a c o m m o n human error when rooks are sharing ranks or files) an d the result had been an app aren t mate in two for K AISSA . The telephone link to M oscow had rung off before the C H A O S team discovered their e rro r a n d appealed to David Levy to restart the game. Efforts to contact M oscow were unsuccessful— probably the Russians were to o busy celebrating with v o d k a — so the audience was treated to yet a n o th e r new spectacle; the sight o f two h u m a n s trying to play chess like a computer. * M ach ines th a t can b alan ce poles o n m o v in g ca rts a n d , possibly, ride m o t o r bikes have been developed by P rofessor D o n a ld Michie.

M ASTE R at IFIPS

63

T h e two h u m a n s were David Levy and Dr. Mikhail Donskoy, one of K A l S S A 's authors. The situation was doubly ironic for Levy because he is a master chess player w ho has bet th at no program will beat him before 31 August 1978. Eventually Levy an d D o n sk o y came up with an 11-move continuation which gave a win for K A IS SA . This win would become official unless M oscow could be contacted early the next afternoon and continue the game before the final round. At 5 o'clock the next day the Russians phoned in to find o u t which p ro g ram they were to play in the final round. W hen told the circumstances they sportingly agreed to restart the game and were delighted to see K A IS S A find a 9-move con tinuation to mate, i.e. 2 moves better than the h u m a n simulators. U nfortunately n o b o d y asked Levy why he had chosen his moves. A t the end o f the to u rn a m e n t D o n sk o y was presented with a gold medal don ate d by the well-known publisher Mr. Robert Maxwell. K AISSA had won a n d the contestants, particularly the Americans, began to analyse its performance. P ro b ab ly the best analysis so far is by Dr. H ans Berliner: T h e m o st intrig uin g q u e s tio n fro m th e whole event is “ w hat is the stru ctu re o f K A I S S A ? ” W e n o te th a t in all its gam es it had at one poin t o r a n o t h e r a very b a d position . F re q u e n tly , it b lu n d e re d right after leaving its o p en in g book . D e sp ite these e rro rs , K A I S S A m a n a g e d to o v erco m e its disadvantages. This a p p e a r s to be d u e to th e m o re error-free n a tu r e o f its su b seq u e n t play. N e v erth e­ less, this raises the q u e s tio n as to w hy it s h o u ld m a k e e rro rs in w h a t m ost p r o ­ g r a m m e r s w o u ld c o n s id e r sim ple positions.

Berliner chose the m o s t outsta n d in g erro r as move 8 in the post t o u r n a ­ m en t game against C H E S S 4.0.

C HE SS 4.0 1 P-K4 2 PxP 3 P-Q4 4 N-KB3 5 6 7 8

KAISSA P-Q4 N-KB3 N xP P-KN3

B -K 2 0 -0

B-N2 0 -0

R-K1 N-R4

B-B4 • • •

64

The Machine Plays Chess?

So far KAISSA had played from its book but now it had to co m p u te a move and came up with

8 ...

P-K4

A move which, in Berliner's opinion, gave a significant ad vantage to C H E S S 4.0; also a move which “ no self-respecting class 'B' player (1600— 1800) would admit having made (if he made it and was shown the analysis, he would claim to have been sick, etc.)” . C H E S S 4.0 likes to mess up its o p p o n e n t's pawns so it took full a d v a n ­ tage o f the error

9 10 11 12 13 14 15 16 17 18 19

NxB PxP QxQ? B-KN5 N-R3 P-QB3 N-B4 B-B3 B-R6 QR-Q1 RxR

PxN N-N5 RxQ R-Q2 BxP N/5-B3 P-QR4? P-B3 P-R5 RxR K -R1?

At this point Berliner stated that the game was ‘essentially w o n ’ for C H E S S 4.0, i.e. it should win nine times o u t o f ten from the position.

20 21 22 23

BxN P-B4 PxB PxP

NxB P-N4 PxN R -Q 1

If K A IS S A ’s o p p o n e n t were a class ‘B' h u m a n then this would be a h o p e ­ less end game. U nfortunately for C H E S S 4.0 the Russian p ro g ra m notice­ ably tightened its play from this point and a draw was finally agreed at move 65. A disappointm ent for Slate and Atkin but even worse was to come. The fifth United States C h am p io n sh ip took place a few m o n th s later a n d was won by R IB B IT; included a m o n g R IB B IT 's perfect four-point trium ph was a victory over C H E S S 4.0, their third en counter an d third time lucky.

M ASTE R at IFIPS

65

N o w the reader should recall th at M A S T E R had lost two games in the W orld C h a m p io n s h ip — one to R IB B IT and the other to T E C H 2. We were therefore particularly interested to read that the following position had been reached in the third round game between M A S T E R 's victors (Fig. 13). R IB B IT

TECH 2 0 Fig. 13

It was T E C H to play its 23rd move and, in its usual plodding way, it had ju s t sat there a n d eventually time faulted— how lucky can you get? (The closest equivalent in h u m a n play was probably Reshevsky missing a matein-two in a world ch am p io n s h ip qualifying round.) A n d so by the end o f 1974 it was becoming clear to more and more people that the best chess program s were still capable o f the most pathetic blunders. Suggestions, com m ents a n d criticisms began to a p p ear from people outside the field o f c o m p u te r chess programs. M any o f these people stated t h a t all the W orld C h a m p io n s h ip and the fifth A C M to u rn a m e n t h a d show n was th a t the brute-force ‘crunchers’ still d id n ’t know w hat they were do ing— w hat the pro gram s needed was less searching throu gh massive trees a n d m o re o f th a t intangible asset— K N O W L E D G E , the phlogiston o f the Artificial Intelligentsia.

CHAPTER 7

The Knowledge Game F i f t e e n miles east o f Palma on the island of M ajorca is M o u n t R anda, a

huge saddle-shaped mountain which rises abruptly from the s u rro u n d in g countryside. Just below the summit is a cave in which a Spaniard, R a m o n Lull, first conceived the idea o f machines ( ars magna) which would be capable o f analysing all hum an knowledge. He called his m ethod the ‘art o f finding tr u t h ’ (ars inveniendi veritatis) and actually built some machines to d e m o n ­ strate the method. He was the first person to attem pt to build a dispas­ sionate machine. The most complicated machine, the figura universalis, had fourteen concentric wheels and was capable o f searching through a staggering num ber o f possibilities in almost every topic o f h u m a n knowledge. One very practical use o f simpler ars magna was a method for producing new topics for sermons; a method which Lull described in a b ook together with 100 sample sermons produced by the machine. Unfortunately for Lull his work is not well known or treated seriously nowadays; this despite the fact that a monastery to preserve his w ork an d his machines now stands on the sum m it o f M o u n t R a n d a and a statue o f him was erected in Palma City in 1967. The problem is partly the suspicion th at m any people have for M achine Intelligence. The subject is also particularly vulnerable to satire o f which probably the most famous example occurs in Gullivers Travels by J o n a t h a n Swift. We crossed a walk to the o th e r p a rt o f the A c ad e m y , w here, as I have a lre a d y said, the p rojectors in speculative learning resided. T h e first p rofessor I saw was in a very large r o o m with fo rty pupils a b o u t him. A fter sa lu ta tio n , observing me to look earnestly u p o n a fram e, which t o o k u p the greatest p a rt o f b o th the length a n d b re a d th o f the ro o m , he said p e r h a p s I might w o n d e r to see him e m p lo y ed in a project fo r im p ro v in g speculative k n o w ­ ledge by practical a n d m echanical o p e ra tio n s . But th e w o rld w o u ld s o o n be

66

The Knowledge Game

67

sensible o f its usefulness, a n d he flattered him self th a t a m o re no ble exalted th o u g h t nev er s p r a n g in a n y o th e r m a n ’s head. E very on e knew how lab o rio u s the usual m e t h o d is o f a tta in in g to a rts a n d sciences; w hereas by his contrivance, the m ost ig n o r a n t p erso n at a re a so n a b le charge, a n d with a little bodily la b o u r m a y write b o o k s in p h ilo s o p h y , poetry, politics, law, m a th e m a tic s a n d theology, w ith o u t the least assistance fr o m genius o r study. H e then led m e to the fram e, a b o u t the sides w h e r e o f all his pupils sto o d in rank s. It was tw enty foot square, placed in the m id d le o f the r o o m . T h e superficies was c o m p o s e d o f several bits o f w o o d , a b o u t the bigness o f a die, b u t so m e larger th a n others. T hey were all linked to g e th e r by slender wires. T hese bits o f w o o d were covered o n every sq u a re w ith p a p e rs p asted o n th e m , a n d o n these p ap e rs were w ritten all the w o rd s o f th e ir la n g u a g e in their several m o o d s , tenses a n d declensions, but w ith o u t any o rd e r. T h e p ro fe s so r th en desired m e to observe, fo r he was going to set his engine at w o rk . T h e pupils at his c o m m a n d to o k each o f th em hold o f a n iron handle, w h e r e o f th ere were fo rty fixed r o u n d the edges o f the fram e, a n d giving them a s u d d e n tu r n , the w hole d isp o sitio n o f the w o rd s was entirely ch anged. H e then c o m m a n d e d six a n d thirty o f the lads to read the several lines softly as they a p p e a r e d u p o n the fr a m e ; a n d w here they fo u n d three o r fo u r w o rd s together th a t m igh t m a k e p a rt o f a sentence, they dictated to the fo u r rem a in in g boys w ho were scribes. T his w o rk was rep e ated three o r fo u r times, a n d at every tu rn the engine was so co n triv ed , th a t the w o rd s shifted in to new places, as the sq u a re bits o f w o o d m o v e d upside d o w n. Six h o u r s a d ay the y o u n g stu d e n ts were e m p lo y ed in this la b o u r, a n d the p ro fe s so r sh o w e d m e several vo lu m es in large folio alread y collected o f b ro k en sentences, w hich he intend ed to piece together, a n d o u t o f those rich m aterials to give the w o rld a c o m p le te b o d y o f all arts a n d sciences; which how ever might be still im p ro v e d , a n d m u ch expedited, if the public w ou ld raise a fu n d for m ak in g a n d e m p lo y in g five h u n d r e d such fram es in L a g a d o , a n d oblige the m a n a g e rs to c o n t r i b u te in c o m m o n their several collections.

T h e similarities between the Lullian machine described by Swift an d a m o d e rn c o m p u te r are strikingly prophetic, particularly the bits linked together by slender wires an d the vast a m o u n t o f useless output. N ote also how a lack o f funds is the big obstacle. Tout ca change. But to return to more recent times. As we have seen, by the end o f the 1950s there was a general air o f pessimism by pioneers in the subject to which only Professor H erb ert Simon o f the Carnegie Institute was an exception. In the early 1960s new ideas were sought and one o f the most interesting directions in this quest was to see whether a com puter could be p ro ­ g r a m m e d to learn to solve problem s; this being one o f the most obvious weaknesses o f chess program s even nowadays. This a c c o u n t o f some early experiments, reported in 1961 from Bell Laboratories, started from the observation th a t animals, when set a mechanical problem , usually m ake purely r a n d o m actions to begin with (so did Barricelli’s symbio-organisms), a n d then often find the solution by

68

The Machine Plays Chess?

accident. This r a n d o m activity seemed to be fundamental to acquiring knowledge a n d it was argued th at the reason machines did not learn very well was because they were not sufficiently random . T o overcome this problem Dr. R. M organ proposed the design o f a new type o f machine, the C H A O S T R O N . The machine was designed from 14,000 Western Electric wiring charts which had been cut into 2-inch ( 5-cm) squares, thoroughly shaken up in a large sack and then glued into sheets o f appropriate size by a blindfolded worker. Careful checks were made during the entire process to ensure random ness and statistical tests were run to make sure that no unsuspected regularities could occur. U nfortunately this machine was never built but an a tte m p t was m ade to simulate it in an IBM Stretch com puter (so called because it stretched the technology at the time). The simulation language, Y A W N , was chosen because it contained at least as much ambiguity as a natural language hence there was no chance th at the machine might get an accidental clue as to what it was supposed to do. Unfortunately this simulation was not possible either a n d so the experi­ ment was eventually done by simulating Stretch simulating C H A O S T R O N on an IBM 704. The problem for the machine was that it would be given a sequence o f circles, squares or crosses (these patterns were punched on to cards) and was required to print, after examining each card, the word ‘circle’, ‘square’ or ‘cross’. After 133 runs the machine had only made three responses— one o f them was to eject the line printer paper twice. Usually the machine ran for an h our or so with no response and the au th o rs concluded th a t its rate o f learning under these conditions was very low— approximately 10-6 c o n ­ cepts per megayear. A t this point, despite this promising start, the project encountered budget difficulties (in fact the last 133 runs had been m ade after the funds had run out) and it was unfortunately abandoned. So the prospects for a program to learn by itself how to play chess seemed extremely expensive and therefore bleak. However there was an o th e r possibility, in fact a possibility much more similar to how h u m a n s really improve their own gam e— why n o t give the machine some chess books to read? T he first (indeed only) a tte m p t along these lines was m ad e by B a rb a ra J. H u b e r m a n a n d is described by her in A Program to Play Chess End Games , published in 1968.

The Knowledge Game

69

Strictly speaking H u b e r m a n 's research was concerned with the process o f translating a problem solution written for h u m an s into a form th at could be used by a com puter. The three simple end-gam e problems chosen for translation were the White king and (rook), (2 bishops), (knight and bishop) versus the Black king. M ost chess books would devote a b o u t one page to each o f these problem s; in H u b e rm a n 's thesis o f 168 pages the K, R occupies 16 pages o f explanation, the K, 2B occupies 34 pages and the K, B, N occupies 52 pages. Consider part o f C a p a b la n c a 's explanation (for h u m a n consumption) of the K, B, N ending. Given th at we have m anag ed to reach the following position (Fig. 14).

Fig. 14

“ T h e second an d last p a rt will consist in driving the Black king from Q R 8 to Q R 1 in order to mate him (* means forced move).”

10 11 12 13

N -N 6 + B-B7 B-N8 N-Q5

K-R2* K-R3* K-R4* K-R5 2

Black tries to m ake for K R 8 with his king. White has two ways to prevent th a t . . the following is more methodical and more in accord with the spirit o f all these endings, by using the king as much as possible:

14 15 16 17 18

K-B5 N-N4 B-B4 B-K5 K-B4

K-N6 K-B6 K-N6 K-R5 K-R4

3 4 2 2 2

70

The Machine Plays Chess? 19 20 21 22 23 24 25 26 27 28 29

B -B 7 + N -Q 3 B -N 6 N -N 2+ K -B 3 K -B 2 B -B 5+ N -Q 3 B-N4 N -B 1+ B-B3 + +

K-R5 K -R6 K-R5 K -R 6 K -R 7 K -R 6 K-R7 K -R8 K-R7 K -R 8

* (cf. move 13). * 2 * * 2 * * * *

“ It will be seen that the ending is rather laborious. There are two o u t ­ standing features: the close following o f the King an d the control o f the black squares by the bishop and white squares by the knight.” N o w the above is usually quite sufficient explanation for an intelligent h u m a n to learn how to play the ending. C ap ab lan ca assumed th a t the knowledgeable reader would fill in the details when the BK's move is-not forced. N o w this filling in o f detail is by no means trivial. C a p a b l a n c a ’s ex p la n a­ tion might be ‘sufficient’ for a h u m an, but is quite inadequate for a c o m ­ puter— a vast a m o u n t o f additional information must be given to the machine. F o r example, the machine must be explicitly warned a b o u t creating positions where the N an d B are too close to the BK and too far from the W K . One such situation is (Fig. 15)

I

Fig. 15

in which, if B K - Q 4 , then white will lose a piece.

The Knowledge Game

71

In o rder to guard against producing such situations H u b e r m a n ’s p ro ­ gram used the following test (qb = q u e e n ’s bishop, d = distance) [it d (k t,q b )^ 2 a n d d(bk,qb ) ^ 2 and d(bk,kt ) ^ 2 then white could lose a piece]. H u b e r m a n 's p ro g ra m used this, and similar tests, to w ork out its moves. The above is one o f the simplest and more understandable, however: “ Sometimes it will be necessary to move the knight before the king move can be made. This knight move is a tem po move; it must satisfy kt move (.p,q ) = { k tP = k t q V [dq(\\'k,bk) = 2 A 0 0 ) > 4 A location ( p ,k tQ,ar(s(p ) ) ) = —1 A d(ktq,c(ar(s(p)))) = s ( p ) - 2) v ( s ( p ) = 4 A location ( p,krQ,ar(s(p ) ) ) = 0 v[location ( p ,k tq,ar(s(p ) ) ) = — 3 A d(ktq,c(ar(s(p)))) = 4 ])]}” is an example o f the more complicated tests m ade by the program. Professor D onald Michie has said th a t the highest level o f machine intelligence “ is a ‘knowledge m achine’ able to find out how to do things by reading b o o k s ” . Conversely we might say th at the highest level o f h u m a n intelligence is a person able to find o u t how to do things by reading a c o m p u t e r pro g ram which actually does them. Personally I a m n o t to o fond o f H u b e r m a n ’s app ro ach , it exposes the weakness a n d hides the strength o f a com puter. The title o f the paper is “ A P r o g r a m to Play Chess End G a m e s ” a n d the first impression one gets is th at end games m ust be horribly difficult to program. This is n o t so: a p ro g ra m which can search ahead only 2 plies almost entirely ensures that it will not lose a piece in any o f these three simple endings, thus removing a great deal o f H u b e r m a n 's mind-boggling tests. A p a r t from this it is quite sufficient (for the R a n d B, B endings) to only give an incentive to bring the kings together an d then search for moves which constrict the BK, to perform the mate. In the case o f the B, N ending the program has to also be told which corner to drive the BK into b u t this is n o t difficult either. T h e tree-searching a p p r o a c h plus minimal knowledge is, however, criticised by the School o f Knowledge as being insufficient a n d inefficient. T h e tree-search p ro g ra m s d o n o t play perfectly a n d can take up to 10 moves m ore th an they really need for H u b e r m a n ’s three examples (although they always finish within the 50-move limit). However, it does seem obvious th a t a simple p ro g ra m which, in a total o f 10 seconds machine time, can

72

The Machine Plays Chess?

give mate inside the 50-move rule is more efficient than a complicated program which plays each end game perfectly (with specialised rules) and can take 10 minutes machine time. Unfortunately it is difficult to make genuine comparison because the Knowledge School rarely write a working program. In actual fact H u b e r m a n ’s program was not a ‘perfect player', it used the ‘killer heuristic’ which “ introduces playing inefficiency but is used because the time saved is more im p o rtan t". It is a pity that this first mention o f the ‘killer heuristic’ was so buried in a mass o f daunting mathematical notation because it is one o f the more useful tricks in the modern co m p u ter chess program m ers repertoire. It would be unfair to dismiss H u b e rm a n 's work as making a m ountain out o f a molehill. The fact is that a player (hum an or machine) can often get away with second-rate moves in the middle game but most end games are much more sensitive as to the choice o f move. It is not ju st a m atter of the 50-move rule; often the choice o f move can be the difference between winning and losing. The fact th at the best chess program s were ‘strong a m a te u r s ’ in the opening and middle game (about class B) and often quite pathetic in the end game had indeed been clearly dem onstrated in the 1974 World C h a m ­ pionship. In the case o f M A S T E R we were quite aware that it was usually unable to win if it got to Q , K vs K situation but this was a problem which h ad had to be shelved temporarily in order to concentrate on its opening and middle game— after all what is the point o f a pro g ram which can win end games if it never gets to a won end game? After M A S T E R ’S 2-hour sabbatical in an IBM 360/195 for the World C h am p io n sh ip it was difficult to m ake a case for any more machine time. The program, yet again, went into an hiatus relieved only by a d e m o n s t ra ­ tion against the H am pstead Chess Club on 31 August 1974. A t this point in time M A S T E R not only lacked knowledge for end games but was also extremely vulnerable in the openings. One o f the H am pstead players, T h o m a s Caswell (rating 1825/153), had watched M A S T E R play (and lose) a few games before it was his turn. Caswell knew th a t he could beat the program by merely repeating the moves o f any previous game the pro g ram had lost— an im p o rta n t psychological point. He also knew th at the pro g ram was set (if White) to play G I U O C O P I A N O opening, so he decided to entertain b oth himself and the audience with the W ilkes-B arre trap.

The Knowledge Game Master

73

Caswell

1 P-K4 P-K4 2 N-KB3 N-QB3 3 B-B4 N-B3 at this point M A S T E R cam e out o f its book a n d began calculating 6 plies ahead. It saw it could take the K B P so

4 N-N5 5 NxBP 6 K xB

B-B4 BxP+

M o st people prefer 6 K - B 1 but K x B has been played in M A S T E R ’S games a n d is acceptable.

6 ... 7 K-K3

N xP+

M A S T E R is determ ined to have the ro o k but, according to Caswell, this was a real surprise: “ Actually it was this which probably won the game for W hite because I have never seen a reported game in which White did n o t retire the K by 7 K - N 1. I was therefore from that m o m e n t entirely on m y o w n .”

7 8 9 10

... NxR KxN KxP

Q-K2 Q-N4 + P-Q4 +

If B x P there i s a nasty B Q -B 5 + 11 K - Q 3 Q - Q 5 + 12 K - K 2 B - N 5 + and the X -ray feature tells M A S T E R th at its Queen is lost so it ‘horizons’

10 . . .

P-K5 +

A t this po int both Caswell a n d the audience knew he should win, he actually has m ate in 4 b u t missed it.

11 K x P

...

a n d M A S T E R , 60 miles aw ay in Oxfordshire, could no longer ignore the inevitable loss o f the Queen with the horizon effect and began whining th at it w anted to resign, b u t prog ram s are n o t allowed to resign, a n d it was w hipped on

74

The Machine Plays Chess?

11 12 13 14 15 16 17

B-B4 + B-N5 + K-B3 K-B2 BxQ B-B7+ K-B1 N-K4 RxB B-N3 N -N 5+ K-N1 P-KN3 • • •

and M A S T E R had weathered the storm. It had also recovered its c o n ­ fidence and now began to develop

18 P-Q4 19 R-B1+ 20 P-KR3 21 B-B4 22 B-K5!

Q-R5 K-N2 N-B3 RxN ...

a beauty, M A S T E R X-rays through both the knight a n d the king a n d ignores the pawn capture; Caswell no longer had control o f the game.

22 . . . 23 N-B3 24 R-B4 25 N-K4

R-B1 P-B3 Q-N4 Q-R4

Caswell intended to get his Queen out o f trouble via K7

26 N x N Q-K7 27 N -K 4+ K-R3 and the black rook can be taken for a knight but, even better, is the forced

28 R -R 4+ Q-R4 29 R x Q + K x R 30 R-KB1 R x R + (note th at h u m a n s never give up against co m puters in these enlightened times)

31 K x R K-R3 32 P-B3 K-R4 33 B-KB4 P-KR3

The Knowledge Game

75

34 N-B6 + K-R5 35 P-N3 + K x P 36 B-K6 + K-R7 a n d M A S T E R claimed the win because o f

37 N -N 4 + K-R6/8 38 N-B2 + K-R7 39 P-N4 + + The m ost im p o rta n t thing a b o u t this game is th at Caswell had thoroughly enjoyed himself: “ It was my deliberate policy to a d o p t a critical and d a n g e ro u s defence as I th o u g h t this would be more entertaining bo th for the spectators a n d myself altho ugh clearly, if one is o u t for a win against a co m p u te r, it is wiser to a d o p t a careful positional line an d wait for the c o m p u t e r to m ak e a weak move as it seems inclined to do a t the later stages o f the g a m e .” In other words, play safe a n d beat the machine in the end game where it is very weak. O f course M A S T E R should have lost this game at move 10 by Black playing B - K 3 + . A n o th e r example o f it falling into an opening trap was the ‘Blackburne shilling g a m e ’ :

M ASTER

1 P-K4 2 N-KB3 3 B-B4



P-K4 N-QB3 N-Q5?

M A S T E R c an take the K P, so in it goes, boots first

4 N xP

Q-N4

Quite g o o d players can miss w hat is happening an d still play 5 N x B P b u t Q x N P . M A S T E R sees this and does its best

5 BxP+

K-K2

6

QxN

0-0

7 P-KB4 a n d on the whole, m anages to wriggle o u t o f the error with a reasonable development. While M A S T E R was in p o st-C h a m p io n sh ip mothballs we cleaned up its closet o f b o o k openings so th a t it would no longer fall into m an y o f these

76

The Machine Plays Chess?

opening traps. It is possible to do this without running the p rogram , in fact it is possible to rewrite a whole chess program without ever testing it and for a couple of m onths this is precisely what happened in particular feedover was debugged and cleaned up. All these paper improvements should (so we estimated) allow M A S T E R to run much faster. It would be able to search ahead 7 plies normally but, if conditions allowed (time or simplicity) the pro gram was now capable o f ‘changing gear’ ; to search 9 plies ahead and, under really favourable conditions, it would search 11 plies ahead in the simpler end games. The problem was how to get machine time to test and de-bug the improvements. World C ham pionships are a good excuse but unfortunately only take place every 3 years— fortunately help appeared in the cheerful form o f Professor D onald Michie. Professor Michie is the head o f the Artificial Intelligence D ep artm e n t o f Edinburgh and possibly Britain's leading expert on M achine Intelligence. H e had been invited to chair the first C o m p u t e r Chess Conference but, because he could not select the speakers himself, had declined. Quid pro quo, in N o v em b er 1974 Professor Michie asked me if I would like to help organise and chair the second C o m p u t e r Chess Conference at Balliol College, Oxford, and this time it was my turn not to choose the speakers. As the proposed speakers included Mikhail D onskoy, one o f the au th o rs o f K AISSA, and H ans Berliner there was no question o f my refusing the offer. It also gave us an excuse and a reason to run M A S T E R again, for an exhibition at the conference. Between December 1974 and M arch 1975 M A S T E R was able to run on an IBM 360/195 for about 40 minutes on Sunday afternoons providing the machine was fairly idle. It was in this period that Peter K ent and J o h n Birmingham produced a program which could be co m pared favourably with the best Russian and American programs. We knew this because the machine was matched against better and better players whose ratings were eventually equal to K A IS S A a n d C H E S S 4.0, i.e.— 1750/144. O n 9 M arch M A S T E R played M artin D uck (rating 1744/143). After 30 moves the position was (Fig. 16)

The Knowledge Game

77

DUCK

MASTER Fig. 16

i.e. the p ro g ra m was ahead by two pawns. It steadily exploited this advantage and, after 49 moves, the position was (Fig. 17)

Fig. 17

which is a clear-cut win for White if it uses the knight as a sacrificial block ( N - R 4 ) to gain time to queen first. O f course this was much too far ahead for M A S T E R to appreciate so the sacrifice was not made. Duck queened first and, m uttering som ething a b o u t being late for tea, he left. J o h n W a ld ro n , M A S T E R ’S tutor, to o k over an d produced the following position after 73 moves (Fig. 18).

18

The Machine Plays Chess?

Fig. 18

At this time M A S T E R , W a l d r o n ’s alter ego, had been taking a beating regularly every Sunday for a b o u t 2 m onth s and they were bo th possibly losing heart. However, the following was really an experiment to see if M A S T E R could win a simple end game:

14 N-R2 75 K-R3 76 K x Q

Q -Q 4 + QxN!.

(this took the prog ram 6 milliseconds to calculate)

76 77 78 79 80 81 82 83 84 85 86

• • •

P-R7 P-R8(Q) K-N3 Q-B3 K-B3 Q-Q5 + Q -Q 6 + K-Q3? Q -B 6+ Q-B4 +

K-B4!! K-Q5 K-K4 K-Q5 K-B4 K-N4 K-N3 K-N4 K-R5 K-N5 K-R4

By then it was obvious th a t the program had no idea how to win the game. In fact the White king eventually wandered off to K 2 a n d then B2 and the experiment was stopped. The next Sunday M A S T E R played as Black against Bob M a y b u r y

The Knowledge Game

79

(rating also 1744). After M a y b u r y 's 26th move the following position was reached (Fig. 19):

Fig. 19

A h a p p y smile spread over J o h n W a ld ro n 's face as M A S T E R , after 10 seconds calculation, played 26 . . . P -Q 4 ! M a y b u r y immediately saw the reason for the move and muttered “ T h a t pawn a in 't going now here". Nevertheless he sat an d th o u g h t for alm ost 5 minutes before playing on . . .

27 P x P 28 B x P 29 P-QR4 30 P-KN4

P-K5 NxB B-Q2 P-B3

So for the second time in a week M A S T E R was, after 30 moves, ahead in a game against a player whose rating equalled th at o f the best chess p r o ­ grams. M a y b u r y now offered the pro g ram a draw by repetition which it refused

31 K-N2 32 K-B3 33 K-N2 34 K-B3

K-B2 N-N4 + N-K5 N-B6

T h e game continued but, as usual, M A S T E R eventually blundered in the end gam e a n d resigned yet again. T h e next week, Sunday, 23 M arch, was the day before the Chess C o n ­ ference started and, as a special treat, it was hoped th a t Bill H artston, the

80

The Machine Plays Chess?

current British cham pion, would give M A S T E R a game. U nfortun ately he had a prior a p p o in tm en t but fortunately Dr. Hans Berliner (rating 2376/222) said he would play it. M ost o f the conference speakers, including D onald Michie and Ron Atkin, turned up at the Atlas C o m p u te r L aboratory to watch this game. All of us knew that the result was inevitable and the main interest was how long the program could last against a really good player like Berliner who also knew how chess program s worked. I later described what happened in a rather flippant article for the Computer W eekly : Berliner has beaten m ore chess p ro g ra m s th a n he has had cold buffets with a g o o d wine. W h e n he arrived at A tlas his d in n e r a n d M A S T E R were w aiting fo r him, a n d the following are extracts fro m the log o f the gam e (for M read M A S T E R , fo r H read H A N S , for O read op era to r). M : R ight, w h o ’s first for a b ea tin g ? O : O K . H a n s is Black. M : G1 F 3 ; N - K B 3 . O : H a n s is eating at the m o m e n t. M : Surely n o t food for th o u g h t? H : M u n c h , M u n c h . B8 C 6 ; N - Q B 3 . M : C ru n c h c r u n c h — T h a t ’s not in my book . Silence for 24.3 seconds while M A S T E R rum inates. M : C2 C 4 ; P - Q B 4 N o d e s 24000 value 25. H : E7 E5. M : (trying to tra n sp o s e back into b o o k a n d failing) C r u n c h C r u n c h C ru n c h . . . . M : D2 D 4 ; P - Q 4 N o d e s 57000 value 25. (interval) M : Is H a n s m u n c h in g o r cru n c h in g ? H : Yes, E5 E4. Berliner later went th ro u g h the gam e, sh o w n co m p lete in T a b le 1, ex p lain in g so m e o f his early moves. T h e first one ( N - Q B 3 ) is s t a n d a r d practice for g o o d p lay e rs— d o n 't let w eaker o p p o n e n ts (particularly m achines) play b o o k openings. Berliner ‘tested’ the p r o g ra m twice to try tangling up its d e v e lo p m e n t; there were little trap s, which he know s p r o g r a m s like C H E S S 4.0 (the A m e ric a n p r o g r a m ) are liable to fall into. M A S T E R avo ided the tra p s a n d developed q uite well; in fact by m ove 11 it had a slight a d v a n ta g e , th r e a te n in g P -Q 5 , a n d Berliner h ad to play chess for a while ra th e r th a n c o n tin u e the in te rro g atio n . T h e fact th a t M A S T E R lost the g am e eventually was n o su rp rise to an y o n e . Berliner has a ratin g o f 222 (British) w hereas M A S T E R only rates a b o u t 170 in the o p e n in g a n d m iddle gam e. This d r o p s to a b o u t 30 for en d gam es w hich, in this case, it hardly got into. T h e p r o g r a m ’s a u t h o r s were very pleased with its p e r f o r m a n c e against a player o f Berliner’s calibre.

The Knowledge Game

81

TABLE 1

1 N -K B 3 2 P-Q B 4

Seconds

N -Q B 3 P -K 4 3 P-Q 4 P-K 5 4 N -K 5! Q -B 3 5 N xN QPxN 6 N -B 3 B -K B 4 7 B -K 3 0- 0 - 0 8 Q -R 4 P-Q R 3 9 0 -0 -0 N -R 3 10 P -B 3 ! Q -K 2 11 Q - R 5 P -K N 3 12 Q - K 5 ? Q xQ 13 P x Q R xR + 14 K x R B -K 3 15 N x P N -K B 4 16 B -B 4 BxP 17 P - Q N 3 B -Q 4 18 N - B 6 B -K 3 19 P - K 4 N -Q 5 20 B - Q 2 ? ? B -Q R 6! 21 B - Q B 4 BxB 22 P x B R -Q 1 23 K - K l P -K R 4 24 K - B 2 N xP 25 B - B l BxB 26 K x N R -Q 6 + 27 K - K 2 R -Q 7 + B -N 7 28 K - B 3 RxP 29 K - K 3 30 K - B 4 R -Q B 7 31 R - Q l R -B 6 RxP 32 K - N 5 BxP 33 R - Q 7 34 R x P BxN + RxP 35 K x B K -Q 2 36 R - B 8 + 37 K x P R -K R 5 K -Q 3 38 R - B 7 + O : A c o u p le o f m ov es a n d resign . . . O K ? M : F in e by m e — this is a difficult o n e to win. 39 R - B 6 + K -Q 4 40 R - B 5 + K -Q 5 41 R - B 2 ! a n d resigns.

V alue

0

0

24 57 24

25 27 31 28 34 60

22 56 163 105 65 58 17

88 85 46 99 90 57 51 43 38 52 63 40 15

21 2 10 45 40 41 24 47 43 38 29 74 50 38

1 7

22 103 27 39 26

10

— — — —

29 19 34 29 35 56 84

—110 —111

6

— 109 — 100 — 97 — 89 — 95 — 113

105

—121

6

— 71

25 174 189

— 113 — 104 — 123

10 6 5

It was quite true t h a t we were pleased with M A S T E R ’S performance. Berliner himself h a d said afterwards th at the pro g ram was much better th a n the W o rld C h a m p io n s h ip version and was now close to the per­ fo rm an ce o f K A I S S A a n d C H E S S 4.0. A p a r t from this Birmingham a n d

82

The Machine Plays Chess?

Kent had, in the previous week, given M A S T E R the minimal knowledge or incentive to bring the kings together in the end game and M A S T E R had successfully done the K, R and K, B, B endings well within the 50-move limit. It still failed to do the K, B, N ending consistently because it had not, as then, been told which corner to drive the king into. But all this work impressed the School o f Knowledge not one jot at the conference. W h at was the point (they said) o f a program which can get to winning positions against the average to u r n a m e n t player and then, alm ost invariably, blunder away its advantage in the ensuing end game? The conference proper lasted 2 days but it quickly became obvious that the audience and speakers were split into three main groups. One g ro u p was the Brute Force School; the crunchers who followed the advice o f Moltke, a G erm an soldier: “ One does what one can, not what one sh o u ld ." A second group was the Knowledge School who openly derided the Brute Force program s as not only inadequate but also a dead end. In the words o f D onald Michie, if the cruncher should try his hand at a few endings, “ he will discover that the time-honoured m ethods o f enum erating and evaluating hundreds o f thousands o f look-ahead positions are simply not adequate to plaster over the p r o g r a m ’s lack o f real u n derstan din g". The third group in the audience were mainly innocents who found the subject interesting and wanted to know what was going on. F o r 2 days they were blissfully unaw are o f the rising antipathy between the pragm atic C runchers and the prating Knowledgers. As C hairm an I naturally took an unbiased attitude to this escalating feud. Professor Michie's talk was on the K, R vs. K ending and I was intrigued by the fascination this trivial ending seemed to have for the School o f Knowledge. Knowing the ratings o f m any o f the people present, I asked six o f them the following question, “ We have a board which is infinite in the x & y directions thus (Fig. 20).

The Knowledge Game

83

“ The lone Black king is somewhere o u t there on the board, can he be m a t e d ? (F o rg et the 50-move rule.)” Five people, with ratings o f 1800 or better, said n o ; the two kings m ust be b ro u g h t together to effect the mate and this is impossible. The sixth person already knew the answer. I was impressed by the speed at which h u m a n s could answer this problem (a b o u t 5 seconds); they saw immediately the hopelessness o f the case, whereas M A S T E R with its lack o f ‘chess knowledge' would be quite incapable o f giving any answer at all. U n f o rtu n a te ly the five knowledgeable h u m a n s had given the wrong answer. In actual fact there are a n u m b e r o f chess problems which can be solved very quickly by ‘c ru n ch ' program s and yet give considerable difficulty to h u m an s. I should point o u t th at one o f the stand ard techniques used by the K nowledge School to belittle the Brute Force School is to set a problem which they know the tree-searching programs, with limited look ahead, c a n n o t hope to solve. (N.B. as I said before it is more difficult to set p r o b ­ lems to the Knowledge School's program s as they usually do not exist.) F o r example, consider the following test (Fig. 21).

Fig. 21

W hite c a n n o t move his king away from the second ra n k because o f a r o o k check followed by P - N 8 = Q ; and for the same reason the White roo k d are n o t leave the Q N file except to check. O n the o th e r han d , the Black king c a n n o t su p p o rt his Q N pawn or a tta c k W h ite ’s N P w ith o u t being checked on the files or ranks. Y ou are asked to adjudicate the position. W h a t is the verdict? Every chess p r o g r a m in existence would (effectively) say the position

84

The Machine Plays Chess?

was drawn but h um an chess players have one great a d v an tag e— they m ake the assumption that B E C A U S E T H E Q U E S T I O N IS A S K E D then one side (most probably Black) can win. F rom this assumption, which has nothing to do with chess knowledge per se , they can then perform the correct analysis. The answer is given later. So the main reason th a t chess program s often c a n n o t solve an end game problem is because they are N O T T O L D T H A T T H E Y C A N W IN . Given this non-chess specific information they can often solve problems which have baffled many humans. F o r example consider the famous S A V E E D R A position, a deceptively simple position which was nevertheless argued over for m any years at the turn o f the century (Fig. 22).

Fig. 22

Assume a prog ram is playing white and told N O T T O LO SE T H E P A W N (i.e. it is equivalent to a king) N O R A C C E P T D R A W BY R E P E ­ T I T I O N . With this information the prog ram easily produces the solution and, if it is capable o f under-prom otion, eventually wins the game. The answer is given later. A few weeks after my report o f the Balliol C o m p u t e r Chess Conference had appeared in Computer Weekly , I was taken to task by Professor Michie for not giving sufficient emphasis to the im portance o f machine representations o f knowledge. As usual Professor Michie enclosed a position which would stum p M A S T E R plus 99 per cent o f the h u m a n race (Fig. 23). “ This is an end-game study (from A. A. Troitsky) in which W hite can win by prom oting his pawn. But the p ro m o tio n strategy alone occupies no

The Knowledge Game

85

Fig. 23

less th a n 40 ply o f elaborate manoeuvre. . . . W h a t hope would M A S T E R , or Son o f M A S T E R endowed with the hoped-for 15-ply lookahead, have o f finding the winning line?” N o w M A S T E R is a growing lad a n d wanted to play N x P but this loses the all-im portant pawn with only a K, R fork as consolation. As in the Saveedra problem , all M A S T E R needs to know is the non-chess Knowledge th a t W hite m ust p ro m o te the pawn to win. We accordingly set the p aw n high in value ( = K say) an d o u t comes the correct first move P x P (or is it?). So the great debate at the m o m e n t is not whether chess program s need m ore knowledge in the end game (both the Brute Force and the Knowledge Schools accept this necessity), b u t a b o u t precisely w hat and how much knowledge is required. M y own philosophy is th at some chess knowledge is necessary b u t it should be kept to an absolute minimum, if n o t then all t h a t results is a p ro g ra m th a t can play chess a n d nothing but chess. Because o f my flippancy in the ‘cheerfully misleading’ article, Professor Michie prescribed for me a penance— th a t I “ should now write a program to play optim al K i n g + R o o k vs. King, using no more than 20K bytes o f store an d n o m o re th an 7 seconds for move-retrieval. This exercise is specially designed for converting d em on p rogram m ers into angels o f Artificial Intelligence!” A lth o u g h preferring to remain a d e m o n p ro g ra m m e r I was resigned to perform ing this penance. The reason for this was th a t Professor Michie intended to publish his critique o f my miserably misleading attitude. F o rtu n a te ly the following letter a p p e a re d from my old Spanish friend D o n Miguel T o r o s y G allino:

86

The Machine Plays Chess? M ay 14 1975 D e p a r t a m e n t o de Intclligcnta Artificial In stitu te de L U L L S IE R R A R A N D A M a jo rc a , Spain. Q u e rid o Alex, R e: the article o n C o m p u te r Chess (April 10). T h is institute has stu d ied end gam es for m a n y years a n d I enclose som e o f o u r findings. T h ere arc 462 ways o f placing 2 kings o n a chess b o a rd . O f these 378 allow a ro o k to take one o f 48 different positions, 24 allow the ro o k 49 choices, 20 allow 50, 16 allow 5 1 , 12 allow 52, 8 allow 53 a n d 4 allow 54. T herefore there arc 22,400 ways o f legally placing wk, wr vs. bk with white to play. O f these 189 arc m a te in one a n d only one is m a te in 17 moves. W e have generated all these p ositions a n d then linklisted th em in to a d a ta base. A p r o g r a m (called C O J O N E S ) accesses this stru c tu re to recognise an y given sta rt position. It then o u t p u ts the co rrect m ov e a n d h o w m a n y m oves (a ssu m in g black plays perfectly) are required to m ate. F o r e x a m p le — a forcing sequence is retrieved if the p osition is W K in c3, W R in c4, a n d BK in cl. R - d 4 m ate in 3 R - d 1 + m a te in 2 R - c 1 m a te in 1

R— a 1+ + If black does n ot play optim ally th en the d a ta base is re-accessed for th e s h o r te r m a tin g sequence. T h e p ro g r a m is called C O J O N E S because the design is based o n the w o r k o f Prof. R. V. Jo n e s a n d D r. C. Bosch co n c e rn in g the tech niq ues fo r detecting s u b m a rin e s in the last war. T h e cu rre n t search strategy o f the d a ta base closely resembles the ‘satisfycing se a rc h ’ developed by P rofessor H e rb e rt S im o n at C a rn e g ie-M e llo n in A m erica, a tec h n iq u e S im o n has ap plied to finding se m i­ s h a rp needles in r a n d o m haystacks. Su am igo , D o n M iguel T O R O S Y G A L L I N O .

O f course there was little point in my doing a penance which reproduced this erudite work o f the Lullian Institute. I sent the letter on to the Com­ puter Weekly and it was published, together with Michie's article, u nder the title “ The Knowledge G a m e ” . I excused myself from the penance by observing th at C O J O N E S appeared to be the last word on the subject o f K, R vs. K ending.

CHAPTER 8

The State o f the Art In A u g u st 1968 M A C H A C K was dem onstrated a t IFIPS in Edinburgh. This p r o g r a m was p ro b a b ly the first to have a good chance o f beating the casual a m a t e u r (rating = 1500/115) and attracted large crowds whenever it played. O ne o f its games during the exhibition was against the chess p r o g r a m written by J o h n Scott, then a 17-year-old schoolboy (see also C h a p t e r 6 ). Scott's p ro g ra m was the best in Britain at the time but was defeated after a long struggle. T h e following week the fourth M achine Intelligence W o r k s h o p met, also in Edinburgh. These a n n u al workshops, organised by Professor D o n a ld Michie, n o t only gathered an d published some o f the best w ork in M achine Intelligence from all over the world but were also very enjoyable meetings. O n this occasion, th a n k s to M A C H A C K and Scott, the subject and future o f c o m p u te r chess was keenly discussed. Mr. David Levy, who was then the Scottish Chess C h a m p io n with a rating o f approximately 2250/206, was n o t impressed by M A C H A C K and offered a bet th at no com puter p r o g r a m would beat him at chess across the board for the next 10 years. The bet was accepted by Professor Michie a t £250, even odds. Michie was later jo in ed by Professor J o h n M cC arthy, Professor Seymour Papert (1970) a n d Professor Ed. K ozdrowicki (1971),* each o f the new members o f the c o n s o rtiu m staking £250. Recently Professor Michie increased his wager to £500 an d has laid a second wager with Levy (wager accepted) th a t if Levy loses his bet it will be th r o u g h defeat by a p ro g ra m developed under Michie’s direction. The a m o u n t o f the second wager is also £500, so Professor Michie has no w a total o f £1000 a t stake a n d Levy a total o f £1750. T h e m a tc h will consist o f two games, one win an d one draw is sufficient * All professors in Artificial Intelligence. 87

88

The Machine Plays Chess?

to win the match. W h at arc the chances that Levy will be beaten before 31 August 1978? With very little time to go the prospect looks remote. Levy now has a rating o f 2320/215, yet the best chess program s at the m o m en t are only rated at a b o u t 1750/144 and tend to play a t a much lower level in the end game. The main obstacle is the expense o f developing chess programs. F o r example, M A S T E R may have only played 30 hours o f chess but the commercial rate for this time on a big machine is a b o u t £30,000. Even if Michie does win his bet the charge for machine time (ignoring all develop­ ment time) would greatly exceed his winnings. I believe th at it is possible with current technology to beat Levy b u t it would require a massive system o f linked co m puters plus quite gigantic ‘knowledge b a n k s ’ (or databases) and the cost would be astronom ical; possibly o f the same order o f magnitude as the A pollo project. So w hat can we reasonably expect to happen in August 1978? The analogy between the Apollo project and developing a chess p r o ­ gram can be extended. Dr. W erner von Braun, w ho developed the bruteforce Saturn V stage o f Apollo, had this to say after the first successful M o o n landing: Let me say this, in retrospect, w ith all the a d v a n ta g e o f tw en ty tw en ty hindsight, I som etim es w o n d e r at the naivete th a t I myself a n d m an y o f my associates h ad in the early days. F o r ex am ple the p ro b le m o f n av ig atin g to the M o o n a n d m a k in g a pin p o in t lan d in g w here you desire looks awfully sim ple in a m o tio n picture. But w hen y o u have to d o it . . . it’s a very, very difficult p ro b lem . 1 ask myself so m etim es h o w we ever h o p ed to solve these p ro b lem s w ith o u t the help o f the fantastic c o m p u t a t i o n m achin es th a t we have today.

This statement is an acknowledgem ent by von Braun th a t his massive Saturn V solved only the first p art o f the problem o f m a k in g a M o o n landing. It was in fact (indeed it had to be) com puters which controlled an d navigated the astronauts to and from the M o o n ; h u m a n s only flew the last 50 feet dow n to the M o o n ’s surface. By 1978 we can confidently expect an equivalent to the S atu rn V in chess program s and it is my belief th at such a brute-force pro g ram th a t could search full width an d 15 plies deep, would have a good chance, on purely tactical play, o f detecting an error by David Levy and his peers during the middle game. This is partly based on an analysis o f some o f his gam es; he has m ade tactical blunders at only 5 plies. D o n a ld Michie has also said: Alex Bell has stated . . . t h a t at 15-ply Levy will c ru m b le . If I m ay a d d th e qualification ‘in th e m id - g a m e ’, th e n I agree w ith him. F a c e d w ith t h a t degree o f

The State o f the Art

89

lo n g -ra n g e tactical a c c u ra c y Levy will be up against so m e th in g fast a n d slithery, w hich o n c e in a while will c a tc h h im n ap p in g . Before the m id -g a m e is o u t it is likely th a t s o m e tr a p o r a n o t h e r will have been sp ru n g , a p a w n o r tw o (even a piece) will hav e been s n a tc h e d ; a n d the p r o g r a m will e n te r the e n d -g a m e in the lead. “ But w h a t is the use” , we m ay ask , “ o f a p r o g r a m w hich reaches the end g a m e w ith a w in n in g a d v a n ta g e , only to c o m m it hara-kiri by playing like a m oron?”

U n fo rtu n a te ly , Professor Mic hie i s c o r r e c t ; a 15-ply tactical program will fall a p a r t against Levy in an end game ju st as the 7-ply M A S T E R falls a p a r t at the m o m e n t against lower-class players. The 15-ply program is, like the S atu rn V, a necessary b u t not sufficient part. The possibility o f constructing a 15-ply program I leave until the next chapter. F o r the m o m e n t let us assume th at we have one, th a t we can get a slight a d v a n ta g e in the mid-game by sheer tactical play. H o w can a program realise its a d v a n ta g e ? O ne possibility is th at the p ro g ram should (some people would say must) begin to simulate, m ore a n d more, how the h u m an chess player solves the problem o f selecting a move. N o w the main thing that distinguishes the master player from the ordinary player (and the com puter) is th a t he has vastly superior pattern recognition o f goals in chess positions. By this I mean th at ‘true purp ose o f the position' is recognised and understood. A drian de G r o o t repeated and extended a classic experiment (first per­ formed by the Russians) which clearly distinguished this ability in the strong player. In this experim ent the subject is shown a genuine middle-game position for a b o u t 5 seconds. G r a n d m a s te r s can reproduce such positions on a n o t h e r b o a rd with a b o u t 95 per cent accuracy, i.e. 95 pieces out o f 100 will be replaced correctly. The average club player in such an experiment is found to score well below 50 per cent. If the chess positions displayed are r a n d o m — the pieces are placed h a p h a z a rd ly — then perform ance becomes indistinguishable. M ost people can only replace a b o u t 15 per cent o f the pieces irrespective o f their chess skill. T h e conclusion d raw n from these experiments is that grandmasters do n o t think faster or deeper but, due to superior pattern recognition, they do think a b o u t the right things. A startling example o f this phenom ena occurred when ex-World C h a m p io n , M ax Euwe, was interrupted after 10 seconds viewing o f a particularly difficult position. Euwe was able to repro duce the position with only two errors insignificant to the play th a t

90

The Machine Plays Chess?

was to follow. Further, he was able to identify the core problem in the position and had plans formulated for exploration. M ost remarkable, he had already intuitively selected the winning move (which three masters, five experts, an d a num ber o f average players had failed to d o during a complete analysis) and was able to visualise a possible variation. The recognition and reconstruction o f a position is done from s h o r t­ term memory. G. Miller, in an article “ The Magical N u m b e r Seven, Plus or Minus T w o ” , proposed a short-term mem ory model with a capacity o f a b o u t seven ‘c h u n k s ’. The master player recognises a meaningful position by m apping it into a b o u t seven chunks, i.e. for a b o u t twenty-five pieces recalled he must recall a b o u t four pieces per chunk. His advantage is that, due to experience, he has amassed an e n o rm o u s vocabulary; a rough estimate is th a t he can recognise a b o u t 100,000 different clusters o f pieces. Here is one o f them (also the most likely position these pieces will occupy at the 21st move in a master chess game) (Fig. 24).

Fig. 24

This is a familiar pattern to most good chess players. Experiments on eye movements have shown that master players hardly look at any o f these pieces, their peripheral vision informs th em o f a pattern which they have seen thousands o f times; the properties a n d purpose o f this ‘superpiece’ are well known and the pieces are not, n o r need to be, distinguished individually. Unfortunately, although the seven patterns o r c h u n k s d o explain how master players can reconstruct positions, it is n o t at all clear how these patterns suggest strong, plausible moves a n d so trying to simulate the exact m ethods o f a strong player— m ethods derived from m a n y years o f experience staring at chess positions in games between experts— is n o t a

The State o f the Art

91

very promising line o f a p p ro a c h to a W orld C h a m p io n Chess Machine at the m o m en t. Until more u n d erstanding is obtained we must do what we can, n o t (in all likelihood) w hat we should. However, one a p p ro a c h , developed by Zobrist and Carlson at the University o f California, is indeed the identification an d selection o f moves for consideration in the game tree based u po n the move fulfilling a ‘pattern o f interest' to a very good player, in this case Charles Kalme who has a rating o f 2445/230. This idea o f Kalme teaching a program the im p o rta n t ‘c h u n k s ' o f chess positions is an extremely attractive one and of great psychological interest but the program still looks for the ten best moves at each position a n d builds the traditional, ponderous trees for mini-maxing, primarily because the patterns are alm ost entirely keyed to single moves (rather than co m binations or sequences o f moves) and involve only very simple relationships between two pieces or a piece and a square (rather th a n involving m ore complex groupings o f pieces). N o w , as I have already said, the really im portant difference between a h u m a n player a n d a machine is that the machine looks hopefully o u t into the future whereas the good h u m a n player sees a plan or a goal. He often sees th a t getting a piece to a certain square will give him an advantage and he then works backw ards, from the goal position to the present position, to see if his plan is feasible. A p ro g ra m along these lines, i.e. one that identifies an objective at the end o f a path before generating any moves to determ ine w hether the path can be realised, is being developed under the direction o f Mikhail Botvinnik w ho (Reshevsky, again please note) was W o rld Chess C h a m p io n fro m 1948 to 1963. This idea is again attractive in th a t it attem pts to truly simulate the h u m a n m e th o d — the creation o f a plan o f a ttack — but it has been 6 years since B otvinnik’s book, full o f glowing optimism, was published and the project has perhaps ru n into trouble. T h e reasons are n o t h a rd to guess. One reason is that Botvinnik is not a p r o g r a m m e r and, alth ough his m e th o d is highly mathematical, he seems to have an incomplete appreciation o f the art o f computing, an art which dep ends on simplicity n o t complexity. A n o th e r reason is th at his program will n o t select as few goals as a h u m a n player an d therefore m ust spend a lot o f time tree searching albeit in reverse. But is tree searching the only approach? In fact a m athem atical, non-tree-searching a p p ro a c h has been suggested in an analytical system p roposed by R o n A tkin an d Ian Witten. The word

92

The Machine Plays Chess?

‘ply’ is a n a th e m a to Atkin and the a p p ro a c h is extremely abstract, to the point o f being alm ost impossible to visualise or explain except th ro u g h mathematical symbology. Each position is described in terms o f a vector space in 53-dimensional Euclidean space and uses mathematical concepts o f simplices and conn ec­ tivity between them to provide quantitative values representing piece co-operation, mobility, and tactical flexibility. The program has n o t been designed to play complete games but, by maximising the above listed values, it has produced move decisions that co m pare ‘reasonably well' with those made by grandmasters in well-known games. The m ethod quite obviously has no relationship with h u m a n chess thinking and is also quite unable to appreciate tactical situations like captures, checks or even checkmate. W ith the help o f Bill Hartston, the current British cham pion, the p ro ­ gram has been developed into a three-level structure; very roughly the first level deals with tactical play and the higher levels deal with positional play. H artsto n has asserted “ that it annotates better th an G o l o m b e k ” . Atkin and Kepler are two o f my favourite m athem aticians because both o f them are (were) fascinated by description. In K epler’s case he succeeded in showing th at the five Platonic solids could be used to describe the distances o f the six planets (Mercury, Venus, Earth, Mars, Jupiter, Saturn) from the Sun. Unfortunately Kepler's description (although it fitted all the then known facts) fell into disrepute when the planet U ra n u s was discovered. N o w it is quite true th at any chess position can be described in 53dimensional space but such descriptions are frequently sterile. Science is concerned with prediction which is why both Kepler's a n d A tk in ’s models are n o t very helpful, they might describe but they do n o t explain an d therefore c a n n o t suggest how to continue further investigation o f either the solar system or a chess position. Nevertheless A tk in ’s program does not search trees and, despite its tactical failings, it can give very detailed positional an notation. A t present the brute-force program s definitely falter a n d fail in non-tactical situations a n d it could well be that, in such situations, the only way to continue sensibly is to m ake sound positional moves. In fact it is very likely th a t a com bination o f ‘brute-force tactics’ a n d ‘A tkin positional play’ will be a way to overcome David Levy, b u t this welding o f techniques into one p ro g ra m is not an easy task. The plain fact is th a t there is no simple way to reach h u m a n m aster

The State o f the Art

93

level; no trick in m aths, program m ing, knowledge or psychology th at can replace the years o f hard concentration th at David Levy and his colleagues have spent in o rd e r to play as well as they d o — but is this so wonderful? M ost o f us can, for example, recognise an d name thousands o f people and objects; an ability which also far surpasses anything yet achieved by a machine. As S h a n n o n pointed out, com puters d o have their strengths an d co n ­ versely h u m a n s have their weaknesses. F o r example, in 1957 Edward Lasker, the N ew Y o rk chess master, played A rth u r Samuel's draughts pro g ram . In L a sk er’s w ords: I play ch eck ers w orse th a n chess, b ut I felt I could easily see three moves a h e a d . . . . In the early m iddle gam e, o u t o f a clear sky, the c o m p u te r sacrificed o n e m a n , a n d then tw o m ore. I was ju s t a b o u t to m a k e a polite re m a rk to Dr. S am u el a b o u t the m a c h in e 's d e p lo ra b le oversight, w hen I noticed to my h o r r o r th a t n o m a t t e r w h a t I played . . . the m ac h in e w o u ld win back the three m en with the b etter game.

Lasker finally won after a hard battle but admitted that the machine had nearly beaten him. A n o th e r example to m ake the point. There is a game called M onster Chess which has the following initial position (Fig. 25).

Fig. 25

Black, the monster, is com p ensated for lack o f material by being allowed to m a k e 2 moves for each White move, the Black king can also move th r o u g h a check square providing he eventually finishes o u t o f check. A p a r t from this all the rules are as usual— a n d yet I have seen Bill H artston beaten in this gam e by a player w ho h ad no chess rating a n d M A S T E R would b eat D a v id Levy in this game unless he p u t in a lot o f practice.

94

The Machine Plays Chess?

W hat these two examples show is that very good chess players are very highly specialised, indeed their knowledge is possibly a handicap when they are faced with any problem outside the very narrow confines o f normal chess. A slight change in the rules and the patterns are useless. Such experiments re-emphasise the fact that master players are no better at tree searching than ordinary mortals and very much weaker than machines. T o really rub this in consider the possibility o f a pentathlon o f board games for the World C h am pionship and let the games be Chess, Draughts, G o, Backgammon and Kalah. I have absolutely no d o u b t that the winner o f this hypothetical event would be a program using five simple evaluation functions coupled, in turn, to a powerful general tree-searching procedure an d running in a powerful computer. In short I a m completely satisfied with the performance o f com puters playing a variety o f games against mere humans. They are already m ore versatile and flexible in many o f the activities th at we call ‘intellectual’ in the same sense that the wheel surpasses the h u m an leg. In the final chapter I will completely ignore h u m an simulation, knowledge, psychology, pre­ dictions and wishful thinking to concentrate on the p ro g ra m m in g techniques which are almost completely devoid o f knowledge (chess or otherwise) and (apart from more powerful machines) have been a n d will continue to be the m ajor source o f im provement for at least the next 5 years. Beyond that point in time we might find, as von Braun did, that a completely new type o f machine will solve the difficulties o f the last lap and reveal o u r current naivete.

%

CHAPTER 9

Machine Technique typical chess position the average number o f possible moves is about 30. This num ber drops to about 20 in the end game thus (Fig. 26). a

NUMBER

OF

MOVES

POSSIBLE

In

34 32 30 28 26 24 22 20 18

MOVE N U M B E R Fig. 26

The typical game lasts a b o u t 40 moves. Assume that we (hum an or machine) can identify ten ‘reasonable’ possibilities at each move, i.e. about 3 moves by W hite and 3 replies to each. There are therefore 1040 possible games. Suppose we have a machine that can play a game every nanosecond ( = 1,000,000,000 games per second) and we have a million such machines on the jo b full time. Finally assume that all these super machines have been 95

96

The Machine Plays Chess?

working since the solar system first appeared (= 10 18 seconds). T h e result is th at we would have only analysed one ten-millionth o f all these possible games. The above is often used as a fatuous p r o o f that com puters will never be able to play perfect chess— fatuous because it is an equally valid p r o o f that h u m an s c a n n o t attain perfection either. But what if we restrict ourselves to only the first 10 moves? O f course the result after only 10 moves is not going to be as ‘obv io u s’ as it would be after 40 moves but there exists a wealth o f analysis on the openings and, if this were fed into a data base, the machine could m ake a taxonom ic check (i.e. look for the position closest to the one it has produced after 10 moves) and take the h u m a n assessment as to whether White or Black has the advantage or that the game is even. There is therefore no valid reason why a c o m p u ter should not play the opening game faster and better than any h u m a n living or dead (particularly the latter). So why hasn’t it been d one? The main reason is that it is an expensive, time-consuming j o b for a h um an to collect and enter all the available inform ation— nevertheless, once it has been done (plus an update facility as new variations appear), it need never be done again. A n o th e r advantage would be th at h u m an s could interrogate this data base and the machine could regurgitate examples o f when and where last played plus the reasons as to why, in the opinion o f expert h um an analysers, certain moves were though t preferable to others. By the end o f this century a co m p u ter will almost certainly be the best c o m m e n ta to r on the opening moves in a W orld C ham pionship. N o w many chess program s do have a ‘b o o k ’ o f openings but they are extremely small in com parison to the above proposal. The purpose is mainly to save machine time (i.e. the machine is quite capable o f playing sensible openings with its tree searching) and alm ost always they cause problems. One problem with these rather ad hoc books is th at m any openings ju s t do not suit the following style o f play o f the tree search evaluation. W hen the book line runs out the machine no longer has a stored response. It then begins to search and often (K A IS S A is a good example) finds th a t the current position is, in its terms, extremely bad. W ith no inform ation as to the theme or purpose o f the opening the machine tries to rebuild w h a t is known to be a sound position into a position which it likes. So it is im p o rta n t to match the b o o k to the m ac h in e’s style. A m o re

Machine Technique

97

specific example is M A S T E R which currently ‘digs in' during the book moves, e.g. 1 N - K B 3 2 P - K N 3 3 B - N 2 4 0-0. O n emerging from the b o o k M A S T E R 'S evaluation is very keen to c o n ­ trol the centre squares. T h a n k s to the b o o k 's reticence it often finds plenty o f moves which improve its centre control plus, if the o p p o n e n t has been m o re aggressive, plenty o f enemy pieces in the centre to attack. In o rd e r to look ahead the m achine has to generate lists o f moves. This is often described as trivial but it is also crucial— the moves must be p ro ­ duced as fast as possible. M o s t chess prog ram s use a 10 by 12 board n u m b e re d thus (Fig. 27).

110 100

90

B R BN BB B Q B K BB B N B R

80

BP BP BP BP BP

B P BP B P

70

K n ig h t in s q u a r e N. Moves, by offset, are

60

N-21

50

N-19

40

N-12

30

WP WP WP WP WP WP WP WP

20

W R W N WB WQ WK WB WN W R

N-8 N +8 N + 12

10

N + 19

0

Offset SUBTRACT

Offset ADD

N + 21 0

1

2

3

4

5

6

7

8

9

Fig. 27

T h e b o r d e r is artificially filled with friendly pieces a n d its purpose is to detect when pieces (particularly knights) are trying to move off the board. A W hite knight in QN1 would generate, by offsets, a list o f eight possibili­ ties, 1 , 3, 10, 14, 30, 34, 41, 43, a n d have to then reject six o f them. The techniques to obtain the moves o f other pieces are essentially the same and

98

The Machine Plays Chess?

it is a traditional, trivial and rather inefficient method which immediately demonstrates the difference between a c o m p u ter a n d a h u m a n — the machine can only deal with essentially YES or N O situations— concepts like large, small, near, far, better, worse are not understood by machines (although, sooner or later, this may be possible). Using the legal move generator the machine now examines the result (immediate and remote) o f making each o f the possible moves, the replies thus opened to the opponent, the possible replies to these moves, etc. H ow a move is chosen was first described in detail by S han n o n in his classic paper. He gave the d iagram shown in Fig. 28.

Fig. 28

“ It is assumed that there are three possible moves for White, indicated by the three solid lines, a n d if any o f these is m ade there are three possible moves for Black, indicated by the thinner lines. The possible positions after a White and Black move are then the nine circles, and the num bers within are the evaluations for these positions. Maximising on W h ite ’s move, we obtain 0.1 and W hite’s best move is arro w e d .” It took 15 years for the superior pattern recognition o f h u m a n s to realise that it is not necessary to search the whole tree. In S h a n n o n ’s d ia g ra m it is indeed necessary to look at all three evaluations to find the left-hand m inim um ( = 0 .1) but the instant the machine picks up the —0 .5 in the middle three it need look no further and, similarly, picking up —6 in the last three can also terminate the minimising. This cut off is called the A LPH A -BETA PRO CED U RE. Once this was realised (and even Samuel had missed it in his very strong checkers-playing program), a little mathematical analysis revealed th a t if the moves were in o p tim u m order the time taken to search the tree could

Machine Technique

99

d r o p to a b o u t the square root ot its original value, i.e. a program which had taken 100 seconds could, with a lp h a -b e ta , produce the same choice o f move in a b o u t 10 seconds. O f course, this square-root im provement is never achieved in practice because no one knows ho w to o rder the moves optimally (if we did then we would not need to search at all and the im provem ent is, strictly speaking infinite). Nevertheless even the roughest sort when the moves are generated (tor example, checks, captures an d then other moves) can produce co n ­ siderable im provem ents in cut off and speed o f play. A n o th e r trick o f the trade is called R E F U T A T I O N or the K I L L E R H E U R I S T I C . This trick is particularly attractive because it also requires no knowledge (chess o r otherwise). T o show the principle consider Prinz's two-move mate problem (dis­ cussed in C h a p te r 4). A l p h a - b e t a is no help at all in such problems because the evaluation is only binary (only one o f the opening moves guarantees checkm ate, all the rest would ju st return failure). Assum e th at Prinz's p ro g ra m is investigating the correct move ( R - R 6 ) a n d the reply (B-B2). The p ro g ram now generates 5 possible moves for the White king (2 are illegal), 2 moves for the White pawn and 1 move for the W hite rook. It investigates these eight moves and finds that R x P + + is the correct move. A t this point the p r o g r a m has to try a n o th e r Black response so it tries B-Q 3. T h e p ro g ra m now generates 5 possible moves for the White king (3 are illegal), etc. All refutation does it to avoid this repetition by rem em ­ bering the single move which refuted B-B2 (i.e. R x P - f + ) and trying it immediately if it is still possible. In this way all the six bishop moves after the first are quickly ‘killed o ff ’ an d it is not until Black plays P x R that a n o t h e r refuting move ( P - N 7 + + ) has to be found. A lth o u g h a simple principle, refutation is quite difficult to program and use correctly in a chess-playing program . However, tests have shown that in tw o -m o v e m ate problem s a five-fold increase in speed can be obtained on average. A n o t h e r simple trick which has often been overlooked is called C H O P P E R . W h a t this says is th a t if all alternatives except one are obviously b a d then take the one rem aining without a n y further investigation. T h e m o s t obvious use o f C H O P P E R is when a p ro g ram has only one move, for example the king has to move o u t o f check. This may seem trivial b u t m a n y pro g ram s, including T E C H 2 when it played M A S T E R at

100

The Machine Plays Chess?

IFIPS, actually spend a few minutes searching through plies 2, 3, 4, etc., before deciding that their best choice is their only choice. A more subtle use o f C H O P P E R occurs when a chess pro g ram is told that one side or the other can win. T ak e the S A V E E D R A position, for example (given in the last chapter). W hen hum ans are given this problem they are usually told that White can win (if they are not told anything they quickly suspect this possibility anyw ay— this suspicion has nothing to d o with chess knowledge, b u t is fundamental to solving many problems). They then argue that if White can win, then the pawn is worth more than the r o o k — a n d at this point a p r o ­ g ram can now solve the problem. The pro g ram looks ahead 4 plies an d finds th at only one move (P-B7) can save the pawn. So it makes the move w ithout further investigation. Using C H O P P E R the problem unfolds— the White king is forced to move dow n the knight file in order to keep the pawn and also to avoid a draw by repetition. Eventually the White king has to play to QB2 and I leave it to the reader to judge whether R - Q 5 (which prevents the pawn from queening because o f a stalemate threat) is the best move for Black at this point. A c o m p u ter usually assumes that its o p p o n e n t is as intelligent as itself and would expect R - R 6 . A n o th e r example, which C H O P P E R can speed up enormously, is “ C an you win with R, KP, KBP, K N P , K R P vs. R, KBP, K N P , K R P ? ” Well sometimes you can an d sometimes you can't. The expert knows th a t the defender must try to get his R P to K R 4 ; if he can then the game is probably drawn. It is this hard-earned knowledge th at is the main ad v antage o f the expert against a c o m p u ter because, if the machine knows this fact also, it is at least the equal o f the expert in getting where it wants to get and, th an k s to C H O P P E R , vastly superior in speed o f play. There are many other tricks which speed up the generation a n d searching o f chess trees but I will consider only one more. Like m any o f these techniques it is simple, obvious but difficult to implement into a m achine— it is called F E E D O V E R . In a chess program much effort is put into sorting moves into the best o rder at the various plies. This transform s an initially r a n d o m tree into an highly ordered structure with a lp h a - b e ta values a n d refutations plus (if applicable) any chops on branches. In the majority o f program s a m ove is then selected an d the whole tree is th ro w n away. A t the next move the machine behaves as though it has never seen the position before a n d

Machine Technique

101

laboriously rebuilds the tree. Sometimes as in the case o f C O K O , it can even miss so m ething it had seen in the previous analysis. All this seems very wasteful and is prone to error therefore, in the case o f M A S T E R , the m ost im p o rta n t parts o f the tree are saved in order to (1) speed u p the searching process on the next move, ( 2) to hang on to any strong sequences (particularly checkmate), a n d (3) to aid in debugging by having the p ro g ra m report w hat it thinks is the m ost likely continuation o f the game, i.e. w hat it thinks is the o p p o n e n t ’s best move and what it then intends to play. F E E D O V E R was designed a n d written by Peter K ent and J o h n Birming­ h a m in a b o u t 2 days but it to o k m an y hours o f testing to avoid some o f the difficulties it raises in implementation. Nevertheless a crude form currently (along with a lp h a - b e ta , refutation, c h o p p e r a n d other tree-pruning techniques) allows M A S T E R to play at 9 plies when it emerges from the opening with the option o f changing do w n to 11 an d even 13 plies if time a n d the position permit. As M A S T E R is written in a PL/1, a slow, high-level language, a n d as new machines are com ing on the m a rk et which are some 10 times faster th a n cu rren t models, it therefore seems quite feasible th at chess program s will reach 15 plies o f tactical play in the near future. A t this d e p th they will indeed give David Levy a hard, tactical game— they m a y even get to an objectively w on gam e— but they will never beat him because (and this is both their strength an d weakness) they still will not k n o w w h a t they are doing. The m ain reason they d o n o t know w hat they are doing is th a t too much knowledge slows up the deep tree search. Param eters in the sorting and evaluation m ust be cheap to c o m p u te or necessary, i.e. either speed up play, im prove the ordering o f the moves o r correct a fault observed in actual play. M A S T E R has some chess knowledge b u t it is deliberately kept as small as possible a n d only put in with reluctance. The parameters o f this k now ­ ledge are: (a) M aterial value. (b) A ttac k s on pieces by lower valued pieces or on inadequately defended pieces. (c) H id d e n a tta c k s — pins, X-rays, skewers. (d) Position o f pieces (e.g. knights are weak a t the edge o f boards). (e) P aw n s increase in value (passed paw ns very rapidly) as they

102

The Machine Plays Chess? w

advance (equal to o p p o n en t's lowest piece when they reach the 7th rank). (f) Control o f squares (central squares are highly valued at the begin­ ning but, as the game progresses, this attraction fades and the squares a ro u n d the o p p o n e n t's king become more attractive). (g) Doubling o f rooks, queens and bishops. (h) A ttacking passed pawns, the squares in front o f passed pawns and blocking passed pawns (see C h a p te r 7, M A S T E R vs. D U C K for the reason this knowledge was fed in). (i) The king is encouraged to go to KN1 in the first part o f game and then, after half the material has gone for either side, it will try to move to the centre. (j) Opposition o f kings. (k) Move kings together when o p p o n en t only has a king. With this M A S T E R can perform the (K and Q, R or 2B) versus K mate at ju st 3-ply look-ahead. This rule can also help to solve the adjudica­ tion problem given in the previous chapter— get the BK to Q 6 and a 15-ply look-ahead can easily see how to win the game. (l) Keep the king next to pawns (again helps to solve the adjudication problem). (m) Castling. By now the reader should have some idea o f what he would be up against should he ever play a machine. But will this help either you or David Levy to beat a chess program in the next few years? The reason I ask this question is th a t chess program s are still advancing rapidly in sophistication a n d when faced ‘over the b o a rd ' have other, more psycho­ logical advantages which are only just being exploited. F o r example, C H E S S 4.0 makes com m ents on the o p p o n e n ts ’ moves. If the move is a good one then it might say ‘Oh, you did th a t .’ O n the other hand, if the o p p o n en t plays slowly he is liable to get the message ‘Time sure flies’ come up on the screen. Some c o m m en ts are even more sarcastic, an d are calculated to amuse the audience a n d em barrass the opponent. A phenomenon! that is very noticeable with chatty chess program s is th at the audience is very interested w h a t the machine ‘thinks’ a b o u t the current position. On one occasion when M A S T E R was giving an exhibition its o p p o n e n t positively insisted on having the m achine’s assessment o f the position with every move it m ade and seemed to derive c o m fo rt fro m the

Machine Technique

103

fact th a t it rem ained steady an d was noticeably relieved whenever the score dro p p ed . T o illustrate o n e effect o f know ing the m ach ine’s evaluation I will finish with a game against M A S T E R . As usual the p r o g ra m h ad gone into m othballs after the second chess conference in M a r c h 1975. It was resurrected in A ugust as a special treat (I was leaving the country) an d actually played a transatlantic game with R ichard Cichelli in Pennsylvania. The next week we hoped to retest this historic transatlantic link but no contact was m a d e — so I played it for the last time. The p r o g r a m itself is actually resident inside the machine at all times but, in o rd e r to control its playing speed a n d evaluation, a n u m b e r o f punched cards are read in to begin with. Also read in is the current opening book. O n e now sits d ow n in front o f a visual display unit which resembles a television set a n d has a set o f typewriter keys. The p ro g ra m comes u p a n d asks, o n the screen, w h a t c o lo u r you want. BELL (White)

1 2 3 4 5

N-KB3 P-KN3 B-N2 0-0 P-Q3

vs.

M A S T E R (Black)

N-KB3 P-Q4 QN-Q2 P-B4

A surprise here. M A S T E R did not k n o w this opening a n d began to c o m ­ pute. T o d o this it claimed to p priority in the machine a n d all other work in the m achine cam e to a halt. In co ntrast to the rapidity (almost instan­ taneous) o f the boo k play, the p ro g ra m takes a very long time to co m p u te its first move ( a b o u t 5 minutes) because it has to initialise a vast a m o u n t o f storage a n d build up the first F E E D O V E R . F ro m now on the program displays (and this was to cause me problems) an evaluation o f the current position in its terms. (See also Berliner’s game in C h a p te r 7.) Value

5 ... 6 B-N5 7 P-B3

P-K3 B-K2 P-KR3

10 20

30

104

The Machine Plays Chess? 8

9 10 11 12 13

BxN Q -R4 N -QR3 Q -N 5 Q -R4 Q -N5

Value 30 40 40 40 40 40

BxB 0 -0 N -N3 N -Q 2 N -N 3 N -Q 2

U p to this point I had been taking advantage o f what I knew the p r o ­ gram would try to do, i.e. I did not go anywhere near the centre so when it came out o f the book it was a little lost. I also knew it would try to push its queen side pawns at a b o u t move 10 so, out o f curiosity, I had put my queen against them. The program had offered a draw by repetition which I pointed out to Peter K ent and complained that it was up to me to break this deadlock. N o sympathy was forthcom ing so . . .

14 15 16 17 18 19

QR-Q1 Q-R4 Q-R5 Q xQ P-K4 KR-K1

P-QR3 N-N3 N-Q2 RxQ P-QN4 P-N5



40 60 30 50 50 20

The speed (a few seconds) o f this move amazed and slightly annoyed me, it was still blindly and pathetically advancing its pawns. Also I was tired o f playing quietly and felt like some ‘wood pushing’

20 21 22 23 24 25

P-K5 PxB PxP N-K5 RxN P-QB4

PxN RPxP KxP NxN R-Q3 B-N2

80 110 130 140 170 170

The program at this point thought it was doing well because it had got a pawn to the 7th rank. I intended to disillusion it

26 R-N1 27 P x P 28 P x P

R-N3 R-QN1 BxB

140 140 130

Machine Technique

29 K x B 30 R x BP 31 K-B3

PxP K-B3 R-N5

105

110 110 140

When M A S T E R gets a score o f 200 or more it usually means that it is genuinely winning. At this point I had brought its score down but it still thought that the advanced pawn was worth a lot. We have now reached an end game in which the superiority o f my h u m a n knowledge will win the day

32 R-B2 33 K-K2 34 K-Q2

P-QR4 P-R5 P-R6

120 130 140

So it is now three against three (and it still thinks it’s doing well, but I know I’m going to beat it to a pulp, after all this is an end game. Kent just sits there).

35 36

R-B4 R-QR4

R(5)-N4 R-KB4

140 110

H orizon effect, it is just delaying the inevitable so, without too much thought,

37

P-B4

R-KR4

130

Horizon effect again, when is it going to face up to its problems like a man?

38 P-R4 39 R x P

R-QB4 R(4)-N4

60 50

His score is coming down nicely now

40 R-N3 41 P x R 42 K-B2 43 R x P

RxR RxP R-N4 R-QR4

0 -50 -60 -70

grace, how could Pow! A n d let that be a lesson to you., N o w for the coup de grace, I not win? Well it was tea time and I was in a hurry

44 R-N6 45 R-N2 46 K x R

R -R 7+ RxR K-B4

-6 0 -6 0 -4 0

106

The Machine Plays Chess? 47 48 49

P-Q 4 K -B 3 P-B5?

K -N5 KxP PxP

-10 -0 30

I blew it, it’s not just chess program s that play pathetic end games 50 51 52

P-Q 5 P-Q 6 P-Q 7

P-B5 P-B 6 P-B7

10 50 10

D raw agreed. Turing said o f his paper machine after its game with Glennie: “ I f I were to sum up the weakness o f (my) system in a few words I would describe it as a caricature o f my own play. ’ After my game with M A S T E R I felt like summing up my play as a caricature o f the m achine’s weaknesses. Peter Kent ju st grinned. At the end o f a game a massive a m o u n t o f output is printed by the program in order to check out some o f its decisions. In my game it h a d predicted my next move 23 times and, even more significant, had m ade its feedover move almost 90 per cent o f the time. It had also expected my 49th move to be P-Q5. So much for a program which has played a b o u t 30 hours o f chess. I leave it to the reader to imagine what a n o th e r 970 hours practice might achieve.

Addendum my last game with M A S T E R because we failed to re-establish a T ransatlantic link with Richard Cichelli on that Sunday. I left England the next week believing th at this was a te m p o rary failure and that M A S T E R would be able to play in the A C M to u rn a m e n t in O ctober; the machine time a n d the links had been approved an d fully tested out, a n d Cichelli had agreed to represent the p ro g ra m at the tournam ent. I received the following letter from Richard Cichelli just 2 days before subm itting this manuscript. I trust posterity will appreciate (as David Levy obviously has) th at a big obstacle to developing a chess p ro g ra m is any c o n ta ct whatsoever with officialdom who ‘k n o w ’ th at c o m p u ter chess is j u s t a game. I played

A. G . Bell D iv isio n o f C o m p u t i n g R esearch C SIR O P.O . Box 1800 C a n b e r r a City, A .C .T . A u s tr a lia 2601 30 N o v e m b e r 1975 D e a r A lex: I suspect th a t K e n t ’s told y o u th a t getting M A S T E R into A C M ’75 was a lot m o re o f a p r o b le m t h a n originally th o u g h t. Col. , head o f , thin ks chess p r o ­ g r a m m in g is politically u n su itab le for the n etw o rk . A n y w a y , I enclose a c o p y o f my last letter to K en t. It includes lots o f to u rn e y news. S o rr y a b o u t M A S T E R — we tried. I ’ll sen d y o u a ta p e o f m y P A S C A L stuff s o o n as I get over to Lehigh d u rin g the d ay . It is fo r P A S C A L I. S late is c o n s id e rin g w ritin g a new chess p r o g r a m in P A S C A L . Sincerely, R ic h a rd J. Cichelli M r. P eter K e n t Science R e se a rc h C oun cil A tla s C o m p u t e r L a b o r a t o r y C h i l t o n — D i d c o t — O x fo rd s h ire E n g la n d D e a r Peter, T h a n k y o u very m u c h fo r th e chess p r o g r a m m in g literature. Levy is publishing an analysis o f th e A C M ’75 t o u r n e y av ailab le in F e b r u a r y :

107

108

The Machine Plays Chess? ISB N 0 - 9 1 4 8 9 4 - 0 1 -3 1975 U.S. Computer Chess Championship C o m p u te r Science Press, Inc. 4566 Poe A venue W o o d la n d Hills, Ca. 91364 C ost : $3.95 for p ap e rb ac k

As you p ro b a b ly kn o w , Allen Newell a n d H e rb ert S im o n received the T u rin g A w a rd this year. T hey m en tio n ed their chess p r o g r a m m in g research d u rin g their accep tan ce speeches. It is really a m a z in g the fam e th a t aw aits chess p ro g r a m m e r s , if they just o b tain the m atu rity to sto p chess p r o g ra m m in g ! ? ! I sp o k e with Newell a b o u t o u r p ro b lem s with ****. He was a s to n is h e d a n d c h a ­ grined. H e said, “ I'll have to talk to Dave a b o u t t h a t .’' He requests th a t you send to him copies o f the relevant co rre sp o n d e n c e (at C a rn e g ie-M e llo n U niversity, Pitts­ b u rg h, Pa., U S A ). He assures me th a t he will at least be able to straig h ten things o ut for next year. I believe Newell can help everyone co ncern ed . Y o u owe it to y o u rse lf to pursue this. ****** deserves to get so m e heat. N o w for som e f u n ! This is the story o f the little p ro g ra m th at alm o st w a sn 't there. Because o f my plans for t o u r n a m e n t p articip atio n , we ( M a r t h a & I) arrived a day early fo r the conference. I a tte n d e d the tou rn ey o rg a n isa tio n a l m eeting ju st to confirm o u r w ith d raw al. N e w b o r n said th a t since I was there w ould I care to m o n ito r a n o t h e r p ro g r a m . T h e p ro g r a m was a u th o r e d by a previous t o u r n a m e n t gadfly. G a r t h C o u rto is , at the U niversity o f C o lo ra d o . I had met G a r t h a n d ow ed him a favor fro m previous years. A nyw ay, to m a k e a long story sh o rt (?), I accepted the duties. M o n ty N e w b o rn assured me that the p r o g ra m was a b o r n disaster. G a r t h was an u n em p lo y ed chem ist a n d knew very little chess, less c o m p u t e r science, a n d possibly zip a b o u t h o w to write a chess p ro g ra m . (Insert c o n d e sc en d in g N e w b o r n smile here.) Well, G a r t h certainly had the w orld stack ed against him. His c o m p u t e r w as an obsolete N o v a mini that was sort o f fo rg o tte n in a closet in the E.E. b uild ing at the U niversity o f C o lo r a d o . N o one there even knew he was using it. T h is old N o v a had a b o u t half the h o rse p o w e r o f N e w b o r n 's sp a n k in g new one, a n d it was smaller. G a r t h h ad the m ost m od est h a rd w a re o f the tourney. W e were seated 10th sim ply because the 11th a n d 12th ra n k e d entries were k n o w n to be ab solu tely terrible. A n d it d id n 't help th a t the p r o g r a m 's n a m e w as u n p ro n o u n c a b le . . . E T A O I N S H R D L U . . . n am e d afte r the first tw o key c o lu m n s o f the linotype. D a v id Levy baptised it E.S. Round 1 T h e luck o f the draw . Paired against M o n ty N e w b o r n 's O S T R I C H . “ I ’m sorry a b o u t sticking you with this p r o g r a m , D ick, b u t it is so b a d at least the gam es w o n ’t last lo ng,” said P rofessor N e w b o r n w ith great c o n s o la tio n in his voice. I smiled, th in k in g fo ur letter words. Well, the o p en in g went better th a n expected a n d N e w b o r n finally a d m itte d O S ­ T R I C H h ad b ungled the opening. W e were in the thick o f the m id dle gam e, even m aterial, a n d S H R D L U had all its pieces o u t o n the offensive. O S T R I C H sat w ith a bishop, knight, a n d ro o k stuck in a co rn er. “ It's n o t playing a b ad gam e so fa r.” N e w b o r n was c o m in g a r o u n d . Well th en it h ap p e n ed . S H R D L U su ckered O S T R I C H with a p o iso n e d paw n. It was am azing . Several m oves later O S T R I C H h ad its only developed piece, the Q ueen, sitting o n Q N 7 a n d S H R D L U h ad fo u r pieces c o m in g in on its o p p o n e n t ’s K ing. Well as luck w ould have it, ju st at the m o m e n t S H R D L U h a d a m a te in tw o, it noticed it was r u n n in g sh o rt o f tim e a n d d r o p p e d its search d e p th to tw o ply.

Addendum

109

N e w b o r n w as furiously c h e c k in g his listings a n d q u ery in g his person al o n site N o v a C .E . a b o u t the h a rd w a re . S H R D L U m a d e safe c h e c k in g m oves a n d picked u p so m e m aterial. “ W h y d o e s n ’t this lousy p r o g r a m get it over w i t h ? " said N e w b o r n , c o m in g full circle. Well S H R D L U a d m in is te r e d the c o u p de grace o n the 40 th m ove (it was 40 m oves in tw o hours). S H R D L U f o u n d a pretty m a te as s o o n as it th o u g h t it had tim e to look. Round 2 O n ly th e devil co u ld have invented the Swiss system. Paired ag ainst C H E S S 4.4. Slate h a d w a tc h e d S H R D L U a n d was impressed. S H R D L U was playing nice chess fo r a mini. Slate is a g e n tlem an a n d t h r o u g h o u t the g am e we h ad pleasant conversation. S H R D L U se arc h ed 1200 to 5000 n od es d u rin g its move. It kept very accu rate time c o n tr o l by h av in g a s e p a ra te in te rru p t key to signal the clock change. C H E S S 4.4 on the C D C C Y B E R 175 search ed m o re n o d e s per second th a n S H R D L U per move. T ypical trees were 500K n o d es a n d up. S H R D L U held the initiative t h r o u g h o u t the game. It m a d e several deep tactical e r r o r s a n d C H E S S 4.4 prevailed by b ru te force. But even in defeat, S H R D L U was th re a te n in g m a te in three. A n o te o f interest here: D u r in g the chess p r o g r a m m in g panel discussion, Joel M oses o f sy m b o lic a lg e b raic m a n ip u la tio n fam e a n d R ic h a rd G r e e n b l a t t ’s boss, a n n o u n c e d th a t G r e e n b l a t t h a d a h a r d w a re T T L chess m a c h in e u n d e r co n stru c tio n . 500K nodes per s e c o n d ! ! ! A full eight ply per s e c o n d — a n d it only cost $10K. S late ( M r . N o d e s-p e r-s e c o n d ) ju s t held his head, quietly, in disbelief. A n d Levy, a fte r a slight p au se, ask ed , “ W o u ld M r. G re e n b la tt care to increase my w a g e r? ” A m a n w ith real guts.

Simultaneous display by Levy against all the programs Levy w as in b ad sh ape. H e lo o k e d ill a n d c o m p la in e d o f the jet lag. I have never seen him so o u t o f sorts, a n d his play sh ow ed it. H e actually perm itted tw o draws. S H R D L U held its o w n until it got in to tim e trouble. T h e n it politely sped up, se a rc h e d very shallow , a n d blew the game. By n o w it had established itself as a p r o ­ g r a m to be re c k o n e d with. S late's fa v o ra b le e v a lu a tio n helped. Round 3 E.S. vs. C H U T E 1.2. S H R D L U , the clearly s u p e rio r p r o g r a m decim ated C H U T E . M a r t h a m a n a g e d the p r o g r a m while I went to a d e b a te on S IL ’s (System Im p le­ m e n t a t i o n L an g u a g es.) N e w s p a p e r people p h o to g r a p h e d her fro m every angle (the o n ly girl). N e ith e r she n o r the m o n ito r fo r C H U T E kn ew h o w to play chess. F o r ­ t u n a te ly b o t h p r o g r a m s ac ce p ted algeb raic n o ta tio n . In cid e n ta lly , th e t o u r n a m e n t set-u p was the best I have ever seen. T h ere were six large m a g n e tic display b o a r d s with a side display p a d for previous moves. E a c h table w as e q u ip p e d with a reg u lar to u r n e y set a n d a giant set with p a w n s 6" high. It was a g re a t set u p fo r th e s p e c ta to rs a n d R ic h a rd H a r b e c k a n d his associates received well deserved c o n g r a tu la tio n s . Round 4 O n c e a g a in t h a t old Swiss system got us. (It isn’t g rea t b u t it is the fairest.) W e were p a ire d a g a in st T o n y M a r s l a n d ’s W I T A . W I T A h a d only o n e win. If we h ad been paired a g a in s t a n y o n e with tw o wins th en se co n d place co u ld have been o u rs o n the b reak po ints.

110

The Machine Plays Chess?

By m ove 9 S H R D L U had W I T A ’s K ing in the m iddle o f the b o a rd . (A nice little sacrifice got it there.) T h en S H R D L U did an a m a z in g thing. It h ard ly ever searched m o re th a n four ply; but there it was progressively deepening w hat it th o u g h t was a go o d line. A n d it was! A n n o u n c e d m ate in three. T he fans went wild. Levy said “ I'm sure E.S. will find this line. It has played surprisingly well in this t o u r n a m e n t . ” It was the shortest m ate in t o u r n a m e n t c o m p u t e r chess. S H R D L U tied for second. T h e best m in i-co m p u ter chess p r o g r a m yet. At the a w a rd s p resentation, Jean S a m m e t h an d e d me the first place tro p h y by m istake. Ben M ittm a n (o f N o rth w e ste rn ) c o m m e n te d to M a r th a that S H R D L U deserved th a t prize. G a r t h received the third place tro p h y based on the tie-breaking points. We h ad a gay old tim e c o n g ra tu la tin g him by ph one. He m odestly explained that he w a sn 't sure how go o d S H R D L U was because it alw ays beat him! Sincerely, R ic h a rd J. Cichelli

References A great deal o f material in this b oo k came from personal comm unications a n d the SIG A R T newsletters. A more formal list o f references can be found in the Proceedings o f the First Computer Chess Conference published by the Atlas C o m p u t e r L ab o ra to ry , Science Research Council, Chilton, O xford­ shire.

111

Index >

ACE computer 16, 29 A C M tournaments 41-48, 52, 54, 64, 65, 107 AI see Artificial intelligence Alexander, C. H. O'D. 14 Algorithm 9 Alpha-beta 98 Artificial intelligence 23 Atkin, Larry 41-43, 48, 60, 64 Atkin, Ron 52, 80, 91, 92 ATLAS computer 26, 49-53, 80,

Dead position 18, 30, 39 de Groot, Adrian 89 Donskoy, Mikhail 63, 76 Draughts see Checkers Dreyfus, Hubert 36-38

Eastlake, Donald 38-40 ELIZA 40-41 E N IA C computer 16,31 ETAOIN S H R D L U 108-110 Euwe, Max 89-90

110

Babbage, Charles 12-13 Barricelli, Nils 49-50, 67 Berliner, Hans 45, 63-64, 76, 80-81 Bernstein, Alex 33-36 Birmingham, John 54, 76, 81, 101 Bletchley 13-17 Bobrow, Dan 41 Botvinnik, Mikhail 45, 91 Bowden, Lord 8 , 16-17, 29, 35

Feedover 100-101 Fine, Reuben 49 Fischcr, Bobby 42, 45, 54

G E N IE 46-47 Gillogly, James 42-43 Glennie, Alick 17-21 Golombek, Harry 14-15 Good, Jack 1 4 , 44-45,51 Greenblatt, Richard 38-41, 109

Caswell, Thomas 72-75 Cathode ray tube see C R T C H A O S 60-62 Checkers 28-29, 40, 93, 98 CHESS 3 .0 ~ 4 .4 41-44, 48,55, 6064, 76, 80-81, 102, 109 Chopper 99-100 Cichelli, Richard 103,107-110 C O K O 46-47, 101 Cooper, Dennis 47, 49 Courtois, G arth 108-110 C R T 15-16, 26-27

Hartston, Bill 79, 92-93 Horizon effect 29 Huberman, Barbara 36, 68-72

IFIPS

51

Jones, R. V. 113

14, 86

114

The Machine Plays Chess?

KAISSA 4 8 , 6 0 , 6 2 - 6 4 , 7 6 , 8 1 , 9 6 Kempelen, Wolfgang von 1-3 Kent, Peter 53-54, 58-60, 76, 82, 101, 104-107 Killer 72, 99 Kozdrowicki, Edward 47, 49, 87

Lasker, Edward 34, 93 Levy, David 54-55, 60, 62-63, 8789, 92-93, 101-102, 107-109 Lull, Ramon 66-67

M A C H A C K 38-41, 51-52, 54, 87 M A D M computer 16,21,26-30,33 Maelzel, Johann 3-6 M A N IA C computer 31-33, 36, 49 MASTER 49-65, 72-85, 89, 97, 99, 101-103, 106-107 McCarthy, John 14, 87 Michie, Donald 17, 71, 76, 80, 82, 84-89 Mini-max 13, 21, 98

Napoleon 3-6, 59 Newborn, Monroe 62, 108 OSTRICH

62, 108

Papert, Seymour 38, 87 Plausible move 33, 39 Ply 18, 22 Poe, Edgar Allan 4-6 Prinz, Dietrich Gunther 26-30, 34, 35, 99 Quiescent

Refutation

see Dead position see Killer

Reshevsky, Samuel 42-45 RIBBIT 58-59, 64-65

Samuel, Arthur 93, 98 Saveedra, F. 84, 100 Schlumberger, William 4-6 Scott, John 51-52, 87 Shannon, Claud 8, 14, 21-25, 30, 40, 93, 98 SIG A R T newsletter 37 Simon, Herbert 36-37, 67, 86, 108 Slate, David 41-43, 48, 60, 62, 64, 109 Sprague, Richard 23-26 Storage tube see CRT Strachey, Christopher, 28-30, 34-35 Symbio-organism 50

TECH 42-44 T EC H 2 55-56, 58, 60, 65, 99 TELL 56-58 ‘ Toros y Gallino, Don Miguel 9, 85-86 Torres y Quevedo, Leonardo 8-11 Turing, Alan 14-22, 27, 29-30, 4041, 44, 106, 108 Turk, The 1-7 T U R O C H A M P 16-21

Ulam, Stanislaw

31-35

von Neumann, John 49

Waldron, John

Zobrist, Al

91

21, 23-25, 31,

54, 77-79

P ERGAMON CHESS SERIES The Machine Plays Chess? Alex Bell tells the story of M a n ’s efforts to build a machine capable of playing winning chess, lie punctuates his account of the som ew hat erratic progress made since the eighteenth century with some charm ing anecdotes reflecting the h u m o u r and wit which have characterized this field o f technological development. C o m p u te r personnel may not be surprised by the suicidal blunders a chess program m e is still capable of making after hours of sound playing, but to the layman this book will provide a fascinating insight into the dimensions of the challenge that chess presents to the co m p u ter program m er. “ Beca u se it’s there,” was Sir E d m u n d Hillary’s explanation of why he climbed M o u n t Everest. The chess pro g ra m m e r might well use the same explanation when asked w hy he has accepted his challenge. I he difference is that chess seems to have no finite bounds limiting its development, and the triu m p h a n t p ro g ra m m e r will never be sure that his program m e c annot be eclipsed by a n o th e r even when all hum an opponents are long vanquished. Alex Bell has spent 15 years writing operating systems for the most powerful com puters, and is the a u th o r of many papers on com puting techniques as well as his earlier book, Games Playing with Computers , which describes in detail how m a n y games, including chess, can be program m ed on a c o m p u ter. He was the Leader of the M A S T E R project which produced the 1976 E u ropean C o m p u te r Chess C h a m p io n and is a c o m b ata n t in the 1977 W orld C o m p u te r Chess C h am p io n sh ip s. This is a book which will be of interest not only to c o m p u te r p ro gram m ers and chess players, but also to the logically-minded layman with a knowledge o f the principles of co m p u ter operations and the rules of chess.

ISBN 0 08 0 2 1 2 1 2