100% found this document useful (1 vote)
42 views

University Institute of Engineering Department of Computer Science and Engg

kheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs

Uploaded by

protoツツDPS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
42 views

University Institute of Engineering Department of Computer Science and Engg

kheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs akheka sjiskakejsks jsjskaksjjK sjsjsjsjjsjsjejejjajajsjsjjejwkkakaa sjwjjajajsjjsjsjs

Uploaded by

protoツツDPS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

UNIVERSITY INSTITUTE OF

ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE
AND ENGG.

Bachelor of Engineering (Computer Science & Engineering)


Artificial Intelligence(20CST-258)

DISCOVER . LEARN . EMPOWER


1
INTRODUCTION

Course Outcome
CO Title Level
Number

CO3 Determine the knowledge representations using Understand


predicate logics and semantic networks.

2
Propositional logic
• Propositional logic (PL) is the simplest form of logic where all the
statements are made by propositions.
• A proposition is a declarative statement which is either true or false.
• It is a technique of knowledge representation in logical and mathematical
form.
• Example:
• It is Sunday.
• The Sun rises from West (False proposition)
• 3+3= 7(False proposition)
• 5 is a prime number.

3
Basic facts about propositional logic
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• In propositional logic, we use symbolic variables to represent the logic, and we can use any
symbol for a representing a proposition, such A, B, C, P, Q, R, etc.
• Propositions can be either true or false, but it cannot be both.
• Propositional logic consists of an object, relations or function, and logical connectives.
• These connectives are also called logical operators.
• The propositions and connectives are the basic elements of the propositional logic.
• Connectives can be said as a logical operator which connects two sentences.
• A proposition formula which is always true is called tautology, and it is also called a valid
sentence.
• A proposition formula which is always false is called Contradiction.
• A proposition formula which has both true and false values is called
• Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.

4
Syntax of propositional logic
• The syntax of propositional logic defines the allowable sentences for
the knowledge representation.
• There are two types of Propositions:
• Atomic Propositions
• Compound propositions

5
Atomic Proposition
• Atomic propositions are the simple propositions.
• It consists of a single proposition symbol.
• These are the sentences which must be either true or false.
• Example:
• 294.5K
• Looking at Artificial Intelligence Technologies Solutions
• 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.

6
Compound proposition
• Compound propositions are constructed by combining simpler or
atomic propositions, using parenthesis and logical connectives.

• Example:
• "It is raining today, and street is wet."
• "Ankit is a doctor, and his clinic is in Mumbai."

7
Logical Connectives
• Logical connectives are used to connect two simpler propositions or
representing a sentence logically
• Create compound propositions with the help of logical connectives.
• There are mainly five connectives, which are given as follows:
• Negation
• Conjunction:
• Disjunction
• Implication
• Biconditional

8
The summarized table for Propositional Logic
Connectives

9
Truth Table
• In propositional logic, we need to know the truth values of
propositions in all possible scenarios.
• Combine all the possible combination with logical connectives, and
the representation of these combinations in a tabular format is
called Truth table.

10
The truth table for all logical connectives

11
Truth table with three propositions:

• A proposition composing three propositions P, Q, and R.


• This truth table is made-up of 8 Tuples as we have taken three
proposition symbols.

12
Precedence of connectives

• there is a precedence order for propositional connectors or logical


operators. This order should be followed while evaluating a
propositional problem.
• Following is the list of the precedence order for operators:
Precedence Operators

First Precedence Parenthesis

Second Precedence Negation

Third Precedence Conjunction(AND)

Fourth Precedence Disjunction(OR)

Fifth Precedence Implication

Six Precedence Biconditional

13
Logical equivalence
• Logical equivalence is one of the features of propositional logic. Two
propositions are said to be logically equivalent if and only if the
columns in the truth table are identical to each other.
• Let's take two propositions A and B, so for logical equivalence, we can
write it as A⇔B. In below truth table we can see that column for ¬A∨
B and A→B, are identical hence A is Equivalent to B

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

15
Limitations of Propositional logic
• Cannot represent relations like ALL, some, or none with propositional
logic. Example:
• All the girls are intelligent.
• Some apples are sweet.
• Propositional logic has limited expressive power.
• In propositional logic, we cannot describe statements in terms of
their properties or logical relationships.

16
Rules of Inference
• Inference:
• In artificial intelligence, we need intelligent computers which
can create new logic from old logic or by evidence, so
generating the conclusions from evidence and facts is termed
as Inference.
• Inference rules:
• 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.
17
Terminologies related to inference rules
• 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.

18
Example
• Some of the compound statements are equivalent to each other,
which we can prove using truth table:

19
Types of Inference rules

• Modus Ponens
• Modus Tollens
• Hypothetical Syllogism
• Disjunctive Syllogism
• Addition
• Simplification
• Resolution

20
Modus Ponens

• The Modus Ponens rule is one of the • Proof by Truth table:


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.

21
Modus Tollens

• The Modus Tollens rule state that if • Proof by Truth table:


P→ Q is true and ¬ Q is true, then
¬ P will also true. It can be
represented as:

• 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
22
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:

• 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

23
Hypothetical Syllogism

24
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

25
Disjunctive Syllogism: Proof by truth-table

26
Addition
• The Addition rule is one the common inference rule, and it 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.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)

27
Proof by Truth-Table

28
Simplification
• The simplification rule state that • Proof by Truth-Table:
if P∧ Q is true, then Q or P will
also be true. It can be
represented as:

29
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

30
Proof by Truth-Table

31
THANK YOU

32

You might also like