Phil/Psych 446, Cognitive Modeling, Week 5

5a, Frames and schemas

Why philosophy needs cognitive modelling

1. Epistemology. Philosophy is concerned with the structure and growth of knowledge. The best way to investigate these is to develop computer models of inference, superseding purely logical analyses. In philosophy of science, the discovery and justification of scientific theories can be modelled computationally.

2. Metaphysics. Philosophy is concerned with the nature of mind and thinking. Computational models help us to understand the nature of representations and processes, and to see how thought might be produced by a physical system.

3. Ethics. We can get a deeper understanding of ethical deliberation by developing computational models of complex ethical reasoning, e.g. ethical coherence.

Cognitive modelling provides a methodology for the approach to philosophy I call cognitive naturalism, which sees philosophical problems as intimately connected with issues in the cognitive sciences. As for cognitive psychology, computer programs provide a means of building and testing philosophical theories.


Frame is Marvin Minsky's word for concept or schema.

On the importance of concepts, schemas, and frames, see notes for Phil/Psych 256.


Uses of frame-based systems:


Frame system: a semantic network with more complex structures and procedures. Translation from semantic nets to frames: node -> frame; link -> slot.

Instance frame: describes individual things, e.g. Shania Twain, University of Waterloo.

Class frame: describes entire class, e.g. singer, university.

Slots: parts of a frame that contain slot values that describe the thing or class. For classes, the values are defaults, that hold typically but universally. E.g. birds typically fly, but not all birds fly (penguins).

Frame: Shania-Twain

Frame: University

In principle, all the information in frames could be translated into rules or predicate calculus (formal logic), but frames naturally support different kinds of procedures.


Inference by inheritance

To answer a query about an instance or class, move up the is-a and a-kind-of hierarchy until you find a frame with a slot relevant to the query. Then the default slot value provides an answer to the query. Example:

Does Shania Twain have a spleen? Shania Twain is woman, a woman is a kind of person, persons have spleens, so by inheritance Shania Twain has a spleen.

This inference could be made by a rule-based system, but inheritance may provide a much more efficient way of answering the question.

Classification by matching

To classify an instance whose a-kind-of slot needs filling in, match the instance against relevant class frames to see which has the best fit. Example:

What kind of singer is Shania Twain? Match instance frame for Shania Twain against frames for opera-singer, country-singer, rock-singer, and pop-singer. If best match is with pop-singer, conclude that Shania Twain should be classifed as a pop singer.

Problem solving

Represent a problem as an instance frame with slots for starting conditions and goals.

Match the problem against class frames that describe typical problems and have slots describing their solutions. Find the problem frame (schema) that has the best match.

Then the problem solution can be gained by inheritance from the relevant problem schema. Example:

If parents always have 2 children, how many children would be produced over 10 generations? Solution: classify this a problem in exponential growth, and calculate 2 to the power 10.

Thus problem solving can be viewed as a combination of classification by matching and inference by inheritance, not (as in rule-based systems) as a search through a space of operators.


Similarly, represent an problem as an instance frame with slots for available knowledge and what is to be explained.

Match the problem against class frames that describe typical explanations and have slots describing their solutions. Fine the explanation frame (schema) that has the best match.

Then the explanation can be produced by inheritance from the relevant explanation schema. Example:

Why did Pat leave money in the restaurant? Match the situation to the script (dynamic frame) for restaurant, note that there is a slot in the script for leaving money as a tip, and infer that Pat was tipping.

Then explanation is matching + inheritance.

Language understanding

In order to understand the linguistic description of a situation, match the situation to stored frames and fill in missing information.

For example, when reading "Drew was in the restaurant, and left a tip" you would match the restaurant frame and realize that the tip left was monetary, not the tip of an iceberg.

There are limitations to this, however, because there are many situations for which we do not have stored representations, e.g. "There's a goat in the restaurant."

Frame creation by generalization

Given two or more instance frames, create a class frame by abstracting the slots and values they have in common. These slots and values then belong to the new class frame.

E.g. create a new class frame DOG by seeing what instance frames for two particular dogs have in common.

Frame creation by conceptual combination

Given two class frames, create a new class frame that has all the slots and values that they each have.

E.g. the frame YOUNG-CANADIAN might have all the slots and values from the frames YOUNG and CANADIAN.

Sometimes, however, the slot values might conflict, as in FLYING-PENGUIN.

Morever, not all conceptual combinations take all the slots from both contributing concepts. E.g. an apartment dog is not an apartment, but a dog suitable for living in an apartment. In such cases, conceptual combination must be much more creative: see P. Thagard, Coherent and creative conceptual combinations.

Recent books on concepts:

Greg Murphy, The Big Book of Concepts, 2002.

Eric Margolis: Concepts: Core Readings, 1999.


5b, Implementing frames in LISP


There are many different ways a frame structure could be implemented in LISP; for example, using:

- a list such as (frame-name (slot1 value1) (slot2 value2) ...)

- a symbol and property list, built up by (put frame-name 'slot-name 'value)

- a LISP structure using DEFSTRUC

- a class in the Common LISP object system

- a symbol with an associated set of rules of the form IF (object is-a frame-name) THEN (slot-name object value)

A more radical representation of concepts is to use neural networks (see week 8).

Use data abstraction to define a function GET-SLOT-VALUE that hides the particular way in which you implemented the frame. Also define a function PUT-SLOT-VALUE that adds to the frame a new slot with a given value.


Inference by inheritance

Formulate a query in frame terms, e.g. (find-value 'frame-name 'slot-name).

If the frame already has a filled slot, then just return its value.

Otherwise, repeatedly move up the frame system by using the IS-A and A-KIND-OF slots: if FIRST-FRAME is a kind of SECOND-FRAME, then see whether SECOND-FRAME has the relevant slot. If so, return its value as the answer to the query and stop.

If you get to the top of the hierarchy and no relevant slot is found, then quit and return a failure message.

Classification by matching

Classify an instance frame by determining which class frame it best matches.

Calculate the match between two frames by seeing whether they both have the same slot with the same value (a "hit").

Various matching algorithms are possible:

Return the class frame that is the best match, and supplement the instance frame by adding a new IS-A slot with the returned value.

Optional exercise: Write procedures that translate logic-like representations of facts such as (color-of sky blue) into frames and vice versa.

Assignment #3, is due Feb. 17.

Project plan

The project is not due until the end of term, but a project plan should be handed in no later than March 3. The plan should include the following information:

1. What cognitive process do you want to model?

2. What general approach do you plan to take (e.g. rules, neural nets)?

3. What programming tool (language or simulator) do you plan to use?

Programming assignment 5 will be part of your modelling project.

Phil/Psych 446

Computational Epistemology Laboratory.

Paul Thagard

This page updated Jan. 31, 2005