100% found this document useful (1 vote)
1K views32 pages

KRR Unit I Notes

The document provides an overview of Knowledge Representation and Reasoning (KR&R) in artificial intelligence, outlining its importance, key concepts, and various types of knowledge. It describes how KR&R enables intelligent decision-making, problem-solving, and the handling of incomplete information through different reasoning techniques. Additionally, it discusses the role of logic in KR&R and the components of Knowledge-Based Systems (KBS), including knowledge bases, inference engines, and user interfaces.

Uploaded by

linren2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views32 pages

KRR Unit I Notes

The document provides an overview of Knowledge Representation and Reasoning (KR&R) in artificial intelligence, outlining its importance, key concepts, and various types of knowledge. It describes how KR&R enables intelligent decision-making, problem-solving, and the handling of incomplete information through different reasoning techniques. Additionally, it discusses the role of logic in KR&R and the components of Knowledge-Based Systems (KBS), including knowledge bases, inference engines, and user interfaces.

Uploaded by

linren2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

JERUSALEM COLLEGE OF ENGINEERING

(An Autonomous Institution, Affiliated to Anna University,Chennai)

NOTES

JAL1602 - KNOWLEDGE REPRESENTATION AND REASONING

UNIT I - INTRODUCTION
Introduction: The Key Concepts, Need for Knowledge Representation and Reasoning - The Role of
Logic. The Language of First-Order Logic: Introduction-The Syntax- The Semantics-The Semantics-
Explicit and Implicit.
1.1 The Key Concepts: Knowledge, Representation, and Reasoning:
Knowledge representation and Reasoning(KR&R) is the field of artificial intelligence dedicated to
representing information about the world in a form that a computer system can utilize to solve
complex tasks.
The class of systems that derive from this approach are called knowledge based(KB) systems or
agents.
A KB agent maintains a knowledge base of facts expressed in a declarative language. The KB is
the agent’s representation of the world.
Knowledge Representation and Reasoning (KR&R) is a core area of Artificial Intelligence (AI) that
deals with how knowledge can be stored, organized, and used to make intelligent decisions. It focuses
on:

 Knowledge – Information about the world, including facts, rules, and relationships.
 Representation – A way to structure and store knowledge efficiently.
 Reasoning – The process of drawing conclusions from available knowledge.

Example:
Imagine a medical diagnosis system:

 Knowledge – “If a patient has a fever and cough, they might have the flu.”
 Representation – This rule can be stored using logic or databases.
 Reasoning – Given patient symptoms, the system deduces that flu is a likely diagnosis.
1.2 Need for Knowledge Representation and Reasoning:
 KR&R is essential in AI and intelligent systems because it allows machines to store, retrieve,
and process information effectively.
 KR&R is essential for building knowledge-based systems that solve problems using stored
knowledge.
Different types of Knowledge:

1. Declarative Knowledge: It includes concepts, facts, and objects and expressed in a declarative
sentence.
2. Structural Knowledge: It is a basic problem-solving knowledge that describes the relationship
between concepts and objects.
3. Procedural Knowledge: This is responsible for knowing how to do something and includes
rules, strategies, procedures, etc.
4. Meta Knowledge: Meta Knowledge defines knowledge about other types of Knowledge.
5. Heuristic Knowledge: This represents some expert knowledge in the field or subject.
1. Enabling Knowledge-Based Systems:
 A Knowledge-Based System (KBS) is an AI system that utilizes stored knowledge to make
intelligent decisions.
Example: Medical Expert Systems – A doctor’s assistant AI can analyze symptoms and
suggest possible diagnoses based on medical knowledge.
Example: Legal AI Systems – AI can analyze past cases and legal rules to provide legal
advice.
2. Efficient Storage and Management of Knowledge:
 Helps in structuring large amounts of data into a meaningful and accessible format.
 Reduces redundancy by allowing reusable knowledge structures like ontologies and
semantic networks.
Example: Google Knowledge Graph organizes billions of facts to provide direct answers to
user queries instead of just links.
3. Enabling Intelligent Decision-Making:
KR&R allows systems to make logical decisions by applying reasoning techniques to
knowledge.
 Deductive Reasoning – Drawing specific conclusions from general facts.
Example: If "All humans are mortal" and "Socrates is a human," then "Socrates is mortal."
 Inductive Reasoning – Generalizing from specific cases.
Example: If a student gets good grades after attending extra classes, we infer that extra classes
help improve performance.
 Abductive Reasoning – Inferring the most likely explanation.
Example: If a patient has a fever and a sore throat, the most probable explanation is an
infection.
4. Handling Incomplete and Uncertain Information:
 Real-world problems often have missing or uncertain data. KR&R helps by:
 Using probabilistic reasoning to make the best possible decisions with incomplete data.
 Allowing default reasoning (assuming certain facts unless proven otherwise).
Example: Autonomous Vehicles – Self-driving cars must make decisions even when sensor data
is unclear (e.g., foggy conditions).
5. Automating Problem-Solving and Learning:
 KR&R enables AI to solve complex problems automatically.
 Helps in machine learning by providing structured knowledge that AI can use to improve
performance.
Example: AI Tutors – Personalized education systems use KR&R to adapt lessons based on
student progress.
6. Enabling Natural Language Understanding and Communication:
 KR&R is crucial in Natural Language Processing (NLP), where AI needs to understand
and generate human language.
 Helps AI disambiguate meanings (e.g., "bank" can mean a financial institution or a
riverbank).
 Supports semantic search and conversational AI (e.g., chatbots, virtual assistants).
Example: Siri/Alexa use KR&R to interpret user requests and provide relevant responses.
7. Supporting AI Applications in Various Domains:
KR&R is widely used in:
 Healthcare – Disease diagnosis, patient monitoring, treatment recommendations.
 Finance – Fraud detection, risk assessment, automated trading.
 Robotics – Object recognition, motion planning, autonomous decision-making.
 E-commerce – Personalized recommendations, customer service chatbots.
1.2.1 Knowledge-Based System (KBS):
A Knowledge-Based System (KBS) is an AI system that uses stored knowledge and reasoning
mechanisms to solve complex problems in a specific domain. It mimics human expertise by processing
structured knowledge and drawing logical conclusions.
Key Components of a Knowledge-Based System:
1. Knowledge Base:
 Stores facts, rules, and heuristics (rules of thumb) related to a specific domain.
 Can be represented using logic, ontologies, semantic networks, or databases.
Example:
 In a medical expert system, the knowledge base includes:
 Symptoms and diseases
 Treatment guidelines
 Drug interactions
2. Inference Engine:
 The reasoning mechanism that applies logical rules to the knowledge base to deduce new
facts or solutions.
 Uses forward chaining (data-driven) or backward chaining (goal-driven) reasoning.
Example:
 A loan approval system uses inference rules to determine eligibility based on credit history,
income, and loan amount.
 A chess-playing AI evaluates board positions to decide the best move.
3. User Interface:
 Allows interaction between the user and the system.
 Can be text-based, graphical, or voice-based.
Example:
 Chatbots like Siri and Alexa use a natural language interface to interact with users.
 Medical diagnostic tools allow doctors to input symptoms and receive recommendations.
Types of Knowledge-Based Systems:
1. Expert Systems:
 Simulate human expert decision-making in specific fields.
