Ai - 2
Ai - 2
• What is Proposition?
• A proposition (or a statement) is classified as a
declarative sentence to which only one of the
truth values. i.e. true or false.
• Example: New Delhi is the capital of India. (T)
• The square of 4 is 16. (T)
• The cube of 5 is 122. (F)
• Bring me coffee. (Not a proposition)
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
P (Proposition) NOT P
T F
F T
P Q P AND Q
F F F
F T F
T F F
T T T
P Q P OR Q
F F F
F T T
T F T
T T T
P Q PQ
F F T
F T T
T F F
T T T
P Q P<->Q
F F T
F T F
T F F
T T T
• Few Definitions:
• When a statement cannot be logically broken
into smaller statements, we call it atomic.
• Let r be a propositional formula, constructed
by connecting atomic propositions p, q, s, etc.
by operators. An interpretation for r is a
function that maps v (p), v (q) and v (s) into
true or false values that together keep r true.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
Example
• If P represents 'This book is good' and Q
represents 'This book is cheap',
• write the following sentences in symbolic form:
• (a) This book is good and cheap.
• (b) This book is not good but cheap.
• (c) This book is costly but good.
• (d) This book is neither good nor cheap.
• (e) This book is either good or cheap.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
WFF Example
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• Resolution algorithm
• Input: A set of clauses, called axioms and a goal.
• Output: To test whether the goal is derivable from the axioms.
• Begin
• 1. Construct a set S of axioms plus the negated goal.
• 2. Represent each element of S into conjunctive normal form (CNF) by the
following steps:
• a) Replace ‘if-then’ operator by NEGATION and OR operation by theorem 10.
• b) Bring each modified clause into the following form and then drop AND
operators connected between each square bracket. The clauses thus obtained
are in conjunctive normal form (CNF). It may be noted that pij may be in
negated or non-negated form.
[ p 11 ∨ p12 ∨ …….. ∨ p1n ] ∧
[ p21 ∨ p22∨….. …∨ p2n ] ∧
……………………………………………
[ pm1 ∨ p m2 ∨ ∨ pm n ]
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• 3. Repeat
• a) Select any two clauses from S, such that one clause
contains a negated literal and the other clause contains
its corresponding positive (non-negated) literal.
• b) Resolve these two clauses and call the resulting
clause the resolvent. Remove the parent clauses from
S.
• Until a null clause is obtained or no further progress
can be made.
• 4. If a null clause is obtained, then report: “goal is
proved”.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• Example:
• Consider the following knowledge base:
• 1. The-humidity-is-high ∨ the-sky-is-cloudy.
• 2. If the-sky-is-cloudy then it-will-rain
• 3. If the-humidity-is-high then it-is-hot.
• 4. it-is-not-hot
• and the goal : it-will-rain.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• Predicate Logic
• Predicate logic (also called first order
predicate logic) has a similar formalism like
propositional logic.
• It includes two more quantifiers, namely, the
essential quantifier (∀) and the existential
quantifier (∃).
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
Alphabets of FOL
• 1. Constants: a, b, c
• 2. Variables: X, Y, Z
• 3. Functions: f, g, h
• 4. Operators: Λ, ∨ , ¬ , →
• 5. Quantifiers: ∀ , ∃
• 6. Predicate: P, Q, R
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• Few Definitions:
• A term is defined recursively as being a constant, variable
or the result of application of a function to a term.
• e.g., a, x, t(x), t(g(x)) are all terms.
• Function denotes relations defined on a domain D. They
map n elements (n >0) to a single element of the
domain. “father-of”, “age-of” represent function
symbols.
• Predicate symbols denote relations or functional
mappings from the elements of a domain D to the values
true or false. Capital letters such as P,Q, MARRIED,
EQUAL are used to represent predicates.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
• Example:
Discuss the validity of the following argument:
• All graduates are educated.
• Ram is a graduate.
• Therefore. Ram is educated
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
Concept of Semi-decidability
• A sound and complete proof method is able to
prove the validity of a formula. But if the
formula is invalid, the proof procedure (by
resolution principle or otherwise) will never
terminate. This is called semi-decidablity. FOL
is semi-decidable, as it is unable to prove the
invalidity of a formula.
UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA
Thank You