Propositional Logic - PowerPoint PPT Presentation

About This Presentation
Title:

Propositional Logic

Description:

With n propositional symbols, one can define 2n models. Model of a KB ... Engine-Starts Flat-Tire Car-OK. Battery-OK Bulbs-OK. Connective symbol (implication) ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 36
Provided by: JeanClaud85
Category:

less

Transcript and Presenter's Notes

Title: Propositional Logic


1
Propositional Logic
  • Russell and Norvig Chapter 6Chapter 7, Sections
    7.17.4Slides adapted from
  • robotics.stanford.edu/latombe/cs121/2003/home.htm

2
Knowledge-Based Agent
3
Types of Knowledge
  • Procedural, e.g. functions Such knowledge can
    only be used in one way -- by executing it
  • Declarative, e.g. constraints It can be used
    to perform many different sorts of inferences

4
Logic
  • Logic is a declarative language to
  • Assert sentences representing facts that hold in
    a world W (these sentences are given the value
    true)
  • Deduce the true/false values to sentences
    representing other aspects of W

5
Connection World-Representation
6
Examples of Logics
  • Propositional calculus A ? B ? C
  • First-order predicate calculus ( x)( y)
    Mother(y,x)
  • Logic of Belief B(John,Father(Zeus,Cronus))

7
Model
  • Assignment of a truth value true or false to
    every atomic sentence
  • Examples
  • Let A, B, C, and D be the propositional symbols
  • m Atrue, Bfalse, Cfalse, Dtrue is a model
  • m Atrue, Bfalse, Cfalse is not a model
  • With n propositional symbols, one can define 2n
    models

8
Model of a KB
  • Let KB be a set of sentences
  • A model m is a model of KB iff it is a model
    of all sentences in KB, that is, all sentences
    in KB are true in m
  • Given a vocabulary A, B, C and D, how many models
    for AB -gt C are there?
  • for AB -gt B?

9
Satisfiability of a KB
A KB is satisfiable iff it admits at least one
model otherwise it is unsatisfiable
KB1 P, ?Q?R is satisfiableKB2 ?P?P is
satisfiable KB3 P, ?P is unsatisfiable
10
Logical Entailment
  • KB set of sentences
  • ? arbitrary sentence
  • KB entails ? written KB ? iff every model
    of KB is also a model of ?
  • Alternatively, KB ? iff
  • KB,?? is unsatisfiable
  • KB ? ? is valid

11
Inference Rule
  • An inference rule ?, ? ? consists of 2
    sentence patterns ? and ? called the conditions
    and one sentence pattern ? called the conclusion
  • If ? and ? match two sentences of KB then the
    corresponding ? can be inferred according to the
    rule

?
12
Inference
  • I Set of inference rules
  • KB Set of sentences
  • Inference is the process of applying successive
    inference rules from I to KB, each rule adding
    its conclusion to KB

13
Example Modus Ponens
  • Battery-OK ? Bulbs-OK ? Headlights-Work
  • Battery-OK ? Starter-OK ? ?Empty-Gas-Tank ?
    Engine-Starts
  • Engine-Starts ? ?Flat-Tire ? Car-OK
  • Battery-OK ? Bulbs-OK

14
? Connective symbol (implication) Logical
entailment Inference
?
15
Soundness
  • An inference rule is sound if it generates only
    entailed sentences
  • All inference rules previously given are sound,
    e.g.modus ponens ? ? ? , ? ?
  • The following rule ? ? ? , ? ? is
    unsound, which does not mean it is useless

?
?
16
Completeness
  • A set of inference rules is complete if every
    entailed sentences can be obtained by applying
    some finite succession of these rules
  • Modus ponens alone is not complete, e.g.from A
    ? B and ?B, we cannot get ?A

17
Proof
The proof of a sentence ? from a set of
sentences KB is the derivation of ? by applying
a series of sound inference rules
18
Proof
The proof of a sentence ? from a set of
sentences KB is the derivation of ? by applying
a series of sound inference rules
  • Battery-OK ? Bulbs-OK ? Headlights-Work
  • Battery-OK ? Starter-OK ? ?Empty-Gas-Tank ?
    Engine-Starts
  • Engine-Starts ? ?Flat-Tire ? Car-OK
  • Headlights-Work
  • Battery-OK
  • Starter-OK
  • ?Empty-Gas-Tank
  • ?Car-OK
  • Battery-OK ? Starter-OK ? (56)
  • Battery-OK ? Starter-OK ? ?Empty-Gas-Tank ?
    (97)
  • Engine-Starts ? (210)
  • Engine-Starts ? Flat-Tire ? (38)
  • Flat-Tire ? (1112)