Example: MYCIN – A medical expert system for diagnosing bacterial infections.
2. Decision Support Systems (DSS):
 Help in decision-making by analyzing data and suggesting the best action.
Example: SAP Business Intelligence – Assists companies in strategic planning
3. Natural Language Processing (NLP) Systems:
 Understand and generate human language.
Example: Google Translate – Uses a knowledge base of languages to translate text.
4. Recommendation Systems:
 Suggest products, movies, or content based on user preferences.
Example: Netflix recommendation engine – Suggests movies based on user viewing history.
5. Robotics and Automations:
 Robots use knowledge bases to navigate environments, recognize objects, and make
decisions.
Example: Autonomous vehicles (Tesla) – Use stored traffic rules and sensor data to drive
safely.
1.2.2 Why Knowledge Representation?
Knowledge Representation (KR) is crucial in AI because it allows systems to store, retrieve, and
process information efficiently. It organizes data into a structured format so that machines can
understand and use it for decision-making.
Key Reasons for Knowledge Representation in AI:
1. Efficient Storage and Organization of Knowledge:
 AI systems need to store large amounts of data in a way that makes retrieval and
processing efficient.
 KR provides structured formats like logic, ontologies, and semantic networks to manage
knowledge effectively.
Example:
A medical knowledge base stores diseases, symptoms, and treatments in an organized structure
so AI can quickly retrieve relevant information.
2. Facilitates Logical Reasoning:
 KR enables AI to derive new knowledge from existing facts using reasoning techniques.
 Allows AI to infer missing information and make intelligent decisions.
Example:
If we store the rule:
"All birds can fly except penguins and ostriches,"
and we ask, "Can a sparrow fly?", AI can deduce the answer using reasoning.
3. Enables Human-Like Understanding:
 AI must understand real-world concepts, relationships, and context.
 KR helps systems interpret ambiguous or incomplete information.
Example:
A self-driving car needs to understand road signs, traffic rules, and pedestrian behavior to
navigate safely.
4. Supports Communication Between Humans and Machines:
 KR bridges the gap between human knowledge and machine processing.
 Enables chatbots, virtual assistants, and NLP systems to interact meaningfully.
Example:
Siri and Alexa process and store knowledge to answer user queries accurately.
5. Standardization for AI Systems:
 KR provides a universal structure for knowledge, making AI systems interoperable across
different platforms.
 Used in Semantic Web, Expert Systems, and Ontologies.
Example:
Google’s Knowledge Graph connects concepts like “Apple” (company) and “Apple” (fruit) to
improve search accuracy.
Techniques of Knowledge Representation in AI:
1. Logical Representation:
Logical representation is a language with some definite rules which deal with propositions and
has no ambiguity in representation. It represents a conclusion based on various conditions and
lays down some important communication rules. Also, it consists of precisely defined syntax
and semantics which supports the sound inference. Each sentence can be translated into logics
using syntax and semantics.
Syntax and Semantics:
 Syntax: The atomic symbols of the logical language, and the rules
for constructing well-formed, nonatomic expressions (symbol
structures) of the logic.
 Semantics: The meanings of the atomic symbols of the logic, and
the rules for determining the meanings of nonatomic
expressions of the logic.
 Proof Theory: The rules for determining a subset of logical
expressions, called theorems of the logic.
 It decides how we can construct legal sentences in logic.
 It determines which symbol we can use in knowledge representation. Also, how to write
those symbols.
 Semantics are the rules by which we can interpret the sentence in the logic.
 It assigns a meaning to each sentence.

Advantages:
 Logical representation helps to perform logical reasoning.
 This representation is the basis for the programming languages.
Disadvantages:
 Logical representations have some restrictions and are challenging to work with.
 This technique may not be very natural, and inference may not be very efficient.
2. Semantic Networks:
Semantic networks work as an alternative of predicate logic for knowledge representation. In
Semantic networks, you can represent your knowledge in the form of graphical networks. This
network consists of nodes representing objects and arcs which describe the relationship
between those objects. Also, it categorizes the object in different forms and links those objects.
This representation consist of two types of relations:
 IS-A relation (Inheritance)
 Kind-of-relation

Advantages:
 Semantic networks are a natural representation of knowledge.
 Also, it conveys meaning in a transparent manner.
 These networks are simple and easy to understand.
Disadvantages:
 Semantic networks take more computational time at runtime.
 Also, these are inadequate as they do not have any equivalent quantifiers.
 These networks are not intelligent and depend on the creator of the system.
3. Frame Representation:
A frame is a record like structure that consists of a collection of attributes and values to
describe an entity in the world. These are the AI data structure that divides knowledge into
substructures by representing stereotypes situations. Basically, it consists of a collection of slots
and slot values of any type and size. Slots have names and values which are called facets.

Advantages:
 It makes the programming easier by grouping the related data.
 Frame representation is easy to understand and visualize.
 It is very easy to add slots for new attributes and relations.
 Also, it is easy to include default data and search for missing values.
Disadvantages:
 In frame system inference, the mechanism cannot be easily processed.
 The inference mechanism cannot be smoothly proceeded by frame representation.
 It has a very generalized approach.
4. Production Rule:
In production rules, agent checks for the condition and if the condition exists then production
rule fires and corresponding action is carried out. The condition part of the rule determines
which rule may be applied to a problem. Whereas, the action part carries out the associated
problem-solving steps. This complete process is called a recognize-act cycle.
The production rules system consists of three main parts:
 The set of production rules
 Working Memory
 The recognize-act-cycle
Advantages:
 The production rules are expressed in natural language.
 The production rules are highly modular and can be easily removed or modified.
Disadvantages:
 It does not exhibit any learning capabilities and does not store the result of the problem for
future uses.
 During the execution of the program, many rules may be active. Thus, rule-based
production systems are inefficient
Approaches to Knowledge Representation in AI:
1. Simple Relational Knowledge:
It is the simplest way of storing facts which uses the relational method. Here, all the facts about
a set of the object are set out systematically in columns. Also, this approach of knowledge
representation is famous in database systems where the relationship between different entities
is represented. Thus, there is little opportunity for inference.
Example:
NAME AGE EMP ID
John 25 100071
Sam 23 100056
Joel 27 100063

2. Inheritable Knowledge:
In the inheritable knowledge approach, all data must be stored into a hierarchy of classes and
should be arranged in a generalized form or a hierarchal manner. Also, this approach contains
inheritable knowledge which shows a relation between instance and class, and it is called
instance relation. In this approach, objects and values are represented in Boxed nodes.
Example:

3. Inferential Knowledge:
The inferential knowledge approach represents knowledge in the form of formal logic. Thus, it
can be used to derive more facts. Also, it guarantees correctness.
Example:
Statement 1: John is a cricketer.
Statement 2: All cricketers are athletes.
Then it can be represented as;
Cricketer(John) ∀ x = Cricketer (x) ———-> Athelete (x)s
1.2.3 Why Reasoning?
Reasoning is the process of drawing conclusions from known facts. AI needs reasoning to solve
problems, make decisions, and handle uncertainty.
Key Reasons for Reasoning in AI:
1. Deriving New Knowledge:
 AI can infer unknown facts from given data.
 Uses deductive, inductive, and abductive reasoning.
