AI Unit4 Reasoning PPT
AI Unit4 Reasoning PPT
Reasoning
By
Dr. Mrudul Dixit
Unit IV : Reasoning
● Reasoning plays a great role in the process of artificial Intelligence.
● The reasoning is the process of deriving logical conclusion and making predictions from available data ie.knowledge, facts,
and beliefs.
● In AI reasoning is important to make the system work rationally like human beings
● Reasoning : The mental ability of humans to generate conclusions from assumptions or premises
● A reason is consideration which explains or justifies
● When a system is told task to do something the system need reasons to tell whether it can perform or not
● Types of reasoning :
Abduction Criteria Reasoning Traditional Logic
• 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.
Inference rules
• Types of Inference rules:
2. Modus Tollens:
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
Inference rules
• Types of Inference rules:
3. Hypothetical Syllogism:
• The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true, and Q→R is
true.
• 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
Inference rules
• Types of Inference rules:
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
Inference rules
• Types of Inference rules:
5. Addition:
• The Addition rule states that If P is true, then P∨Q will be true.
• Example:
• Statement: I have a vanilla ice-cream. ==> P
• Statement-2: I have Chocolate ice-cream ==> Q
• Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Inference rules
• Types of Inference rules:
6. Simplification:
• The simplification rule state that if P∧ Q is true, then Q or P will also be true.
•
Inference rules
• Types of Inference rules:
7. Resolution:
• The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be true.
•
Sound rules of inference
∙ Here are some examples of sound rules of inference
∙ Each can be shown to be sound using a truth table
RULE PREMISE CONCLUSION
Modus Ponens A, A → B B
And Introduction A, B A∧B
And Elimination A ∧ B A
Double Negation ¬¬A A
Unit Resolution A ∨ B, ¬B A
Resolution A ∨ B, ¬B ∨ C A∨C
Unit IV : Reasoning
● Types of reasoning :
● Inductive reasoning:
− It is a form of reasoning to arrive at a conclusion using limited sets of facts by the process of generalization.
− It starts with the series of specific facts or data and reaches to a general statement or conclusion.
− It is a type of propositional logic, works as per bottom-up reasoning.
− The historical data is used to generate a generic rule, for which premises support the conclusion.
− In inductive reasoning, premises provide probable supports to the conclusion, so the truth of premises does
not guarantee the truth of the conclusion
− Ex. Premise: All of the pigeons we have seen in the zoo are white, Conclusion: Therefore, we can expect
all the pigeons to be white.
− Inductive reasoning starts with a specific assumption, then it broadens in scope until it reaches a
generalized conclusion.
− With inductive reasoning, the conclusion may be false even if the premises are true.
Unit IV : Reasoning
● Types of reasoning :
● Inductive reasoning: Ex.
− Spam Filtering: In email spam filtering, inductive learning algorithms analyze large volumes of labeled data
(spam and non-spam emails) to identify patterns and features indicative of spam.
− These algorithms learn from the examples to classify incoming emails as either spam or non-spam, even if
they have not encountered those specific emails before.
− Image Classification: Machine learning models can learn to recognize patterns and features associated with
specific object classes by training on a labeled image dataset.
− We can train an AI system on thousands of images of cats to learn the common characteristics that define a cat,
enabling it to classify unseen images as either cats or non-cats.
− Natural Language Processing: Inductive reasoning is crucial in natural language processing tasks like
sentiment analysis or text classification.
− By analyzing large amounts of labeled text data, AI models can identify patterns in the text that indicate
sentiment or classify documents into different categories.
− These models can then generalize from the observed patterns to classify new, unseen text
Unit IV : Reasoning
● Types of reasoning :
● Inductive reasoning:
− It is valuable when dealing with uncertain or incomplete data.
− Data is often noisy, incomplete, or ambiguous in real-world scenarios, Inductive learning algorithms can handle
such data by leveraging patterns and generalizations.
− By extracting relevant features and recognizing common patterns, machines can make reasonable
predictions and fill in the missing information.
− Inductive reasoning is helpful when dealing with complicated issues where creating clear rules or formulas is
challenging.
− Inductive learning algorithms adapt to the data and extract implicit patterns that might not be immediately
obvious rather than depending on established rules.
− AI systems become more robust and flexible due to their flexibility, which enables them to learn about various
environments.
− While inductive reasoning is powerful, it is essential to consider its limitations.
− A major problem with inductive learning is overfitting, which occurs when the model is too tightly
customized to the training data and struggles to generalize to new situations.
− It requires careful consideration of the bias-variance trade-off and using techniques like regularization and
Unit IV : Reasoning
● Monotonic Reasoning
− It is the process that does not change its direction or can say that it moves in the one direction.
− It will move in the same direction continuously means it will either move in increasing order or decrease.
− But since Monotonic Reasoning depends on knowledge and facts, It will only increase and will never
decrease in this reasoning.
− Once the conclusion is taken, then it will remain the same even if we add some other information to
existing information in our knowledge base.
− In monotonic reasoning, adding knowledge does not decrease the set of prepositions that can be derived.
− To solve monotonic problems, we can derive the valid conclusion from the available facts only, and it will
not be affected by new facts.
− Monotonic reasoning is not useful for the real-time systems, as in real time, facts get changed, so we cannot
use monotonic reasoning.
− Monotonic reasoning is used in conventional reasoning systems, and a logic-based system is monotonic.
− Ex. Sun rises in the East and sets in the West.
−
Unit IV : Reasoning
● Monotonic Reasoning
● Advantages of Monotonic Reasoning:
− In monotonic reasoning, each old proof will always remain valid.
− If we deduce some facts from available facts, then it will remain valid for always.
● Disadvantages of Monotonic Reasoning:
− We cannot represent the real world scenarios using Monotonic reasoning.
− Hypothesis knowledge cannot be expressed with monotonic reasoning, which means facts should be true.
− Since we can only derive conclusions from the old proofs, so new knowledge from the real world cannot be
added.
Unit IV : Reasoning
● Non-monotonic Reasoning
− It is the process that changes its direction or values as the knowledge base increases.
− Non-monotonic Reasoning will increase or decrease based on the condition.
− It depends on assumptions and will change itself with improving knowledge or facts.
− In Non-monotonic reasoning, some conclusions may be invalidated if we add some more information to our
knowledge base.
− Logic will be said as non-monotonic if some conclusions can be invalidated by adding more knowledge into our
knowledge base.
− Non-monotonic reasoning deals with incomplete and uncertain models.
− Ex. Consider a bowl of water, If we put it on the stove and turn the flame on it will obviously boil hot and as we
will turn off the flame it will cool down gradually.
Unit IV : Reasoning
● Non-monotonic Reasoning
− Let suppose the knowledge base contains the following knowledge:
■ Birds can fly
■ Penguins cannot fly
■ Pitty is a bird
■ So from the above sentences, we can conclude that Pitty can fly.
− However, if we add one another sentence into knowledge base "Pitty is a penguin", which concludes "Pitty
cannot fly", so it invalidates the above conclusion.
● Advantages of Non-monotonic reasoning:
− For real-world systems such as Robot navigation, we can use non-monotonic reasoning.
− In Non-monotonic reasoning, we can choose probabilistic facts or can make assumptions.
● Disadvantages of Non-monotonic Reasoning:
− In non-monotonic reasoning, the old facts may be invalidated by adding new sentences.
− It cannot be used for theorem proving.
Unit IV : Reasoning
● Non-monotonic Inference Methods:
− Non-monotonic inference is inference that is weak or ineffective
− The conclusions drawn may be withdrawn in the light of further information, even though all the original
premises are retained.
− These methods are not valid forms of inference but are important as they are being used in everyday
activities.
● The methods are abductive inference, inductive inference and analogical inference
● Abductive inference:
− it is based on use of known knowledge to explain or justify a valid conclusion
− Given the truth of propositions P and Q and the implication P implies Q conclude P
− Ex. people who are drunk stagger when they walk . Its is not reasonable to conclude the person who is
staggering is drunk.
● Inductive inference:
− This is based on the assumption that recurring pattern observed for some event or entity implies that the pattern
is true for all entities in their class
● Analogical inference:
− The inference is obtained from experience
− An analogical inference is an intensional generalization, or, in other words, the construction of a general entity
based on the resemblances between individual occurrences.
Unit IV : Reasoning
● Non-monotonic Reasoning
● It addresses 3 issues:
− Reasoning systems are often faced with lack of knowledge about domains
− Knowledge supporting reasoning must be consistent
− Whether we wish to use logic to address problem of how a knowledge base is updated.
● Truth maintenance systems are developed as variety of means of implementing non monotonic reasoning systems
Unit IV : Reasoning
● Truth Maintenance System: TMS
● A truth maintenance system is a knowledge representation and reasoning system designed to manage inconsistent and
uncertain information.
● It helps maintain a consistent and coherent view of the world by tracking the beliefs and assumptions used to derive
conclusions.
● It is used to detect and resolve conflicts between different beliefs and assumptions.
● In other words, it’s a way of ensuring that the AI system is aware of all the knowledge it possesses and that this
knowledge is valid and up-to-date.
● The TMS works by keeping a record of all the beliefs or facts in the knowledge base, along with the reasoning that led
to them.
● When new information is added to the knowledge base, the TMS checks to see if it is consistent with the existing
beliefs.
● If it is not, the TMS identifies the conflicting beliefs and tries to resolve the inconsistency by removing or modifying
one or more of them. This process is called “belief revision.”
● The TMS also keeps track of the dependencies between different beliefs.
● Ex., if one belief is based on another belief, the TMS will ensure that the latter belief is still valid before accepting the
former. This helps to maintain the integrity of the knowledge base.
● A TMS is often used in expert systems or decision-making systems, where the accuracy and reliability of the
information are critical.
Unit IV : Reasoning
● Truth Maintenance System: TMS
● To choose their actions, reasoning programs must be able to make assumptions and subsequently revise their beliefs
when discoveries contradict these assumptions.
● The Truth Maintenance System (TMS) is a problem solver subsystem for performing functions by recording and
maintaining the reasons for program beliefs.
● Such recorded reasons are useful in constructing explanations of program actions in guiding the course of action of a
problem solver.
● The world is complex and often contradictory, and it can be challenging to represent and reason about inconsistent or
uncertain knowledge
● TMS, a type of knowledge representation and reasoning system that helps to manage inconsistent and uncertain
information.
● It manages uncertain and inconsistent information by tracking beliefs and assumptions used to derive conclusions, to
maintain a consistent and coherent view of the world
● It is employed to protect logical integrity of the conclusions in an inferring system and works as bookkeeper
● TMS provides assertions and dependencies among assertions
● At its core, a TMS is a set of algorithms and data structures that are used to represent and manage the beliefs
and assumptions of a knowledge-based system.
● These beliefs and assumptions are represented as logical assertions, which can be either true or false, and are
organized into a knowledge base.
1. When new information is added to the system, the TMS checks if it is consistent with the existing knowledge base.
2. If it is consistent, it is added to the knowledge base.
3. If it is not consistent, the TMS may either reject the new information or modify the existing beliefs and assumptions to
make them consistent with the new information.
4. When new information is added to the knowledge base, the TMS checks If there is a conflict, the TMS identifies the
conflicting beliefs and tries to resolve the inconsistency by removing or modifying one or more of them. This process
is called “belief revision.”
5. To facilitate this process, the TMS also keeps track of the dependencies between different beliefs.
6. If one belief is based on another belief, the TMS ensures that the latter belief is still valid before accepting the
former.
Unit IV : Reasoning
● Applications of TMS:
● Expert systems: TMS can be used in expert systems to maintain the consistency of knowledge and trace the
consequences of actions taken by the system.
● Robotics: TMS can be used in robotics to ensure the consistency of sensor data and trace the consequences of robot
actions.
● Natural language processing: TMS can be used in natural language processing to maintain consistency in the
interpretation of a text and to trace the consequences of text processing.
● Planning and scheduling: TMS can be used in planning and scheduling applications to maintain consistency in the
scheduling of tasks and to trace the consequences of schedule changes.
● Decision support systems: TMS can be used in decision support systems to maintain consistency in the
decision-making process and to trace the consequences of decisions.
● Diagnosis and troubleshooting: TMS can be used in diagnosis and troubleshooting applications to maintain
consistency in the diagnosis process and trace the consequences of troubleshooting actions.
https://medium.com/@rugvedi.ghule20/truth-maintenance-system-28c7c2ef30f7
Unit IV : Reasoning
● ATMS and JTMS :
● Justification-Based Truth Maintenance System (JTMS)
● It is a simple TMS where one can examine the consequences of the current set of assumptions where the meaning of
sentences is not known.
● Assumption-Based Truth Maintenance System (ATMS)
● It allows to maintain and reason with a number of simultaneous, incompatible, current sets of assumption. Otherwise
it is similar to JTMS, i.e. it does not recognise the meaning of sentences.
https://medium.com/@rugvedi.ghule20/truth-maintenance-system-28c7c2ef30f7
Unit IV : Reasoning
● Fuzzy Logic:
● Fuzzy refers to things that are not clear or are vague
● It considers inaccuracies and uncertainties of any situation.
● Fuzzy Logic is a form of many-valued logic in which the truth values of variables may be any real number between 0
and 1
● It is used in is used in a wide range of applications, such as control systems, image processing, natural language
processing, medical diagnosis, and artificial intelligence.
● The fundamental concept of Fuzzy Logic is the membership function, which defines the degree of membership of an
input value to a certain set or category.
● The membership function is a mapping from an input value to a membership degree between 0 and 1, where 0
represents non-membership and 1 represents full membership.
● Fuzzy Logic is implemented using Fuzzy Rules, which are if-then statements that express the relationship between
input variables and output variables in a fuzzy way.
● The output of a Fuzzy Logic system is a fuzzy set, which is a set of membership degrees for each possible output
value.
● RULE BASE: It contains the set of rules and the IF-THEN conditions provided by the experts to govern the
decision-making system, on the basis of linguistic information.
● FUZZIFICATION: It is used to convert inputs i.e. crisp numbers into fuzzy sets.
● Crisp inputs are basically the exact inputs measured by sensors and passed into the control system for processing,
such as temperature, pressure, rpm’s, etc.
● INFERENCE ENGINE: It determines the matching degree of the current fuzzy input with respect to each rule and
decides which rules are to be fired according to the input field. Next, the fired rules are combined to form the
control actions.
● DEFUZZIFICATION: It is used to convert the fuzzy sets obtained by the inference engine into a crisp value.
Unit IV : Reasoning
● Reasoning with Fuzzy Logic:
● Fuzzy logic is used to imitate human reasoning and cognition.
● Rather than strictly binary cases of truth, fuzzy logic includes 0 and 1 as extreme cases of truth but with various
intermediate degrees of truth.
● Ex. Consider a rule used to control a three-speed fan.
● A binary IF-THEN statement may be then
● IF temperature ≥ 30 THEN fan speed is 3
● The disadvantage of this rule is that it uses a strict temperature as a threshold, but the user may want the fan to still
function at this speed when temperature = 29.9.
● A fuzzy IF-THEN statement may be
● IF temperature is hot THEN fan speed is fast
● where hot and fast are described using fuzzy sets
Unit IV : Reasoning
● Zadeh's Reasoning with Fuzzy Logic:
● Mamdani, Sugeno and Tsukamoto Fuzzy inference engine models are very well known
● https://www.mathworks.com/help/fuzzy/types-of-fuzzy-inference-systems.html
Unit IV : Reasoning
● Case Based Reasoning and Model based diagnosis reasoning
● Case Based Reasoning :(CBR)
● When faced with a new situation or problem, people typically attempt to find some prior experience or situation that is
similar and recall which actions were taken in response to the situation.
● In some instances, there is a high degree of similarity between the current situation and a prior experience in memory.
● When there is a high degree of similarity, the actions previously taken can usually be applied to the current situation.
● In those instances where there is some similarity to prior experience, then typically only some subset of the prior
actions may be applicable or some may be applicable but require modification.
● This process of comparing current situations to prior experience and then applying, potentially with adaptations, prior
actions to the current situation is the fundamental approach of case-based reasoning (CBR).
●
https://artint.info/2e/html2e/ArtInt2e.Ch7.S7.html#:~:text=A%20common%20example%20of%20a,problems%20on%20th
eir%20computer%20systems.