UNIT – I
The Key Concepts: Knowledge, Representation, Reasoning, Why knowledge
representation and reasoning, Role of logic Logic: Historical background, Representing
knowledge in logic, Varieties of logic, Name, Type, Measures, Unity Amidst diversity
1. Knowledge
Definition:
Knowledge refers to facts, information, and skills that an agent possesses about the world. It
can be explicit (clearly defined) or implicit (inferred from other knowledge).
Types of Knowledge:
• Declarative Knowledge (What something is) → Example: "Paris is the capital of
France."
• Procedural Knowledge (How to do something) → Example: "How to ride a bike."
• Common-Sense Knowledge (Everyday reasoning) → Example: "Water is wet."
• Meta-Knowledge (Knowledge about knowledge) → Example: "I know that I don’t
know the answer."
Challenges in Knowledge:
• How to acquire knowledge? (Learning, data gathering)
• How to store knowledge efficiently?
• How to update knowledge when new information arrives?
2. Representation
Definition:
Representation is the way knowledge is encoded and structured so that it can be processed by
AI systems.
Types of Knowledge Representation:
• Logic-Based (e.g., First-Order Logic) → Example: "∀x (Bird(x) → CanFly(x))"
• Rule-Based (If-Then Rules) → Example: "If it is raining, then the ground is wet."
• Semantic Networks (Graph structures of relationships) → Example: "A dog is a
mammal."
• Frames & Ontologies (Structured concepts) → Example: Defining "Car" with
properties like wheels, engine, brand.
• Probabilistic Models (Handling uncertainty) → Example: Bayesian Networks.
Challenges in Representation:
1
• How to choose the best representation for a problem?
• How to balance expressiveness and computational efficiency?
• How to deal with incomplete or uncertain information?
3. Reasoning
Definition:
Reasoning is the process of deriving new knowledge from existing knowledge using logical
inference.
Types of Reasoning:
• Deductive Reasoning (General → Specific) → Example: "All humans are mortal.
Socrates is human. ∴ Socrates is mortal."
• Inductive Reasoning (Specific → General) → Example: "I have seen 100 swans,
all are white. ∴ All swans might be white."
• Abductive Reasoning (Best explanation) → Example: "The grass is wet. ∴ It
probably rained."
• Non-Monotonic Reasoning (Handling changing beliefs) → Example: "Birds can
fly. But penguins are birds that can’t fly."
• Probabilistic Reasoning (Handling uncertainty) → Example: "There’s a 70%
chance it will rain tomorrow."
❖ Why Knowledge Representation and Reasoning (KRR)?
Knowledge Representation and Reasoning (KRR) is fundamental in Artificial Intelligence (AI)
and cognitive science because it enables machines to understand, store, and manipulate
knowledge to make decisions, solve problems, and simulate human intelligence.
Here are the key reasons why KRR is important:
1. To Enable Machines to "Think" Like Humans
2
• Humans reason about the world based on what they know. AI systems need a way to
store and process knowledge to achieve similar reasoning abilities.
• Example: A virtual assistant understands “I’m hungry” and suggests nearby restaurants.
2. To Support Decision-Making and Problem-Solving
• AI systems must reason about available data to make informed decisions.
• Example: In medical diagnosis, a system uses patient symptoms and medical
knowledge to suggest possible diseases.
3. To Handle Complex, Structured Knowledge
• Real-world knowledge is not just raw data—it has relationships, hierarchies, and rules
that must be structured properly.
• Example: A legal AI system must understand that "A lawyer is a type of professional"
and "A contract is legally binding."
4. To Deal with Uncertainty and Incomplete Information
• Many real-world situations involve uncertain, vague, or missing information.
• Example: A self-driving car doesn’t always know the exact intentions of pedestrians but
must make reasonable guesses to ensure safety.
5. To Facilitate Communication Between Humans and AI
• AI must represent knowledge in a way that is understandable both to humans and
machines.
• Example: Chatbots use KRR to understand customer queries and provide relevant
responses.
6. To Enable Learning and Adaptation
• AI systems need a structured knowledge base that can be updated over time as new
information becomes available.
• Example: A fraud detection system learns from past fraud cases and updates its rules
accordingly.
7. To Improve Efficiency in AI Applications
3
• Logical reasoning allows AI to infer new knowledge instead of storing every possible
fact explicitly.
• Example: Instead of storing “A dog has four legs,” a system can store general rules
about mammals and infer this information when needed.
❖ Types of knowledge
What is knowledge representation?
Humans are best at understanding, reasoning, and interpreting knowledge. Human
knows things, which is knowledge and as per their knowledge they perform various
actions in the real world. But how machines do all these things comes under
knowledge representation and reasoning. Hence we can describe Knowledge
representation as following:
o Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence
which concerned with AI agents thinking and how thinking contributes to intelligent
behavior of agents.
o It is responsible for representing information about the real world so that a computer
can understand and can utilize this knowledge to solve the complex real world problems
such as diagnosis a medical condition or communicating with humans in natural
language.
o It is also a way which describes how we can represent knowledge in artificial
intelligence. Knowledge representation is not just storing data into some database, but
it also enables an intelligent machine to learn from that knowledge and experiences so
that it can behave intelligently like a human.
What to Represent:
Following are the kind of knowledge which needs to be represented in AI systems:
o Object: All the facts about objects in our world domain. E.g., Guitars contains strings,
trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the
knowledge base. It is represented as KB. The Knowledgebase is a group of the
Sentences (Here, sentences are used as a technical term and not identical with the
English language).
Knowledge: Knowledge is awareness or familiarity gained by experiences of facts,
data, and situations. Following are the types of knowledge in artificial intelligence:
4
Types of knowledge
Fullscreen
1. Declarative Knowledge:
o Declarative knowledge is to know about something.
o It includes concepts, facts, and objects.
o It is also called descriptive knowledge and expressed in declarativesentences.
o It is simpler than procedural language.
2. Procedural Knowledge
o It is also known as imperative knowledge.
o Procedural knowledge is a type of knowledge which is responsible for knowing how to
do something.
o It can be directly applied to any task.
o It includes rules, strategies, procedures, agendas, etc.
o Procedural knowledge depends on the task on which it can be applied.
3. Meta-knowledge:
o Knowledge about the other types of knowledge is called Meta-knowledge.
4. Heuristic knowledge:
o Heuristic knowledge is representing knowledge of some experts in a filed or subject.
o Heuristic knowledge is rules of thumb based on previous experiences, awareness of
approaches, and which are good to work but not guaranteed.
5. Structural knowledge:
o Structural knowledge is basic knowledge to problem-solving.
5
o It describes relationships between various concepts such as kind of, part of, and
grouping of something.
o It describes the relationship that exists between concepts or objects.
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying
intelligent behavior:
o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution
❖ Features of Knowledge Representation and Reasoning (KRR)
KRR systems have key characteristics that enable AI to store, process, and infer knowledge
effectively. These features ensure that knowledge is structured, usable, and applicable in
various domains.
6
1. Expressiveness
• A good KRR system can represent a wide variety of knowledge (facts, rules,
relationships, uncertainty).
• Example: It should be able to express both "Paris is the capital of France" and "If it is
raining, then the ground is wet."
2. Consistency & Logical Soundness
• The knowledge must be free from contradictions and follow logical principles.
• Example: If the system knows that "All birds can fly" and also "Penguins cannot fly,"
it must handle exceptions properly.
3. Reasoning Capability
• The system should infer new knowledge from existing knowledge.
• Example: If the system knows "Humans are mortal" and "Socrates is human," it should
conclude that "Socrates is mortal."
4. Efficiency & Scalability
• The system must allow fast reasoning even with large amounts of knowledge.
• Example: Google’s Knowledge Graph processes billions of facts efficiently.
5. Flexibility & Modifiability
• Knowledge should be easily updated when new facts are discovered.
• Example: A medical AI should update its knowledge when new treatments become
available.
6. Handling Uncertainty & Incompleteness
• Real-world knowledge is often incomplete or uncertain.
• Example: A self-driving car may not know if a pedestrian will cross the road but must
still reason about possible outcomes.
• Tools: Fuzzy Logic, Bayesian Networks.
7. Hierarchical Organization
7
• Knowledge should be structured in a way that reflects relationships (e.g., taxonomies,
ontologies).
• Example: "A dog is a type of mammal," "A mammal is a type of animal."
8. Machine Interpretability
• Knowledge should be structured in a format that AI can process (e.g., logic, graphs,
ontologies).
• Example: Knowledge graphs like Wikidata and Google Knowledge Graph use
structured data.
9. Multi-Modal Representation
• A KRR system should handle different types of data—text, images, numbers, and
sensor data.
• Example: A robot should understand both a spoken command ("Pick up the box") and
a visual cue (a pointing gesture).
10. Common-Sense Reasoning
• AI should handle basic real-world knowledge like humans do.
• Example: If someone drops a glass, it will likely break.
❖ Challenges in Knowledge Representation and Reasoning (KRR)
1. Knowledge Acquisition (The Knowledge Bottleneck)
• Manually encoding knowledge is time-consuming and labor-intensive.
• Many domains require expert knowledge, which is difficult to formalize.
• Example: Teaching an AI all medical conditions and their symptoms is a massive task.
Possible Solutions:
✔ Automated knowledge extraction (from text, images, databases)
✔ Machine learning to infer rules from data
2. Handling Uncertainty & Incomplete Information
• Real-world knowledge is often imperfect, uncertain, or missing.
• Example: A self-driving car doesn’t always know if a pedestrian will cross the street but must
make a decision.
8
Possible Solutions:
✔ Probabilistic reasoning (Bayesian networks)
✔ Fuzzy logic to handle vague concepts
3. Scalability & Computational Complexity
• Large knowledge bases require fast and efficient reasoning.
• Some logical inferences are computationally expensive (e.g., NP-hard problems in first-order
logic).
• Example: Google’s Knowledge Graph processes billions of facts and must do so quickly.
Possible Solutions:
✔ Optimized reasoning algorithms
✔ Distributed computing for large-scale knowledge bases
4. Representation of Common Sense Knowledge
• AI lacks the common-sense knowledge humans use daily.
• Example: A chatbot might not know that "If someone is wet, they probably went out in the
rain."
Possible Solutions:
✔ Common-sense knowledge bases (e.g., ConceptNet, Cyc)
✔ Machine learning models trained on real-world scenarios
5. Logical Consistency & Contradictions
• Knowledge bases often have conflicting information.
• Example: One source may say "Coffee is healthy," while another says "Coffee is unhealthy."
Possible Solutions:
✔ Non-monotonic reasoning (AI updates beliefs when new evidence appears)
✔ Conflict resolution strategies
6. Contextual Understanding & Ambiguity
• The meaning of knowledge changes depending on context.
• Example: "Bank" could mean a financial institution or the side of a river, depending on
context.
Possible Solutions:
✔ Context-aware reasoning models
✔ NLP techniques like word embeddings for disambiguation
9
7. Evolution & Dynamic Knowledge Updates
• Knowledge changes over time (new scientific discoveries, societal shifts).
• Example: AI used in medical diagnosis must update when new diseases or treatments emerge.
Possible Solutions:
✔ Continuous learning and real-time updates
✔ Crowdsourced knowledge contributions
8. Knowledge Integration from Multiple Sources
• AI must integrate knowledge from multiple, sometimes conflicting sources (text, databases,
human experts).
• Example: An AI news summarizer must combine articles from different perspectives.
Possible Solutions:
✔ Ontology alignment techniques
✔ Trustworthiness scoring for sources
9. Symbolic vs. Subsymbolic AI Conflict
• Traditional KRR uses symbolic AI (logic, rules), while modern AI relies on subsymbolic methods
(neural networks, deep learning).
• Example: A neural network can recognize faces but struggles to explain why two people look
similar.
Possible Solutions:
✔ Hybrid AI (combining symbolic and neural reasoning)
✔ Explainable AI (XAI) to bridge the gap
10. Ethical & Bias Issues
• Knowledge bases may inherit biases from their sources.
• Example: An AI trained on biased job data may discriminate in hiring decisions.
Possible Solutions:
✔ Bias detection and mitigation strategies
✔ Transparency in AI decision-making
10
❖ Applications of Knowledge Representation and Reasoning (KRR)
KRR plays a crucial role in various domains by enabling AI systems to store, infer, and utilize knowledge
effectively. Here are some key applications:
1. Expert Systems
• AI systems that simulate human expertise to assist in decision-making.
• Examples:
✔ Medical Diagnosis → AI like IBM Watson Health suggests treatments based on patient
symptoms.
✔ Legal Reasoning → AI-powered legal assistants analyze contracts and predict case
outcomes.
2. Semantic Web & Ontologies
• Enhances web content with structured, machine-readable data for better search and
reasoning.
• Examples:
✔ Google Knowledge Graph → Helps improve search results by understanding entity
relationships.
✔ Wikidata & DBpedia → Open knowledge bases that structure information for AI.
3. Natural Language Processing (NLP)
• AI uses KRR to understand, translate, and generate human language.
• Examples:
✔ Chatbots & Virtual Assistants → Siri, Alexa, and ChatGPT use structured knowledge for
conversations.
✔ Machine Translation → Google Translate improves translation by reasoning about context.
4. Robotics & Autonomous Systems
• Robots use KRR to navigate, interact, and make intelligent decisions.
• Examples:
✔ Self-Driving Cars → AI reasons about traffic rules, road signs, and obstacles.
✔ Industrial Robots → Use knowledge bases to optimize manufacturing tasks.
5. Healthcare & Biomedical Research
• AI helps in disease prediction, drug discovery, and medical decision-making.
• Examples:
✔ AI Diagnosis → Systems like DeepMind’s AlphaFold predict protein structures for drug
research.
✔ Personalized Medicine → AI recommends treatments based on a patient’s genetic profile.
11
6. Recommender Systems
• AI suggests relevant content based on user preferences.
• Examples:
✔ Netflix & YouTube → Recommend movies/shows based on viewing history.
✔ Amazon & E-commerce → Suggests products by reasoning about user behavior.
7. Cybersecurity & Fraud Detection
• AI detects anomalies and reasons about security threats.
• Examples:
✔ Fraud Detection → AI analyzes transaction patterns to spot credit card fraud.
✔ Intrusion Detection → Uses KRR to detect and respond to cyber attacks.
8. Business Intelligence & Decision Support
• AI analyzes large datasets to provide insights and predictions.
• Examples:
✔ Stock Market Analysis → AI reasons about financial trends for investment decisions.
✔ Customer Relationship Management (CRM) → AI predicts customer needs and behavior.
9. Education & E-Learning
• AI adapts learning materials based on student knowledge levels.
• Examples:
✔ Intelligent Tutoring Systems → AI provides personalized lessons and quizzes.
✔ Automated Grading → AI reasons about student answers to evaluate performance.
10. Smart Assistants & IoT Devices
• AI-powered devices understand and interact with humans.
• Examples:
✔ Smart Home Assistants → Google Assistant, Alexa control home automation.
✔ Wearables (e.g., Smartwatches) → AI interprets health data to suggest workouts or alerts.
12
o Example: ∀x:TrailerTruck(∃s:Set∧s@18∧(∀w∈s)(wheel(w)∧part(x,w))).
2. Conceptual Graphs:
o Eliminates variables for readability.
o Graphically represents logical structure.
3. Knowledge Interchange Format (KIF):
o Designed for machine processing, with a restricted syntax.
also
Lambda calculus and conceptual graphs bridge formal logic and natural language.
Modal logic handles nuances like necessity, possibility, and temporal reasoning.
Higher-order logic expands the scope of logical representation by quantifying over
predicates and relations.
Each formalism is tailored for specific tasks: CGs for human readability, KIF for machine
interchange, and lambda calculus for precise functional representation.
Names, Types, and Measures
When logic is applied to mathematics, the constants represent numerals, which act as names of
numbers. But in real-world applications, a broader range of data is needed, such as:
Names of people and things (e.g., Tom, Elephant)
Types of things (e.g., cat, fish)
Measures of things (e.g., height, weight)
Errors often occur in knowledge representation because names, types, and measures are
confused with the things themselves.
Key Concepts
1. Names
In logic and knowledge representation, a name refers to a specific individual.
For example, "Clyde" is a specific elephant, a proper name that refers to an entity.
The sentence "Clyde is an elephant" connects a proper name (Clyde) with a type
(Elephant).
Core Idea: Names directly refer to an individual, while types refer to a group or category of
entities.
2. Types
A type is a more general category that includes multiple entities.
For example, "Elephant" represents the species, not an individual.
In typed logic, types are represented with variables, such as:
Formula: ('lix:Cat)('liy:Fish) like(x,y)
This means: For every cat x and every fish y, x likes y.
Types help in representing categories of entities rather than specific individuals.
3. Measures
In real-world knowledge representation, measures often represent quantitative
properties, such as salary, height, weight.
For example:
o An actor might choose a salary of $20 million rather than a proper name like
Fred.
In computing systems, failing to distinguish measures from individual entities can cause
bugs. For example:
Tom and Sue have the same salary.
Should imply that their salaries are numerically identical, but not
that they share a paycheck.
In databases and programming, such distinctions avoid incorrect assumptions about how data is
stored and retrieved.
Examples of Confusion Between Names, Types, and Measures
1. Syllogism Fallacy:
Syllogism Example:
o Premise 1: Clyde is an elephant (individual)
o Premise 2: "Elephant" is a species (type)
o Incorrect Inference: Therefore, Clyde is a species.
This mistake arises because "Clyde" (a name) and "Elephant" (a type) are mixed up.
2. Database Errors:
In database systems, aliases (alternative names for individuals) need to be carefully
handled to avoid errors.
Example:
Sam believes that Dr. Jekyll is a gentleman
If Dr. Jekyll = Mr. Hyde (two identities), substituting their names could create paradoxes
(incorrect logical substitutions).
Surrogates are introduced to prevent such issues. A surrogate ensures every entity has a
unique identifier, avoiding mistakes caused by shared names.
Formula to Avoid Paradoxes:
believe(Sam, (3s)(hasName(s, "Dr. Jekyll") /\ gentleman(s))).
believe(Sam, (3s)(hasName(s, "Mr. Hyde") /\ gentleman(s))).
This ensures that substituting names doesn't lead to logical errors.
Conclusion
Names refer to specific individuals.
Types refer to categories or groups.
Measures capture quantitative properties.
Confusing these concepts in databases, programming, and logical reasoning leads to
significant errors and system bugs.
Careful differentiation between names, types, and measures ensures proper knowledge
representation and avoids issues in logic, databases, and computer systems.
"Unity Amidst Diversity" in Logic �
The passage explains how different types of logic have been developed over time. Even with
various notations and approaches, any good logic system must meet four core features. Let's
break down these features with simple terms and examples.
Key Features of a Good Logic System ✅
1. Vocabulary ✅
A logic system needs a collection of symbols to represent things. These symbols can be:
Characters/Words (like A, B, X)
Icons/Diagrams
Sounds
These symbols are divided into four groups:
Symbol Type Purpose
Domain-independent
General symbols like 'AND (∧)', 'OR (∨)'.
symbols
Symbols representing specific people or things. (Example:
Domain-dependent constants
Tom)
Variables Represent unknowns (Example: x, y)
Punctuation Used to group symbols (Parentheses (), commas, etc.)
Simple Example:
In the sentence "Tom likes apples",
o Tom = Domain-dependent constant
o 'likes' = Relation Symbol
o Parentheses () help group these symbols clearly.
2. Syntax ✅ (Grammar Rules)
Syntax refers to the rules for combining symbols to form valid sentences.
It's like grammar in language, ensuring everything follows a structured format.
Simple Syntax Rules:
Symbols must follow a specific order to form correct sentences.
Example: Logical Sentence
"p AND q" (in logical notation p ∧ q)
o Must follow proper order to form valid combinations.
If you follow the syntax, you have well-formed, understandable logical sentences.
3. Semantics ✅ (Meaning and Truth)
A logic system needs a way to associate symbols with real-world meanings and determine
whether statements are true or false.
Key Components:
Theory of Reference: Connects constants and variables to real-world entities.
Theory of Truth: Decides which sentences are correct or incorrect.
Example:
In Alfred Tarski's theory (1935), we have truth tables that show:
Statement Truth Value
p AND q True/False (depends on the truth of 'p' and 'q')
For example, if p = True and q = True, then p AND q = True.
4. Rules of Inference ✅
Inference means drawing logical conclusions based on existing information. A good logic
system must have:
Two Types of Inference:
1. Sound Inference �
Ensures that conclusions preserve true statements according to semantics.
2. Non-monotonic Inference ��
Used in plausible or approximate reasoning but doesn't always preserve strict truth.
Example of Inference:
Modus Ponens (A common inference rule):
o If "If p, then q" and p is true, then q must be true.
Sentence Example:
"If it rains, the ground will get wet."
Inference: If rains = True, then ground_wet = True.
✅ Unity Amidst Diversity
Despite the many notations and types of logic developed over time (like Prolog, Fuzzy Logic,
Modal Logic), they all follow these four core features:
Feature Purpose
Vocabulary For symbols representing entities and actions.
Syntax Grammar to combine symbols into sentences.
Semantics Determines meaning and truthfulness.
Inference Rules for logical reasoning and conclusions.
✅ Applications in Technology
Prolog: Used in AI programming.
SQL: Used in database queries but still has logical semantics.
AI Systems (Frames, Semantic Networks): Have the same expressive power as first-
order logic.
✅ Conclusion
A knowledge representation system must have symbols, grammar rules, truth-based
semantics, and inference methods.
These four components unify different logics into a coherent system, making it
versatile enough for AI, databases, VLSI chip design, and more.
Understanding these foundational features helps computer scientists, AI experts, and logicians
select the right logic system for any application, balancing expressive power, efficiency, and
readability.