Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Logical agents

Presented by:
Muneeb Ur Rehman
What is an Agent?
 An agent can be anything that perceive its environment
through sensors and act upon that environment through
actuators.It runs in the cycle of perceiving, thinking, and
acting.
Logical agents in artificial intelligence

 Logical agents are essential in artificial intelligence as they


enable machines to make informed decisions based on a set
of rules and reasoning. They also play a crucial role in
knowledge representation, inference, and planning, which
are crucial components of AI systems.
Fundamental components of logic-based
agents
1. Knowledge Representation
2. Propositional Logic
3. First-Order Logic
4. Inference and Reasoning
5. Search and Planning
1) Knowledge Representation
 Knowledge representation is the process of translating
real-world knowledge and information into a format that can
be understood and processed by machines. It involves the
use of symbols, rules, and structures to capture and store
information for later retrieval and use by intelligent agents.
Types of knowledge representation
Several types of knowledge representation in artificial intelligence are:
 Semantic networks: Use nodes and links to represent
objects
 Frames: Use structures to represent objects and their
attributes
 Rules: Use if-then statements to represent knowledge
 Logic-based representations: Formal logic to represent and
reason about knowledge.
Example of a logical agent using Knowledge
Representation

 An example of a logical agent using Knowledge Representation is a


chatbot designed to answer customer service questions for a retail
company.

 The agent represents knowledge about the company's products,


policies, and procedures using a knowledge base, which is
essentially a database of facts and rules represented in a logical
language.
2) Propositional Logic
 Propositional logic is a branch of symbolic logic that deals
with propositions or statements that are either true or false.
 It uses logical connectives such as AND, OR, and NOT to
combine propositions and form more complex statements.
 Propositional logic is used in artificial intelligence to
represent and reason about knowledge in a formal and
systematic way.
Syntax and semantics of propositional logic
 The syntax of propositional logic refers to the formal rules
and conventions for constructing propositions and
expressions using logical connectives such as AND, OR, and
NOT.

 The semantics of propositional logic, on the other hand,


deals with the meaning and interpretation of propositions
and expressions, and how they relate to truth values (True or
False).
Logical connectives and Truth tables
 Logical connectives are symbols used in propositional logic to
connect propositions or statements to form more complex
expressions. Examples of logical connectives include AND,
OR, and NOT.

 Truth tables are tables used to specify the truth value of a


complex proposition based on the truth values of its
constituent propositions.
Example of a logical agent using Propositional Logic

 A simple example of a logical agent using propositional logic could


be a home security system that uses sensors to detect motion or
other suspicious activity. The system can be represented using
propositional variables such as "motion detected" or "window
opened".

For example: if "motion detected" and "window opened" are both


true, the system can infer that someone has entered the house and
trigger the alarm.
3) First-Order Logic
 First-order logic is a formal system used in artificial intelligence and
logic programming to represent and reason about objects and their
properties, relationships, and functions. It extends propositional
logic by introducing quantifiers, such as "for all" and "there exists,"
which allow for the formal representation of complex and relational
knowledge. First-order logic is also known as predicate logic
Quantifiers
 Quantifiers are logical symbols used in first-order logic to
express the scope or extent of a predicate over a domain of
objects. The two main quantifiers are "for all" (∀), which
expresses universal quantification, and "there exists" (∃),
which expresses existential quantification.
Example of a logical agent using first-order logic

 Example of a logical agent using first-order logic could be a


grocery list generator. The system could represent grocery
items using predicates, where each item is a predicate that
applies to a specific category of products, such as Fruit(X),
Dairy(X), or Meat(X). The system could use the universal
quantifier "for all" to represent general rules, such as "for all X,
if X is a fruit, then X should be stored in the refrigerator."
4) Inference and Reasoning
Inference is the process of deriving new knowledge or conclusions based on

existing knowledge or evidence.

Reasoning is the process of using logical or probabilistic methods to draw valid

inferences or conclusions from a set of premises or assumptions.

In artificial intelligence, inference and reasoning are used to model human

thinking and decision-making, and to develop intelligent agents that can solve

problems, make predictions, and plan actions.


Example of a logical agent using inference and reasoning

 Example of a logical agent using inference and reasoning is a


diagnostic system for identifying faults in a car. The agent
could use deductive reasoning to derive new conclusions from
existing knowledge about the car's parts and symptoms.
5) Search and Planning
 Search and planning are fundamental components of artificial
intelligence that involve finding solutions to problems and
generating plans to achieve goals in a given domain. Search
algorithms are used to explore possible problem states and
find a path to a desired goal, while planning algorithms create
sequences of actions to achieve a set of objectives.
Types of search and planning algorithms
 Uninformed search algorithms such as breadth-first search and
depth-first search.
 Informed search algorithms like A* search and iterative
deepening A* search
 Local search algorithms like hill climbing and simulated annealing
 Classical planning algorithms such as forward-chaining and
backward-chaining
 Heuristic search algorithms like genetic algorithms and particle
swarm optimization.
Example of a logical agent using Search and Planning

A common example of a logical agent using search and planning is


a robot navigating through a maze to reach a goal. The agent uses
a search algorithm, such as A* or breadth-first search, to explore
the maze and plan its path to the goal. The agent represents the
maze as a graph, where each node represents a location in the
maze, and each edge represents a possible path between two
locations.
THE
END

You might also like