Example:
Given: "All humans are mortal."
Given: "Socrates is a human."
AI infers: "Socrates is mortal."
2. Handling Uncertainty:
 Many real-world problems involve incomplete or ambiguous data.
 AI uses probabilistic reasoning to make the best possible decision.
Example:
A spam filter uses probability to decide whether an email is spam based on keywords and
sender history.
3. Decision-Making:
 AI systems must choose optimal solutions based on available knowledge.
 Used in automated planning, robotics, and AI assistants.
Example:
A self-driving car reasons whether to stop or accelerate based on traffic conditions.
4. Problem-Solving and AI Planning:
 AI analyzes constraints and rules to find a solution to a given problem.
 Used in pathfinding, logistics, and automated workflows.
Example:
Google Maps reasons the shortest route by analyzing traffic data.
5. Learning from Experience:
 AI adapts over time by updating its knowledge and reasoning mechanisms.
 Used in machine learning, recommendation systems, and fraud detection.
Example:
Netflix AI reasons about user preferences and improves recommendations based on past watch
history.
1.3 Role of Logic:
Logic is a fundamental tool in Knowledge Representation and Reasoning (KR&R). It provides a
formal structure for representing knowledge and ensures that reasoning processes are precise,
consistent, and reliable.
 Logic is the study of correct reasoning.
 It is not a particular KRR language.
 There are many systems of logic (logics).
 AI KRR research can be seen as a hunt for the “right” logic.
1.3.1 Why Logic is Important in AI:
Logic plays a critical role in AI by:
1. Providing a formal language – Expresses knowledge in a structured way.
2. Ensuring consistency – Prevents contradictions in knowledge.
3. Supporting automated reasoning – Enables AI to infer new facts.
4. Allowing verification – Helps check the correctness of conclusions.
1.3.2 Types of Logic Used in KR&R
1. Propositional Logic(PL):
 The simplest form of logic, dealing with statements (propositions) that are either true or
false.
 Uses logical operators like AND (∧ ), OR (∨ ), NOT (¬), and IMPLIES (→).
Example:
P: "It is raining."
Q: "The ground is wet."
Rule: P → Q (If it is raining, then the ground is wet).
Given P is true, we can conclude Q is also true.
2. First-Order Logic (FOL) (Predicate Logic):
 Extends propositional logic by introducing objects, relations, and quantifiers.
 More expressive than PL and widely used in AI.
Example:
∀ x (Human(x) → Mortal(x)) → "All humans are mortal."
Human(Socrates) → "Socrates is a human."
Since the first rule applies to all humans, we deduce Mortal(Socrates).
3. Description Logic (DL):
 A subset of FOL used in ontologies and semantic web applications.
 Represents knowledge using concepts, roles, and individuals.
Example:
Concept: Person
Role: hasParent
Fact: John hasParent Mary → Means "Mary is John's parent."
Used in healthcare, e-commerce, and intelligent search engines.
4. Modal Logic:
 Deals with possibility and necessity (e.g., belief, knowledge, time, obligation).
 Used in AI planning, game theory, and agent-based systems.
Example:
◇P → "It is possible that P is true."
□P → "It is necessarily true that P."
1.3.3 How Logic is Used in AI Systems:
Application Logic type used Example
Expert system First Order Logic Medical diagnosis, legal Al
Search engines Description Logic Google Knowledge Graph
Robotics Temporal and Modal Logic Robot motion planning
AI planning Propositional and Predicate Automated scheduling
Logic systems
Chatbots&NLP First Order and Probabilistic Siri, Alexa
Logic

1.3.4 Benefits of Using Logic in KR&R


 Clear and Unambiguous Representation – Knowledge is structured formally.
 Automated Reasoning – AI can deduce facts and make decisions.
 Scalability – Works in complex systems like semantic web and ontologies.
 Consistency and Verification – Ensures that conclusions are correct and reliable.
Propositional logic in Artificial intelligence:
Propositional Logic(PL) or Zeroth Order Logic is a fundamental part of AI that deals with reasoning
using declarative statements. These statements are either true or false, helping AI systems process
facts and make decisions logically. By breaking down complex reasoning into simple propositions, AI
systems can solve puzzles, represent knowledge, and make automated decisions efficiently.
Propositional Logic (PL) is a branch of logic that focuses on statements (propositions) that can be
either true or false. It is also known as Boolean logic since the truth values are binary—either True (1)
or False (0).
In AI, propositional logic forms the foundation for logical reasoning, allowing systems to represent
facts and rules about a problem domain. These rules help the system infer new information or make
decisions based on the given inputs.
Propositional logic simplifies knowledge representation by breaking down reasoning into atomic
statements or propositions. For example, an AI system used in home automation might have
propositions such as:
 P: “The light is on.”
 Q: “The window is open.”
Using logical connectives, the system can combine these propositions to represent more complex
statements like:
 “If the light is on and the window is open, turn off the light.”
By using propositional logic, AI systems can reason effectively and perform tasks like automated
decision-making, knowledge representation, and game playing.
Example:
1. It is Sunday.
2. The Sun rises from West (False proposition)
3. 3+3= 7(False proposition)
4. 5 is a prime number.
Basic Facts About Propositional Logic:
1. Propositions are Declarative Statements:
In propositional logic, each statement, known as a proposition, is either True or False.
Example:
P: “It is raining.” (True or False)
Q: “The heater is on.” (True or False)
2. Atomic Propositions:
These are simple, indivisible statements that cannot be broken down further. Each atomic
proposition represents a basic fact or condition.
Example: “The door is closed.”
3. Compound Propositions:
Multiple atomic propositions can be combined using logical connectives (like AND, OR, NOT)
to create compound propositions.
Example: “The door is closed AND the heater is on.”
4. Binary Truth Values:
Every proposition has a binary truth value: it can only be True (1) or False (0). There are no
intermediate states. This simplicity makes propositional logic ideal for clear-cut decisions.
5. Logical Connectives Combine Propositions:
Logical connectives such as AND, OR, NOT, IF-THEN, and IF AND ONLY IF allow us to
create more complex propositions from simple ones.
Syntax of Propositional Logic:
The syntax of propositional logic defines the rules for creating valid propositions. In propositional
logic, we combine atomic propositions using logical connectives to form more complex statements,
known as compound propositions.
1. Atomic Propositions:
These are basic statements that represent individual facts or conditions.
Example:
P: “It is raining.”
Q: “The heater is on.”
2. Logical Connectives:
Connectives are used to combine atomic propositions to form compound propositions.
 AND ( ∧ ): True if both propositions are true.
 OR ( ∨ ): True if at least one proposition is true.
 NOT ( ¬ ): Negates the truth value of a proposition.
 IF-THEN ( → ): True unless the first proposition is true and the second is false.
 IF AND ONLY IF ( ↔ ): True if both propositions have the same truth value.
3. Compound Propositions:
These are more complex statements formed by connecting atomic propositions using logical
connectives.
Example:
“If it is raining and the heater is on, then the room will be warm.”
This can be written in propositional logic syntax as: (P∧ Q)→R
Where:
P: “It is raining.”
Q: “The heater is on.”
R: “The room is warm.”
Explanation of the Logic:
 AND ( ∧ ) ensures that both conditions must be true (hot outside and windows closed) for
the air conditioner to turn on.
 NOT ( ¬ ) negates the condition, meaning the windows must be closed.
 IF-THEN ( → ) states that if the first part is true, the second part (turning on the AC) will
