Edited: MJS May 3, 1983  10:06 AMFile: {indigo}<loops>loopsmoviescript.bravox12(635)\f1Loops Movie Script x12e24c\f9bThe Loops Design Teamx12e12c\f6Copyright c 1983 by Xerox Corporationx12e12\10f3 1f0Special effects: Title slide white on blue background.  Music and increasing crescendo of sound from Knowledge competition in Background.d3648x12e12j\f1bi15I                                                          d3648x12e12j\u58UKnowledge Programming in Loops:Highlights from an Experimental Coursed3648x12e12c\b70BMark Stefikd3648x12e12c\bDaniel G. Bobrowd3648x12c\bSanjay Mittald3648x12c\b                                                           d3648x12e12j\u59USpecial effects: Fade To A white title on a blue background.d3648x12e12j\f1bi15I                                                          d3648x12e12j\u58UKnowledge Systems Aread3648x12e12c\bXerox Palo Alto Research Centerd3648x12e12c\bCopyright c 1983 by Xerox Corporationd3648x12e12c\f1 10f3 1f1 26f0                                                          d3648x12j\u58Ux12e12\f1bSound:  Music fades.  Crowd noise remains low.  Stefik speaks over the crowd noise.x12e12\f1bScript for Stefik: d3648x12e12j\f1bi18IView: Display of game board.  d3648x12e12j\f1bi4IFilm Clip:  xx-xx-xx to xx-xx-xx  Fade to closeup of the gameboard showing a truck going to a stop where it is robbed by Bonnie or Clyde.  Remark in crowd about being robbed.  Pull back, getting a brief view of full game board on the screen.d3648x2e12j\i10I2b8B4b8B2f1 207f0This may appear to be a typical a video game.d3648x12e12jActually, something much more unusual is happening.d3648x12e12jYou are watching a knowledge competition.d3648x12e12j\19i21IWhat looks like a competition between people is actually a competition between knowledge systems -- knowledge-based computer programs.d3648x12e12jView: Crowd shot.  d3648x12e12j\f1bi4IFilm Clip:  xx-xx-xx to xx-xx-xx Fade to view of crowd gathered around screen.  Watch for 5-10 seconds.  Sound fade though view remains.  d3648x2e12j\i10I2b8B4b8B1f1 102b2f0BThese people have just spent three days taking a course about Loops -- a knowledge programming system.d3648x12e12jThe final problem in the course was to program a knowledge based player.d3648x12e12jInstead of playing the game with a joystick, each team created a computer program -- a sort of independent trucker -- to play the game for them.d3648x12e12j\95i19IThey had to write rules to guide their players in the situations that arise in the simulation world. d3648x12e12jView: of Stefik in his office. The following slide appears momentarily underneath Stefik. d3648x12e12j\f1bi4I                                                          d3648x12e12j\u58UMark StefikKnowledge Systems AreaXerox PARC													Loops Logod3648x12e12c\b45i14f1B10f0b                                                          d3648x12j\u58UKnowledge programming is part of Artificial Intelligence.d3648x12e12jIt is concerned with the techniques for representing knowledge in computer programs.d3648x12e12jKnowledge programming is important in many applications of AI -- where the problems are messy.d3648x12e12j\88i5ILike many things in real life -- pat solutions, or simple mathematical solutions just aren't good enough.d3648x12e12jThings break.  Information is missing.  Assumptions fail.d3648x12e12jTo cope with messiness, AI researchers have found that large amounts of problem-specific knowledge are usually needed.d3648x12e12jThis places a premium on advanced techniques for representing and testing such knowledge in computer programs.d3648x12e12jVery few people have been trained to build knowledge systems.d3648x12e12j "Training" today usually requires several years of study at one of a handful of universities.d3648x12e12jA group of us in the Knowledge Systems Area at Xerox PARC are trying to shorten this training time.d3648x12e12jWe are developing new tools and methods.d3648x12e12jOur goal is to increase the impact and scale of Artificial Intelligence by simplifying methods of Knowledge Programming -- and making those methods more widely accessible.d3648x12e12jView:  Move to Closeup of Loops Logo. MJS pointing to it with a pointer.d3648x12e12j\f1bi5I                                                          d3648x12e12j\u58UIn doing this, we have created a knowledge programming system called Loops.d3648x12e12jWe use this icon as an aid in explaining Loops.d3648x12e12jLoops is a a programming system that integrates several programming paradigms.d3648x12e12j(point)  The first paradigm is procedure-oriented programming of Interlisp.  In this paradigm, big programs are built up from little ones by making subroutines.  Data and programs are kept separate.  Most computer languages in the world are like this.d3648x12e12j\f1b9f0B(point)  The second paradigm is object-oriented programming.  In this paradigm, the world is made up of objects -- combining both procedures and data.  Objects communicate via by sending messages to each other.  Standardized protocols enable different kinds of objects to respond to the same kinds of messages.  Big objects are built out of smaller objects.d3648x12e12j\f1b9f0B(point)  A third paradigm is data-oriented programming -- used for programs that monitor other programs.  You can think of this as a way of connecting probes into the variables of a program.  The probes can trigger additional computations when they sense changes in the data.  In this paradigm, as in the others, Loops provides appropriate methods of composition. d3648x12e12j\f1b9f0BLoops currently provides one other paradigm -- called rule-oriented programming.  This paradigm is specialized for representing decision-making knowledge in the form of rules.d3648x12e12jIn Loops integrates (point at ring) these paradigms are all integrated -- to be used together in building a complete program.d3648x12e12j\20f1b15f0BView: Fade Back to Mark Talkingd3648x12e12j\f1bTo test the effectiveness of the our methods for building knowledge systems, we taught an experimental course.  In the two versions of the 3-day course that have been run so far, the results have been very encouraging. d3648x12e12jEveryone in the course was able to learn enough of the Loops programming environment to formulate the knowledge for their system, and interact with Loops to modify and debug their systems.  d3648x12e12jThe problem setting used in the course is a simulated economic model called Truckin -- brought to life in the video display that you saw.d3648x12e12j\76i7IThe knowledge systems built by the students had to plan routes for buying and selling commodities, and avoiding hazards of the simulation world.d3648x12e12jAt the end of the course, we had a knowledge competition, in which all of the programs competed with each other.     d3648x12e12j\35i21IThis is the story of the experimental course, told from the viewpoint of one of the participants.d3648x12e12jTime 02:10x12e12\f1b10f5BView: Course participant in hallway outside the Loops class room (AH).  d3648x12e12j\f1bi4ISpecial Effects:  Austin's name overlays near bottom of screen for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UAustin HendersonCognitive and Instructional Sciences AreaXerox PARCd3648x12e12c\69i                                                          d3648x12e12j\u58UScript for Austin:  d3648x12e12j\f1bi18IIn February, I took the Loops course offered by my colleagues.  I was curious about how the ideas in Loops would apply to both the art of programming, and to Trillium.  Trillium is an internal Xerox project for designers who are not programmers.  It helps them to develop interactive interfaces to copiers.  d3648x12e12jTwenty two people were in my course.  Since I am from Xerox, I was a somewhat atypical participant.  -- Most of the people came from research laboratories such as SRI International or Lawrence Livermore or Stanford University, or startup AI companies like Applied Expert Systems and Teknowledge.  d3648x12e12jAlso -- I already had experience with the exploratory programming languages Interlisp and Smalltalk, and with knowledge representation languages like Klone.  Loops integrates several different programming paradigms  -- that is, styles for organizing information.  It was being touted as combining the best features of many of the systems that I already knew about.  I wanted to see this for myself.d3648x12e12jView:  Camera follows Austin walking towards the classroom door.  Focuses momentarily on the wall sign, and then back to Austin.d3648x12e12j\f1bi5I                                                          d3648x12e12j\u58UThe Loops Coursed3648x12e12c                                                          d3648x12e12j\u58Ud3648x12e12jThe course was a combination of lectures and exercises using Loops on Xerox computers.  The first lecture was about object-oriented programming in Loops.d3648x12e12jTime 03:10x12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 1d3648x12e12cObject-oriented Programmingd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  01-03-24 to 01-04-16. DGB. "Good Morning. please ask questions."d3648x12e12j\i10I2b8B4b9B1f1 42f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UDaniel G. Bobrowd3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  01-06-00 to 01-07-31.  DGB.  Outline of talk.d3648x12e12j\i10I2b8B4b9B2f1 22f0Film Clip:  01-25-23 to 01-25-59.  DGB.  Bob Blum question and answer.d3648x12e12j\i10I2b8B4b9B2f1 35f0Film Clip:  02-17-47 to 02-18-27.  MJS.  "Pick partners for exercises."d3648x12e12j\i10I2b8B4b9B2f1 36f0Time 07:00x12e12\f1b10f5BView:  Fade to Austin sitting at a workstation.   A course notebook is at hand, open to the pages of the first set of exercises.  Interlisp-D manuals are also at hand.d3648x12e12j\f1bi5IThe workstation screen shows the standard set-up for the Loops Demo.  Second camera is on the screen (or a slave screen).   d3648x12e12j\f1bScript for Austin.d3648x12e12j\f1bi18IAfter the first lecture, we were grouped into teams of 2-3 people to do the exercises on the computer.  Our first set of exercises was about the Loops programming environment and object-oriented programming.d3648x12e12jThe Loops user interface makes extensive use of interactive graphics.  One of the standard ways of accessing objects in Loops is to use a browser.  A browser is a program that enables a user to "browse" through information in a knowledge base.  A particular kind of browser -- a class browser -- shows the inheritance relationships between classes.d3648x12e12j\277i18IView.  Fade to second camera on a slave screen.  The workstation screen shows the standard set-up for the Loops Demo.  Perhaps a split-screen with one camera on the mouse and keyboard and another on the screen.   d3648x12e12j\f1bi5IFor example, here is a class browser for a set of everyday commodities.  From the lattice drawn in the Browser window, we can see that (point at each item with the cursor using the small hand browser) a Tomato is a Vegetable, and also a FragileCommodity.  A Vegetable is a Grocery, and also a PerishableCommodity. Similarly, Apple can be seen to be a Fruit which is also a Grocery.d3648x12e12j\135f1 1b65f0B2i6I6i9I13i16I5i9I6i7I13i19I13i5I21i6IBy pointing at a class in the browser, we can ask Loops to print out more information about a class.  For example, (click Apple holding down Leftshift) here is a printout of the class Apple.  The information in bold font shows information that is defined locally in the class Apple itself.  We see that Apple has Fruit as a super class.  This corresponds to the visual display in the browser window.  Going back to the printout, we can look at the class variables for the class Apple, the descriptions of the instance variables, and the methods.  d3648x12e12j\115f1 1b36f0BApple also inherits information through the class lattice.  The nonbold information about Apple shows variables and methods that are inherited from Apples's super classes. (point at pieces of information which is inherited).   For example, we see that the variable lifeTime must be inherited.d3648x12e12j\172f1b52B1f0 40i8I(camera shifts back to browser lattice)d3648x12e12j\f1bGoing back to the browser, we find out where the pieces come from using the WHEREIS option.  Here we see that the instance variable lifetime comes from PerishableCommodity, and quantity (qty) comes from Commodity, and price is defined locally.  We also see that the methods SetPrice and Display are defined locally in the class Apple itself.   The method TransferOwner comes from Commodity, and SetPrice is defined locally.d3648x12e12j\132i8I12i19I6i8I18i9I62i8I5i7I60i14I12i9I6i8IView:  Fade back to Austin sitting at a workstation.d3648x12e12j\f1bi5IMessage sending is a central idea in object-oriented programming.  This is the way that objects communicate;  it corresponds roughly to procedure call in more traditional languages -- one object causes another object to do something by sending it a message.  An important difference from procedure call is that the sender of a message need not know the name of the procedure used by the receiver of the message -- the sender only needs to know a selector for the method.  This is a key feature behind the idea of protocols.  Two different objects can obey the same set of protocols, that is, carry out the same kinds of operations even though their implementations are completely different.  For example, an object for displaying text and an object for displaying pictures may both use a display protocol, but have completely different ways of carrying it out.  This makes it possible to define uniform interfaces to different classes of objects. d3648x12e12j\788i7IView:  Fade back display at workstation.d3648x12e12j\f1bi5IIn Loops, a $ comes before Loops names.  A left arrow is used for sending a message to an object.  (start typing (_ $Apple New 'App1))  For example, to create an instance of a the class Apple, and name it "App1", we send a New message to the class Apple like this:d3648x12e12j\99f1b37f0B87i3I(_ $Apple New 'App1).d3648x12e12jBy sending a Display message to App1, (camera moves out to where it can see typing and mouse postion -- which should be on clear area of screen) d3008x12e12j\13i7I17f1 1b106f0B(_ $App1 Display)d3648x12e12jwe cause a picture of an apple to appear on the display.  (move App1 to position and click down) using the specialized display method of Apples.  d3008x12e12j\58f1b38f0BTo see the variables of App1 send an Inspect message.d3648x12e12j\37i7I(_ $App1 Inspect)d3648x12e12jThis creates an inspector window which shows the instance variables and their values.  From this window we can inspect and change these variables directly by selecting them with the mouse.  (click mouse Local in title area of inspect window) We have just moved from showing the values for all of the instance variables of App1, including the ones that are inherited to showing only those which are local.  The question marks indicate where no values have been set locally yet.  (click mouse Local in title area of inspect window) So far, all of the values in the instance App1 are being inherited from the class Apple.  d3008x12e12j\190b52B236b52BWe can set a value in App1 using the syntaxd3648x12e12j@(app1 price)_90d3648x12e12jThen if we redisplay the inspector, we see that new price, and also the indication that it has been set locally in the instance, although the values of the other variables are still being inherited.d3008x12e12jThe next part of the exercise anticipates the data-oriented paradigm of the afternoon lecture.  We were told to create a gauge and attach it to the price of App1.  This can be done in a single step as follows (click mouse in demo Menu on Monitoring ...):d3648x12e12j\208f1 1b44f0B(_New $VerticalScale Attach $App1 'price)d3648x12e12jand placing the gauge on the screen.  Now if we change the price of $App1, asd3008x12e12j(_@ $App1 price 45)d3648x12e12jthe gauge immediate shows the change on the display.  This also works if we use a program -- say a method to change the price -- as ind3008x12e12j(_ $App1 SetPrice 85)d3648x12e12jView.  Fade back to Austin at the terminal.   d3648x12e12j\f1bi5IIn most programming systems, one would have to incorporate both functions  -- price calculation and display updating -- into the same program.  In Loops, the active value mechanism separates these functions -- making it possible to attach gauges to variables without changing the programs at all.  This makes it easy to "gauge" up a program.  d3648x12e12jGauges are an interesting tool for monitoring the behavior of a program.  They are much better than trace statements, which disappear as they scroll off a "glass teletype".  Loops comes with a collection of gauges, and new ones are being invented all the time.  Part of our afternoon exercises was to implement a new kind of gauge.d3648x12e12jThe rest of the first set of exercises was about facilities for editing and debugging programs.  These facilities in Loops make extensive use of the Interlisp-D environment on which Loops stands.  An example of this is the integration with the Loops Break Package -- an interactive facility for debugging programs.  Loops extends the Break Package to work with objects.  d3648x12e12jFor example, suppose that I am working on a large program, possibly with parts of it written by other people.  Suppose also that some unidentified part of the program is clobbering the value of some variable -- such as the price of App1.  Using the Loops extension of the Break Package, we can ask the system to Break -- that is, stop -- whenever any program tries to change that variable.  Like this: ...d3648x12e12j\347i3IView.  Fade back to the display terminal.   d3648x12e12j\f1bi5II can ask the system to Break when the price of Apple1 is changed as followsd3648x12e12j(BreakIt $App1 'price)d3648x12e12j Now if we invoke the SetPrice method as before ...d3008x12e12j(_ $App1 SetPrice 25)d3648x12e12ja Break Window appears on the screen (camera has panned over to midscreen where the break window has come up).  This window shows that a program is trying to change the value of the price of Apple1 from 85 to 25.  By selecting the BT option, we can get a back trace of the calling stack.  Here we see that the PutValue was called from inside Apple.SetPrice.  We can look at the calling arguments by selecting the item in the stack like this -- and we can inspect those arguments (which may be objects like apple1) like this.d3008x12e12j\36f1 2b71f0B201i8IThese debugging features enable us to to find the spot in the program that is attempting to set the price.  To resume the computation, we can just select the OK option, and the Break window will go away, the computation will procede, and the gauge on the screen will be updated.d3648x12e12jTime 13:00x12e12\f1b10f5BView:  Hallway.   Austin near the classroom door.d3648x12e12j\f1bi5IScript for Austin:  d3648x12e12j\f1bi18I Data-oriented programming was the main subject for the afternoon lecture.  d3648x12e12jTime 13:20x12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 2d3648x12e12cData-oriented Programmingd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  03-00-34 to 03-01-06.  DGB.  Welcome back.d3648x12e12j\i10I2b8B4b9f1B21f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UDaniel G. Bobrowd3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58Ud3648x12e12jFilm Clip:  03-03-24 to 03-04-22.  Dual of object-oriented pgming.d3648x12e12j\i10I2b8B4b9B2f1 31f0Film Clip:  03-14-27 to 03-14-50.  One mechanism, many applications.d3648x12e12j\i10I2b8B4b9f1B35f0Film Clip:  03-17-04 to 03-18-30.  Nesting.d3648x12e12j\i10I2b8B4b9B2f1 8f0Film Clip:  03-19-26 to 03-19-49.  In KRL, ....d3648x12e12j\i10I2b8B4b9B2f1 12f0Film Clip:  03-27-08 to 03-28-20.  Arbitrary msgs.d3648x12e12j\i10I2b8B4b9B2f1 15f0Film Clip:  03-35-16 to 03-37-23.  Gauges.d3648x12e12j\i10I2b8B4b9B2f1 7f0Film Clip:  04-03-32 to 04-03-47.  Thank you.d3648x12e12j\i10I2b8B4b9B2f1 10f0Time 19:30x12e12\f1b10f5BView:  Camera on Austin seated at workstation, ready to work on exercises.d3648x12e12j\f1bi5IThe next set of exercises was about defining and specializing classes.  The examples for these exercises were drawn from the Loops gauges.d3648x12e12jThe first exercise was to make an accumulating gauge, that is, a gauge that indicates the arithmetic sum of all of the values that have been set so far.d3648x12e12jView:  Workstation screen.d3648x12e12j\f1bi5IThe course material suggests that we create a class for Accumulator by specializing the class LCD.  We begin by creating a class browser for the gauges.d3648x12e12j(Browse GAUGESCLASSES)d3648x12e12jUsing the Browser -- we can use the Specialize option, and type in the name of the new class.  Note that the new Accumulator class now appears in the browser window.d3648x12e12jView:  Zoom in on Browser window for gauges.d3648x12e12j\f1bi5IWe can take a look at the Accumulator class.  After selecting the PrintSummary option, we see that Accumulator has several methods.  The exercise instructions suggest that we specialize the Set method -- listed here.  To look at that method, we can use the EM option to examine the method function from the lisp editor.d3648x12e12j\190i3IWe wait for a moment while Lisp fetches the source code from a file server, and now we see that the method for Set takes two arguments -- self, the instance of the accumulator class -- and the new reading.  To define a new Set message for Accumulator, we typed3648x12e12jDM (Accumulator d3648x12e12j -- let's see, what arguments does DM take?  We can use ?= facility to find out.  -- d3008x12e12jDM( Accumulator ?=d3648x12e12j-- ah -- we just need to name the selector and arguments.  Of course.  We're defining a method for Set. -- sod3008x12e12jDM (Accumulator Set (self reading) )d3648x12e12jSo now we're in the Interlisp editor again. We should put in a comment ---d3008x12e12j(* Method for accumulating readings in order to Set an Accumulator.)d3648x12e12j-- And we want to just specialize the code for the LCD by adding the new reading to the existing reading in the Accumulator.  We can use SendSuper to activate the inherited code for Set.  So all we need to do is to add the new reading.  Like this: d3008x12e12j(_Super self Set (IPLUS reading @reading]d3648x12e12j-- and make sure that the method returns that reading as its value.d3008x12e12jAustin deletes the self Lisp variable at the end of the Method.d3648x12e12j\f1 63f0and we can exit the Editor.d3008x12e12jNow let's build an accumulator, and test it out.  First we create an instance of the Accumulator class and save it in the Lisp variable ac1.d3648x12e12j(SETQ ac1 (_ $Accumulator New)) d3648x12e12jThen the exercise instructions say to set the scale and tell the Accumulator to Update.  Okay --d3648x12e12j(_ ac1 SetScale 0 100)(_ ac1 Update)l3648x12e12j-- Ah -- now the picture of the Accumulator-LCD appears on the screen.  So we can send it Set messages.  We'll set it to ten.d3648x12e12j(_ ac1 Set 10)d3648x12e12jWe'll try it again and again.  d3648x12e12jredoredoredol3648x12e12jIt's accumulating!  It works! d3648x12e12jView:  Austin in office.d3648x12e12j\f1bi5IScript for Austin:  d3648x12e12j\f1bi18IThere were several more parts to the exercise -- each part more challenging and requiring more initiative than the previous.  The last part of the exercise was about creating new classes by combining existing classes.  Several of the gauges that come with Loops are made in this way -- by combining parts of simpler gauges.  d3648x12e12jView:  Workstation display view. d3648x12e12j\f1bi5I27f0Special effect: WIPE!!! d3648x12e12j\f1bi16IFor example, the DigiMeter is made by combining a Meter with an LCD and the DigiScale is made by combining a HorizontalScale with an LCD.  The last problem was to define a DigiDial, by combining a Dial with an LCD.  I was surprised.  Along with almost everybody else in the class, we were actually able to do this.  In most programming languages this would be a very difficult thing to do.  Even in object-oriented systems lacking a multiple inheritance capability, this would be hard .  In Loops it was easy.  Facilities for combining classes are an important part of Loops.d3008x12e12j\17i9I50i9I87bi8BI253b20BView:  Camera focuses on Austin in the hallway.  d3648x12e12j\f1bi5I42f0At this point in the course, we all had had a pretty intensive first day.  We had learned a lot about object-oriented programming and data-oriented programming, and had all become acquainted with the user interface in Loops.   The last session of the day was to introduce the Truckin game.d3648x12e12j\276i7IWe hadn't heard much about Truckin yet.  We all knew that it was part of a scheme to teach us to build a small expert system, but we didn't really know how that was going to work.  This lecture was to be a brief introduction, so we could think about the ideas over night.d3648x12e12j\27i7ITime xx:xxx12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 3d3648x12e12cIntroduction to Truckind3648x12e12c\16i7I                                                          d3648x12e12j\u58UFilm Clip:  05-02-51 to 05-05-25.  Sanjay -- introductory fragments.d3648x12e12j\i10I2b8B4b9f1B35f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58USanjay Mittald3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UTime xx:xxx12e12\f1b10f5BView:  Sanjay in front of Truckin printout.  Wearing same clothing as on the previously-recorded video tape. Sanjay will be pointing at the game board. d3648x12e12j\f1bi4I22i7IScript for Sanjay.d3648x12e12j\f1bTeaching about expert systems is usually quite time-consuming.  In order to study an example expert system, the first several weeks are usually spent learning the vocabulary and concepts of the domain -- be it medical diagnosis, experiment planning, or whatever.d3648x12e12jHowever, this course on knowledge programming in Loops is only three days long.  To give you experience with an expert system, we had to find a problem area that you already know about -- something from common experience.d3648x12e12jThe domain we picked is about planning a truck route -- buying and selling goods to make a profit.  Buying goods and going places is something that we all know something about.d3648x12e12jTruckin is a simulation world for this domain.  It comes to life as a sort of video game, except that it is not played by people.  Behind each truck is a small expert system, that makes the decisions about where to go, and what to buy and sell. d3648x12e12j\i7I124b112BYour job, starting tomorrow afternoon, is to build an automated player.  Your player will act as an independent trucker, trying to make a profit in the simulation worldd3648x12e12j\54i16I30bi19BIThis is a game board for the Truckin game.  This is a highway, this is a road stop, this is a truck going down the highway.  d3648x12e12j\29i7ITruckin provides an interactive environment in Loops for developing your player.  Trucks go back and forth.  They take turns running.  They buy and sell.d3008x12e12j\i7IRoad stops with the icons are called producers.  Trucks can buy goods there.  Roadstops with a commodity name -- like groceries -- are consumers.  Trucks can sell goods there.  Some Roadstops sell gas; some levy taxes -- like the weigh stations, some correspond to rough spots in the road.  If a truck goes too fast over a rough road it may damage some fragile cargo.d3008x12e12j\37i9I89i9IA pedagogical goal in the design of Truckin is that the simulation is intended to be complex enough to preclude trivial solutions -- such as linear programming solutions.  It is meant to be like the kinds of domains in which expert systems are usually applied -- messy real-world problems that need expertise, not just mathematical formulas.d3648x12e12j\36i7IFilm Clip:  05-12-48 to 05-13-35.  SM: An assortment of trucks.d3648x12e12j\i10I2b8B4b9f1B30f0Film Clip:  05-15-55 to 05-16-58.  SM: Bandits, conflicting constraintsd3648x12e12j\i10I2b8B4b9f1B38f0iFilm Clip:  05-17-28 to 05-18-00.  SM: Austin question.d3648x12e12j\i10I2b8B4b9f1B22f0Film Clip:  05-19-08 to 05-20-40.  SM: Starting with Peddler.d3648x12e12j\i10I2b8B4b9f1B28f0Film Clip:  05-24-17 to 05-24-47.  SM: What can you do in a move?d3648x12e12j\i10I2b8B4b9f1B32f0Film Clip:  05-27-09 to 05-28-04.  SM: Gauges.d3648x12e12j\i10I2b8B4b9f1B13f0Time xx:xxx12e12\f1b10f5BView:  Display screen showing collection of Loops Gauges all counting down from 5 to 0.  Ticking sound in background ala 60 minutes.  d3648x12e12j\f1bi4ITime xx:xxx12e12\f1b10f5BSpecial effects: A white title on a blue background.d3648x12e12j\f1bi15I                                                          d3648x12e12j\u58UKnowledge Programming in Loops:d3648x12e12c\bSecond Day of the Experimental Coursed3648x12e12c\b                                                          d3648x12e12j\u58UTime xx:xxd3648x12e12j\f1b10f5B  Camera focuses on Austin in the hallway.  d3648x12e12j\f1b42f0Script for Austin.d3648x12e12j\f1biOn the first day, several people worked until late in the evening just to get ahead in the exercises of the course.  Others went home to read the manuals.  Pretty much everybody had started thinking about Truckin -- proposing strategies that they wanted to build into their expert systems.d3648x12e12j\205i7IThe first item on the agenda for the second day was a lecture on rule-oriented programming.  I was curious about rules, because although everybody in AI has heard a lot about using rules, rule languages have not been widely accepted or available.  I had never built a big program using rules, and I expected to learn something about how to do this.  Also, we had been told that rules would be an important part of the mini-expert systems that we would be building for Truckin.d3648x12e12j\468i7ITime 03:10x12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 4d3648x12e12cRule-oriented Programmingd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  06-03-28 to 06-05-49.  MJS.  What's special about rules.d3648x12e12j\i10I2b8B4b9B2f1 33f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UMark Stefikd3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  06-09-10 to 06-11-54.  MJS.  Wash Machine, 1-shots.d3648x12e12j\i10I2b8B4b9B2f1 28f0Film Clip:  06-17-36 to 06-19-09.  MJS.  Explanation ...d3648x12e12j\i10I2b8B4b9B2f1 21f0Film Clip:  06-20-37 to 06-21-55.  MJS.  Austin .. how auditing works.d3648x12e12j\i10I2b8B4b9B2f1 35f0Film Clip:  06-34-21 to 06-36-00.  MJS.  Peddler ...d3648x12e12j\i10I2b8B4b9B2f1 17f0Film Clip:  06-54-02 to 06-55-34.  MJS.  In the exercises.d3648x12e12j\i10I2b8B4b9B2f1 23f0Time 07:00x12e12\f1b10f5BView:  Fade to Austin sitting at a workstation.   A course notebook is at hand, open to the pages of the first set of exercises.  Interlisp-D manuals are also at hand.d3648x12e12j\f1bi5IThe workstation screen shows the standard set-up for Truckin.  Second camera is on the screen (or a slave screen).d3648x12e12j\f1b53i7ISet Up.  Truckin should be initialized, and the Traveler player should be compiled with auditing turned on except for FindStoppingPlace.  Truckin is running, but has been interrupted by a CNTRL-SHIFT break.   d3648x12e12j\f1b9i7I32i8I82i7IScript for Austin.d3648x12e12j\f1bi18IThe next set of exercises emphasized debugging in rules.  We started with an existing player called Traveler. d3648x12e12j\100i8IView.  Fade to second camera on a slave screen.  The workstation screen shows the standard set-up for the Loops Demo.  Perhaps a split-screen with one camera on the mouse and keyboard and another on the screen - SmallTalk style.   d3648x12e12j\f1bi5IA convenient way to access the rules of a player is through a browser.  So ...d3648x12e12j(Browse $Player)d3648x12e12jHere is the Traveler.  By selecting the EM option, we can edit one of the methods -- which happens to be implemented as a Loops RuleSet.  Now the rules appear on the screen.   We will edit the rules in the Traveler that are used to determine a stoppingPlace -- that is, a RoadStop on the route to a final destination.  So here are the rules.  The instructions say that we should turn on auditing -- that is, the saving of dependency trail -- so we change the compiler options for auditing.d3648x12e12j\12i8I186i8I30i13ICompiler Options: A;d3648x12e12jOne of the first things that we did was to practise using the dependency trail mechanism for debugging.  So we can type OK to start Truckin going again, and we see the various trucks running.  The gauges at the right hand side have been attached to monitor fuel consumption, and the weight of cargo, and such things.  d3648x12e12j\132i7IPause for 5 seconds or so to let people watch and understand the game in action.d3648x12e12j\f1 80f0Now my truck is going, and I'll interrupt it with the Rule Exec by typing a CTRL-F.  That new window is the Rule Exec.  I can get the value of variable by typing its name.  So, for exampled3648x12e12jre: stoppingPlaced3648x12e12j\4b13BThat tells me the next place that my player has decided to stop.  To see what rule was behind that decision, I type can ask "why" as follows:d3008x12e12jre: why stoppingPlaced3648x12e12j\4b17Band now the text of the rule comes up.  If we type OK, to the Rule Exec, the simulation just continues.  Another debugging technique is to attach additional gauges to things.  So to attach a gauge to my stoppingPlace, I could interrupt Truckin again.  (Use CTRL-SHIFT.)  For example, we can attach an LCD to the stoppingPlace of my trucker as follows:d3008x12e12j\236i8I8f1 17f0 43i13I(_New $LCD Attach $Austin 'stoppingPlace)d3648x12e12jand we can place gauge next to the other ones.  Now when we run Truckin some more, we see that the new gauge shows the changes to my trucker's stoppingPlace as they are computed.  d3008x12e12j\64i7I72i13IAnother technique is stepping through the rules.  To do this, we stop Truckin again (Use CTRL-SHIFT) and change the compiler options.  We go up to the class browser for Players, and edit the method for FindStoppingPlace.  Now we change the compiler options d3648x12e12j\70i7I7f1 16f0Compiler Options: BT PR;d3648x12e12jNow we type OK to start Truckin again, and ah.  Now the my RuleSet has started running.  We can see a printout of the rule in the top window.  In the Rule Exec, I can now ask any question as before.  To go to the next rule, I just type OK.  And the next rule appears.  This technique can be useful in determining why a particular rule does not fire in a RuleSet.d3648x12e12j\24i7IView:  Fade to Austin sitting at a workstation.   A course notebook is at hand, open to the pages of the first set of exercises.  Interlisp-D manuals are also at hand.d3648x12e12j\f1bi5IThe last part of this exercise was to specialize the Traveler to create a new player, with slightly altered structure and behavior.  At the end of this exercise, we knew enough about rules to start expressing our own strategy ideas in a personalized Truckin player.  d3648x12e12j\53i8I189i7INext we had a lecture about the Truckin knowledge base and simulation.  d3648x12e12j\32i7ITime 03:10x12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 5d3648x12e12cThe Truckin Knowledge Based3648x12e12c\4i7I                                                          d3648x12e12j\u58UFilm Clip:  07-06-20 to 07-07-35. SM. Truckin RoadMapd3648x12e12j\i10I2b8B4b9B1f1 19f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58USanjay Mittald3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  07-08-02 to 07-08-28.  SM.  Cheating ...d3648x12e12j\i10I2b8B4b9B2f1 17f0Film Clip:  07-13-04 to 07-14-35.  SM.  Austin on browsers.d3648x12e12j\i10I2b8B4b9B2f1 24f0Film Clip:  07-08-02 to 07-08-28.  SM.  Cheating ...d3648x12e12j\i10I2b8B4b9B2f1 17f0Film Clip:  07-30-27 to 07-31-49.  SM.  3 msgs to gameMaster.d3648x12e12j\i10I2b8B4b9B2f1 26f0Film Clip:  08-00-32 to 08-01-00.  SM.  One more hint.  Crowd leaving.d3648x12e12j\i10I2b8B4b9B2f1 35f0View:  Austin sitting at a workstation.   A course notebook is at hand, open to the pages of the first set of exercises.  Interlisp-D manuals are also at hand.d3648x12e12j\f1bi5IThe workstation screen shows the standard set-up for Truckin.  Second camera is on the screen (or a slave screen).d3648x12e12j\f1b53i7IScript for Austin.d3648x12e12j\f1bi18IWe worked for the rest of the afternoon on our independent truckers.  People discussed strategy and even shared rules.  Some people worked late into the evening, others came early in the morning.  Just before lunch we had a lecture on advanced features. d3648x12e12j\47i21ISpecial effects: Show sequence of slides from 1st course, of people working on their players, puzzling at their workstations. Maybe with music background.d3648x12e12j\f1bi15IView:  Display screen showing collection of Loops Gauges all counting down from 5 to 0.  Ticking sound in background ala 60 minutes.  d3648x12e12j\f1bi4ISpecial effects: A white title on a blue background.d3648x12e12j\f1bi15I                                                          d3648x12e12j\u58UKnowledge Programming in Loops:d3648x12e12c\bThird Day of the Experimental Coursed3648x12e12c\b                                                          d3648x12e12j\u58USpecial effects: Show more of the sequence of slides from 1st course, of people working on their players, puzzling at their workstations. Maybe with music background.d3648x12e12j\f1bi15ITime 03:10x12e12\f1b10f5BSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 6d3648x12e12cAdvanced Featuresd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  08-01-13 to 08-01-50.  DGB.  This lecture has the property ...d3648x12e12j\i10I2b8B4b9B2f1 39f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UMark Stefikd3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  08-02-41 to 08-03-44.  MJS.  Advanced features means ...d3648x12e12j\i10I2b8B4b9B2f1 33f0Film Clip:  08-16-41 to 08-17-27  MJS.  Composite Objects.d3648x12e12j\i10I2b8B4b8B2f1 24f0Film Clip:  08-23-52 to 08-24-50  MJS.  Perspectives.d3648x12e12j\i10I2b8B4b8B2f1 19f0Film Clip:  08-27-50 to 08-30-15  MJS.  Mixins vs. perspectives.d3648x12e12j\i10I2b8B4b8B2f1 30f0Film Clip:  08-33-00 to 08-33-31  MJS.  Knowledge bases.d3648x12e12j\i10I2b8B4b8B2f1 22f0d3648x12e12j\f5bView:  Austin in lounge area.d3648x12e12j\f1bi7IScript for Austin.d3648x12e12j\f1bi18IDuring an afternoon break, Sanjay Mittal gave us a demo of the Loops tester.  We learned that the tester is an expert system, written in Loops, used to certify new releases of Loops.d3648x12e12jSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UDemod3648x12e12cThe Loops Testerd3648x12e12c                                                          d3648x12e12j\u58USpecial Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58USanjay Mittald3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UView:  Sanjay seated at workstation.  (Second camera is set-up on computer screen).d3648x12e12j\f1bi7IScript for Sanjay.d3648x12e12j\f1bi18IUntil last fall, we had no systemmatic way of certifying new releases of Loops.  Whenever someone on the Loops development team changed the system, he was responsible for verifying that the code worked before putting it into a new release.  However, Loops had grown to about three hundred thousand bytes of source code, and sometimes changes to one part of the system had unexpected interactions with another part of the system.d3648x12e12jLast fall I started building an expert system that would automatically, and systemmatically put Loops through its paces.  It was an expert system about Loops itself, designed to uncover bugs in new releases.  Metaphorically, it harnesses Loops specifications -- that is, a knowledge base about what Loops is supposed to do -- to a tireless computer.  Now the Loops development team does not have to depend only on its human resources -- three people -- to spot bugs in a new release of Loops.  We could call on the services of an expert system to check things out.d3648x12e12j\238i20IHere is an example of the tester in action:d3648x12e12jView:  Switch to camera on Workstation display.d3648x12e12j\f1bi7IIn Loops, like any system that is built in layers, the more sophisticated features depend on the correctness of the lower level features.  Similarly, the tester must first certify the most primitive features of Loops, and then go on to the higher level features.d3648x12e12jOn the screen the tester has brought up a browser to show the relationships between the tests in its knowledge base.  In contrast with a class browser, the lines in the tester browser show dependencies between subtests.  The tests on the right depend on the ones in the left.d3648x12e12jThe current set of tests covers most of Loops functionality, and all of the low level operations -- such as message sending, value putting and getting for various cases.  The tester provides a framework for defining new tests.  Using this framework, the tests are entered manually.  Let's take a look at one of the tests in the knowledge base.d3648x12e12jIf we just want to display a test without making any changes, we select the PP option on the middle-button menu for the selected test. However, by selecting the EditTEST option in the left-button menu, we enter a mode where the tests can be created, edited, including the manipulation of various links between tests.d3648x12e12j\76bi2BI83bi8BINow we're ready to run the tester.  If we select the AllTests option in the menu, the tester starts.  As a test is started, its name is outlined in the browser and a message appears in the typescript window.  When a test completes correctly, it is blackened.d3648x12e12j\53b8BThis mode of running the tester steps through the entire knowledge base without user interaction -- unless there is an error.  Interactive modes of running specific tests are also available -- for situations where bugs have been discovered.  d3648x12e12jView:  Austin in lounge area.d3648x12e12j\f1bi7IScript for Austin.d3648x12e12j\f1bi18ISuddenly it was mid afternoon of the last day and time for the knowledge competition.  People were quickly putting the finishing touches on their players -- adding that one last rule, saving their knowledge bases.d3648x12e12jBefore the competition actually started, people were asked to explain the ideas behind their expert systems.  d3648x12e12jSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UThe Knowledge Competitiond3648x12e12c                                                          d3648x12e12j\u58UNote:  Tapes 9 & 11 are people shots.  Tapes 10 & 12 are Truckin display:d3648x12e12j\f1bi5I52i7IFilm Clip:  09-00-53 to 09-01-30.  Steve Gadol.d3648x12e12j\i10I2b8B4b9B2f1 12f0Film Clip:  09-02-27 to 09-03-00.  Chris Tong.d3648x12e12j\i10I2b8B4b9B2f1 11f0Film Clip:  09-04-16 to 09-05-15  Martin Kay.d3648x12e12j\i10I2b8B4b8B2f1 11f0Film Clip:  09-10-06 to 09-11-50.  Lee Erman and Steve Reis.d3648x12e12j\i10I2b8B4b9B2f1 25f0Film Clip:  09-12-56 to 09-13-02  SM: Here's the gameboard.d3648x12e12j\i10I2b8B4b8B2f1 25f0Film Clip:  09-21-39 to 09-22-04  MJS: Do we run a Peddler?d3648x12e12j\i10I2b8B4b8B2f1 25f0Film Clip:  09-10-06 to 09-11-50.  Lee Erman and Steve Reis.d3648x12e12j\i10I2b8B4b9B2f1 25f0Film Clip:  09-12-56 to 09-13-02  SM: Here's the gameboard.d3648x12e12j\i10I2b8B4b8B2f1 25f0****d3648x12e12j\f1bFilm Clip:  10-12-09 to 10-12-52  SM: Here's the game board!d3648x12e12j\i10I2b8B4b8B2f1 26f0Film Clip:  10-16-47 to 10-17-08.  Gauges for Gadol.d3648x12e12j\i10I2b8B4b9B2f1 17f0Film Clip:  10-22-56 to 09-23-00  Game starts.d3648x12e12j\i10I2b8B4b8B2f1 12f0Film Clip:  10-28-42 to 10-29-05  Sell that gold!d3648x12e12j\i10I2b8B4b8B2f1 15f0****d3648x12e12j\f1bFilm Clip:  09-42-01 to 09-42-22.  We're going back to get gas.d3648x12e12j\i10I2b8B4b9B2f1 28f0Film Clip:  11-06-37 to 11-06-51.  Luey got robbed.  Go Tek!d3648x12e12j\i10I2b8B4b9B2f1 25f0****d3648x12e12j\f1bFilm Clip:  12-02-56 to 12-04-09.  SM: To summarize ... tomatoes.d3648x12e12j\i10I2b8B4b9B2f1 30f0Film Clip:  12-04-50 to 12-05-15.  Getting into endgame!d3648x12e12j\i10I2b8B4b9B2f1 21f0****d3648x12e12j\f1bFilm Clip:  11-08-04 to 11-08-43  Mav broke.   last ditch strategy.d3648x12e12j\i10I2b8B4b8B2f1 33f0Film Clip:  12-10-04 to 12-10-43  Very end.d3648x12e12j\i10I2b8B4b8B2f1 9f0Film Clip:  11-10-04 to 11-10-28  Let's hear it for the turtle!d3648x12e12j\i10I2b8B4b8B2f1 29f0View:  Austin in hallway.d3648x12e12j\f1bi7IScript for Austin.d3648x12e12j\f1bi18IAfter the knowledge competition, we gathered for a wrap-up session.d3648x12e12jSpecial Effects:  Fade to Loops Color Saturn Logo with subtitle as follows:d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58ULecture 7d3648x12e12cWrap-Upd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  13-02-21 to 13-02-52.  DGB.  The coin we are paid in ...d3648x12e12j\i10I2b8B4b9B2f1 33f0Special Effects:  Subtitle appears for a few seconds.d3648x12e12j\f1bi16I                                                          d3648x12e12j\u58UDaniel G. Bobrowd3648x12e12cKnowledge Systems Aread3648x12e12cXerox PARCd3648x12e12c                                                          d3648x12e12j\u58UFilm Clip:  13-06-59 to 13-07-35  DGB.  Outline of topics. d3648x12e12j\i10I2b8B4b8B2f1 25f0Film Clip:  13-15-00 to 13-15-22  Ideas and feedback.d3648x12e12j\i10I2b8B4b8B2f1 19f0Film Clip:  13-17-26 to 13-17-34  How do you know when to use ...d3648x12e12j\i10I2b8B4b8B2f1 31f0Film Clip:  13-21-01 to 13-21-27  Objects.d3648x12e12j\i10I2b8B4b8B2f1 8f0Film Clip:  13-23-05 to 13-23-35  Rules.d3648x12e12j\i10I2b8B4b8B2f1 6f0Film Clip:  13-26-50 to 13-28-20  Combination methods for ...d3648x12e12j\i10I2b8B4b8B2f1 27f0Film Clip:  13-33-57 to 13-34-10  Demons - Erman, MJS, DGB.d3648x12e12j\i10I2b8B4b8B2f1 25f0Film Clip:  13-50-00 to 13-51-43  Research objectives ...d3648x12e12j\i10I2b8B4b8B2f1 23f0Film Clip:  13-52-00 to 13-52-37  Thank you very much!d3648x12e12j\i10I2b8B4b8B2f1 20f0View:  A sequence of stills selected from the video tape, with a 3-second pause between each:d3648x12e12j\f1biStill Shot:  Mark doing introduction.d3648x12e12j\i11I2f1 24f0Still Shot:  Danny at lecture.d3648x12e12j\i11I2f1 17f0Still Shot:  Austin beckoning at workstation.d3648x12e12j\i11I2f1 32f0Still Shot:  Sanjay at lecture.d3648x12e12j\i11I2f1 18f0Still Shot:  Crowd scene from the knowledge competition.d3648x12e12j\i11I2f1 43f0Special Effect:  Starts with a still shot of the Truckin gameboard with a truck about to pull into Alice's Restaurant.  This shot becomes animated as a game truck (labeled Xerox) is shown slowing down to park.  Fades to a scene filmed in "registration" of a REAL Xerox truck, pulling into a parking place.  The doors open, and Danny and Sanjay start running into a building, with Mark racing along behind.  Camera pans upward and it is the REAL Alice's Restaurant in La Honda!  Picture freezes and the following credits overlay on the screen or scroll up from below:d3648x12e12j\f1bi56I1i                                                          d3648x12e12j\u58USlide:d3648x12e12j\bScript Engineer: Mark Stefikl4269d4918x12e12j\bProduction Engineer:	Ken Beckmanl4269d4918x12e12j\bMusic Engineer: Blue Jeansl4269d4918x12e12j\bKnowledge Engineer:  Lynn Conwayl4269d4918x12e12j\bLoops Course Engineers:		Mark Stefik, Daniel Bobrow, and Sanjay Mittall4269d4918x12e12j\b                                                          d3648x12e12j\u58UView:  White letters on a blue background.d3648x12e12j\f1b42f0B                                                          d3648x12e12j\u58UThe experimental course "Knowledge Programming in Loops" is offered periodically by the Knowledge Systems Area at Xerox PARC.  d3648x12e12j\88i22IThe Loops Knowledge Programming System is currently available to selected Xerox customers that have been designated as Loops beta-test sites.d3648x12e12j\125i9I                                                          d3648x12e12j\u58U		d3648x12e12j\b3BTHE ENDd3648x12e12c\f9d3648x12e12j\f9