---
title: "Frame with example"
subject: "Artificial Intelligence"
chapter: 5
key: "semester_6/artificial_intelligence:frame-with-example"
source: https://www.bctengineer.com/q/semester_6/artificial_intelligence/frame-with-example
site: BCT Engineering
---

# Frame with example

Artificial Intelligence · Chapter 5: Structured Knowledge Representation

- Asked in: 2069 Poush, 7 marks
- Video: [L71: Frames for knowledge Representation in Artificial Intelligence | Attributes, Reasoning Actions](https://www.youtube.com/watch?v=5iHBv_74Ces) — Easy Engineering Classes
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/artificial_intelligence/frame-with-example
- Whole chapter: https://www.bctengineer.com/md/semester_6/artificial_intelligence/chapter-5

## Question

What is a frame? Explain it with suitable example.

## Short answer

A frame is a structured knowledge representation with slots, facets (defaults, ranges, procedures like if-needed), arranged in is-a hierarchy for inheritance. Example: Book frame has slots author, pages; default language English; price if-needed computes pages×2. TextBook is-a Book; AI_Rich_Knight instance of TextBook inherits English and price 1280.

## Answer

A **frame** is a structured knowledge representation for a stereotyped object, concept or situation, proposed by Marvin Minsky (1975). It is a collection of **slots** (attributes), each holding a value, a default, a restriction or an attached procedure. Frames are arranged in a hierarchy (`is-a`, `instance-of`) so that slots are inherited.

#### Parts of a frame
- **Frame name:** the object or class.
- **Slots:** attributes of the object.
- **Facets:** extra information about a slot: `value`, `default`, `range/type`, and procedures `if-needed` (compute when asked), `if-added` / `if-removed` (run when changed), also called demons.
- **Links:** `is-a` and `instance-of` to parent frames.

#### Example: a Book frame hierarchy
```text
Frame: Book
  is-a: Publication
  author:     [type: Person]
  pages:      [range: 1..2000]
  language:   default English
  price:      [if-needed: pages * 2]

Frame: TextBook
  is-a: Book
  subject:    [type: String]
  edition:    default 1

Frame: AI_Rich_Knight       (instance)
  instance-of: TextBook
  author:     Elaine Rich
  subject:    Artificial Intelligence
  pages:      640
  edition:    3
```
- `language` of AI_Rich_Knight is not stored, so the default **English** is inherited from Book.
- `price` is computed by the if-needed procedure: 640 × 2 = 1280.

#### Equivalent FOPL
instance(AI_Rich_Knight, TextBook), isa(TextBook, Book), author(AI_Rich_Knight, Elaine_Rich), ∀x instance(x,TextBook) → language(x, English).

#### Advantages
- Natural organisation of knowledge around objects.
- Inheritance and default values reduce storage and allow reasoning with missing data.
- Procedural attachment combines declarative and procedural knowledge.

#### Limitations
- No formal semantics; reasoning with exceptions and negation is difficult.
- Hard to build and maintain for large domains.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Who proposed frames and what are they?
   A. Quillian; graphs of nodes and arcs
   B. Schank; primitive acts for meaning
   C. Holland; populations of chromosomes
   D. Minsky; structures of slots for stereotyped objects or situations
   Answer: D. Frames (Minsky, 1975) are slot-based structures arranged in a hierarchy. (Key point: Frame definition)

2. In the example, AI_Rich_Knight has no language slot. What value does it get?
   A. English, inherited as the default from Book
   B. Nothing; it is unknown
   C. Hindi, taken from the author
   D. English, computed by an if-needed procedure
   Answer: A. Defaults flow down the instance-of / is-a hierarchy when a slot is empty. (Key point: Default inheritance)

3. What does an if-needed facet do?
   A. Runs when a value is added to the slot
   B. Computes the slot value when it is asked for, e.g. price = pages × 2
   C. Restricts the slot to a range
   D. Stores a fixed default
   Answer: B. If-needed is a procedure run on demand; if-added runs when a value changes. For 640 pages the price is 1280. (Key point: If-needed)
