Scripts in AI
Scripts are a knowledge representation structure designed by Roger Schank and Robert Abelson in the 1970s to capture stereotypical sequences of events in w...
Representing Sequences of Events
Scripts are a knowledge representation structure designed by Roger Schank and Robert Abelson in the 1970s to capture stereotypical sequences of events in well-understood situations. While frames represent objects and their properties, scripts represent processes — the expected chain of actions that unfolds in a familiar scenario like visiting a restaurant, taking a flight, or attending a doctor's appointment.
A script has several components. The entry conditions describe what must be true before the script can begin. The result describes the world state after the script completes. The props list the objects typically present. The roles identify the people or agents involved. The scenes or tracks subdivide the script into phases, each containing a sequence of expected events.
The classic example is the restaurant script. Entry condition: the customer is hungry and has money. Props: tables, menus, food, bill. Roles: customer, waiter, chef, cashier. The scenes unfold: entering and being seated, ordering from the menu, receiving and eating the food, receiving the bill, paying, and leaving. If a story says "John went to a restaurant and left a tip," a script-based reasoner knows John must have eaten a meal and paid for it, even though those facts were not stated explicitly — the script fills the gap.
Scripts enable natural language understanding by providing the context needed to interpret ambiguous or incomplete descriptions. When a system understands that the sentence "the waiter brought the check" belongs in the payment scene of the restaurant script, it can answer questions about what happened before and after.
The SAM (Script Applier Mechanism) program, developed in the 1970s, demonstrated script-based story understanding, answering questions about restaurant and car accident narratives.
Exam tip: Know the components of a script — entry conditions, results, props, roles, and scenes — and be ready to construct a simple script for a given scenario. Scripts are often compared to frames in exam questions.