follow.
Logical Connectives in Propositional Logic
Logical connectives are essential operators that combine atomic propositions to form compound
propositions. These connectives allow AI systems to build more complex rules and perform logical
reasoning. Below are the most common connectives used in propositional logic:

CONNECTIVES SYMBOL MEANING EXAMPLE


AND ∧ True if both (P ∧ Q): “It is
propositions are raining AND
true. cold.”
OR ∨ True if at least (P ∨ Q): “It is
one proposition is raining OR cold.”
true.
NOT ¬ Negates the truth ¬P: “It is not
value of a raining.”
proposition.
IF-THEN → True unless the (P → Q): “If it
first is true and rains, then it will
second is false. flood.”
IF AND ONLY IF ↔ True if both (P ↔ Q): “It rains
propositions are if and only if it is
either true or cloudy.”
false.

These connectives helps to create logical rules that AI systems can use to make decisions.
1. AND ( ∧ ):
The result is True only if both propositions are true.
Example: If P is “It is hot” and Q is “The fan is on”, then (P ∧ Q) means both conditions are
satisfied.
2. OR ( ∨ ):
The result is True if at least one of the propositions is true.
Example: (P ∨ Q) will be true if either it is hot or the fan is on.
3. NOT ( ¬ ):
This inverts the truth value of the proposition.
Example: If P is true, ¬P will be false.
4. IF-THEN ( → ):
This implies that if the first proposition is true, the second must also be true for the compound
statement to be true.
Example: “If it rains, then the ground will be wet” (P → Q).
5. IF AND ONLY IF ( ↔ ):
This is true only when both propositions have the same truth value (either both true or both
false).
Example: “It is cloudy if and only if it will rain” (P ↔ Q).
Truth Table:
A truth table is a useful tool for determining the truth value of a compound proposition based on the
truth values of its atomic propositions. It systematically lists all possible combinations of truth values
and the corresponding output for a given logical expression.
How Truth Tables Work:
Let’s consider two propositions:
P: “It is raining.”
Q: “The ground is wet.”
We can build a truth table to evaluate the compound proposition P ∧ Q (It is raining AND the ground
is wet).

 The result of P ∧ Q is True only when both P and Q are True.


Truth Table with Three Propositions:
Let’s extend the concept to three propositions:

 P: “It is hot.”
 Q: “The air conditioner is on.”
 R: “The windows are closed.”
We can create a truth table for the compound proposition (P ∨ Q) ∧ R (It is hot OR the air
conditioner is on, AND the windows are closed.

Purpose of Truth Tables:

 Truth tables help in evaluating the outcomes of complex logical expressions.


 They ensure correct reasoning by listing all possibilities, making them a vital tool for AI
systems that rely on logical reasoning.
Precedence of Connectives in Propositional Logic:
When evaluating compound propositions with multiple logical connectives, it’s important to follow a
specific order of precedence to ensure accurate results. Similar to arithmetic operations, logical
operators are evaluated in a defined sequence, from highest to lowest precedence.
Order of Precedence:
1. NOT ( ¬ ) – Negation has the highest precedence and is evaluated first.
2. AND ( ∧ ) – Conjunction is evaluated next, after negations are resolved.
3. OR ( ∨ ) – Disjunction comes after AND operations.
4. IF-THEN ( → ) – Implication is evaluated after OR.
5. IF AND ONLY IF ( ↔ ) – Biconditional has the lowest precedence.
Example: Precedence in Action
Consider the following logical expression:
¬P∨ (Q∧ R)
 Step 1: Evaluate ¬P (Negation).
 Step 2: Evaluate Q ∧ R (AND).
 Step 3: Evaluate ¬P ∨ (Q ∧ R) (OR).
The final result depends on the proper evaluation order, ensuring the correct outcome.
Using Parentheses for Clarity
To avoid ambiguity, it’s good practice to use parentheses in complex expressions. For
example: (P∨ Q)→R
In this case, (P ∨ Q) is evaluated first, followed by the implication →
Logical Equivalence in Propositional Logic:
Logical equivalence occurs when two or more logical expressions produce the same truth values for all
possible combinations of their propositions. In other words, two statements are logically equivalent if
they always have the same result, regardless of the truth values of the individual propositions.
Definition of Logical Equivalence:
Two propositions P and Q are logically equivalent if: P≡Q
This means that both P and Q yield identical truth values for all possible cases. Logical equivalence
allows AI systems to simplify complex expressions without changing their meaning.
Example of Logical Equivalence:
1. De Morgan’s Laws:
These laws show how negations of conjunctions and disjunctions behave:
¬(P∧ Q)≡(¬P∨ ¬Q)
¬(P∨ Q)≡(¬P∧ ¬Q)
2. Double Negation:
Negating a negation gives the original proposition:
¬(¬P)≡P
3. Implication and Disjunction:
An implication can be rewritten as:
P→Q≡¬P∨ Q
Tautologies and Contradictions:
 Tautology:A tautology is a statement that is always true, no matter the truth values of its
individual propositions.
Example: P∨ ¬P≡True
 Contradiction: A contradiction is a statement that is always false.
Example: P∧ ¬P≡False
 Contingency: A proposition that can be either true or false depending on the truth values of
its components.
 Example: "P ∧ Q" ≡True and False
Properties of Operators in Propositional Logic:
In propositional logic, logical operators follow specific properties that allow us to manipulate and
simplify logical expressions. Understanding these properties is essential for building efficient AI
systems that rely on logical reasoning.
1. De Morgan’s Laws:
These laws describe how negations distribute over AND ( ∧ ) and OR ( ∨ ) operations:
 First Law:
¬(P∧ Q)≡(¬P∨ ¬Q)
This means that the negation of a conjunction is equivalent to the disjunction of the negated
propositions.
 Second Law:
¬(P∨ Q)≡(¬P∧ ¬Q)
This means that the negation of a disjunction is equivalent to the conjunction of the negated
propositions.
2. Commutative Property:
This property states that the order of the propositions does not affect the result of AND ( ∧ )
and OR ( ∨ ) operations:
 AND:
P∧ Q≡Q∧ P
 OR:
P∨ Q≡Q∨ P
3. Associative Property:
This property allows us to group propositions in any order when using AND or OR operations:
 AND:
(P∧ Q)∧ R≡P∧ (Q∧ R)
 OR:
(P∨ Q)∨ R≡P∨ (Q∨ R)
4. Distributive Property:
This property states that AND distributes over OR, and vice versa:
 AND over OR:
P∧ (Q∨ R)≡(P∧ Q)∨ (P∧ R)P
 OR over AND:
P∨ (Q∧ R)≡(P∨ Q)∧ (P∨ R)
Rules of Inference in Propositional Logic:
Rules of inference or Inference rules are the templates for generating valid arguments. Inference rules
are applied to derive proofs in artificial intelligence, and the proof is a sequence of the conclusion that
leads to the desired goal.
 Implication: It is one of the logical connectives which can be represented as P → Q. It is a
Boolean expression.
 Converse: The converse of implication, which means the right-hand side proposition goes to
the left-hand side and vice-versa. It can be written as Q → P.
 Contrapositive: The negation of converse is termed as contrapositive, and it can be represented
as ¬ Q → ¬ P.
 Inverse: The negation of implication is called inverse. It can be represented as ¬ P → ¬ Q.
From the above term some of the compound statements are equivalent to each other, which we
can prove using truth table:
Hence from the above truth table, we can prove that P → Q is equivalent to ¬ Q → ¬ P, and
Q→ P is equivalent to ¬ P → ¬ Q.
Basic Rules of Inference:
1. Modus Ponens (Law of Detachment):
The Modus Ponens rule is one of the most important rules of inference, and it states that if P
and P → Q is true, then we can infer that Q will be true. It can be represented as:

Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
Proof by Truth table:

2. Modus Tollens (Law of Contrapositive):


The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P will also true. It can
be represented as:

Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
Proof by Truth table:

3. Hypothetical Syllogism:
The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true, and Q→R is
true. It can be represented as the following notation:
If p → q and q → r, then p → r.
Example:
Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R
Proof by truth table:

4. Disjunctive Syllogism:
The Disjunctive syllogism rule state that if P∨ Q is true, and ¬P is true, then Q will be true. It
can be represented as:

Example:
Statement-1: Today is Sunday or Monday. ==>P∨ Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
Proof by truth-table:

5. Addition:
The Addition rule is one the common inference rule, and it states that If P is true, then P∨ Q
will be true.It can be represented as:

Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨ Q)
Proof by truth-table:

