Propositional Logic Reasoning correctly computationally - PowerPoint PPT Presentation

About This Presentation
Title:

Propositional Logic Reasoning correctly computationally

Description:

John plays tennis if sunny and weekend day. If John plays tennis, Mary goes ... Specific: Does John play tennis? All: what may one conclude? State-Space Model? ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 30
Provided by: ics5
Category:

less

Transcript and Presenter's Notes

Title: Propositional Logic Reasoning correctly computationally


1
Propositional Logic Reasoning correctly
computationally
  • Chapter 7 or 8

2
Natural Reasoning
  • John plays tennis if sunny and weekend day.
  • If John plays tennis, Mary goes shopping.
  • It is Saturday.
  • It is sunny.
  • Specific Does John play tennis?
  • All what may one conclude?

3
State-Space Model?
  • What are the States?
  • What are the legal operators?
  • What is an appropriate search?
  • What do we want?

4
States
  • Collection of boolean formula in boolean
    variables.
  • Proposition variables stand for a statement that
    may be either true or false.
  • Ex. It is the weekend. Q
  • Ex. It is Saturday. P
  • Ex. It is Saturday implies is weekend
  • P gtQ
  • Initial State what you know
  • P, PgtQ meaning clauses are true.

5
Operators
  • Operators take a previous state (collection of
    formula) and add new formula.
  • Modus Ponens If A is true, and A implies B, then
    B is true.
  • Model
  • A it is Saturday, B it is weekend
  • and A is true, and AgtB is true, then B is
    true.

6
What are the right operators?
  • If some A are B, and some B are C, then some A
    are C.
  • If A implies B, and B is false, then A is false.

7
A model
  • Models are particular instantiations of the
    variables.
  • If some A are B, and some B are C, then some A
    are C.
  • A women, B students, C men
  • If some women are students, and some students are
    men, then .
  • Bad Rule.

8
Concerns
  • What does it mean to say a statement is true?
  • What are a good set of operators?
  • What can we say in propositional logic?
  • What is the efficiency?
  • Can we guarantee to infer all true conclusions?

9
Semantic definition of Truth
  • Model possible world
  • xy 4 is true in the world x3, y1.
  • xy 4 is false in the world x3, y 2.
  • Entailment S1,S2,..Sn S means in every
    world where S1Sn are true, S is true.
  • Careful No mention of proof just checking all
    the worlds.
  • Some cognitive scientists argue that this is the
    way people reason.

10
Reasoning or Inference Systems
  • Proof is a syntactic property.
  • Rules for deriving new sentences from old ones.
  • Sound any derived sentence is true.
  • Complete any true sentence is derivable.
  • NOTE Logical Inference is monotonic. Cant
    change your mind.

11
Proposition Logic Syntax
  • See text for complete rules
  • Atomic Sentence true, false, variable
  • Complex Sentence connective applied to atomic or
    complex sentence.
  • Connectives not, and, or, implies, equivalence,
    etc.
  • Defined by tables.

12
Propositional Logic Semantics
  • Truth tables p gtq p or q

p q p gtq p or q
t t t t
t f f f
t t t t
t t t t
13
Beware Implies gt
  • If 22 5 then monkeys are cows. TRUE
  • If 22 5 then cows are animals. TRUE
  • Indicates a difference with natural reasoning.
    Single incorrect or false belief will destroy
    reasoning. No weight of evidence.

14
Inference
  • Does s1,..sk entail s?
  • Say variables (symbols) v1vn.
  • Check all 2n possible worlds.
  • In each world, check if s1..sk is true, that s is
    true.
  • Complexity approximately O(2n).
  • Complete possible worlds finite for
    propositional logic, unlike for arithmetic.

15
Translation into Propositional Logic
  • If it rains, then the game will be cancelled.
  • If the game is cancelled, then we clean house.
  • Can we conclude?
  • If it rains, then we clean house.
  • p it rains, q game cancelled r we clean
    house.
  • If p then q. not p or q
  • If q then r. not q or r
  • if p then r. not p or r
    (resolution)

16
Concepts
  • Equivalence two sentences are equivalent if
    they are true in same models or worlds.
  • Validity a sentence is valid if it is true in
    all models. (tautology) e.g. P or not P.
  • Sign Members or not Members only.
  • Berra Its not over till its over.
  • Satisfiability a sentence is satisfied if it
    true in some model.

