1.
Introduction to Knowledge Representation
• Knowledge Representation (KR) is a fundamental aspect of Artificial
Intelligence that involves encoding information about the world in a form
that a computer system can utilize to solve complex tasks.
• It enables machines to mimic human reasoning, understand concepts, learn
from experiences, and make decisions.
• In AI, knowledge representation helps in:
o Perception: Understanding sensory data.
o Reasoning: Drawing conclusions and making decisions.
o Learning: Improving performance based on experiences.
o Communication: Interacting with humans using natural language.
2. Importance of Knowledge Representation in AI
• Efficient knowledge representation allows:
o Accurate Decision Making: By organizing and processing relevant
information.
o Complex Problem Solving: Through logical reasoning and inference
mechanisms.
o Learning and Adaptation: By generalizing from past experiences.
o Communication and Interaction: Facilitating natural language
processing and human-computer interaction.
3. Types of Knowledge in AI
1. Declarative Knowledge:
o Facts and statements about the world.
o Example: "Paris is the capital of France."
2. Procedural Knowledge:
o Instructions or methods on how to perform tasks.
o Example: Algorithm for sorting numbers.
3. Meta-Knowledge:
o Knowledge about knowledge itself.
o Example: Understanding the relevance or reliability of information.
4. Heuristic Knowledge:
o Rules of thumb or intuitive judgments.
o Example: "If it is raining, then the road might be slippery."
5. Structural Knowledge:
o Relationships among concepts.
o Example: Taxonomies or ontologies in semantic networks.
4. Approaches to Knowledge Representation
There are several approaches used in AI to represent knowledge:
4.1 Logical Representation
• Description: Uses formal logic to represent facts and rules.
• Example: Predicate Logic, Propositional Logic.
• Advantages:
o Precise and unambiguous representation.
o Enables complex reasoning using inference rules.
• Disadvantages:
o Computationally expensive for large datasets.
o Limited expressiveness for uncertain or incomplete knowledge.
• Example:
• All humans are mortal: ∀x (Human(x) → Mortal(x))
• Socrates is human: Human(Socrates)
• Therefore, Socrates is mortal: Mortal(Socrates)
4.2 Semantic Networks
• Description: Graphical representation of knowledge using nodes (concepts)
and edges (relationships).
• Example:
• (Cat) --is a--> (Animal)
• (Cat) --has--> (Tail)
• (Cat) --can--> (Meow)
• Advantages:
o Intuitive and easy to visualize.
o Captures hierarchical relationships.
• Disadvantages:
o Lack of formal semantics.
o Ambiguity in representing complex relationships.
4.3 Frames
• Description: Data structures representing stereotypical situations.
• Example: Frame for "Restaurant Visit"
• Restaurant Visit:
• - Participants: Customer, Waiter, Chef
• - Actions: Ordering, Cooking, Serving, Billing
• Advantages:
o Modular and structured representation.
o Captures default values and inheritance.
• Disadvantages:
o Inflexible in representing dynamic scenarios.
o Limited reasoning capabilities.
4.4 Production Rules
• Description: Knowledge in the form of IF-THEN rules.
• Example:
• IF it is raining THEN carry an umbrella.
• Advantages:
o Simple and easy to understand.
o Suitable for rule-based expert systems.
• Disadvantages:
o Inefficient for large rule sets.
o Difficult to manage conflicting rules.
4.5 Ontologies
• Description: Formal representation of knowledge as a set of concepts
within a domain and the relationships between those concepts.
• Example: Ontology for a university system:
• (Professor) --teaches--> (Course)
• (Student) --enrolled in--> (Course)
• (Course) --belongs to--> (Department)
• Advantages:
o Rich expressiveness with formal semantics.
o Promotes knowledge sharing and reuse.
• Disadvantages:
o Complex to design and maintain.
o Computationally expensive reasoning.
5. Problems in Representing Knowledge
Despite its importance, knowledge representation faces several challenges:
5.1 Incompleteness and Uncertainty
• Knowledge is often incomplete or uncertain in real-world scenarios.
• Example: Medical diagnosis may not have a clear cause for symptoms.
• Challenge:
o Traditional logic systems are inadequate for uncertain knowledge.
o Requires probabilistic reasoning (e.g., Bayesian networks).
5.2 Ambiguity and Vagueness
• Natural language is often ambiguous and vague.
• Example: "The bank is crowded" (Bank can mean riverbank or financial
institution).
• Challenge:
o Difficult to represent ambiguous concepts accurately.
o Requires context-awareness and disambiguation techniques.
5.3 Inconsistency
• Knowledge from multiple sources may conflict.
• Example: One source states "X is true," another states "X is false."
• Challenge:
o Resolving contradictions without losing relevant information.
o Requires non-monotonic reasoning and belief revision.
5.4 Scalability
• Real-world knowledge is vast and constantly growing.
• Example: Representing knowledge for the entire web.
• Challenge:
o Storing and processing massive datasets efficiently.
o Requires scalable storage and computational techniques.
5.5 Expressiveness vs. Efficiency Trade-off
• High expressiveness leads to complex reasoning but reduces efficiency.
• Example: Predicate logic is highly expressive but computationally expensive.
• Challenge:
o Balancing expressive power with computational efficiency.
5.6 Maintenance and Updating
• Knowledge needs to be updated as new information becomes available.
• Example: Updating medical knowledge with new research findings.
• Challenge:
o Ensuring consistency while updating or modifying knowledge.
o Requires dynamic knowledge management systems.
5.7 Representation of Common Sense Knowledge
• Common sense reasoning is intuitive for humans but difficult to formalize.
• Example: "Water flows downhill."
• Challenge:
o Formalizing intuitive knowledge for machines.
o Requires large-scale common sense knowledge bases (e.g.,
ConceptNet).
6. Solutions to Knowledge Representation Problems
• Probabilistic Models: Handling uncertainty using Bayesian networks.
• Fuzzy Logic: Managing vagueness and ambiguity.
• Non-monotonic Reasoning: Addressing inconsistency by allowing
withdrawal of inferences.
• Ontology Engineering: Creating formal ontologies for better expressiveness.
• Scalable Storage: Using cloud storage and distributed databases for
scalability.
• Machine Learning Integration: Learning new knowledge from data.
7. Applications of Knowledge Representation
1. Expert Systems: Medical diagnosis, financial analysis.
2. Natural Language Processing: Language understanding, translation.
3. Robotics: Environmental perception and navigation.
4. Semantic Web: Linked data and ontology-based information retrieval.
5. Cognitive Computing: Reasoning and decision making.
8. Conclusion
• Knowledge Representation is critical for enabling intelligent behavior in AI
systems.
• It involves not only storing information but also reasoning and drawing
inferences.
• Despite numerous challenges, advancements in probabilistic reasoning,
ontologies, and machine learning are paving the way for more effective
knowledge representation systems.
• The future of AI heavily relies on solving these challenges to build more
intelligent, adaptable, and reliable systems.
1. Introduction to Knowledge Representation Using Logic
• Logic is a formal system used in Artificial Intelligence to represent
knowledge, reason, and draw inferences.
• It provides a structured way to express facts, rules, and relationships in a
precise and unambiguous manner.
• The two most widely used types of logic for knowledge representation are:
o Propositional Logic (also known as Propositional Calculus or Boolean
Logic)
o Predicate Logic (also known as First-Order Logic or FOL)
2. Propositional Logic
2.1 What is Propositional Logic?
• Propositional Logic is the simplest form of logic that deals with propositions
(statements) that can be either true or false.
• It does not consider the internal structure of the statements.
• Example Propositions:
o "It is raining." (P)
o "The ground is wet." (Q)
2.2 Syntax of Propositional Logic
• Propositions: Represented as symbols like P, Q, R, etc.
• Logical Connectives:
o AND (∧): Conjunction, e.g., P∧– Both must be true.
o OR (∨): Disjunction, e.g., P∨Q – At least one must be true.
o NOT (¬): Negation, e.g., ¬P – Inverts the truth value.
o IMPLIES (→): Implication, e.g., P→– If P is true, then Q must be true.
o BICONDITIONAL (↔): Equivalence, e.g., P↔Q – Both are either true
or false.
2.3 Semantics of Propositional Logic
• The semantics define the meaning of propositions and how their truth
values are calculated.
• Truth Table: Used to evaluate the truth value of complex propositions.
2.4 Representation Using Propositional Logic
• Example Statements:
o "If it is raining, then the ground is wet."
▪ P→Qnwhere:
▪ P: It is raining.
▪ Q: The ground is wet.
o "It is raining or snowing."
▪ P∨R where:
▪ R: It is snowing.
2.5 Limitations of Propositional Logic
• Lack of Expressiveness: Cannot represent relationships between objects.
o Example: "All humans are mortal" cannot be represented effectively.
• Scalability Issues: Large knowledge bases require a large number of
propositions.
• No Quantifiers: Cannot express statements involving "all" or "some."
3. Predicate Logic (First-Order Logic - FOL)
3.1 What is Predicate Logic?
• Predicate Logic extends Propositional Logic by considering the internal
structure of propositions.
• It uses predicates, variables, and quantifiers to represent complex
statements about objects and their relationships.
3.2 Syntax of Predicate Logic
• Predicates: Functions representing properties or relations.
o Example: Human(Socrates), Loves(John,Mary)
• Terms: Objects or entities.
o Constants: Specific objects (e.g., Socrates, John)
o Variables: General objects (e.g., x, y, z)
• Quantifiers:
o Universal Quantifier (∀): Indicates that a statement is true for all
elements.
▪ Example: ∀x Human(x)→Mortal(x)
▪ "All humans are mortal."
o Existential Quantifier (∃): Indicates that a statement is true for at
least one element.
▪ Example: ∃x Loves(John,x)
▪ "John loves someone."
3.3 Representation Using Predicate Logic
• Example Statements:
3.5 Advantages of Predicate Logic
• High Expressiveness: Can represent complex relationships and
generalizations.
• Use of Quantifiers: Allows representation of universal and existential
statements.
• Efficient Reasoning: Enables more powerful inference mechanisms.
3.6 Limitations of Predicate Logic
• Computational Complexity: Inference mechanisms are computationally
expensive.
• Handling Uncertainty: Cannot represent uncertainty directly.
• Ambiguity and Vagueness: Requires precise definitions, not suitable for
vague knowledge.
4. Comparison of Propositional and Predicate Logic
Criteria Propositional Logic Predicate Logic (FOL)
Propositions (True or False Predicates with variables and
Basic Element
statements) constants
Low – Cannot express
High – Can represent complex
Expressiveness relationships or
relationships and quantifiers
generalizations
Supports ∀ (Universal) and ∃
Quantifiers Not Supported
(Existential)
Inference Limited – Uses simple rules Powerful – Uses advanced inference
Power like Modus Ponens mechanisms
Complexity Lower complexity Higher computational complexity
Not suitable for large Suitable for large and complex
Scalability
knowledge bases domains
Examples P→Q, P∧Q ∀x(Human(x)→Mortal(x))
Suitable for simple, fixed Suitable for complex, dynamic
Usage
knowledge knowledge
5. Applications in AI
• Propositional Logic:
o Digital circuits and truth tables.
o Simple rule-based expert systems.
• Predicate Logic:
o Natural Language Processing (NLP).
o Knowledge-based systems (Expert Systems).
o Semantic Web and Ontologies.
o Automated Theorem Proving.
6. Conclusion
• Propositional Logic is simpler but less expressive, suitable for basic
reasoning tasks.
• Predicate Logic is more expressive and powerful, enabling complex
knowledge representation and reasoning.
• Both forms of logic are fundamental to AI systems, contributing to
knowledge-based systems, natural language processing, and intelligent
decision-making.
• Understanding the trade-offs between expressiveness and complexity helps
in choosing the appropriate logic for specific AI applications.
Here are detailed notes on Resolution, Refutation, Deduction, Theorem Proving,
Inferencing, Monotonic, and Non-Monotonic Reasoning.
1. Resolution in Artificial Intelligence
1.1 What is Resolution?
• Resolution is an inference rule used in Propositional and Predicate Logic for
automated theorem proving.
• It works by refuting a statement by showing that its negation leads to a
contradiction.
• Widely used in Logic Programming and Prolog.
1.2 How Resolution Works
• Combines pairs of clauses with complementary literals to produce a new
clause.
• Example:
o P∨Q
o ¬P∨R
o Resolution Step:
▪ Cancel out P and ¬P
▪ Result: Q∨R
1.3 Resolution in Propositional Logic
• Operates on clauses in Conjunctive Normal Form (CNF), where a formula is
expressed as a conjunction of disjunctions of literals.
• Example:
o (P∨Q)∧(¬P∨R)
o Resolution yields: (Q∨R)
1.4 Resolution in Predicate Logic
• Uses Unification to match variables with terms.
• Example:
o P(x)∨Q(x)
o ¬P(y)∨R(y)
o By unification, x=y, the result is: Q(x)∨R(x
1.5 Advantages of Resolution
• Sound and Complete: Ensures correct inferences and can derive any
logically entailed conclusion.
• Uniformity: Only one rule is used for all inferences.
1.6 Limitations of Resolution
• Computational Complexity: Can be inefficient for large knowledge bases.
• Not Constructive: Proves the existence of a solution but doesn’t construct
it.
2. Refutation
2.1 What is Refutation?
• Refutation is a proof technique used to prove the validity of a statement by
contradiction.
• Involves assuming the negation of the statement and demonstrating that it
leads to a contradiction.
2.2 How Refutation Works
• Proof by Contradiction:
o Assume the negation of the statement SS to be proved.
o Combine it with the knowledge base.
o If this leads to a contradiction, then SS must be true.
2.3 Example of Refutation
• To prove: P→Q
o Assume P∧¬Q
o If this leads to a contradiction, then P→Q is true.
2.4 Refutation in Theorem Proving
• Used extensively in Automated Theorem Provers.
• Statements are converted into CNF and combined with the negation of the
theorem to find contradictions using Resolution.
2.5 Advantages of Refutation
• Systematic and general-purpose.
• Ensures completeness in proving theorems.
2.6 Limitations of Refutation
• Computationally expensive.
• May involve exploring irrelevant parts of the knowledge base.
3. Deduction
3.1 What is Deduction?
• Deduction is a reasoning process where conclusions are derived logically
from given premises.
• If the premises are true, the conclusion must also be true.
• Example:
o Premise 1: All humans are mortal.
o Premise 2: Socrates is human.
o Conclusion: Socrates is mortal.
3.2 Types of Deductive Reasoning
• Modus Ponens:
o If P→Q and P are true, then Q is true.
• Modus Tollens:
o If P→Q and ¬Q are true, then ¬P is true.
• Syllogism:
o Combines two premises to derive a conclusion.
o Example:
▪ A→B
▪ B→C
▪ Conclusion: A→C
3.3 Deduction in AI
• Used in Expert Systems, Theorem Proving, and Automated Reasoning.
• Ensures soundness, as conclusions are logically valid.
4. Theorem Proving
4.1 What is Theorem Proving?
• Theorem Proving is the process of automatically proving mathematical
theorems using formal logic.
• Utilizes Logical Inference Rules and Resolution.
4.2 Types of Theorem Proving
• Automated Theorem Proving (ATP):
o Uses algorithms and logic programming (e.g., Prolog) to prove
theorems.
• Interactive Theorem Proving:
o Requires human guidance for complex proofs.
4.3 Methods in Theorem Proving
• Resolution-Based Proving:
o Uses resolution refutation to prove theorems.
• Natural Deduction:
o Uses a set of inference rules to derive conclusions.
4.4 Applications of Theorem Proving
• Formal Verification:
o Verifying hardware and software correctness.
• Mathematics:
o Proving mathematical theorems automatically.
5. Inferencing
5.1 What is Inferencing?
• Inferencing is the process of deriving new facts from known facts using
logical rules.
• Core mechanism in Expert Systems and Knowledge-Based Systems.
5.2 Types of Inference
• Forward Chaining:
o Starts with known facts and applies rules to reach conclusions.
• Backward Chaining:
o Starts with a goal and works backward to find supporting facts.
6. Monotonic and Non-Monotonic Reasoning
6.1 Monotonic Reasoning
• In Monotonic Reasoning, the set of conclusions derived from a knowledge
base does not decrease when new knowledge is added.
• Example:
o If P→QP \to Q and PP are true, then QQ is true.
o Adding new facts cannot invalidate QQ.
6.2 Non-Monotonic Reasoning
• In Non-Monotonic Reasoning, the set of conclusions can change when new
knowledge is added.
• Supports reasoning with incomplete or changing information.
• Example:
o "Birds can fly."
o New Fact: "Penguins are birds and cannot fly."
o The conclusion is revised.
6.3 Differences Between Monotonic and Non-Monotonic Reasoning
Criteria Monotonic Reasoning Non-Monotonic Reasoning
Knowledge Conclusions never change Conclusions can change with
Growth with new knowledge new knowledge
Assumes complete and Deals with incomplete or
Certainty
unchanging knowledge changing knowledge
Classical Logic, Mathematical Default Logic, Circumscription,
Example
Proofs Autoepistemic Logic
Mathematical Theorems, Common Sense Reasoning,
Applications
Formal Verification Expert Systems
6.4 Applications in AI
• Monotonic Reasoning:
o Formal Verification and Mathematical Theorem Proving
• Non-Monotonic Reasoning:
o Expert Systems, Common Sense Reasoning, and AI Planning
7. Conclusion
• These logical reasoning methods are fundamental in Artificial Intelligence,
enabling systems to:
o Prove theorems (Theorem Proving)
o Derive conclusions (Inferencing)
o Handle incomplete or dynamic knowledge (Non-Monotonic
Reasoning)
• Understanding these techniques is essential for building intelligent systems
with robust reasoning capabilities.