Scripts
A script is a knowledge representation scheme similar to a frame, but instead of describing an object, the script describes a sequence of events. Like the frame, the script portrays a stereotyped situation. Unlike the frame, it is usually presented in a particular context. To describe a sequence of events, the script uses a series of slots containing information about the people, objects, and actions that are involved in the events.
Some of the elements of a typical script include entry conditions, props, roles, tracks, and scenes. The entry conditions describe situations that must be satisfied before events in this script can occur or be valid. Props refer to objects that are used in the sequence of events that occur. Roles refer to the people involved in the script. The result is conditions that exist after the events in the script have occurred. Track refers to variations that might occur in a particular script. And finally, scenes describe the actual sequence of events that occur.
A typical script is shown in Figure 5.7. It is a variation of the well-known restaurant example that has been used in AI to show how knowledge is represented in script format. Going to a restaurant is a stereotyped situation with predictable entry conditions, props, roles, and scenes. As you can see, such a script accurately describes what occurs in almost every fast-food restaurant situation. The scenes are miniscripts within the main script that describes the various subdivisions of the entire process. Note the optional scene that describes a take-out situation rather than an eat-in situation. Another option may be a drive-through scene. Finally, note the results.
A script is useful in predicting what will happen in a specific situation. Even though certain events have not been observed, the script permits the computer to predict what will happen to whom and when. If the computer triggers a script, questions can be asked and accurate answers derived with little or no original input knowledge. Like frames, scripts are a particularly useful form of knowledge representation because there are so many stereotypical situations and events that people use every day. Knowledge like this is generally taken for granted, but in computer problem-solving situations, such knowledge must often be simulated to solve a particular problem using artificial intelligence.
To use the script, you store knowledge in the computer in symbolic form. This is best done using LISP or another symbolic language. You can then ask questions about various persons and conditions. A search and pattern-matching process examines the script for the answers. For example, what does the customer do first? Well, he parks the car, then goes into the restaurant. Whom does he pay? The server, of course. The whole thing is totally predictable.

Script representation is interrelated with case-based reasoning.