0% found this document useful (0 votes)
32 views28 pages

Unit 3

The document discusses knowledge representation and reasoning in artificial intelligence. It covers propositional logic and first-order logic, including their syntax, semantics, and applications in areas like knowledge representation, automated reasoning, planning and decision making. Inference methods like resolution and chaining are also explained.

Uploaded by

happyrobinsingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views28 pages

Unit 3

The document discusses knowledge representation and reasoning in artificial intelligence. It covers propositional logic and first-order logic, including their syntax, semantics, and applications in areas like knowledge representation, automated reasoning, planning and decision making. Inference methods like resolution and chaining are also explained.

Uploaded by

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

ARTIFICIAL

INTELLIGENCE
UNIT - 3

[email protected]
Knowledge Representation and Reasoning

• Knowledge representation and reasoning (KRR) is a


fundamental area of artificial intelligence (AI) that deals
with how to represent, store, and manipulate knowledge
in a way that enables intelligent reasoning and problem-
solving. It is a crucial component of AI systems because
AI applications, such as expert systems, natural
language processing, robotics, and autonomous agents,
rely on the ability to acquire, represent, and reason with
knowledge.
Propositional logic
• Propositional logic, also known as propositional
calculus or sentential logic, is a fundamental branch of
logic used in artificial intelligence (AI) and various
other fields of computer science and mathematics. It
serves as a formal system for representing and
reasoning about the truth or falsity of statements,
propositions, or facts.
• Propositional logic is particularly important in AI for
its role in knowledge representation, automated
reasoning, and decision-making.
Syntax:
• In propositional logic, the basic building blocks are propositions, which
are statements that can be either true or false. These propositions are
typically represented using variables, such as P, Q, R, etc., and are
combined using logical connectives. The main logical connectives in
propositional logic include:
• Conjunction (AND): Represented by ∧. It represents the logical "and"
operation and is true only when both propositions are true.
• Disjunction (OR): Represented by ∨. It represents the logical "or"
operation and is true when at least one of the propositions is true.
• Negation (NOT): Represented by ¬. It represents the logical "not"
operation and negates the truth value of a proposition.
• Implication (→): Represents "if...then..." relationships. For example, P
→ Q is true unless P is true and Q is false.
• Biconditional (↔): Represents "if and only if" relationships. For
example, P ↔ Q is true when P and Q have the same truth value (both
true or both false)
• Semantics: Propositional logic defines the truth values (true or false) of complex
propositions based on the truth values of their constituent propositions and the
logical connectives used. This is done through truth tables, which exhaustively list
all possible combinations of truth values for the input propositions and specify the
resulting truth value of the complex proposition.
• Knowledge Representation: Propositional logic is used to represent knowledge in
AI systems, especially when dealing with simple, discrete, and binary information.
Knowledge is represented as a collection of propositional statements that capture
facts and relationships in a domain.
• Automated Reasoning: AI systems employ propositional logic for automated
reasoning. They can use inference rules and algorithms to derive conclusions from a
set of propositions, check for consistency, and answer questions based on the
available knowledge.
• Planning and Decision-Making: In AI planning, propositional logic is used to
represent the state of the world, actions, and goals. Automated planners use
propositional logic-based representations to generate plans and make decisions.
• Limitations: While propositional logic is useful for representing and reasoning
about simple, discrete, and binary knowledge, it has limitations. It cannot handle
quantifiers (e.g., "forall" and "exists") to represent variables over a range of values,
which is addressed by first-order logic. Additionally, it does not deal with
uncertainty or probabilistic reasoning, which is addressed by probabilistic logic and
Bayesian networks.
first order logic
• First-order logic (FOL), also known as first-order predicate calculus, is
a fundamental formalism in artificial intelligence (AI) for representing
and reasoning about knowledge. It serves as a foundation for
knowledge representation and inference in various AI applications.
Here are some key aspects of first-order logic in AI:
• Syntax of First-Order Logic:
• Constants: Represent specific objects.
• Variables: Represent placeholders for objects.
• Predicates: Express relationships between objects.
• Functions: Represent operations that return objects.
• Quantifiers: Existential (∃) and universal (∀) quantifiers are used to express
statements about all or some objects.
• Semantics of First-Order Logic:
• Interpretations: Assign meanings to the constants, predicates, and functions.
• Truth Values: Sentences in FOL are assigned either true or false values based on
the interpretation.
• First-Order Logic Statements:
• Atomic Sentences: Basic statements expressing a relationship between objects.
• Compound Sentences: Formed by combining atomic sentences using logical
connectives (AND, OR, NOT).
• Knowledge Representation:
• Objects and Relations: FOL allows the representation of objects and their
relationships using predicates.
• Hierarchical Structure: FOL can represent hierarchical relationships between
concepts.
• Inference in First-Order Logic:
• Deductive Reasoning: FOL supports deductive reasoning, allowing the
derivation of new knowledge from existing knowledge.
• Resolution: Resolution is a common inference mechanism used in FOL-based
systems.
• Applications in AI:
• Expert Systems: FOL is used to represent expert knowledge in various domains.
• Natural Language Processing (NLP): FOL is applied in semantic
representation and understanding.
• Planning and Robotics: FOL is used for representing actions and states in
planning problems.
Inference in first order logic
• Resolution in First-Order Logic:
• Resolution Rule:
• The resolution rule is a fundamental inference rule in FOL.
• It is used to derive a new clause by resolving two clauses that contain
complementary literals (one positive and one negative).
• The resolution rule eliminates the complementary literals and combines the
remaining literals from both clauses.
• Example of Resolution:
• Suppose we have two clauses: �∨�P∨Q and ¬�∨�¬P∨R.
• Applying resolution with �P and ¬�¬P yields the new clause �∨�Q∨R.
• Resolution Refutation:
• In automated theorem proving, the resolution refutation is commonly used.
• The goal is to derive a contradiction (e.g., an empty clause) by applying
resolution repeatedly.
• If a contradiction is reached, it implies that the negation of the original
statement is true.
• Limitations and Considerations:
• Computational Complexity:
• The resolution process can become computationally expensive,
especially for large knowledge bases.

