SlideShare a Scribd company logo
1 of 28
Propositional Logic
or how to reason correctly
Chapter 8 (new edition)
Chapter 7 (old edition)
Goals
• Feigenbaum: In the knowledge lies the
power. Success with expert systems. 70’s.
• What can we represent?
– Logic(s): Prolog
– Mathematical knowledge: mathematica
– Common Sense Knowledge: Lenat’s Cyc has a
million statement in various knowledge
– Probabilistic Knowledge: Bayesian networks
• Reasoning: via search
History
• 300 BC Aristotle: Syllogisms
• Late 1600’s Leibnitz’s goal: mechanization
of inference
• 1847 Boole: Mathematical Analysis of
Logic
• 1879: Complete Propositional Logic: Frege
• 1965: Resolution Complete (Robinson)
• 1971: Cook: satisfiability NP-complete
• 1992: GSAT Selman min-conflicts
Syllogisms
• Proposition = Statement that may be either
true or false.
• John is in the classroom.
• Mary is enrolled in 270A.
• If A is true, and A implies B, then B is true.
• If some A are B, and some B are C, then
some A are C.
• If some women are students, and some
students are men, then ….
Concerns
• What does it mean to say a statement is
true?
• What are sound rules for reasoning
• What can we represent in propositional
logic?
• What is the efficiency?
• Can we guarantee to infer all true
statements?
Semantics
• Model = possible world
• x+y = 4 is true in the world x=3, y=1.
• x+y = 4 is false in the world x=3, y = 1.
• Entailment S1,S2,..Sn |= S means in every
world where S1…Sn 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.
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.
Can’t change your mind.
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.
Propositional Logic: Semantics
• Truth tables: p =>q |= ~p or q
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&Q) =>R
• (S or T) => 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.
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.
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
• Horn clause has at most 1 positive literal.
– Prolog only allows Horn clauses.
– if a, b, c then d => 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.
Forward Reasoning
• From facts to conclusions
• Given s1: p, s2: q, s3: p&q=>r
• Rewrite in clausal form: s3 = (-p+-q+r)
• s1 resolve with s3 = -q+r (s4)
• s2 resolve with s4 = r
• Generally used for processing sensory
information.
Backwards Reasoning:
what prolog does
• From Negative of Goal to data
• Given s1: p, s2: q, s3: p&q=>r
• Goal: s4 = r
• Rewrite in clausal form: s3 = (-p+-q+r)
• Resolve s4 with s3 = -p +-q (s5)
• Resolve s5 with s2 = -p (s6)
• Resolve s6 with s1 = empty. Eureka r is true.
Davis-Putnam Algorithm
• Effective, complete propositional algorithm
• Basically: recursive backtracking with tricks.
– early termination: short circuit evaluation
– pure symbol: variable is always + or – (eliminate the
containing clauses)
– one literal clauses: one undefined variable, really
special cases of MRV
• Propositional satisfication is a special case of
Constraint satisfication.
WalkSat
• Heuristic algorithm, like min-conflicts
• Randomly assign values (t/f)
• For a while do
– randomly select a clause
– with probability p, flip a random variable in
clause
– else flip a variable which maximizes number of
satisfied clauses.
• Of course, variations exists.
Hard Satisfiability Problems
• Critical point: ratio of clauses/variables =
4.24 (empirical).
• If above, problems usually unsatsifiable.
• If below, problems usually satisfiable.
• Theorem: Critical range is bounded by
[3.0003, 4.598].
What can’t 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.

More Related Content

Similar to PropositionalLogic.ppt

Tma2033 chap1.1&1.2handout
Tma2033 chap1.1&1.2handoutTma2033 chap1.1&1.2handout
Tma2033 chap1.1&1.2handoutshiqinrino
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
Inductive definitions
Inductive definitionsInductive definitions
Inductive definitionslorcap
 
Theorem proving 2018 2019
Theorem proving 2018 2019Theorem proving 2018 2019
Theorem proving 2018 2019Emmanuel Zarpas
 
The Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and BackThe Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and BackMoshe Vardi
 
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsAmr Rashed
 
Bayesian Neural Networks
Bayesian Neural NetworksBayesian Neural Networks
Bayesian Neural NetworksNatan Katz
 
Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agentShiwani Gupta
 
Discrete mathematics suraj ppt
Discrete mathematics suraj pptDiscrete mathematics suraj ppt
Discrete mathematics suraj pptAshiskumarDash2
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2S.Shayan Daneshvar
 

Similar to PropositionalLogic.ppt (20)

Logic.ppt
Logic.pptLogic.ppt
Logic.ppt
 
m7-logic.ppt
m7-logic.pptm7-logic.ppt
m7-logic.ppt
 
Tma2033 chap1.1&1.2handout
Tma2033 chap1.1&1.2handoutTma2033 chap1.1&1.2handout
Tma2033 chap1.1&1.2handout
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
 
1. Logic and Proofs.ppt
1. Logic and Proofs.ppt1. Logic and Proofs.ppt
1. Logic and Proofs.ppt
 
