Memra

Frames & scripts

Frames bundle a concept into named slots with defaults and procedural attachment (demons); scripts encode stereotyped event sequences for between-the-lines inference.

Frames: structured nodes

A flat semantic net puts every fact at the same level. Frames (Minsky, 1975) add structure: a frame is a data structure for a stereotyped entity, built from named slots. A slot can hold an identifier, a link to other frames (class/instance), a requirement descriptor (a constraint new instances must meet), a default value used when nothing specific is known, a procedural attachment (code), or case-specific data.

Two slot types make frames more than a record. A default value supports default reasoning: a bird frame defaults flies = True, so an unseen bird is assumed to fly until told otherwise. A demon is a procedure invoked as a *side effect* of accessing or changing a slot — e.g. a type-checking demon that rejects an out-of-range value. This is procedural attachment: code lives with the data.

The frame→object-oriented-programming lineage is direct. Slots are instance variables, defaults are default field values, class/subclass links are inheritance, and demons are methods (active values). Minsky's frame work at MIT fed straight into Smalltalk, and from there into C++ and Java. If you understand a Java class, you already understand a frame.

Scripts: stereotyped event sequences

Understanding a story needs background knowledge no single sentence states. A script (Schank & Abelson) encodes a stereotyped *sequence of events* in a context, with five components: entry conditions (what must hold for the script to apply), results (what is true afterward), props (supporting objects with defaults), roles (participants and their typical actions), and scenes (temporal sub-sequences).

The restaurant script is the classic: told only *"John went to a restaurant and later felt full,"* the script lets a system infer he was seated, ordered, ate, paid, and left — the between-the-lines events the text omits. This is why language understanding is mostly *world knowledge*, not just parsing. Scripts are rigid, though: the script-match problem (which script applies when several could?) and the between-the-lines problem (unexpected events break the script) motivated more modular memory organisation packets (MOPs), a direct ancestor of case-based reasoning.

Worked example

A Penguin frame inherits the Bird default flies = True but overrides it to False, and a count_legs slot is filled by a *demon* (computed on access, not stored). The Python sketch below mirrors a frame with a default-bearing parent, a local override, and a procedural attachment — the same structure as a class hierarchy.

NORMAL ~/memra/learn/comp-456/frames-and-scripts utf-8 LF