• Expressiveness:
• While powerful, FOL may struggle with expressing certain types of
knowledge, such as uncertainty or default reasoning.

• Soundness and Completeness:


• Soundness ensures that if the inference rules are applied correctly, the
conclusions are valid.
• Completeness ensures that valid conclusions can be reached using the
inference rules.
• Resolution. Chaining- concept

• 1. Resolution:
• Definition:
• Resolution is a fundamental inference rule in logic, commonly used in automated theorem
proving and knowledge representation.
• It is specifically associated with first-order logic (FOL).
• Objective:
• The primary goal of resolution is to derive new clauses by resolving two clauses that contain
complementary literals (one positive and one negative).
• The process continues iteratively until a contradiction is reached or no more resolutions are
possible.
• Process:
• Convert the knowledge base into Conjunctive Normal Form (CNF), a standard form suitable
for resolution.
• Apply the resolution rule iteratively, eliminating complementary literals and combining the
remaining literals from two clauses.
• The goal is often resolution refutation, where a contradiction implies the falsehood of the
original statement.
• Use Case:
• Resolution is commonly used in automated reasoning systems, theorem provers, and logic
programming languages like Prolog.
• 2. Chaining:
• Definition:
• Chaining, or rule chaining, is a method of reasoning that involves applying a
sequence of rules to draw conclusions or make inferences.
• It is often associated with rule-based systems and forward/backward chaining.
• Objective:
• The goal of chaining is to start with a set of initial facts and use a set of rules to infer
new facts or conclusions.
• Process:
• Forward Chaining:
• Start with known facts and apply rules to derive new facts.
• Continue this process until the desired conclusion is reached or no more rules
can be applied.
• Backward Chaining:
• Start with a goal or desired conclusion.
• Work backward by applying rules in reverse to find the supporting facts needed
to satisfy the goal.
• Use Case:
• Chaining is often used in rule-based expert systems where knowledge is represented
as a set of rules with conditions and actions.
• Comparison:
• Nature:
• Resolution is a mechanism for logical deduction, often used to prove theorems or
refute statements.
• Chaining is a reasoning strategy that involves applying rules sequentially to reach
a goal.
• Application:
• Resolution is commonly used in theorem proving and logic programming.
• Chaining is prevalent in rule-based expert systems and knowledge-based systems.
• Direction:
• Resolution can be applied in any direction (forward or backward) depending on
the specific context.
• Chaining is explicitly associated with both forward chaining and backward
chaining.
• Termination:
• Resolution may terminate when a contradiction is reached or no more resolutions
are possible.
• Chaining terminates when the desired goal is achieved or no more rules can be
applied.
forward chaining and backward chaining
• 1. Forward Chaining:
• Forward chaining, also known as data-driven or goal-driven reasoning, starts
with the available data and uses rules to infer new conclusions.
• The process is driven by the data and continues until a goal is reached.
• Process:
• Initialization:
• Begin with the available facts or data.
• Rule Application:
• Apply rules to the known facts to infer new facts.
• Continue this process iteratively.
• Goal Checking:
• Check if the desired goal or conclusion has been reached.
• If the goal is not achieved, continue applying rules.
• Example:
• Consider an expert system for medical diagnosis. Start with
the patient's symptoms, apply rules based on medical
knowledge, and iteratively infer possible diseases until a
diagnosis is reached.
• Advantages:
• Well-suited for problems where the initial data is available,
and the system needs to work towards a goal.
• Can be more efficient for problems with a large number of
possible conclusions.
• Disadvantages:
• May generate a large number of intermediate conclusions.
• May not be efficient if the goal is not reachable from the
available data.
• 2. Backward Chaining:
• Definition:
• Backward chaining, also known as goal-driven or query-driven
reasoning, starts with a goal or query and works backward to find the
supporting evidence or facts.
• The process is driven by the goal, and it aims to find the conditions
under which the goal can be satisfied.
• Process:
• Goal Specification:
• Start with the goal or conclusion that needs to be satisfied.
• Rule Application:
• Apply rules in reverse to find the evidence or facts needed to satisfy
the goal.
• Continue this process iteratively until reaching known facts.
• Example:
• In the same medical diagnosis system, start with the goal of
identifying the disease. Apply rules backward to find the
symptoms that lead to the diagnosis.
• Advantages:
• Well-suited for problems where the desired goal is known,
and the system needs to determine the supporting evidence.
• More focused and can be efficient for problems with a clear
goal.
• Disadvantages:
• May explore unnecessary paths if the goal is not achievable.
• May not be optimal for problems with a large number of
potential goals.
• Comparison:
• Direction:
• Forward chaining starts with data and moves toward goals.
• Backward chaining starts with goals and works backward to
data.
• Efficiency:
• Forward chaining may be more efficient when the initial data
is abundant.
• Backward chaining may be more efficient when the goal is
known, and the system needs to find the evidence.
• Application:
• Forward chaining is used when the system needs to discover
consequences or outcomes.
• Backward chaining is used when the system needs to find the
causes or evidence.
Utility theory and Probabilistic reasonin
• Utility Theory:
• Definition: Utility theory is a framework used
in decision theory to model and quantify
individuals' preferences over different
outcomes or states of the world. It provides a
systematic way of making decisions under
uncertainty by assigning numerical values,
called utilities, to different possible outcomes.
• Key Concepts:
• Utility Function:
• A utility function is a mathematical function that assigns a numerical value
(utility) to each possible outcome or state of the world.
• The utility function reflects an individual's preferences and measures the
desirability of different outcomes.
• Decision Making:
• Decision makers aim to maximize expected utility when facing uncertainty.
• Expected utility is computed by weighing the utility of each possible outcome by
its probability.
• Risk Aversion and Risk Seeking:
• Individuals may exhibit different attitudes toward risk. Risk-averse individuals
prefer a certain outcome with a lower utility over a risky outcome with a higher
expected utility.
• Risk-seeking individuals may prefer a risky outcome with a higher expected
utility.
• Trade-offs:
• Utility theory allows decision makers to make trade-offs between risks and
rewards, helping them make rational decisions based on their preferences.
• Probabilistic Reasoning:

• Definition: Probabilistic reasoning involves dealing


with uncertainty by using probability theory to model
and reason about uncertain information. It provides a
framework for making decisions and inferences when
the outcomes are not known with certainty.
• Key Concepts:
• Probability Distributions:
• Probabilistic reasoning involves specifying probability distributions over
uncertain events.
• A probability distribution assigns probabilities to different possible outcomes.
• Bayesian Inference:
• Bayesian inference is a key component of probabilistic reasoning, where prior
beliefs are updated based on new evidence using Bayes' theorem.
• It allows for the calculation of posterior probabilities given prior probabilities and
observed evidence.
• Uncertainty Modeling:
• Probabilistic reasoning is used to model different types of uncertainty, including
epistemic uncertainty (uncertainty due to lack of knowledge) and aleatory
uncertainty (inherent variability).
• Decision Making under Uncertainty:
• Decision theory, in conjunction with probabilistic reasoning, helps in making
decisions by considering the probabilities of different outcomes and their
associated utilities.
Hidden Markov model
• A Hidden Markov Model (HMM) is a
statistical model used to represent a system that
transitions between a set of hidden states over
time, where each state generates observable
outcomes with certain probabilities. HMMs are
widely used in various fields, including speech
recognition, natural language processing,
bioinformatics, and finance.
• States:
• HMMs have a set of hidden states, which represent the underlying, unobservable processes in
the system.
• States are not directly observed but influence the observable outcomes.
• Observations:
• Each state in an HMM generates observable outcomes or emissions with certain probabilities.
• Observations can be discrete symbols (e.g., words in a speech recognition system) or
continuous values (e.g., sensor measurements).
• Transitions:
• There are transition probabilities between states, indicating the likelihood of transitioning
from one state to another.
• Transition probabilities are usually represented by a state transition matrix.
• Emission Probabilities:
• Each state has associated emission probabilities, specifying the likelihood of generating a
particular observation.
• Emission probabilities are often represented by an emission matrix.
• Initial State Probabilities:
• The model starts in one of the hidden states with certain probabilities.
• Initial state probabilities represent the likelihood of being in each state at the beginning.
• Markov Property:
• The Markov property in HMMs implies that the future state depends only on the current state
and not on the sequence of events that preceded it.
• Applications:
• Speech Recognition:
• Modeling phonemes or words as hidden states and acoustic features as
observations.
• Bioinformatics:
• Analyzing biological sequences, such as DNA or protein sequences.
• Natural Language Processing:
• Part-of-speech tagging, named entity recognition, and other language-
related tasks.
• Financial Time Series Analysis:
• Modeling financial market states based on historical data.
• Robotics:
• Localization and mapping in robotics
Bayesian networks.
• Bayesian Networks (BNs), also known as Bayesian
Belief Networks or Bayes Nets, are probabilistic
graphical models that represent and encode the
probabilistic relationships among a set of variables.
These networks are named after the Reverend Thomas
Bayes, who made significant contributions to
probability theory. Bayesian Networks are widely
used in artificial intelligence, machine learning, and
decision support systems for modeling uncertainty
and making probabilistic inferences
• Nodes:
• Nodes in a Bayesian Network represent random variables or events. Each node is associated with
a variable, and the network collectively models the joint probability distribution of these
variables.
• Edges:
• Edges in the network represent probabilistic dependencies between variables. An edge from node
A to node B indicates that B is dependent on A.
• Directed Acyclic Graph (DAG):
• A Bayesian Network is a directed acyclic graph (DAG), meaning there are no cycles in the
graph. The absence of cycles ensures that the network is acyclic and well-defined.
• Conditional Probability Tables (CPTs):
• Each node in a Bayesian Network has an associated Conditional Probability Table (CPT). The
CPT specifies the conditional probability distribution of the node given its parents in the
network.
• Parents and Children:
• In the context of a Bayesian Network, nodes with an incoming edge to a given node are called
parents, and nodes with an outgoing edge are called children.
• Bayes' Rule:
• Bayesian Networks rely on Bayes' Rule to update probabilities based on new evidence. Bayes'
Rule expresses how the probability of a hypothesis is updated given new data.
• Inference:
• Bayesian Networks enable probabilistic inference, allowing the calculation of probabilities for
specific variables given observed evidence or marginalization over other variables
• Applications:
• Medical Diagnosis:
• Modeling the relationships between symptoms and diseases to aid in
medical diagnosis.
• Risk Assessment:
• Assessing the risk factors associated with a particular event or outcome.
• Finance:
• Modeling financial variables and their dependencies for risk analysis and
decision-making.
• Natural Language Processing:
• Representing semantic relationships between words or concepts.
• Computer Vision:
• Modeling dependencies between features in image recognition tasks.
• Bayesian Network Inference:
• Exact Inference:
• Exact algorithms, such as Variable Elimination or Belief Propagation, are
used for exact probabilistic inference in Bayesian Networks.
• Approximate Inference:
• Due to the complexity of exact inference, approximate inference
methods like Monte Carlo methods or Markov Chain Monte Carlo
(MCMC) may be used for large or complex networks.
• Sensitivity Analysis:
• Assessing the impact of changes in evidence on the probability
distribution of other variables.

You might also like