17
Validity ! Provability
  • Goldbachs conjecture Every even number (gt2) is
    the sum of 2 primes.
  • This is either valid or not.
  • It may not be provable.
  • Godel No axiomization of arithmetic will be
    complete, i.e. always valid statements that are
    not provable.

18
Natural Inference Rules
  • Modus Ponens p, pgtq -- q.
  • Sound
  • Resolution example (sound)
  • p or q, not p or r -- q or r
  • Abduction (unsound, but common)
  • q, pgtq -- p
  • ground wet, rained gt ground wet -- rained
  • medical diagnosis

19
Natural Inference Systems
  • Typically have dozen of rules.
  • Difficult for people to use.
  • Expensive for computation.
  • e.g. a -- a or b
  • a and b -- a
  • All known systems take exponential time in worse
    case. (co-np complete)

20
Full Propositional Resolution
  • clause 1 x1 x2..xny ( or)
  • clause 2 -y z1 z2 zm
  • clauses contain complementary literals.
  • x1 .. xn z1 zm
  • y and not y are complementary literals.
  • Theorem If s1,sn s then
  • s1,sn -- s by resolution.
  • Refutation Completeness.
  • Factoring (simplifying x or x goes to x)

21
Horn Clauses Prolog program
  • Horn clauses have 1 positive literal.
  • They have the form a,b,c,gt d
  • Modus Ponens is Horn Clause complete.
  • Means If KB is a set of horn clauses, and KB gt
    horn clause c, then KB -gt c by modus ponens.
  • Resolution is also horn clause complete since
    it yields modus ponens.

22
Conjunctive Normal Form
  • To apply resolution we need to write what we know
    as a conjunct of disjuncts.
  • Pg 215 contains the rules for doing this
    transformation.
  • Basically you remove all ? and gt and move
    nots inwards. Then you may need to apply
    distributive laws.

23
Proposition -gt CNFGoal Proving R
  • P
  • (PQ) gtR
  • (S or T) gt Q
  • T
  • Distributive laws
  • (-s-t) or q?
  • (-s or q)(-t or q).
  • P
  • -P or Q or R
  • -S or Q
  • -T or Q
  • T
  • Remember implicit adding.

24
Resolution Proof
  • P (1)
  • -P or Q or R (2)
  • -S or Q (3)
  • -T or Q (4)
  • T (5)
  • R (6)
  • -P or Q 7 by 2 6
  • -Q 8 by 7 1.
  • -T 9 by 8 4
  • empty by 9 and 5.
  • Done order only effects efficiency.

25
Resolution Algorithm
  • To prove s1, s2..sn -- s
  • Put s1,s2,..sn not s into cnf.
  • Resolve any 2 clauses that have complementary
    literals
  • If you get empty, done
  • Continue until set of clauses doesnt grow.
  • Search can be expensive (exponential).

26
Forward and Backward Reasoning
  • Prolog only allows Horn clauses.
  • if a, b, c then d gt not a or not b or not c or
    d
  • Prolog writes this
  • d - a, b, c.
  • Prolog thinks to prove d, set up subgoals a, b,
    c and prove/verify each subgoal.

27
Forward Reasoning
  • From facts to conclusions
  • Given s1 p, s2 q, s3 pqgtr
  • Rewrite in clausal form s3 (-p-qr)
  • s1 resolve with s3 -qr (s4)
  • s2 resolve with s4 r
  • Generally used for processing sensory
    information.

28
Backwards Reasoning what prolog does
  • From Negative of Goal to data
  • Given s1 p, s2 q, s3 pqgtr
  • Goal s4 r
  • Rewrite in clausal form s3 (-p-qr)
  • Resolve s4 with s3 -p -q (s5)
  • Resolve s5 with s2 -p (s6)
  • Resolve s6 with s1 empty. Eureka r is true.

29
What cant we say?
  • Quantification every student has a father.
  • Relations If X is married to Y, then Y is
    married to X.
  • Probability There is an 80 chance of rain.
  • Combine Evidence This car is better than that
    one because
  • Uncertainty Maybe John is playing golf.
  • Changing world actions
Write a Comment
User Comments (0)
About PowerShow.com