KNOWLEDGE
UNIVERSITI MALAYSIA SABAH
- FACULTY OF COMPUTING & INFORMATICS
- Course: KT24202 Artificial Intelligence Knowledge Representation & Logic & RL in AI
- Instructor: Dr. Mohammed Ahmed
- Date: 2026-04-12
LECTURE AGENDA
- Knowledge Representation & Logic
- Reinforcement Learning
- Faculty of Computing & Informatics
- Universiti Malaysia Sabah
- Lecture Series 2026
THINKING QUESTIONS
- How does a robot know what an “object” is without ever seeing one before?
- If I say “bird,” what exactly should an AI understand about it?
- Can a machine “understand” knowledge, or does it only store data?
- Why can humans learn from mistakes, but some AI systems struggle to do so?
SECTION 01: FOUNDATIONS
What is Knowledge Representation?
Core Definition:
- Knowledge Representation (KR) is a fundamental AI field dedicated to structuring and formatting information about the world in a manner that machines can comprehend and process.
The Knowledge Base:
- Structured information resides here, serving as the central repository for an agent's understanding.
Functional Capabilities:
- Reasoning:
- Drawing logical conclusions from known facts.
- Decision-Making:
- Evaluating options based on contextual knowledge.
- Problem Solving:
- Actively resolving complex, real-world tasks.
Importance of KR:
- Without a KR framework, AI systems lack the contextual understanding necessary to interpret their environments.
- Example: "It is raining." How would you format this so a computer knows to bring an umbrella?
DATA, INFORMATION, AND KNOWLEDGE
Transformation Process
STAGE 1: Data
- Raw, unorganized facts and figures lacking inherent meaning or context.
- Example: "12012012"
STAGE 2: Information
- Contextualized, categorized, and condensed data that becomes meaningful.
- Answers: Who, What, When, Where
STAGE 3: Knowledge
- Perceptions, skills, and experience applied to information to achieve goals.
- Answers: How
In AI, Knowledge Representation focuses on structuring this "Knowledge" tier so machines can reason and solve problems.
TYPES OF KNOWLEDGE
Categories of Knowledge
Declarative Knowledge:
- Knowing what (Facts & Assertions)
- Includes object relationship and value (e.g., Rises in)
Procedural Knowledge:
- Knowing How (Rules & Methods)
Structural Knowledge:
- Knowing Why (Hierarchies & Taxonomies)
Examples
- Hierarchical Relationships:
- Class and Sub-class examples:
- For a computer system:
- [Computer System]
- Class → Sub-Class relationships such as
- [The Sun]
- [Hardware]
- [Software]
- Semantic Networks and implicit propositions.
EXPLICIT VS. TACIT KNOWLEDGE
Definitions and Differences
Explicit Knowledge:
- CODIFIED & OBJECTIVE
- Easily recorded, articulated, and shared.
- Stored in manuals, databases, and policies.
- Readily processed by LLMs and NLP systems.
Tacit Knowledge:
- INTUITIVE & SUBJECTIVE
- Internal traits like individual skills and expertise.
- Deeply ingrained and difficult to codify or transfer, it includes mental models and "gut feelings."
Formalization Challenge
- Tacit knowledge is captured through problem-solving sessions with experts, translating intuitive skills into explicit rules for AI Knowledge Bases.
- Methods include mentorship and storytelling.
KNOWLEDGE ACQUISITION PROCESS
Steps for Gathering Knowledge
- Literature Review:
- Analyzing academic papers, reports, and documented sources to extract foundational facts and domain logic.
- Expert Interviews:
- Engaging with subject matter experts to elicit nuanced insights, decision paths, and tacit experiences.
- Direct Observation:
- Studying real-world scenarios and operational interactions to understand practical knowledge application.
- Outcome:
- The acquired knowledge is translated into structured formats (Rules, Frames, or Logic) that are machine-readable and computationally processable.
APPROACHES TO KNOWLEDGE REPRESENTATION
Methodologies
- Relational Knowledge:
- Facts + relations (like a DB).
- Example: Parent(Anna, Bob) → Anna is Bob’s parent.
- Inheritable Knowledge:
- Hierarchies + inheritance.
- Example: Bird → Fly; Penguin → Bird (but overrides Fly).
- Inferential Knowledge:
- Logical: Likes(x, pizza) ∧ Serves(restaurant, pizza) → Will Visit(x, restaurant).
- Procedural Knowledge:
- Condition-action rules.
- Example: IF overdue(book) THEN send_reminder(email).
KNOWLEDGE GOAL AND TYPES
Representation Needs
- Goal: Common sense reasoning
- Need to represent knowledge about the world including:
- Objects
- Events
- Procedures
- Relations
- Mental states
- Meta knowledge
PROPERTIES OF REPRESENTATION SYSTEMS
Key Attributes
- Representational Adequacy:
- Ability to represent the required knowledge.
- Inferential Adequacy:
- Ability to manipulate knowledge and produce new knowledge.
- Inferential Efficiency:
- Ability to direct inference methods productively and use limited resources efficiently (e.g., time, storage).
- Acquisitional Efficiency:
- Ability to acquire new knowledge, ideally automatically.
CATEGORIES AND OBJECTS
Understanding Categories
- Specific objects (e.g., my basketball BB9) and general categories (e.g., Basketballs).
- Categories as Relationships:
- Basketballs(BB9) = True
- Reification of predicates:
- Basketballs → use in other predicates
- Member(BB9, Basketballs) = True
- Abbreviated to BB9 ∈ Basketballs
- Subcategories for Instance:
- Subset(Basketballs, Ball) = True
- Abbreviated as Basketballs ⊂ Ball
- Taxonomy: System of categories and subcategories.
BASIC RELATIONS FOR CATEGORIES
Disjoint Relationships:
- Disjoint({Animals, Vegetables})
Exhaustive Decomposition:
- ExhaustiveDecomposition({Americans, Canadians, Mexicans}, NorthAmericans)
Partitioning:
- Partition({Males, Females}, Animals)
These properties can be defined using first-order logic.
PHYSICAL COMPOSITION
Basics
Basic relations such as PartOf
- PartOf(Bucharest, Romania)
- PartOf(Romania, EasternEurope)
- PartOf(EasternEurope, Europe)
- PartOf(Europe, Earth)
Can be used to define composite objects:
- Biped(a) ⇒ ∃l1, l2, b
- Leg(l1) ∧ Leg(l2) ∧ Body(b)
- ∧ PartOf(l1, a) ∧ PartOf(l2, a)
- ∧ PartOf(b, a)
- ∧ Attached(l1, b) ∧ Attached(l2, b)
- ∧ l1 ≠ l2
- ∧ [∀l3Leg(l3) ∧ PartOf(l3, a) ⇒ (l3 = l1 ∨ l3 = l2)]
PROTOTYPES
Understanding Prototypes
- Natural categories are hard to define; there is no set of features applicable to all instances.
- Prototypes have typical properties.
- Example: Select typical members of categories
- ∃b ∈ Typical(Bird) ⇒ CanFly(b)
HIERARCHIES AND INHERITANCE
Taxonomies
- Hierarchies are a natural way to structure categories.
- Groups of things that share properties in the world do not require definitions to be repeated.
- Example:
- Saying “elephants are mammals” conveys extensive information.
- Questions about inheritance:
- “Does A inherit from B?” is the same as “Is B in the transitive closure of IS-A (or subsumption) from A?”
GRAPHICAL REPRESENTATION OF INHERITANCE
Reasoning with Inheritance
- IS Relations:
- Clyde ↓ Elephant (category) ↓ Gray (property)
- Clyde is an Elephant, Elephant is Gray.
- Transitive Relations:
- Transitive closure on all paths rather than just direct relationships.
- Example:
- Clyde is an Elephant, Elephant is Gray ⇒ Clyde is Gray
STRICT INHERITANCE
Conclusions and Paths
- Conclusions produced through complete transitive closure on all paths (any traversal procedure will do).
- All reachable nodes imply associated properties.
LATTICE STRUCTURE WITH STRICT INHERITANCE
Multiple Inheritance
- Multiple AND (∧) parents (i.e., multiple inheritance).
- Trees: All conclusions reachable by any paths are supported.
DEFEASIBLE INHERITANCE
Property Overriding
- Inherited properties can be overridden or defeated.
- Conclusions determined by upward search from focus node, selecting the first version of property desired.
SHORTEST PATH HEURISTIC
Path Navigation
- Links have polarity (positive or negative).
- Utilization of shortest path heuristic to determine which polarity matters in conclusions.
- Some paths may be preempted, while others are considered admissible.
PROBLEM: AMBIGUITY
Handling Ambiguity
- Lack of a single shortest path necessitates explicit handling of ambiguous reasoning chains.
- Distinguish between ambiguous and unambiguous reasoning chains, preferring some extensions over others (default logic).
- Difference between credulous vs. skeptical reasoning.
ONTOLOGIES
Knowledge Organization
Categories include:
- Anything
- Abstract Objects
- Generalized Events
- Sets
- Numbers
- Physical Objects
- Processes
- Places
- Animals
- Humans
Organization of knowledge within a single taxonomy.
FRAMES
Definition and Usage
- A frame is a collection of attributes or slots and associated values that describe a real-world entity.
- Each frame represents either a class or an instance (an element of a class).
EXAMPLE FRAME
- Lecture Example:
- Specialization of: meeting
- Context: large number of students
- Course: Op. Systems
- Level: Difficult
- Actions triggered by attributes such as intolerance and behavior expectations for students.
KNOWLEDGE DISCOVERY
Information Retrieval
- When facing new situations, information is stored in frames with slots.
- Some slots trigger actions leading to new situations.
- Frames serve as templates needing to be filled in.
- Filling them allows agents to undertake actions and retrieve other frames.
- Frames extend traditional record datatypes in databases, aligning closely with object-oriented processing.
FLEXIBILITY IN FRAMES
Slot Functionality
- Slots in a frame can contain:
- Information for selecting a frame in a situation.
- Relationships to other frames.
- Procedures to execute after slot completion.
- Default information for missing input.
- Blank slots that can remain unfilled unless required for a task.
- Other frames to maintain hierarchy.
EVENTS
Defining Events
- Events describe truths contingent on time.
- Example for a flying event:
- E ∈ Flyings
- Flyer(E, Shankar)
- Origin(E, SanFrancisco)
- Destination(E, Baltimore)
- Events may or may not be ongoing during a specific time frame, with facts true at specific points called fluents.
- Example: At(Shankar, Baltimore)
PREDICATES OF EVENTS
- Truth at Time: T(f , t)
- Event Occurrence: Happens(e,i)
- Initiates: Initiates(e, f , t)
- Terminates: Terminates(e, f , t)
- Fluents: Clipped(e,f , i), Restored(e,f , i)
TIME INTERVALS
Benefits of Representation
- Time can be represented in intervals or moments of zero duration.
- Allows definitions such as:
- End(i1) = Start(I2)
- Preceding intervals, subsets, overlaps, beginning, end, identity of time intervals.
SCRIPTS
Script Definition
- A structured representation describing a stereotyped sequence of events in a context.
- Scripts help organize events in knowledge bases and relate closely to frames.
COMPONENTS OF A SCRIPT
- Entry Conditions: must be true for script activation.
- Results: facts true upon script completion.
- Props: Items within the script’s context.
- Roles: Actions participants perform.
- Scenes: Temporal aspects of the script.
CANONICAL EXAMPLE: RESTAURANT VISIT
- Objects: tables, menu, food, check, money
- Roles: customer, waiter, cook, cashier, owner
- Entry Conditions:
- Customer is hungry.
- Customer has money.
- Results:
- Customer is no longer hungry.
- Customer has less money; owner gains more.
SCRIPT ACTIONS
Symbols and Meanings
| Symbol | Meaning | Example |
|---|---|---|
| ATRANS | transfer a relationship | give |
| PTRANS | transfer location of object | go |
| PROPEL | apply physical force | push |
| MOVE | move body part | kick |
| GRASP | grab an object | grab |
| INGEST | consume an object | eat |
| EXPEL | expel from body | cry |
| MBUILD | mentally create info | decide |
| CONC | conceptualize | think |
| SPEAK | produce sound | say |
| ATTEND | focus sense organ | listen |
DETAILED SCRIPT EXAMPLE
Restaurant Interaction
- Scene 1: Entering
- Customer enters restaurant and looks at tables.
- Decides where to sit.
- Scene 2: Ordering
- Waiter brings menu.
- Scene 3: Eating
- Picks food from the menu and consumes it.
- Scene 4: Exiting
- Pays the check and leaves the restaurant.
CYC
Overview
- Goal: Codify millions of knowledge pieces for common sense.
- Origin:
- Started in 1984 by Microelectronics and Computer Technology Corporation.
- 1986: Estimated completion required 250,000 rules and 350 man-years.
- Spinoff:
- In 1994, spun off into Cycorp, Inc.
- 2008: Links to Wikipedia added.
- 2012: Publicly available through OpenCyc.
Structure
- Basic Facts:
- Examples include “Every tree is a plant” and inference like “Trees die eventually.”
- CycL Language:
- Utilizes predicate calculus similar to Lisp.
- Current Efforts:
- Connection to natural language processing.
CYC ONTOLOGY
Levels of Knowledge
- Upper Level:
- Contains broad abstract concepts and universal truths.
- Smallest but widely referenced.
- Middle Level:
- Not universal but widely used abstraction.
- E.g., human interaction, geospatial relationships.
- Lower Level:
- Specific knowledge areas like chemistry and biology.
Specific Examples
- Upper Level:
- (isa Event Collection)
- (genls Event Situation)
- Middle Level:
- DisjointWith(SocialGathering, SingleDoerAction)
- Lower Level:
- Various facts about chemical reactions and their classifications.
End of Document