6. Simplification:
The simplification rule state that if P∧ Q is true, then Q or P will also be true. It can be
represented as:

Proof by truth-table:

7. Resolution:
The Resolution rule state that if P∨ Q and ¬ P∧ R is true, then Q∨ R will also be true. It can be
represented as:

Proof by Truth-Table:

Applications of Propositional Logic in AI:


1. Knowledge Representation in Expert Systems:
Represents rules and facts to solve domain-specific problems (e.g., medical diagnosis systems).
2. Reasoning and Decision-Making:
AI agents use logical rules to make decisions (e.g., robot vacuum cleaners deciding when to
start cleaning).
3. Natural Language Processing (NLP):
Helps analyze text and respond logically (e.g., chatbots understanding weather-related
queries).
4. Game-Playing AI:
Uses logic to make strategic moves (e.g., deciding checkmate in chess).
Limitations of Propositional Logic:
1. Inability to Handle Complex Relationships:
Propositional logic cannot represent relationships between multiple objects or deal with
hierarchies of information.
2. No Handling of Uncertainty:
It works only with true or false values and cannot deal with probabilities or uncertain
outcomes, limiting its use in real-world applications involving incomplete data.
3. Limited Expressiveness:
It cannot represent time-based sequences or dynamic events, which are crucial in some AI
systems like speech recognition and robotics.
4. Scalability Issues:
As the number of propositions grows, the complexity of expressions increases, making
reasoning slower and harder to manage.
Example :
1. It is not sunny this afternoon and it is colder than yesterday.
2. We will go swimming only if it is sunny.
3. If we do not go swimming then we will take a canoe trip.
4. If we take a canoe trip, then we will be home by sunset.
Denote:
• p = It is sunny this afternoon
• q = it is colder than yesterday
• r = We will go swimming
• s= we will take a canoe trip
• t= We will be home by sunset
Solution:
1. ¬ p ^ q
2. r →p
3. ¬ r → s
4. s→ t
First Order Logic or Predicate Logic:
 Predicate logic, also known as first-order logic (FOL), is an extension of propositional logic
that allows us to express relationships between objects and their properties. In AI, predicate
logic is widely used to represent knowledge and perform reasoning in more complex scenarios
where relationships matter.
 Unlike propositional logic, which deals with simple true/false statements, predicate logic
introduces predicates, variables, constants, and quantifiers. These elements help in modeling
real-world problems that involve multiple objects and their interactions.
 First-Order Logic (FOL) is an extension of propositional logic that allows reasoning about
objects and the relationships between them. While propositional logic only deals with
statements that are either true or false, FOL introduces quantifiers (e.g., ∀ for “for all” and ∃
for “there exists”), enabling the representation of statements about groups of objects.
Role of Predicate Logic in AI:

 Knowledge Representation: It provides a structure for representing complex facts about


objects and their relationships in a system.
 Reasoning: AI systems use predicate logic to infer new information from existing facts, making
it suitable for decision-making tasks.
Example:
“John is the father of Mary” can be represented as: Father(John,Mary).
This expression tells that there is a relationship (Father) between two objects (John and Mary).
Predicate logic enables to model and reason about such relationships effectively.
Components of Predicate Logic (or) Syntax of First-Order Logic:
The building blocks of First-Order Logic (or) Predicate logic involves several key components that
allow it to represent relationships and properties of objects in a structured way.
1. Predicates:
 A predicate is a function that returns either true or false based on the relationship between
its arguments.
 Example: IsHungry(John). This predicate represents whether John is hungry, returning
true if he is and false if not.
2. Variables:
 Variables are placeholders for objects within a domain. They allow us to represent general
statements that apply to multiple objects.
 Example: In IsHungry(x), the variable x can represent any person.
3. Constants:
 Constants represent specific objects or entities in the domain.
 Example: John is a constant in the predicate IsHungry(John).
4. Functions:
 Functions: Maps objects to other objects
 Example: father(John) = Mike, father is the function which maps the objects.
Atomic Sentences:
 An atomic sentence in FOL consists of a predicate and its arguments, representing the simplest
form of a statement. For example, isTeacher(John) is an atomic sentence indicating that John
is a teacher. These basic sentences serve as building blocks for more complex logical
expressions.
 Formally stating, the structure of an atomic sentence looks like the following:
Predicate ( term1,term2,term3,..)
Complex Sentences:
 Complex sentences in FOL are formed by combining atomic sentences using logical connectives
like AND (∧ ), OR (∨ ), NOT (¬), and IMPLIES (→). For instance, the sentence
(isTeacher(John) ∧ isStudent(Mary)) → teaches(John, Mary) expresses a condition where
John teaches Mary if both conditions hold. These logical operations enable AI models to
construct rules that reflect real-world relationships and constraints, making FOL a versatile
tool for knowledge-based systems.
 Formally stating c1,c2.... represent connectives, a complex sentence in First Order Logic in AI
can be defined as follows:
Predicate 1( term1,term2,term3,..)c1 Predicate 2
Properties of Quantifiers:
Quantifiers in First Order Logic in AI follow some properties as stated below.
1. In the universal quantifier, ∀ x∀ y is equivalent to ∀ y∀ x.
2. In the existential quantifier, ∃ x∃ y is equivalent to ∃ y∃ x.
3. ∃ x∀ y is not equivalent to ∀ y∃ x.
4. Quantifier Duality: Each quantifier can be expressed using the other.
∀ x Predicate( x ) is same as ¬ ∃ x ¬ Predicate(x).
Points to Remember About Quantifiers in First-Order Logic:
While using quantifiers in writing expressions for First Order Logic in Artificial Intelligence, we need
to keep the following points in mind.
 The main connective for the universal quantifier ∀ is the implication (⟹).
 The main connective for existential quantifier ∃ is and (∧ ).
