Ai R16 - Unit-3
Ai R16 - Unit-3
Ai R16 - Unit-3
UNIT III
− the notion of truth in an abstract sense and is concerned with the principles of
valid inferencing.
A proposition in logic is a declarative statements which are either true or false (but not
both) in a given context. For example,
− “Jack is a male”,
− logic helps in inferencing new proposition, which is also true in the same context.
1.2.Well-formed formula
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
1.3.Truth Table
− By using truth table, the truth values of well-formed formulae are calculated.
The meanings of the logical operators are given by the following truth table.
P Q ~P PQ PVQ P Q P Q
T T F T T T T
T F F F T F F
F T T F T T F
F F T F F T T
1.4.Equivalence Laws:
Commutation
1. PQ Q P
2. P V Q Q V P
Association
1. P (Q R) (P Q) R
2. P V (Q V R) (P V Q) V R
Double Negation
~ (~ P) P
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
Distributive Laws
1. P ( Q V R) (P Q) V (P R)
2. P V ( Q R) (P V Q) (P V R)
De Morgan’s Laws
1. ~ (P Q) ~P V~Q
2. ~ (P V Q) ~P ~Q
P V ~P T (true)
Law of Contradiction
P ~P F (false)
2. Propositional Logic – PL
● PL deals with
● Each row of a truth table for a given formula is called its interpretation under which a
formula can be true or false.
− it is a tautology.
● Let be a formula and if there exist at least one interpretation for which is true,
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
● We can translate
conditional (if .. then) natural language sentences into its corresponding propositional formulae.
Example
● Show that " It is humid today and if it is humid then it will rain so it will rain today" is a
valid argument.
A : It is humid
B : It will rain
: ((A B) A) B
● Using truth table approach, one can see that is true under all four interpretations and
hence is valid argument.
A B A B=X XA= Y Y B
T T T T T
T F F F T
F T T F T
F F T F T
− very good at presenting a survey of all the truth possibilities in a given situation.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
● For example, if a formula contains n atoms, then the truth table will contain 2n entries.
● Since P Q R is false for 14 entries out of 16, we are left only with two entries to be
tested for which is true.
− So in order to prove the validity of a formula, all the entries in the truth table may
not be relevant.
● Other methods which are concerned with proofs and deductions of logical formula are as
follows:
− Axiomatic System
● The name natural deductive system is given because it mimics the pattern of natural
reasoning.
Conventions:
− E for Elimination.
− P, Pk , (1 k n) are atoms.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
Interpretation: If we have hypothesized or proved P1, P2, … and Pn , then their conjunction P1
P2 … Pn is also proved or derived.
E- : If P1 P2 … Pn then Pi ( 1 i n)
Rule 5: I- (Introducing )
Interpretation: If given 1, 2, …and n to be proved and from these we deduce then 1 2
… n is also proved.
E- : If P1 P, P1 then P
Rule 7: I- (Introducing )
I- : If P1 P2, P2 P1 then P1 P2
Rule 8: E- (Elimination )
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
E- : If P1 P2 then P1 P2 , P2 P1
Rule 9: I- ~ (Introducing ~)
− there are no premises and is true under all interpretations i.e., is a tautology or
valid.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
Solution:
{ premise 1} Q P (1)
{ premise 2} Q R (2)
{ premise } Q (3.1)
{ I- , ( 3 )} Q (P R) Conclusion
● It is based on the set of only three axioms and one rule of deduction.
− It is minimal in structure but as powerful as the truth table and natural deduction
approaches.
− The proofs of the theorems are often difficult and require a guess in selection of
appropriate axiom(s) and rules.
− These methods basically require forward chaining strategy where we start with
the given hypotheses and prove the goal.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
Axiom1 (A1): ( )
Axiom3 (A3): (~ ~ ) ( )
{Hypothesis} Q (1)
of { P Q, Q R }.
{Hypothesis} P Q (1)
{Hypothesis} Q R (2)
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
Deduction Theorem:
Given |- ( ),
we can prove { } |- .
Useful Tips
2. Useful tip
− construction of proof of a formula from given set of formulae and are called
direct methods.
● In semantic tableaux,
● Semantic tableau
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
− Even if one path remains non contradictory or unclosed (open), then the formula
at the root of a tableau is consistent.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
6. Resolution Refutation in PL
− If there is a refutation in new set using resolution principle then goal is proved
− one with positive atom (P) and other with negative atom (~ P) for the application
of resolution rule.
● Disjunctive Normal Form (DNF): A formula in the form (L11 ….. L1n ) V ..… V
(Lm1 ….. Lmk ), where all Lij are literals.
● Conjunctive Normal Form (CNF): A formula in the form (L11 V ….. V L1n ) ……
(Lp1 V ….. V Lpm ) , where all Lij are literals.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
− P Q ~P V Q
− PQ ( P Q) ( Q P)
Double Negation
− ~~P P
− ~ ( P Q) ~ P V ~ Q
− ~ ( P V Q) ~ P ~ Q
(Distributive law)
P V (Q R) (P V Q) (P V R)
6.3Resolvent of Clauses
− then these clauses may be resolved together by deleting L from C1 and ~ L from
C2 and constructing a new clause by the disjunction of the remaining literals in C1
and C2.
● Inverted binary tree is generated with the last node (root) of the binary tree to be a
resolvent.
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
6.4Logical Consequence
www.Jntufastupdates.com
B.Tech. III Year CSE II Sem Artificial Intelligence Unit III
www.Jntufastupdates.com