Chapter 14 (Structured Knowledge Representation)
Structured Knowledge Representation is a method of organizing information in a formalized way
that allows an AI system to understand, manipulate, and reason with that information efficiently.
Rather than storing knowledge as raw data, it is encoded using structured formats that capture
facts and the relationships, contexts, and rules that govern those facts. Here, we are going
to learn four different tools to do so: Frames, the Semantic Net, Scripts & MOPs (Memory
Organization Packets), and Goals & Plans.
1 Frames
Frames are like templates or blueprints that represent knowledge about things, situations, or
events. Think of a frame as a structured “data card” that describes something by listing its
features (called slots) and values (called fillers).
Marvin Minsky introduced them to help machines reason like humans by using structured knowl-
edge that mimics the way we organize information in our minds.
Example 1. Suppose that you have bought a new mobile phone. The phone is a Samsung
model, and it has an Android operating system, a 4500mAh battery, supports 5G, comes with a
108MP camera, a 6.5 inch AMOLED display, 128GB storage and a fingerprint scanner. Design
a frame structure to represent this mobile phone, including slots and their fillers.
Ans:
Frame: Mobile Phone
- Brand: Samsung
- Operating System: Android
- Battery-Capacity: 4500mAh
- Network: 5G
- Camera: 108MP
- Display: 6.5-inch AMOLED
- Storage: 128GB
1
- Fingerprint Scanner: Yes
Example 2. Suppose that you have bought a new car. The car is a Tesla Model, with an electric
engine, a range of 350 miles, a 15-inch touchscreen, autonomous driving capabilities, and a dual
motor. Design a frame structure to represent this car, including slots and their fillers.
Ans:
Frame: Car
- Brand: Tesla
- Engine: Electric
- Range: 350 miles
- Touchscreen: 15-inch
- Autonomous Driving: Yes
- Motor: Dual Motor
Example 3. Suppose that you are designing a frame for a restaurant. The restaurant is called
“The Green Olive,” and it offers Italian cuisine. The restaurant has 100 seats, offers both
dine-in and delivery options, and does not serve wine. Design a frame structure to represent
this restaurant, including slots and their fillers.
Ans:
Frame: Restaurant
- Name: The Green Olive
- Cuisine: Italian
- Seats: 100
- Services: Dine-in, Delivery
- Wine Served: No
Centre for Data Science, ITER, SOADU
Example 4. Suppose that you are designing a frame for a smartphone app. The app is called
“FitTrack” which tracks fitness activities and is available in the iOS and Android App stores. It
has features like step tracking, calorie counting, workout plans, and a user rating of 4.5 stars.
Design a frame structure to represent this app, including slots and their fillers.
Ans:
Frame: Smartphone App
- Name: FitTrack
- Category: Fitness
- Platform: iOS, Android
- Features: Step Tracking, Calorie Counting, Workout Plans
- Rating: 4.5 stars
Example 5. Suppose that you are designing a frame for an online course. The course is titled
“Introduction to Artificial Intelligence” and is taught by Deepak Khemani. It has 11 weeks of
content, includes both video lectures and quizzes, and is hosted on NPTEL. Design a frame
structure to represent this course, including slots and their fillers.
Ans:
Frame: Online Course
- Title: Introduction to Artificial Intelligence
- Instructor: Deepak Khemani
- Duration: 11 weeks
- Content: Video Lectures, Quizzes
- Platform: NPTEL
Example 6. Suppose you are designing a frame for a book. The book is titled “The Great
Gatsby” by F. Scott Fitzgerald. It has 180 pages, is of the genre “Classic,” and was published
in 1925. Design a frame structure to represent this book, including slots and their fillers.
Ans:
Centre for Data Science, ITER, SOADU
Frame: Book
- Title: The Great Gatsby
- Author: F. Scott Fitzgerald
- Pages: 180
- Genre: Classic
- Year of Publication: 1925
2 Semantic Net
A Semantic Network is a graph-based knowledge representation technique used in AI to represent
concepts and their relationships, where
• nodes represent objects, concepts, or entities (Cat, Animal, Car, etc.), and
• edges (links) represent relationships (is-a, has-a, part-of, can, etc.).
It is used to represent structured knowledge in a way that allows inference (drawing new con-
clusions from what is already known) and inheritance (lower-level nodes automatically get the
properties of higher-level ones).
Example 7. In a university knowledge base, a Professor is considered a type of Faculty, and a
Faculty is a type of Staff. All Staff members work at the University, and all Faculty members
are assigned an Office. Additionally, a Professor teaches a Course. Based on this information,
draw a Semantic Network that represents the relationships among these entities, and clearly
illustrate how inheritance allows the Professor node to acquire at least two properties from its
higher-level categories.
Ans: Here, corresponding semantic network will be
Centre for Data Science, ITER, SOADU
Here, Professor (lower-level node) inherits the property has Office from Faculty (higher-level
node). Similarly, Professor inherits the property works at University from Staff.
Example 8. In a hospital knowledge base, a Surgeon is a type of Doctor, and a Doctor is a type
of Medical Staff. All Medical Staff work in a Hospital and follow a Duty Roster. Every Doctor
holds a Medical License and wears a White Coat. A Surgeon, in particular, performs Operations,
uses Surgical Instruments, and has a Specialty. Based on this information, construct a Semantic
Network showing the relationships and show at least two inherited properties of the Surgeon.
Ans: Here, corresponding semantic network will be
Centre for Data Science, ITER, SOADU
Notice that from the MedicalStaff node, the Surgeon node inherits:
• works in Hospital
• follows Duty Roster
Again, from the Doctor node, the Surgeon node inherits:
• holds Medical License
• wears White Coat
Example 9. In a tech company knowledge base, a Software Engineer is a type of Engineer, and
an Engineer is a type of Employee. All Employees receive a Salary and report to a Manager.
Every Engineer has access to the Tech Lab and attends Project Meetings. Additionally, a
Software Engineer writes Code and works with a Tech Stack. Based on this information, draw
a Semantic Network to represent the relationships. Clearly show how inheritance allows the
Software Engineer node to acquire at least two properties from its higher-level categories.
Ans: Here, corresponding semantic network will be
Centre for Data Science, ITER, SOADU
Observe that, from the Engineer node, the SoftwareEngineer node inherits:
• has access to Tech Lab
• attends Project Meetings
Again, from the Employee node, the SoftwareEngineer node also inherits:
• receives Salary
• reports to Manager
Example 10. In a school knowledge base, a Librarian and a Teacher are both types of Staff
Members, who are in turn Employees of the School. All Employees are required to attend
Training Sessions. A Librarian manages the Library, which contains various Books and has a
Reading Room. A Teacher borrows Books from the Library and prepares Lesson Plans. Draw a
Semantic Network to represent these relationships. Clearly show how inheritance allows Librarian
and Teacher nodes to acquire at least two properties from at least one higher-level category.
Ans: Here, corresponding semantic network will be
Centre for Data Science, ITER, SOADU
Here, the Librarian and the Teacher both inherit works at School and attends Training Sessions
from the higher-level node Employee.
3 Scripts and MOPs
3.1 Scripts
Scripts are a type of structured knowledge representation used to describe stereotypical se-
quences of events or actions that typically occur in familiar, everyday situations. They help
represent a series of actions or events that happen in a fixed or predictable order, allowing
systems to anticipate what happens next in a scenario.
Artificial intelligence and cognitive science often use scripts to model human behavior or
routine tasks. By organizing events in a predefined order, scripts allow AI systems to reason
about how events unfold, which is important for tasks such as understanding language, predicting
outcomes, and helping decision-making.
Example 11 (Going to the Movies). A script for going to the movies might include the following
steps:
1. Arrive at the theater.
2. Buy a ticket at the counter.
Centre for Data Science, ITER, SOADU
3. Enter the cinema hall.
4. Find your seat.
5. Watch the movie.
6. Leave the theater
In this script, each step represents an event that occurs in a specific order. The AI system can
use this script to predict the sequence of actions and guide users.
Example 12 (Going on a Job Interview). A script for a job interview could look like this:
1. Arrive at the interview location
2. Check in at the front desk.
3. Wait for the interview.
4. Interview (The interviewer asks questions, and you answer them).
5. Receive the outcome (whether hired or not).
6. Leave the interview.
In this scenario, the script helps the AI understand the typical flow of events during an interview
and predict what to expect during the process.
Example 13 (Making a Cup of Tea). A script for making tea involves the following steps:
1. Fill the kettle with water and boil it.
2. Place a tea bag in a cup.
3. Pour the hot water into the cup.
4. Let the tea steep for a few minutes.
5. Add milk or sugar according to preference.
6. Stir the tea and it is ready for drinking.
This script helps an AI system understand the process of making tea and predict actions, like
suggesting the optimal steeping time or reminding someone to add sugar.
Centre for Data Science, ITER, SOADU
3.2 Memory Organization Packets (MOPs)
MOPs are essentially a framework or template that bundles all relevant details about a specific
situation, task, or action, allowing efficient retrieval, reuse, and modification of knowledge.
MOPs provide a modular way to store and recall information about how things usually happen,
making them useful for modeling procedural memory and event understanding.
Key Characteristics of MOPs:
• Memory-Based: MOPs are stored in memory and accessed when a similar situation
occurs.
• Packet-Like: Think of a MOP as a ‘packet’ of knowledge that contains slots for various
elements of a situation.
• Reusable: Once a MOP is defined, it can be reused in similar contexts, saving time and
computation
• Partial Matching: AI systems can match incoming information partially with existing
MOPs to retrieve the best fit.
An MOP includes slots and fillers, similar to frames (slots represent components of a situation,
while fillers provide the specific values). But they are designed for different purposes.
• While Frame is used to represent an object, concept, or entity, MOP is used to represent
a situation, event, or routine memory pattern.
• Frame is a static template with slots and fillers, but MOP is a dynamic memory chunk
with event sequences and roles.
• Frame is used to store Descriptive knowledge, but MOP is used to store Procedural
knowledge.
Example 14. Consider the following MOP for visiting a traditional restaurant: a person enters
the restaurant, is seated by a host, reads the menu, places an order with a waiter, eats the food,
pays the bill, and then leaves the restaurant. Now, suppose you visit a fast-food restaurant like
McDonald’s, where you order at the counter and find your seat. Explain how partial matching
helps an AI system recognize and adapt the traditional MOP to fit this new situation.
Centre for Data Science, ITER, SOADU
Ans: The AI uses partial matching to adapt the traditional restaurant MOP to a fast-food
restaurant scenario by identifying similarities and updating the differing steps.
Traditional Restaurant MOP:
1. Enter the restaurant.
2. Be seated by a host.
3. Read the menu.
4. Order from a waiter.
5. Eat the food.
6. Pay the bill.
7. Leave the restaurant.
Fast-Food Restaurant Scenario:
1. Enter the restaurant.
2. Read the menu.
3. Order at the counter (instead of from a waiter).
4. Pay while ordering (not after eating).
5. Find your own seat (instead of being seated by a host).
6. Eat the food.
7. Leave the restaurant.
Partial matching helps the AI recognize familiar structures. It reuses the traditional MOP and
adjusts specific steps to fit the fast-food context. This allows the AI to understand and respond
effectively to new but related situations.
Example 15. Imagine you have an MOP for the process of buying groceries at a supermarket,
which involves walking through various aisles, picking items, and checking out at the counter.
Now, suppose you go shopping at an online grocery store instead, where the steps may differ.
Explain how partial matching can help the AI system adapt the traditional grocery store MOP
to fit the new online grocery shopping scenario.
Centre for Data Science, ITER, SOADU
Ans: The AI uses partial matching to adapt the traditional grocery store MOP to an online
grocery shopping scenario by recognizing shared steps and adjusting the differences.
Traditional Grocery Store MOP:
1. Enter the store.
2. Walk through aisles.
3. Pick items from the shelves.
4. Proceed to the checkout counter.
5. Pay for the items.
6. Leave the store.
Online Grocery Shopping Scenario:
1. Open the online grocery store website.
2. Browse through virtual aisles (instead of physically walking through aisles).
3. Add items to the cart (instead of picking items from shelves).
4. Proceed to online checkout.
5. Pay for the items.
6. Wait for delivery (instead of leaving the store).
Partial matching helps the AI recognize that although the context has changed, many steps are
similar. The system reuses the traditional grocery shopping MOP and adapts specific steps to
the online context. This enables AI to understand and adapt to new scenarios while maintaining
the core structure of the experience.
4 Goals and Plans
Definition (Goal). In AI, a goal is a desired outcome or final state that an intelligent agent
aims to achieve through its actions.
Definition (Plan). A plan is a sequence of actions or steps that an intelligent agent takes that
leads it from the current state to the desired goal state.
Centre for Data Science, ITER, SOADU
Example 16. Consider a robotic vacuum cleaner that performs cleaning tasks to clean a room.
It has sensors like LiDAR, Camera, and Infrared. Its plan involves the following steps: Start
from the charging dock and begin cleaning from one corner of the room, Use sensors to map
the room and identify areas that need cleaning, Navigate and clean around obstacles (such as
furniture and walls) while cleaning the floor, Ensure the entire room is covered, including corners
and edges, Return to the charging dock when the cleaning is complete or if the battery is low.
Design a semantic network to describe this information.
Ans: Here, the plan steps are
Step1: Start from the charging dock and begin cleaning from one corner of the room
Step2: Use sensors to map the room and identify areas that need cleaning
Step3: Navigate and clean around obstacles while cleaning the floor
Step4: Ensure the entire room is covered, including corners and edges
Step5: Return to the charging dock when the cleaning is complete or if the battery is low
Correspondingg semantic network will be
Centre for Data Science, ITER, SOADU
Example 17. An AI-powered delivery robot has the goal of delivering a package from a warehouse
to a customer’s house. Describe the robot’s plan. How could the robot plan change in response
to dynamic obstacles such as traffic or blocked roads?
Ans:
Goal: The robot’s goal is to deliver a package from the warehouse to the customer’s house.
Plan (initial steps):
1. Pick up the package from the warehouse.
2. Navigate to the destination using a predefined route (e.g., through main roads and streets).
3. Avoid basic obstacles (e.g., pedestrians, small objects) along the way.
4. Reach the customer’s house and deliver the package.
Plan (if there is a blocked road or traffic):
1. Detect the obstacle using sensors or traffic data.
2. Recalculate an alternate route (e.g., through Side Street).
3. Continue navigation on the new route.
4. Deliver the package to the customer’s house.
Example 18. A self-driving car drives on its own to transport a passenger from point A to
point B. It has sensors like LiDAR, Radar, Cameras, and GPS. The car’s plan includes: Pick
up the passenger at point A after confirming the booking and the destination, Plan the route
to point B (considering the shortest or most efficient path), Follow the predefined route while
constantly monitoring for traffic signals, pedestrian crossings, and other vehicles on the road,
Adjust speed and direction based on road conditions, traffic laws, and dynamic environmental
factors, Continuously update the map of the surrounding environment using sensors to detect
and avoid obstacles, and Arrive at point B (ensuring that the car stops safely at the destination).
Design a semantic network to describe this information.
Centre for Data Science, ITER, SOADU