AM601PC Knowledge Representation and Reasoning UNIT-2
AM601PC Knowledge Representation and Reasoning UNIT-2
The Key Concepts: Knowledge, Representation, Reasoning, need of knowledge representation and reasoning,
Knowledge based systems, Role of logic Logic: Historical background, Representing knowledge in logic,
Varieties of logic, Name, Type, Measures, Unity Amidst diversity.
Knowledge Representation and Reasoning (KRR) enables computers to understand, organize, and apply
real-world information effectively using rules for accurate decision-making.
Refers to the information and facts about the world that a system needs to perform tasks effectively. This
includes data, rules, concepts, relationships, and general understanding of the domain or problem.
Example: Knowing that "water boils at 100°C" or "a car has four wheels."
Representation:
Involves structuring and organizing knowledge in a way that computers can store, process, and use.
Common methods include logical statements, graphs, semantic networks, ontologies, or frames.
Example: Representing a family tree with nodes (individuals) and edges (relationships).
Reasoning:
The process of drawing conclusions, making inferences, or solving problems using the represented
knowledge. This could involve deduction (logical reasoning), induction (generalization), or abduction
(hypothesis generation).
Example: Given "All humans are mortal" and “Ram is human," reasoning concludes, “Ram is mortal."
Components of KRR:
● Ontologies (Organized Knowledge) Provide a structured framework of knowledge, defining a set of
concepts and categories that represent a subject.
● Rules: Govern the logical framework within which AI systems operate to derive reasoned conclusions.
● Semantics: Offer a deeper understanding of data through meaningful interpretation and association.
Example: Knowing that "Apple" can mean a fruit or a company based on the sentence: "I ate an apple"
vs. "Apple released a new iPhone."
What is Knowledge?
Knowledge is when someone (like John) understands and is sure about a fact or idea (like "Mary will
come to the party").
Propositions:
A proposition is a statement that can be either true or false, like "The sky is blue" or "Water boils at
100°C."
● Believing means thinking something is true, but you might not be completely certain or correct.
Propositional Attitudes:
● Verbs like "knows," "hopes," or "doubts" show how someone feels about or relates to an idea or fact.
For example:
o "John knows that Mary will come to the party" means John is sure.
o "John hopes that Mary will come to the party" means John wants it to happen but isn't sure.
What is Representation?
● Representation is the use of one thing (like a symbol, image, or word) to stand for something else,
making it easier to understand, use, or communicate.
Examples:
● The number "7" or Roman numeral "VII" represents the concept of the number seven.
● Symbols (like words, numbers, or drawings) are used to stand for ideas, objects, or facts.
Example: The sentence "The sky is blue" is a proposition because it represents the idea or fact that the
sky has a blue color.
Knowledge Representation:
Since not all beliefs or knowledge can be directly represented, reasoning is applied. Reasoning helps
connect what is explicitly represented with additional information or conclusions
Definition of Reasoning:
Symbols (like words or numbers) are easier to manipulate than the abstract ideas they represent. This
allows us to move, combine, and rearrange symbols to create new representations.
For example:
In binary addition:
In reasoning: We can combine sentences like "John loves Mary" and "Mary is coming to the party"
to infer "Someone John loves is coming to the party."
Logical Inference:
Reasoning involves logical inference, where conclusions follow logically from the initial sentences or
facts. facts. a->b->c then a->c
The philosopher Gottfried Leibniz (17th century) proposed that reasoning is a form of calculation —
but instead of numbers, we manipulate symbols representing propositions.
Here’s an example illustrating Leibniz’s idea that reasoning is like calculation using symbols:
Propositions (Symbols):
Using the rule: If AAA and BBB, then CCC (where CCC: Socrates is mortal), we combine AAA and BBB to
conclude CCC.
● Understanding Behavior
Knowledge helps describe the behavior of complex systems (human or machine) using beliefs, desires,
goals, and intentions.
● Intentional Stance
Describing a system’s behavior in terms of beliefs and intentions is often more useful than technical
details (like algorithms). Helps us reason about the system’s actions intuitively rather than focusing on
low-level operations.
● If you say, "The vending machine wants to make customers happy," it’s misleading because the
vending machine has no desires or intentions.
● In reality, it simply follows a set of programmed rules: "If a customer inserts money and selects a
product, dispense the product. “
"If the correct passcode is entered, unlock the door." This rule can be easily understood by a human
as a meaningful instruction.
Knowledge-Based Systems
In Simple Terms:
How it Shapes Actions and Reasoning: The system checks the current temperature. Based on its knowledge,
it decides to turn on the heater automatically to meet the goal of a warm living room.
Knowledge-Based Systems
A knowledge-based system uses a Knowledge Base (KB) containing symbolic structures to represent
beliefs and facts. Unlike procedural systems, it separates knowledge representation from execution. In
the second PROLOG example, the system uses rules and facts (e.g., color(snow, white)) to reason and
determine outputs.
Key distinction: A knowledge-based system reasoning relies on stored knowledge, not just procedures.
● Adaptability: Useful for open-ended tasks where the system can't know all tasks in advance.
● Easy Extension: Adding new information automatically extends system behavior and
dependencies.
● Error Debugging: Faults can be traced back to incorrect beliefs in the KB, simplifying
troubleshooting.
Allows assimilation of new knowledge, like reading facts about geography, which can be reused across
different tasks.
Why Reasoning?
● Logical Inference: Reasoning computes new beliefs by inferring from represented facts.
o For example, combining Patient X’s allergies with known relationships allows the system to
deduce new allergic conditions.
● Conceptual Trade-offs: Sometimes reasoning includes reasonable assumptions not strictly tied
to represented facts (e.g., assuming Tweety flies even without explicit evidence).
● Why Logic Matters for KRR: Logic is important for knowledge representation and reasoning
(KRR) because it helps us understand how knowledge is related (entailment) and how to reason about it
using rules and truth conditions.
● First-Order Logic (FOL): The main language we’ll use to represent knowledge is First-Order
Logic (FOL), which was created by Gottlob Frege. FOL is widely used in AI for structuring knowledge.
● FOL is Just a Starting Point: FOL is just the beginning. We’ll explore other types of logic and
languages for representing knowledge, which may have different forms and meanings.
● Beyond Logic: While logic is useful for reasoning, there are other ways of reasoning that go
beyond what logic alone can handle.
● Adequacy at Each Level: At the knowledge level, we care about how well the language
represents knowledge and its reasoning rules. At the symbol level, we focus on how efficiently the system
can process and compute the knowledge.
● Using Logic for Analysis: First-Order Logic is ideal for analyzing knowledge systems at the
knowledge level, and in the next chapter, we’ll look at it in more detail, without worrying about
computational issues for now.
● The Knowledge Level (Newell’s Idea): Allen Newell suggests we can understand knowledge
systems at two levels:
● Knowledge level: Focuses on how knowledge is represented and what its rules of reasoning are.
● Symbol level: Deals with the technical side, like the computer architecture and algorithms used to
process the knowledge.
● Knowledge and representation have been central to philosophical debates for over two millennia.
● In the 5th century B.C., Socrates challenged common beliefs about knowledge by claiming to
know little and questioning others who asserted knowledge about topics like Truth, Beauty, and Justice.
● Socrates’ dialectical method (questioning) was carried on by his student, Plato, who helped
establish epistemology, the study of knowledge and its justification.
● Epistemology was not just a theoretical pursuit; in Socrates' case, it had real-life
consequences—he was condemned to death for his questioning of accepted beliefs, which led to
accusations of impiety and corruption.
Terminology.
● Aristotle's Contribution: Aristotle shifted philosophy's focus from the nature of knowledge to the
practical problem of representing it, laying the groundwork for many fields, including logic, ethics, and
biology.
● Terminology Invention: Aristotle invented and defined terms to represent knowledge across
various fields, creating the foundational vocabulary for modern technical discourse.
● Greek and Latin Influence: Many terms Aristotle coined in Greek (e.g., category, metaphor,
hypothesis) were later translated into Latin, which further influenced English terminology.
● Everyday Usage: Words like category and quality, originally coined by Aristotle and later
Latinized, have become common in everyday language, far beyond their philosophical origins.
Syllogism
● Aristotle’s Syllogism: Aristotle invented the syllogism, a three-part logical pattern to deduce
conclusions from premises. Example: "All broad-leafed plants are deciduous. All vines are broad-leafed
plants. Therefore, all vines are deciduous.“
● Major and Minor Premises: A syllogism combines two premises—major (general statement) and
minor (specific statement)—to reach a conclusion.
● Formal Logic: Aristotle formalized syllogisms with rules of inference, using variables to represent
general terms in logical deductions.
● Systematic Analysis: Aristotle's method involved systematic analysis, introducing formal rules to
convert one logical pattern into another while maintaining truth.
● Legacy in Modern Logic: Modern symbolic logic and programming languages still use
Aristotle’s approach of stylized natural language and variables for reasoning.
SCHOLASTIC LOGIC
● Propositions and Vowels: Scholastics used four types of propositions, labeled with vowels: A (All
A is B), I (Some A is B), E (No A is B), O (Some A is not B).
● Basic Syllogism Patterns: They created patterns for valid syllogisms, like Barbara (AAA),
Celarent (EAE), Darii (AII), and Ferio (EIO), each with specific logical structures.
● Logical Hierarchies: Patterns like Barbara and Darii show how properties are inherited, while
Celarent and Ferio identify category exclusiveness or inconsistencies.
● Scholastic Innovations: The Scholastics, especially Peter of Spain, expanded on Aristotle’s logic,
influencing later developments in language and modal logic.
● Tree of Porphyry: Porphyry’s network, known as the Tree of Porphyry, categorized substances
and species, with "substance" as the highest genus and "human" as a species. It defined categories using
genus (general class) and differentiae (specific features).
● Inheritance and AI: The concept of inheritance, used in AI and object- oriented systems, builds
on this method. For example, Living Thing is a material substance, and Human is a rational, sensitive
living thing. This inheritance system is fundamental to how AI systems define categories.
● Ramon Lull’s Automated Reasoning: In the 13th century, Ramon Lull invented mechanical
devices for automated reasoning. His system, Ars Magna, merged logic and theology, expanding on
Porphyry’s tree by adding Ens (Being) as the supertype of Substance.
MATHEMATICAL LOGIC
● Universal Characteristic: Leibniz assigned prime numbers to basic concepts (e.g., Substance =
2, Material = 3) and used multiplication to represent composite concepts (e.g., Human = 2 × 3 × 7 × 13 ×
19 = 10,374).
● Reasoning with Numbers: Leibniz tested relationships between categories by dividing their
numbers. For example, since Human's number is divisible by Body's number, all humans are bodies, but
not minerals (as Human’s number is not divisible by Mineral’s).
● Limitations: While Leibniz’s system worked well for universal affirmative syllogisms (Barbara
type), it couldn't represent logical operations like negation, disjunction, or implication, limiting its
scope.
Example:
● "All humans are bodies": Since 10,374 (Human) is divisible by 6 (Body), all
humans are bodies.
Represents the schema or structure of knowledge. Contains concepts (classes) and their
relationships (ontology). Defines rules and constraints, such as subclass relationships,
domain/range of properties, and axioms.
Example in ontology:
Represents the facts or data about specific instances. Contains assertions about
individuals based on the T-Box. Links individuals to concepts and properties.
Example:
Boolean Algebra
Definition:
A branch of algebra that deals with binary variables and logical operations. Developed by
George Boole in the mid-19th century.
● Basic Operations:
o OR (⋁ or ∨): Union/Disjunction.
Frege's Begriffsschrift
Key Features:
o Quantifiers: Introduced the notions of "for all" (∀∀∀) and "there exists"
(∃∃∃).
Algebraic Notation
Types:
o Classical Algebraic Notation: Using x,y,zx, y, zx,y,z, and operators like +,−,∗,/+, -,
*, /+,−,∗,/.
o Abstract Algebra Notation: Groups, rings, fields with operations like (a∗b)−1(a *
b)^{-1}(a∗b)−1.
● Modern Logic: Achieves this partially, as it can represent any precise, factual
information in a computable form.
Example:
(∀x)(cat(x)⇒mammal(x)).
Example:
● Breaks sentences into two parts: Subject (what you're talking about) and Predicate
(what you're saying about it).
Example:
Represents relationships and internal structure using variables and quantifiers (∀\forall: for
all, ∃\exists: there exists).
Example:
o Logic:
(∀x)(trailerTruck(x)⇒numberOfWheels(x,18)).
Example:
o Logic:
(∀x)((truck(x)∧(∃y)(trailer(y)∧part(x,y)))⇒(∃s)(set(s)∧count(s,18)∧(∀w)(member(
w
,s)⇒(wheel(w)∧part(x,w)))).
Meaning: Every truck xxx with a trailer yyy has a set sss of 18 wheels.
Logic isn't the only way to represent knowledge; specialized notations (like music) are better
for certain tasks.
Example:
(∃x1)(∃x2)(tone(x1,G)∧dur(x1,1)∧next(x1,x2)∧tone(x2,A)).
Musicians prefer traditional notation, but logic is useful for computer analysis.
o Logic: (∀x)(∀y)((tone(x,B)∧next(x,y))⇒¬tone(y,F)).
o Meaning: If a note is BB and the next is yy, yy cannot be FF.
Key Takeaways
2. Predicate Logic: Adds details with subjects, predicates, and quantifiers.
4. Special Notations: Logic complements, not replaces, domain-specific tools like
music notation.
5. Expressiveness: Logic can represent everything computable but has limitations
when it comes to vague or unquantifiable knowledge.
Classical FOL, created by Frege and Peirce, is the most widely used logic system. Though
they started with different approaches and notations, their systems converged to express the
same ideas. This highlights that notational differences do not affect logical equivalence.
Variations in Logic:
Example: Different symbols like "∃" or "exists" may be used, but the meaning remains the
same.
2. Subsets: Some logics simplify FOL by limiting features for efficiency.
3. Proof Theory: Variations allow or restrict how proofs are constructed.
Example: Linear logic ensures every piece of information is used exactly once.
4. Model Theory: Adjusts truth values assigned to statements.
Example: Classical FOL uses "true" or "false," while fuzzy logic uses a range from 0 (false)
to 1 (true).
Typed Logic:
Typed logic becomes even more useful with multiple quantifiers, making expressions clearer
and less error-prone.
(∀x:TrailerTruck)(∃s:Set)(s@18∧(∀w∈s)(wheel(w)∧part(x,w)))
This means: "For every trailer truck, there exists a set of 18 wheels, where each wheel is part
of the truck."
The fundamentals of lambda calculus, conceptual graphs, modal logic, and higher-order
logic, illustrating their roles in formal logic and computational systems. Here's a summary of
the key points:
Lambda Calculus
Purpose: A formal system introduced by Alonzo Church to define and evaluate functions
and relations.
Key Features: Lambda calculus uses λ\lambdaλ to define functions and operations.
o Scenario: You want to define a function that adds 2 to any number.
o Lambda Expression:
λx.(x+2)
This means: "A function that takes an input xxx and returns x+2x
(λx.(x+2))3=3+2=5
Components:
Advantages:
● Applications:
∀P:Predicate(P(0)∧(∀n:Integer)(P(n)⇒P(n+1))⇒∀n:IntegerP(n)).
Comparison of Representations
Example: ∀x:TrailerTruck(∃s:Set∧s@18∧(∀w∈s)(wheel(w)∧part(x,w))).
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.
● Each formalism is tailored for specific tasks: CGs for human readability, KIF for
machine interchange, and lambda calculus for precise functional representation.
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:
Errors often occur in knowledge representation because names, types, and measures are
confused with the things themselves.
Key Concepts
1. Names
● 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
● In typed logic, types are represented with variables, such as: Formula:
('lix:Cat)('liy:Fish) like(x,y)
3. Measures
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:
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
Syllogism Example:
This mistake arises because "Clyde" (a name) and "Elephant" (a type) are mixed up.
Example:
● If Dr. Jekyll = Mr. Hyde (two identities), substituting their names could create
paradoxes
● Surrogates are introduced to prevent such issues. A surrogate ensures every entity
has a
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.
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
Tom)
Simple Example:
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.
If you follow the syntax, you have well-formed, understandable logical sentences.
A logic system needs a way to associate symbols with real-world meanings and determine
whether statements are true or false
Key Components:
Example:
Inference means drawing logical conclusions based on existing information. A good logic
system must have:
1. Sound Inference Ensures that conclusions preserve true statements according to
semantics.
Example of Inference:
Sentence Example:
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
Conclusion
● These four components unify different logics into a coherent system, making it
versatile enough for AI, databases, VLSI chip design, and more.