You are on page 1of 15

Artificial Intelligence

Logical Agents - Propositional Logic


Contents
 Logical Agents
 Propositional Logic – Introduction
 Connectives – TT
 Example Sentences
 Tautology and Contradictory
 A simple knowledge base
 Entailment and derivation
 Inference and rules
 Proving things
Logical Agents
 Humans know things and do reasoning/inference, which are
important for artificial agents
 Central component is a knowledge-base
 Knowledge is made of sentences
 Sentences are expressed in a language
 To derive new sentences through inference
 Sentences are expressed according to the syntax of the
representation language, which specifies all the sentences that
are well formed
 semantics defines the truth of each sentence with respect to
each possible world
 logical entailment between sentences—the idea that a sentence
follows logically from another sentence
In every model where a is true, b is also true
Propositional Logic
 a simple but powerful logic
 statements are made by propositions, which is a declarative
statement which is either true or false
 syntax defines the allowable sentences and atomic sentences
consist of a single proposition symbol (can be true or false)
 Example: P, Q, R, W1,3 and North
 P - “It is hot.”
 Q - “It is humid.”
 R - “It is raining.”
 (P  Q)  R - “If it is hot and humid, then it is raining”
 Q  P - “If it is humid, then it is hot”
 W1,3 to stand for the proposition that the wumpus is in [1,3]
Propositional Logic
 There are five connectives in common use:
 ...and [conjunction]
 ...or [disjunction]
...implies [implication / conditional]
..is equivalent [biconditional]
 ...not [negation]
¬P is true iff P is false in m
P ∧ Q is true iff both P and Q are true in m
P ∨ Q is true iff either P or Q is true in m
P ⇒ Q is true unless P is true and Q is false in m
P ⇔ Q is true iff P and Q are both true or both false in m
Complex sentences are constructed from simpler sentences,
using parentheses and logical connectives.
Propositional Logic
 Truth tables for the five logical connectives

Parenthesis > Negation > Conjunction(AND) > Disjunction(OR) > Implication > Biconditional
Examples of PL sentences
 Example
 It is Raining and it is Thursday:
 R  T, where
 R represents “It is Raining”, T represents “it is Thursday”.
 Example
 It is not hot but it is sunny. It is neither hot nor sunny.
It is not hot, and it is sunny. It is not hot, and it is not sunny.
 Let h = “it is hot” and s = “it is sunny.”
 ~h  s ~h  ~s
 Example
 Suppose x is a particular real number. Let p, q, and r symbolize
“0 < x,” “x < 3,” and “x = 3.” respectively.
Then the following inequalities
 x3 0<x<3 0<x3
can be translated as
 qr pq p  (q  r)
Tautology and Contradictory
 A tautology is true under any interpretation.
 The expression A ˅ ¬A is a tautology.
 This means it is always true, regardless of the value of A.
 An expression which is false under any interpretation is
contradictory (or unsatisfiable).
 A  ¬A
 Some expressions are satisfiable, but not valid. This means
that they are true under some interpretation, but not under
all interpretations.
 AB
A simple knowledge base
 R1 : ¬P1,1
 R2 : B1,1 ⇔ (P1,2 ∨ P2,1)
 R3 : B2,1 ⇔ (P1,1 ∨ P2,2 ∨ P3,1)
 R4 : ¬B1,1
 R5 : B2,1
Entailment and derivation
 Entailment: KB |= Q
 Q is entailed by KB (a set of premises or assumptions) if and
only if there is no logically possible world in which Q is false
while all the premises in KB are true.
 Or, stated positively, Q is entailed by KB if and only if the
conclusion is true in every logically possible world in which
all the premises in KB are true.
 Derivation: KB |- Q
 We can derive Q from KB if there is a proof consisting of a
sequence of valid inference steps starting from the premises in
KB and resulting in Q

10
Inference
 Deduction: the process of deriving a conclusion from a set of
assumptions
 Applying a sequence of rules is called a proof
 Equivalent to searching for a solution
 If we deduce a conclusion C from a set of assumptions, we
write:
{A1, A2, …, An} ├ C
 If C can be concluded without any assumption
├C
 The inference rule A ├ B is expressed as
A
B Given A, B is deduced (or concluded).
It is like if A is true, then B is true.
Types of Inference rules
Soundness of Rules
P Q P→Q OK?
True True True 
True False False 
False True True 
False False True 
Proving things
 A proof is a sequence of sentences, where each sentence is either a
premise or a sentence derived from earlier sentences in the proof by
one of the rules of inference.
 The last sentence is the theorem (also called goal or query) that we
want to prove.
 Example

1 Humid Premise “It is humid”


2 HumidHot Premise “If it is humid, it is hot”
3 Hot Modus Ponens(1,2) “It is hot”
4 (HotHumid)Rain Premise “If it’s hot & humid, it’s raining”
5 HotHumid And Introduction(1,2) “It is hot and humid”
6 Rain Modus Ponens(4,5) “It is raining”
The End…

15

You might also like