Structure of Predicates:
Predicate consists of two key elements: the predicate symbol and arguments. Predicates are enhanced
with quantifiers to specify the scope of variables involved.
1. Predicate Symbol:
 The predicate symbol defines the property or relationship being described.
 Example:
 IsHungry(x) represents whether a person (x) is hungry.
 Married(x, y) denotes that person x is married to person y.
 Predicates are named based on the relationship or property they represent. The symbol is
followed by arguments enclosed in parentheses.
2. Arguments and Arity:
 Arguments refer to the specific objects that the predicate is applied to.
 The arity of a predicate refers to the number of arguments it takes.
 Examples:
 IsHungry(x): A predicate with 1 argument (arity = 1).
 Married(x, y): A predicate with 2 arguments (arity = 2).
 X(a, b, c): A predicate with 3 arguments (arity = 3), representing something like “a +
b + c = 0.”
3. Quantifiers in Predicate Logic:
Quantifiers in First-Order Logic (FOL) allow the expression of statements involving multiple
objects. They extend logic beyond individual propositions by enabling statements about entire
groups or subsets within a domain.
Quantifiers allows to specify the scope of variables. There are two main types:
1. Existential Quantifier ( ∃ ):
The universal quantifier (∀ ) denotes that a statement applies to all objects in a given
domain. It is expressed as:
∀ x P(x) meaning “For all x, P(x) holds.”
 Meaning: There exists at least one object that satisfies the given condition.
 Example: ∃ x IsHungry(x)
This statement means that at least one person is hungry.
 Negation: The negation of the existential quantifier means that no such object exists.
¬∃ x IsHungry(x)
This means that no one is hungry.
Example:
∀ x (isMammal(x) → hasHair(x))
This sentence states that every mammal has hair. Universal quantification is commonly
used in AI to create general rules that apply to all entities, such as “all students must
attend class.”
By using the universal quantifier, AI systems can formulate rules that apply broadly
across various scenarios, supporting tasks like inference generation.
2. Universal Quantifier ( ∀ ):
The existential quantifier (∃ ) is used when a statement applies to at least one object in the
domain. It is expressed as:
∃ x P(x) meaning “There exists an x such that P(x) holds.”
 Meaning: The given condition holds for all objects in the domain.
 Example: ∀ x (IsHuman(x)→IsMortal(x))
This means that all humans are mortal.
 Negation: The negation of the universal quantifier means there is at least one exception.
¬∀ x IsHuman(x)→IsMortal(x)
This implies that at least one human is not mortal.
Example:
∃ x (teaches(John, x))
This sentence asserts that John teaches at least one person. Existential quantification
is useful for expressing conditions where only a single instance or occurrence is
required to satisfy the logic, such as “there exists a student who completed the
project.”
This quantifier plays a vital role in systems that search for specific solutions or
instances within a problem space.
Properties of Quantifiers:
Quantifiers in FOL possess important properties such as:
 Commutativity: ∀ x ∀ y P(x, y) is logically equivalent to ∀ y ∀ x P(x, y).
 Distributivity: Quantifiers can be distributed across logical operations, such as:
∀ x (P(x) ∨ Q(x)) ≡ (∀ x P(x)) ∨ (∀ x Q(x)).
These properties ensure logical consistency when constructing complex rules. For instance,
distributivity allows the creation of nested logical conditions, which are essential in AI for handling
multiple scenarios simultaneously.
Free and Bound Variables:
In First-Order Logic (FOL), variables are categorized as free or bound.
 Free variables are not associated with any quantifier and can take any value from the domain.
For example, in the expression P(x), x is a free variable.
 Bound variables are associated with a quantifier (∀ or ∃ ) and are limited to the scope of that
quantifier. In ∀ x P(x), x is bound.
The distinction between free and bound variables is crucial because only statements with bound
variables are valid logical expressions for reasoning. Free variables must be quantified for the
statement to be meaningful in AI applications.
In First-Order Logic (FOL), variables are categorized as free or bound.
Examples of Predicate Logic:
1. Simple Predicate Example:
 Predicate: IsHungry(John)
 Meaning: This predicate represents the state of whether John is hungry. It takes one
argument (John) and returns true if John is hungry, otherwise false.
 Application in AI:
In NLP-based chatbots, predicates like this could help infer the user’s intent. For example, if a
chatbot detects that the user is hungry, it could suggest nearby restaurants.
2. Equality Predicate Example:
 Predicate: E(x,y)≡(x=y)
 Meaning: This predicate denotes that x is equal to y. It returns true if the two objects are
identical.
 Application in AI:
AI-based reasoning systems use equality predicates to match objects. For example, in a robot
warehouse, a robot may use this predicate to determine if an object picked matches the one
requested (e.g., E(Package1, RequestedItem)).
3. Mathematical Predicate Example:
 Predicate: X(a,b,c)≡(a+b+c=0)
 Meaning: This predicate checks whether the sum of a, b, and c equals zero. It returns true
if the equation holds, otherwise false.
 Application in AI:
In optimization problems, AI models might use mathematical predicates to check if constraints
are satisfied. For example, in scheduling systems, such predicates can validate if certain
conditions are met (e.g., X(shiftA, shiftB, totalTime) checks if the total shift hours are
balanced).
4. Relationship Predicate Example:
 Predicate: M(x,y)≡x is married to y
 Meaning: This predicate expresses a relationship between two objects, indicating that x is
married to y.
 Application in AI:
In family tree AI systems, relationship predicates are used to infer relationships among family
members. For instance, if M(John, Mary) is true, the system can infer that John is Mary’s
spouse.
5. Universal Quantification Example:
 Expression: ∀ x (IsHuman(x)→IsMortal(x))
 Meaning: This statement reads as “For all x, if x is human, then x is mortal.” It applies to
every object in the domain of humans. If an object is found to be human, it must also be
mortal for the statement to hold true.
 Application in AI:
Knowledge-based systems use such rules to infer properties about objects. For example, in
medical diagnosis systems, rules like “All viruses can spread infections” (∀ x IsVirus(x) →
CanSpreadInfection(x)) help the system reason about diseases.
6. Existential Quantification Example:
 Expression: ∃ x IsHungry(x)
 Meaning: This reads as “There exists at least one x such that x is hungry.” It indicates that
at least one object in the domain satisfies the condition of being hungry.
 Application in AI:
In robot planning, a robot could use existential quantifiers to plan actions. For example,
“There exists a task that requires charging” (∃ x TaskRequires(x, Charging)) might guide the
robot to prioritize charging tasks.
7. Compound Example with Multiple Quantifiers:
 Expression: ∀ x∃ y (Parent(x,y))
 Meaning: This statement means “For every person x, there exists a person y such that x is
the parent of y.” It shows how multiple quantifiers can be used together to represent
complex relationships.
 Application in AI:
This logic is often used in social network AI models to analyze relationships. In a family tree
system, the model could use such logic to infer relationships between family members.
Propositions with Multiple Quantifiers:
In predicate logic, multiple quantifiers can be used within a single proposition to express more
complex ideas. The order of quantifiers is crucial, as it can change the meaning of the statement.
Example 1: Order of Quantifiers Matters:
 Expression: ∀ x∃ y (Parent(x,y))
 Meaning: For every person x, there exists at least one person y such that x is the parent of
y.
 Example in AI: In a family tree system, this could represent the rule that every parent must
