Professional Documents
Culture Documents
Propositional Logic or How To Reason Correctly: Chapter 8 (New Edition) Chapter 7 (Old Edition)
Propositional Logic or How To Reason Correctly: Chapter 8 (New Edition) Chapter 7 (Old Edition)
p q p =>q ~p or q
t t t t
t f f f
t t t t
t t t t
Implies =>
• If 2+2 = 5 then monkeys are cows. TRUE
• If 2+2 = 5 then cows are animals. TRUE
• Indicates a difference with natural
reasoning. Single incorrect or false belief
will destroy reasoning. No weight of
evidence.
Inference
• Does s1,..sk entail s?
• Say variables (symbols) v1…vn.
• Check all 2^n possible worlds.
• In each world, check if s1..sk is true, that s
is true.
• Approximately O(2^n).
• Complete: possible worlds finite for
propositional logic, unlike for arithmetic.
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)
Concepts
• Equivalence: two sentences are equivalent
if they are true in same models.
• Validity: a sentence is valid if it true in all
models. (tautology) e.g. P or not P.
– Sign: Members or not Members only.
– Berra: It’s not over till its over.
• Satisfiability: a sentence is satisfied if it true
in some model.
Validity != Provability
• Goldbach’s conjecture: Every even number
(>2) 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.
Natural Inference Rules
• Modus Ponens: p, p=>q |-- q.
– Sound
• Resolution example (sound)
– p or q, not p or r |-- q or r
• Abduction (unsound, but common)
– q, p=>q |-- p
– ground wet, rained => ground wet |-- rained
– medical diagnosis
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)
Full Propositional Resolution
• clause 1: x1 +x2+..xn+y (+ = 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)
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 => and
move “not’s” inwards. Then you may need
to apply distributive laws.
Proposition -> CNF
Goal: Proving R
• P • P
• (P&Q) =>R • -P or –Q or R
• (S or T) => Q • -S or Q
• T • -T or Q
• Distributive laws: • T
• (-s&-t) or q • Remember:implicit
(-s or q)&(-t or q). adding.
Resolution Proof
• P (1) • -P or –Q : 7 by 2 & 6
• -P or –Q or R (2) • -Q : 8 by 7 & 1.
• -S or Q (3) • -T : 9 by 8 & 4
• -T or Q (4) • empty: by 9 and 5.
• T (5) • Done: order only
• ~R (6) effects efficiency.
Resolution Algorithm
To prove s1, s2..sn |-- s
1. Put s1,s2,..sn & not s into cnf.
2. Resolve any 2 clauses that have
complementary literals
3. If you get empty, done
4. Continue until set of clauses doesn’t grow.
Search can be expensive (exponential).
Forward and Backward Reasoning