19
Inference Problem
  • Given
  • KB a set of sentence
  • ? a sentence
  • Answer
  • KB ? ?

20
Deduction vs. Satisfiability Test
KB ? iff KB,?? is unsatisfiable
  • Hence
  • Deciding whether a set of sentences entails
    another sentence, or not
  • Testing whether a set of sentences is
    satisfiable, or not
  • are closely related problems

21
Complementary Literals
  • A literal is a either an atomic sentence or the
    negated atomic sentence, e.g.
    P or ?P
  • Two literals are complementary if one is the
    negation of the other, e.g.
    P and ?P

22
Unit Resolution Rule
  • Given two sentences L1 ? ? Lp and
    M where Li,, Lp and M are all literals,
    and M and Li are complementary literals
  • Infer L1 ? ? Li-1 ? Li1 ? ? Lp

23
Examples
  • From?Engine-Starts ? Car-OK
  • Engine-Starts
  • InferCar-OK

Modus ponens
  • From?Engine-Starts ? Car-OK
  • ?Car-OK
  • Infer ?Engine-Starts

Modus tolens
24
Shortcoming of Unit Resolution
  • From
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Engine-Starts ? Empty-Gas-Tank
  • we can infer nothing!

25
Full Resolution Rule
  • Given two sentences L1 ? ? Lp and
    M1 ? ? Mq where L1,, Lp, M1,, Mq are all
    literals, and Li and Mj are complementary
    literals
  • Infer L1? ? Li-1?Li1??Lk?M1? ?
    Mj-1?Mj1??Mk in which only one copy of each
    literal is retained (factoring)

26
Example
  • From
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Engine-Starts ? Empty-Gas-Tank
  • Infer
  • Empty-Gas-Tank ? Flat-Tire ? Car-OK

27
Example
  • From
  • ?P ? Q (? P ? Q)
  • ?Q ? R (? Q ? R)
  • Infer
  • ?P ? R (? P ? R)

28
Not All Inferences are Useful!
  • From
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Engine-Starts ? ?Flat-Tire
  • Infer
  • ?Flat-Tire ? Flat-Tire ? Car-OK

29
Not All Inferences are Useful!
  • From
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Engine-Starts ? ?Flat-Tire
  • Infer
  • ?Flat-Tire ? Flat-Tire ? Car-OK

tautology
30
Not All Inferences are Useful!
  • From
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Engine-Starts ? ?Flat-Tire
  • Infer
  • ?Flat-Tire ? Flat-Tire ? Car-OK ? True

tautology
31
Full Resolution Rule
  • Given two clauses L1 ? ? Lp and
    M1 ? ? Mq
  • Infer the clause L1? ? Li-1?Li1??Lk?M1? ?
    Mj-1?Mj1??Mk

32
Sentence ? Clause Form
Example (A ? ?B) ? (C ? D) 1. Eliminate ?
?(A ? ?B) ? (C ? D)2. Reduce scope of ? (?A ?
B) ? (C ? D)3. Distribute ? over ? (?A ? (C ?
D)) ? (B ? (C ? D)) (?A ? C) ? (?A ? D) ? (B ?
C) ? (B ? D) Set of clauses ?A ? C , ?A ? D ,
B ? C , B ? D
33
Resolution Refutation Algorithm
  • RESOLUTION-REFUTATION(KB,a)
  • clauses ? set of clauses obtained from KB and ?a
  • new ?
  • Repeat
  • For each C, C in clauses do res ?
    RESOLVE(C,C) If res contains the empty clause
    then return yes
  • new ? new U resIf new ? clauses then return no
  • clauses ? clauses U new

34
Example
  • ?Battery-OK ? ?Bulbs-OK ? Headlights-Work
  • ?Battery-OK ? ?Starter-OK ? Empty-Gas-Tank ?
    Engine-Starts
  • ?Engine-Starts ? Flat-Tire ? Car-OK
  • Headlights-Work
  • Battery-OK
  • Starter-OK
  • ?Empty-Gas-Tank
  • ?Car-OK
  • ?Flat-Tire

35
Summary
  • Propositional Logic
  • Model of a KB
  • Logical entailment
  • Inference rules
  • Resolution rule
  • Clause form of a set of sentences
  • Resolution refutation algorithm
Write a Comment
User Comments (0)
About PowerShow.com