have at least one child.
Now, let’s reverse the quantifiers:
 Revered Expression: ∃ y∀ x (Parent(x,y))
 Meaning: There exists a person y such that every person x is the parent of y.
 Interpretation: This is logically impossible under normal circumstances, as a single person
cannot have all people as parents.
Example 2: Nested Quantifiers in AI:
 Expression: ∀ x∃ y (RobotCanPerform(x,y))
 Meaning: For every task x, there exists a robot y that can perform the task.
 AI Application: This could represent a rule in a robot planning system, where every task
must have at least one robot capable of completing it.
Now, consider the reversed version:
 Revered Expression: ∃ y∀ x (RobotCanPerform(x,y))
 Meaning: There exists a robot y that can perform every task x.
 AI Application: This would imply that a single robot can perform all tasks, which may not
always be practical.
Semantics of First-Order Logic:
 The semantics of First-Order Logic (FOL) define how symbols and expressions are interpreted
to determine their truth value. Semantics connect logical sentences with real-world meanings
by assigning objects, relations, and functions to constants, predicates, and functions used in the
logic.
 An interpretation provides the meaning for all constants and predicates, while a model satisfies
a set of logical sentences, meaning the sentences are true under the given interpretation. In AI,
semantics ensure that logical statements accurately represent real-world scenarios. For
instance, in knowledge-based systems, models can validate the truth of rules applied to
structured data.
 Semantics play a critical role in enabling AI systems to infer new knowledge from known facts.
They allow machines to process logical rules and derive conclusions based on how entities
relate to each other. This makes FOL essential in knowledge representation and automated
reasoning tasks.
Interpretation in First-Order Logic (FOL):
 Definition of Interpretation:
An interpretation in First-Order Logic (FOL) is a pair (D, I), where:
 D (Domain): A nonempty set of objects.
 I (Interpretation Mapping): A function that assigns meanings to nonlogical symbols (predicate
symbols and function symbols) as relations and functions over D.
 Domain (D):
The domain D can be any nonempty set, including:
 People, objects, numbers, concepts, etc.
 Abstract entities such as fairness, situations, and even fictional objects like unicorns.
 Interpretation of Predicate Symbols:
A predicate symbol P of arity n is interpreted as an n-ary relation over D:
I[P] CD × D > DxDx...× D (n times)
Example:
 If Dog is a unary predicate, I [Dog] is a subset of D representing the set of all dogs.
 If OlderThan is a binary predicate, I[OlderThan] is a subset of D × D representing pairs where
the first element is older than the second.
 Interpretation of Function Symbols:
A function symbol f of arity n is interpreted as an n-ary function over D:
I[f]: D × D × × D → D (n times)
Example:
 If bestFriend is a unary function, I[best Friend] is a function mapping each person to their best
friend.
 If johnSmith is a constant function, I[johnSmith] is a specific element in D representing John
Smith.
 Characteristic Function Representation:
Predicates can also be viewed using characteristic functions:
I[P]: D × D ×... × D → 0,1

 A tuple (d1, d2, ..., dn) belongs to the relation I [P] if and only if the characteristic function
returns 1.
 If P is a propositional symbol (arity 0), then I[P] is either 0 (false) or 1 (true).
 Interpretation in Propositional Logic:
For the propositional subset of FOL:
 The domain D is ignored.
 The interpretation is simply a mapping from propositional symbols to 0 or 1.
This structured approach to interpretation in FOL allows us to formally assign meaning to logical
statements and evaluate their truth based on a given interpretation.
Example 1 :
Consider a simple domain D consisting of three people: {Alice, Bob, Charlie}.

 Let Tall(x) be a unary predicate representing "x is tall".


Suppose I [Tall] = {Alice, Charlie}, meaning Alice and Charlie are tall, but Bob is not.
 Let Friends(x, y) be a binary predicate representing "x and y are friends".
Suppose [Friends] = {(Alice, Bob), (Bob, Charlie)} , meaning Alice is friends with Bob, and
Bob is friends with Charlie.

 Let age(x) be a function mapping each person to their age in years.


Suppose I [age] = {(Alice, 25), (Bob, 30), (Charlie, 35)}.
Using this interpretation:
 Tall(Alice) is true because Alice is in I[Tall].
 Friends(Alice, Charlie) is false because (Alice, Charlie) is not in I[Friends].
 age(Charlie) = 35 is true by the function mapping.
Example 2:
Consider a domain D consisting of three animals: {Dog, Cat, Bird).
 Let Has Wings(x) be a unary predicate representing "x has wings".
Suppose I [HasWings] = Bird, meaning only the Bird has wings.

 Let Bigger Than(x, y) be a binary predicate representing "x is bigger than y".
Suppose I [BiggerThan] = (Dog, Cat), (Dog, Bird), (Cat, Bird), meaning Dog is bigger than
both Cat and Bird, and Cat is bigger than Bird.
 Let sound(x) be a function mapping each animal to its characteristic sound.
Suppose I[sound]= (Dog," Bark"), (Cat," Meow"), (Bird, "Chirp")
Using this interpretation:

 HasWings (Dog) is false because Dog is not in I[HasWings].


 Bigger Than (Dog, Bird) is true because (Dog, Bird) is in I[BiggerThan].
 sound(Cat) = "Meow" is true by the function mapping.
This structured approach to interpretation in FOL allows us to formally assign meaning to logical
statements and evaluate their truth based on a given interpretation.
Denotation in First-Order Logic (FOL):
Denotation in First-Order Logic (FOL) defines how terms (constants, variables, and functions) refer
to specific elements in a given domain (D) based on an interpretation (I) and variable assignment (μ).
1. Key Concepts:
 Interpretation (I): Maps constants, function symbols, and predicate symbols to specific
meanings within the domain D.
 Domain (D): The set of objects under discussion.
 Variable Assignment (μ): A mapping from FOL variables to elements of D.