02-boolean.ppt
02-boolean.ppt02-boolean.ppt
02-boolean.ppt
 
Inductive definitions
Inductive definitionsInductive definitions
Inductive definitions
 
AI IMPORTANT QUESTION
AI IMPORTANT QUESTIONAI IMPORTANT QUESTION
AI IMPORTANT QUESTION
 
AI-Unit4.ppt
AI-Unit4.pptAI-Unit4.ppt
AI-Unit4.ppt
 
Theorem proving 2018 2019
Theorem proving 2018 2019Theorem proving 2018 2019
Theorem proving 2018 2019
 
The Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and BackThe Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and Back
 
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
 
10a.ppt
10a.ppt10a.ppt
10a.ppt
 
Np complete
Np completeNp complete
Np complete
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
Bayesian Neural Networks
Bayesian Neural NetworksBayesian Neural Networks
Bayesian Neural Networks
 
Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agent
 
Discrete mathematics suraj ppt
Discrete mathematics suraj pptDiscrete mathematics suraj ppt
Discrete mathematics suraj ppt
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 

Recently uploaded

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 

Recently uploaded (20)

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 

PropositionalLogic.ppt

  • 1. Propositional Logic or how to reason correctly Chapter 8 (new edition) Chapter 7 (old edition)
  • 2. Goals • Feigenbaum: In the knowledge lies the power. Success with expert systems. 70’s. • What can we represent? – Logic(s): Prolog – Mathematical knowledge: mathematica – Common Sense Knowledge: Lenat’s Cyc has a million statement in various knowledge – Probabilistic Knowledge: Bayesian networks • Reasoning: via search
  • 3. History • 300 BC Aristotle: Syllogisms • Late 1600’s Leibnitz’s goal: mechanization of inference • 1847 Boole: Mathematical Analysis of Logic • 1879: Complete Propositional Logic: Frege • 1965: Resolution Complete (Robinson) • 1971: Cook: satisfiability NP-complete • 1992: GSAT Selman min-conflicts
  • 4. Syllogisms • Proposition = Statement that may be either true or false. • John is in the classroom. • Mary is enrolled in 270A. • If A is true, and A implies B, then B is true. • If some A are B, and some B are C, then some A are C. • If some women are students, and some students are men, then ….
  • 5. Concerns • What does it mean to say a statement is true? • What are sound rules for reasoning • What can we represent in propositional logic? • What is the efficiency? • Can we guarantee to infer all true statements?
  • 6. Semantics • Model = possible world • x+y = 4 is true in the world x=3, y=1. • x+y = 4 is false in the world x=3, y = 1. • Entailment S1,S2,..Sn |= S means in every world where S1…Sn 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.
  • 7. 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. Can’t change your mind.
  • 8. 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.
  • 9. Propositional Logic: Semantics • Truth tables: p =>q |= ~p or q p q p =>q ~p or q t t t t t f f f t t t t t t t t
  • 10. 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.
  • 11. 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.
  • 12. 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)
  • 13. 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.
  • 14. 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.
  • 15. 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
  • 16. 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)
  • 17. 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)
  • 18. 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.
  • 19. Proposition -> CNF Goal: Proving R • P • (P&Q) =>R • (S or T) => 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.
  • 20. 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.
  • 21. 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).
  • 22. Forward and Backward Reasoning • Horn clause has at most 1 positive literal. – Prolog only allows Horn clauses. – if a, b, c then d => 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.
  • 23. Forward Reasoning • From facts to conclusions • Given s1: p, s2: q, s3: p&q=>r • Rewrite in clausal form: s3 = (-p+-q+r) • s1 resolve with s3 = -q+r (s4) • s2 resolve with s4 = r • Generally used for processing sensory information.
  • 24. Backwards Reasoning: what prolog does • From Negative of Goal to data • Given s1: p, s2: q, s3: p&q=>r • Goal: s4 = r • Rewrite in clausal form: s3 = (-p+-q+r) • Resolve s4 with s3 = -p +-q (s5) • Resolve s5 with s2 = -p (s6) • Resolve s6 with s1 = empty. Eureka r is true.
  • 25. Davis-Putnam Algorithm • Effective, complete propositional algorithm • Basically: recursive backtracking with tricks. – early termination: short circuit evaluation – pure symbol: variable is always + or – (eliminate the containing clauses) – one literal clauses: one undefined variable, really special cases of MRV • Propositional satisfication is a special case of Constraint satisfication.
  • 26. WalkSat • Heuristic algorithm, like min-conflicts • Randomly assign values (t/f) • For a while do – randomly select a clause – with probability p, flip a random variable in clause – else flip a variable which maximizes number of satisfied clauses. • Of course, variations exists.
  • 27. Hard Satisfiability Problems • Critical point: ratio of clauses/variables = 4.24 (empirical). • If above, problems usually unsatsifiable. • If below, problems usually satisfiable. • Theorem: Critical range is bounded by [3.0003, 4.598].
  • 28. What can’t 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.