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

AI Unit-2

This document discusses propositional logic and its key concepts. Propositional logic uses propositions that can be either true or false. It includes atomic propositions, compound propositions, and logical connectives like negation, conjunction, disjunction, implication, and biconditional. Truth tables are used to determine the truth values of propositions. Propositional logic has limitations and predicate logic was developed to address these. Fuzzy logic also aims to model human reasoning more closely by allowing intermediate possibilities between true and false.

Uploaded by

Aakansha Saxena
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)
61 views28 pages

AI Unit-2

This document discusses propositional logic and its key concepts. Propositional logic uses propositions that can be either true or false. It includes atomic propositions, compound propositions, and logical connectives like negation, conjunction, disjunction, implication, and biconditional. Truth tables are used to determine the truth values of propositions. Propositional logic has limitations and predicate logic was developed to address these. Fuzzy logic also aims to model human reasoning more closely by allowing intermediate possibilities between true and false.

Uploaded by

Aakansha Saxena
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

(5A24ARI)

Chapter-2: Logic and


Programming Languages in AI
Presented By
Prof. Aakansha Saxena
Assistant Professor
Rashtriya Raksha University
Propositional Logic
• The literal meaning of a proposition is to put across one’s views, ideas,
suggestions, expression or judgment. The proposition can be done
through a formal document or oral communication (Informal). It can either
address a positive or negative connotation.
• A proposition in logic includes Boolean functionalities in a sentence to
make it either True or False and also adds reasoning techniques and
proofing methods to make it much more comprehensive.
• The simplest kind of logic is propositional logic (PL), in which all
statements are made up of propositions. The term "Proposition"refers to
a declarative statement that can be true or false. It's a method of
expressing knowledge in logical and mathematical terms.
Example:

• It is Sunday.
• The Sun rises from West (False proposition)
• 3 + 3 = 7 (False proposition)
• 5 is a prime number.
Syntax of propositional logic:
• The allowed sentences for knowledge representation are defined by the syntax of propositional
logic. Propositions are divided into two categories:
Atomic Propositions.
Compound propositions.
• Atomic propositions: Simple assertions are referred to as atomic propositions. It is made up of
only one proposition sign. These are the sentences that must be true or untrue in order to pass.

Example:
• 2+2 is 4, it is an atomic proposition as it is a true fact.
• "The Sun is cold" is also a proposition as it is a false fact.
• Compound proposition: Simpler or atomic statements are combined with parenthesis and logical
connectives to form compound propositions.

Example:
• "It is raining today, and street is wet."
• "Ankit is a doctor, and his clinic is in Mumbai."
Basic facts about propositional logic:
• Because it operates with 0 and 1, propositional logic is also known as Boolean logic.
• In propositional logic, symbolic variables are used to express the logic, and any symbol
can be used to represent a proposition, such as A, B, C, P, Q, R, and so on.
• Propositions can be true or untrue, but not both at the same time.
• An object, relations or functions, and logical connectives make up propositional logic.
• Logical operators are another name for these connectives.
• The essential parts of propositional logic are propositions and connectives.
• Connectives are logical operators that link two sentences together.
• Tautology, commonly known as a legitimate sentence, is a proposition formula that is
always true.
• Contradiction is a proposition formula that is always false.
• Statements that are inquiries, demands, or opinions are not propositions, such
as "Where is Rohini","How are you", and "What is your name" are not propositions.
Logical Connectives
• Logical connectives are used to link two simpler ideas or to logically represent
a statement. With the use of logical connectives, we can form compound
assertions. There are five primary connectives, which are listed below
1) Negation: A statement like ¬P is referred to as a negation of P. There are
two types of literals: positive and negative literals.
Example: Rohan is intelligent and hardworking. It can be written as,
P = Rohan is intelligent,
Q = Rohan is hardworking. What is then -P ?, -Q ?
2) Conjunction:A conjunction is a sentence that contains ∧ connective such
as, P ∧ Q.
Example: "Ritika is a girl and Engineer",
Here P = Ritika is a girl. Q = Ritika is Engineer, so we can write it as P ∧ Q.
3) Disjunction: A disjunction is a sentence with a connective ∨ , such as
P ∨ Q, where P and Q are the propositions.
4) Implication: An implication is a statement such as P → Q. If-then
rules are another name for implications. It can be expressed as follows:
If it rains, the street is flooded.
Because P denotes rain and Q denotes a wet street, the situation is
written as P and Q
5) Biconditional: A sentence like P Q, for example, is a biconditional
sentence. I am alive if I am breathing.
P= I am breathing, Q = I am alive, it can be represented as P ⇔ Q.
Following is the summarized Truth table for Propositional Logic
Connectives
Precedence of connectives:

Precedence Operators

First Precedence Parenthesis

Second Precedence Negation

Third Precedence Conjunction(AND)

Forth Precedence Disjunction(OR)

Fifth Precedence Implication

Sixth Precedence Biconditional


Properties of Operators:
• Commutativity:
• P ∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P.
• Associativity:
• (P ∧ Q) ∧ R = P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R).
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• Distributive:
• P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
• P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
• DE Morgan's Law:
• ¬(P ∧ Q) = (¬P) ∨ (¬Q),
• ¬(P ∨ Q) = (¬ P) ∧ (¬Q).
• Double-negation elimination:
• ¬(¬P) = P.
Limitations of Propositional logic:

•This is not possible to represent relations like ALL, some, or none with
propositional logic. Example:
•All the girls are intelligent.
•Some apples are sweet.
•The expressive power of propositional logic is restricted.
•We can't explain propositions in propositional logic in terms of their qualities or
logical relationships.
Predicate Logic:

• Every complete sentence contains two parts –


• Subject: The subject is what or whom the sentence is about.
• Predicate: It tells something about the subject. sentence involving the
predicates that describe the property of objects are denoted by P(x)
where
P – The Predicate
x – It is a variable denoting any object.
Predicate Logic
Universal Quantifier:

• Universal quantifier is a symbol of logical representation, which


specifies that the statement within its range is true for everything or
every instance of a particular thing.
• The Universal quantifier is represented by a symbol ∀, which
resembles an inverted A.
• All man drink coffee. ∀x man(x) → drink (x, coffee).
• It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:

• Existential quantifiers are the type of quantifiers, which express that


the statement within its scope is true for at least one instance of
something.
• It is denoted by the logical operator ∃, which resembles as inverted E.
When it is used with a predicate variable then it is called as an
existential quantifier.
• Some boys are intelligent. ∃x: boys(x) ∧ intelligent(x)
• It will be read as: There are some x where x is a boy who is intelligent.
Examples
What is Fuzzy Logic?
• Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. The
approach of FL imitates the way of decision making in humans that involves all
intermediate possibilities between digital values YES and NO.
• The conventional logic block that a computer can understand takes precise input
and produces a definite output as TRUE or FALSE, which is equivalent to human’s
YES or NO.
• The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers, the
human decision making includes a range of possibilities between YES and NO,
such as −
CERTAINLY YES
POSSIBLY YES
CANNOT SAY
POSSIBLY NO
CERTAINLY NO
Implementation
• It can be implemented in systems with various sizes and capabilities
ranging from small micro-controllers to large, networked,
workstation-based control systems.
• It can be implemented in hardware, software, or a combination of
both.
Why Fuzzy Logic?
• Fuzzy logic is useful for commercial and practical purposes.
• It can control machines and consumer products.
• It may not give accurate reasoning, but acceptable reasoning.
• Fuzzy logic helps to deal with the uncertainty in engineering.
Fuzzy Logic Systems Architecture

• It has four main parts as shown −


• Fuzzification Module − It transforms the system inputs, which are
crisp numbers, into fuzzy sets. It splits the input signal into five steps
such as −
LP x is Large Positive
MP x is Medium
Positive
S x is Small
MN x is Medium
Negative
LN x is Large Negative
• Knowledge Base − It stores IF-THEN rules provided by experts.
• Inference Engine − It simulates the human reasoning process by
making fuzzy inference on the inputs and IF-THEN rules.
• Defuzzification Module − It transforms the fuzzy set obtained by the
inference engine into a crisp value.
Application Areas of Fuzzy Logic
Automotive Systems
• Automatic Gearboxes
• Four-Wheel Steering
• Vehicle environment control
Consumer Electronic Goods
• Hi-Fi Systems
• Photocopiers
• Still and Video Cameras
• Television
Domestic Goods
• Microwave Ovens
• Refrigerators
Environment Control
• Air Conditioners/Dryers/Heaters
• Humidifiers
Monotonic Reasoning:

• In monotonic 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.
• Any theorem proving is an example of monotonic reasoning.
Example: Earth revolves around the Sun.
• It is a true fact, and it cannot be changed even if we add another sentence in
knowledge base like, "The moon revolves around the earth" Or "Earth is not
round," etc.
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.
Non-monotonic Reasoning

• 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.
• "Human perceptions for various things in daily life, "is a general
example of non-monotonic reasoning.
Example
• 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.

You might also like