2. Interpretation and Variable-Free Terms:
An interpretation (D, I) consists of:
A variable-free term (constant or function applied to constants) always denotes a fixed element
of D.
Example:
Consider a domain D = {Alice, Bob, Charlie} and an interpretation I such that:
I[bestFriend] = A function that maps a person to their best friend.
I[johnSmith] = Bob.
bestFriend(Bob) = Alice.
Then, the term bestFriend(johnSmith) denotes Alice, as per the function interpretation.
3. Variable Assignment (μ) and Denotation of Terms with Variables:
To handle terms with variables, we need a variable assignment (μ), which maps each variable
to an element of D.
Definition of Denotation:
Given an interpretation (D, I) and a variable assignment μ, the denotation of a term t (written
⟦ t⟧ ₙ) follows these rules:
1. If x is a variable:
[[x⟧ ₙ = μ[x]
2. If t₁, ..., tₙ are terms and f is a function symbol of arity n:
f(t₁, ..., tₙ)⟧ ₙ = F(d₁, ..., dₙ)
F = I[f] (Function f interpreted in I).
dᵢ = ⟦ tᵢ⟧ ₙ (Denotation of each sub-term tᵢ).
 Example: Understanding Denotation with Variables
Given Domain and Interpretation:
Let D = {Alice, Bob, Charlie}, and define:
I[father]: A function that returns the father of a given person.
father(Alice) = Bob.
father(Bob) = Charlie.
Variable Assignment (μ):
μ[x] = Alice (Variable x is assigned to Alice).
Evaluating the Denotation of father(x):
1. Step 1: Find the value of x in μ
μ[x] = Alice.
2. Step 2: Apply the function interpretation:
father(Alice) = Bob.
Thus, ⟦ father(x)⟧ ₙ = Bob.
Evaluating father(father(x)):
1. First, compute father(x):
⟦ father(x)⟧ ₙ = Bob.
2. Next, compute father(Bob):
⟦ father(Bob)⟧ ₙ = Charlie.
Thus, ⟦ father(father(x))⟧ ₙ = Charlie.
 Recursive Nature of Denotation
Observe that denotation is always applied recursively, meaning:
The denotation of complex terms is built from the denotation of their sub-terms.
Every term ⟦ t⟧ ₙ ultimately refers to an element of D.
Satisfaction and Models:
Satisfaction and models help determine whether a formula is true or false under a given
interpretation (D, I). This allows us to check whether a given set of statements is logically valid in a
specific domain.
 Satisfaction ( |= ): A formula α is satisfied in an interpretation (D, I) if it evaluates to true.
 Model: If an interpretation satisfies all formulas in a given set S, it is called a model of S.
1. Atomic Formula Satisfaction:
Example 1: Checking Atomic Formula Satisfaction:
Consider an interpretation where:
 D = {Alice, Bob, Charlie}
 I[Teacher] = {Alice, Charlie} → Meaning: Alice and Charlie are teachers.
 I[bestFriend] is a function:
 bestFriend(Alice) = Bob
 bestFriend(Bob) = Charlie
 bestFriend(Charlie) = Alice
Now, consider the formula:
Teacher(bestFriend(Bob))
1. Find ⟦ bestFriend(Bob)⟧ → From the function bestFriend(Bob) = Charlie.

2. Check if Charlie is in I[Teacher] → Since Charlie ∈ {Alice, Charlie}, the formula is true.
Thus, Teacher(bestFriend(Bob)) is satisfied in this interpretation.
2. Satisfaction of Logical Connectives:
Given an interpretation (D, I, μ), we determine whether logical statements AND ( ∧ ), OR (
∨ ), NOT ( ¬ ) hold.
Example 2: Checking Logical Operators:
Let:
D = {1, 2, 3, 4}
I[Even(x)] = {2, 4} (i.e., 2 and 4 are even)
I[Odd(x)] = {1, 3} (i.e., 1 and 3 are odd)
Checking Satisfaction:
1. Even(2) ∧ Odd(2):
 Even(2) is true because 2 is in {2, 4}.
 Odd(2) is false because 2 is not in {1, 3}.
Since one part of the AND statement is false, Even(2) ∧ Odd(2) is false.
2. Even(2) ∨ Odd(2):
 Even(2) is true.
 Odd(2) is false.
Since at least one side is true, Even(2) ∨ Odd(2) is true.
3. ¬Even(2):
 Even(2) is true.
So, ¬Even(2) is false.
3. Satisfaction of Quantified Formulas:
Quantified formulas involve ∀ (for all) and ∃ (there exists).
Example: Universal and Existential Quantification:
Consider a domain of students and teachers:
D = {Alice, Bob, Charlie}
I[isStudent] = {Alice, Bob} (Alice and Bob are students)
I[isTeacher] = {Charlie} (Charlie is a teacher)
Checking Universal and Existential Statements
1. ∀ x. isStudent(x):
 Alice is a student (true).
 Bob is a student (true).
 Charlie is NOT a student (false).
Since one element (Charlie) makes the formula false, (D, I) ⊭ ∀ x. isStudent(x).
2. ∃ x. isStudent(x):
There exists at least one element in D (Alice or Bob) that satisfies isStudent(x).
Since Alice and Bob satisfy the condition, (D, I) |= ∃ x. isStudent(x).
4. Example of a Model:
A model satisfies all formulas in a given set S.
Example: A Logical Model
Let:
D = {0, 1, 2, 3, 4, 5}
I[LessThan(x, y)] = { (0,1), (1,2), (2,3), (3,4), (4,5) } (Defines a natural number order)
Consider the set S:
1. ∀ x ∃ y. LessThan(x, y)
For x = 0, y = 1 satisfies LessThan(0,1).
For x = 1, y = 2 satisfies LessThan(1,2).
For x = 4, y = 5 satisfies LessThan(4,5).
But for x = 5, there is no y such that LessThan(5, y).
Since one value of x (x=5) makes the formula false, (D, I) ⊭ ∀ x ∃ y. LessThan(x, y).
Thus, (D, I) is not a model of S.
5. Logical Truth and Models:
If a formula is true in all possible models, it is logically valid (tautology).
If a formula is false in at least one model, it is not logically valid.
If a model satisfies a set of formulas S, we say (D, I) is a model of S.
Example: Checking Logical Truth
Let:
D = {0, 1, 2}
I[Equal(x, y)] means x and y are equal.
Consider the formula ∀ x. Equal(x, x):
For x = 0, Equal(0, 0) is true.
For x = 1, Equal(1, 1) is true.
For x = 2, Equal(2, 2) is true.
Since this is true for all x, we conclude:
(D, I) |= ∀ x. Equal(x, x)
This means ∀ x. Equal(x, x) is logically valid in this model.

Implicit and Explicit Semantics in First-Order Logic (FOL):


 First-Order Logic (FOL) is a formal system used for knowledge representation and reasoning.
 A knowledge base (KB) consists of explicit facts, while implicit facts must be derived using
logical inference.
 The process of determining entailments from a given KB is fundamental to reasoning in AI.
 Explicit vs. Implicit Semantics:
 Explicit Semantics: Facts that are directly stated in the KB.
 Implicit Semantics: Facts that are not explicitly stated but can be inferred from existing
knowledge using logical reasoning.
Example: The Blocks-World Scenario:
Consider a scenario with three blocks stacked on a table.
Given facts:
 The top block is green.
 The bottom block is not green.
 The color of the middle block is unknown.
 The question: Is there a green block directly on top of a nongreen one?
 Formal Representation in FOL:
Let a, b, and c be the names of the blocks.
Predicate symbols:
G(x): x is green.
O(x, y): x is on top of y.
The knowledge base S contains:
{ O(a, b), O(b, c), G(a), ¬G(c) }
The claim to be proven: S |= α, where:
α = ∃ x∃ y. G(x) ∧ ¬G(y) ∧ O(x, y)
 Logical Entailment Proof
To show S |= α, we consider all interpretations that satisfy S.
 Case 1: Suppose G(b) is true.
Since ¬G(c) and O(b, c) are in S, we infer:
G(b) ∧ ¬G(c) ∧ O(b, c)
This satisfies ∃ x∃ y. G(x) ∧ ¬G(y) ∧ O(x, y).
 Case 2: Suppose G(b) is false (¬G(b) is true).
Since G(a) and O(a, b) are in S, we infer:
G(a) ∧ ¬G(b) ∧ O(a, b)
Again, this satisfies ∃ x∃ y. G(x) ∧ ¬G(y) ∧ O(x, y).
In both cases, α is a logical consequence of S.
 Importance of Implicit Reasoning:
 This example highlights that deriving implicit knowledge from a KB can involve nontrivial
reasoning.
 In FOL, the problem of determining whether one sentence is a logical consequence of others
is generally undecidable.
 No automated procedure can universally determine logical validity in all cases.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy