SlideShare a Scribd company logo
1 of 22
Download to read offline
Lecture 1: Propositional Logic
Syntax
Semantics
Truth tables
Implications and Equivalences
Valid and Invalid arguments
Normal forms
Davis-Putnam Algorithm
1
Atomic propositions and logical connectives
An atomic proposition is a statement or assertion that must be true or false.
Examples of atomic propositions are: โ€œ5 is a primeโ€ and โ€œprogram terminatesโ€.
Propositional formulas are constructed from atomic propositions by using logical connectives.
Connectives
false
true
not
and
or
conditional (implies)
biconditional (equivalent)
A typical propositional formula is
The truth value of a propositional formula can be calculated from the truth values of the atomic
propositions it contains.
2
Well-formed propositional formulas
The well-formed formulas of propositional logic are obtained by using the construction rules
below:
An atomic proposition is a well-formed formula.
If is a well-formed formula, then so is .
If and are well-formed formulas, then so are , , , and .
If is a well-formed formula, then so is .
Alternatively, can use Backus-Naur Form (BNF) :
formula ::= Atomic Proposition
formula
formula formula
formula formula
formula formula
formula formula
formula
3
Truth functions
The truth of a propositional formula is a function of the truth values of the atomic
propositions it contains.
A truth assignment is a mapping that associates a truth value with each of the atomic propositions
. Let be a truth assignment for .
If we identify with false and with true, we can easily determine the truth value of
under .
The other logical connectives can be handled in a similar manner.
Truth functions are sometimes called Boolean functions.
4
Truth tables for basic logical connectives
A truth table shows whether a propositional formula is true or false for each possible truth
assignment.
If we know how the five basic logical connectives work, it is easy (in principle) to construct a truth
table.
5
Mistake in table for implication?
Notice that is only if is and is .
If is , then the implication will be . Could this possibly be correct?
Some people feel that it is counterintuitive to say that the implication
โ€œIf horses have wings, then elephants can danceโ€
is true, when we know that horses donโ€™t have wings and that elephants canโ€™t dance.
There are four possible truth tables for implication :
T1 T2 T3 T4
6
Mistake in table for implication?
First Argument:
If we used T1, then would have the same table as .
If we used T2, then would have the same table as .
If we used T3, then would have the same table as โ€“even worse!
Clearly, each of these three alternatives is unreasonable. Table T4 is the only remaining possibility.
7
Mistake in table for implication?
Second Argument:
We would certainly want to be a tautology. Letโ€™s test each of the four possible
choices for .
T1 T2 T3 T4
Only T4 makes the implication a tautology.
8
A more complex truth table
Let be the formula
To construct the truth table for we must consider all possible truth assignments for , , and .
In this case there are such truth assignments. Hence, the table for will have 8 rows.
In general, if the truth of a formula depends on propositions, its truth table will have rows.
9
Special formulas
A propositional formula is
a tautology if for all .
a contradiction if for all .
satisfiable if for some .
It is easy to see that is a tautology and that is a contradiction,
The truth table on the previous page shows that the formula is a tautology.
Note that
is a contradiction iff is a tautology.
is satisfiable iff is not a tautology.
Major open problem: Is there a more efficient way to determine if a formula is a tautology (is
satisfiable) than by constructing its truth table?
10
Implications
In the formula
is the antecedent, hypothesis or premise
is the consequent or conclusion
Can be associated with 3 variants:
Converse:
Inverse:
Contrapositive:
An implication and its contrapositive are equivalent.
Modus Ponens: Given and , conclude .
Modus Tollens: Given and , conclude .
11
Equivalences
Two formulae and are equivalent iff for any truth assignment we have .
Claim: and are equivalent iff is a tautology.
Some Useful Equivalences that can be used to simplify complex formulas:
12
When is an argument valid?
An argument is an assertion that a set of statements, called the premises, yields another statement,
called the conclusion.
An argument is valid if and only if the conjunction of the premises implies the conclusion.
In other words, if we grant that the premises are all true, then the conclusion must be true also.
An invalid argument is called a fallacy. Unfortunately, fallacies are probably more common than
valid arguments.
In many cases, the validity of an argument can be checked by constructing a truth table.
All we have to do is show that the conjunction of the premises implies the conclusion.
13
Valid and Invalid Arguments
Which of the following arguments are valid?
1. If I am wealthy, then I am happy. I am happy. Therefore, I am wealthy.
2. If John drinks beer, he is at least 18 years old. John does not drink beer. Therefore, John is not
yet 18 years old.
3. If girls are blonde, they are popular with boys. Ugly girls are unpopular with boys. Intellectual
girls are ugly. Therefore, blonde girls are not intellectual.
4. If I study, then I will not fail basket weaving 101. If I do not play cards to often, then I will
study. I failed basket weaving 101. Therefore, I played cards too often.
14
A More Complicated Example!
The following example is due to Lewis Carroll. Prove that it is a valid argument.
1. All the dated letters in this room are written on blue paper.
2. None of them are in black ink, except those that are written in the third person.
3. I have not filed any of those that I can read.
4. None of those that are written on one sheet are undated.
5. All of those that are not crossed out are in black ink.
6. All of those that are written by Brown begin with โ€œDear Sir.โ€
7. All of those that are written on blue paper are filed.
8. None of those that are written on more than one sheet are crossed out.
9. None of those that begin with โ€œDear sirโ€ are written in the third person.
Therefore, I cannot read any of Brownโ€™s letters.
15
Lewis Carrol example (cont.)
Let
be โ€œthe letter is dated,โ€
be โ€œthe letter is written on blue paper,โ€
be โ€œthe letter is written in black ink,โ€
be โ€œthe letter is written in the third person,โ€
be โ€œthe letter is filed,โ€
be โ€œI can read the letter,โ€
be โ€œthe letter is written on one sheet,โ€
be โ€œthe letter is crossed out,โ€
be โ€œthe letter is written by Brown,โ€
be โ€œthe letter begins with โ€˜Dear Sirโ€™ โ€œ
16
Lewis Carrol example (cont.)
Now, we can write the argument in propositional logic.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Therefore
17
Negation Normal Form
Some more useful equivalences:
18
Negation Normal Form
The negation of
is simply
This may not be very useful. Often desirable to simplify formula as much as possible using four
tautologies above.
The resulting formula is said to be in negation normal form.
19
Disjunctive Normal Form
Every propositional formula is equivalent to a formula in disjunctive normal form (DNF):
where each is a literal (an atomic proposition or the negation of one).
In short: .
Every propositional formula is equivalent to a formula in conjunctive normal form (CNF):
where each is a literal.
In short: .
How hard is it to check if CNF formula is a tautology? How about DNF? How about checking for
satisfiability instead?
20
Connectives
From CNF (or DNF) it follows that no connectives other than are really needed.
Since is equivalent to , we only need .
Likewise, is sufficient.
Likewise, is sufficient.
But is not sufficient.
NAND
Consider the binary connective .
Claim: alone is sufficient.
21
Deciding satisfiability
The fastest known algorithms for deciding propositional satisfiability are based on the
Davis-Putnam Algorithm.
A unit clause is a clause that consists of a single literal.
function Satisfiable (clause list S) returns boolean;
/* unit propagation */
repeat
for each unit clause do
delete from every clause containing
delete from every clause of in which it occurs
end for
if is empty then return TRUE
else if null clause is in then return FALSE end if
until no further changes result end repeat
/* splitting */
choose a literal occurring in
if Satisfiable ( ) then return TRUE
else if Satisfiable ( then return TRUE
else return FALSE end if
end function
22

More Related Content

Similar to propositional_logic.pdf

Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicpendragon6626
ย 
Critical Task 3 Rubric Critical Elements Exemplary (1.docx
Critical Task 3 Rubric  Critical Elements Exemplary (1.docxCritical Task 3 Rubric  Critical Elements Exemplary (1.docx
Critical Task 3 Rubric Critical Elements Exemplary (1.docxannettsparrow
ย 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicIT Engineering Department
ย 
Geo 2.1 condtional statements
Geo 2.1 condtional statementsGeo 2.1 condtional statements
Geo 2.1 condtional statementsejfischer
ย 
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx
1Week 3 Section 1.4 Predicates and Quantifiers As.docxjoyjonna282
ย 
Arguments in discreate structures and stuff
Arguments in discreate structures and stuffArguments in discreate structures and stuff
Arguments in discreate structures and stuffZenLooper
ย 
1-19
1-191-19
1-19jimpict
ย 
Week 14 April 28 & 30 - Love and Death Castillo, Chap. 9 .docx
Week 14  April 28 & 30  - Love and Death Castillo, Chap. 9 .docxWeek 14  April 28 & 30  - Love and Death Castillo, Chap. 9 .docx
Week 14 April 28 & 30 - Love and Death Castillo, Chap. 9 .docxmelbruce90096
ย 
Notes for logic
Notes for logicNotes for logic
Notes for logicAmit Chaudhary
ย 
Journal 2
Journal 2Journal 2
Journal 2Ban Lara
ย 
ArgumentsA. Arguments are found in many texts and media .docx
ArgumentsA.   Arguments are found in many texts and media .docxArgumentsA.   Arguments are found in many texts and media .docx
ArgumentsA. Arguments are found in many texts and media .docxjewisonantone
ย 
Question 1 When orienting your reading, which of the following q.docx
Question 1 When orienting your reading, which of the following q.docxQuestion 1 When orienting your reading, which of the following q.docx
Question 1 When orienting your reading, which of the following q.docxIRESH3
ย 
Geometry 201 unit 2.2
Geometry 201 unit 2.2Geometry 201 unit 2.2
Geometry 201 unit 2.2Mark Ryder
ย 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
ย 
Phil115 1 Intro
Phil115  1 IntroPhil115  1 Intro
Phil115 1 Introguest55c847
ย 
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docxgilbertkpeters11344
ย 
Obj. 9 Inductive Reasoning
Obj. 9 Inductive ReasoningObj. 9 Inductive Reasoning
Obj. 9 Inductive Reasoningsmiller5
ย 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoningindu psthakur
ย 

Similar to propositional_logic.pdf (20)

Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logic
ย 
Critical Task 3 Rubric Critical Elements Exemplary (1.docx
Critical Task 3 Rubric  Critical Elements Exemplary (1.docxCritical Task 3 Rubric  Critical Elements Exemplary (1.docx
Critical Task 3 Rubric Critical Elements Exemplary (1.docx
ย 
Logic.pptx
Logic.pptxLogic.pptx
Logic.pptx
ย 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
ย 
Geo 2.1 condtional statements
Geo 2.1 condtional statementsGeo 2.1 condtional statements
Geo 2.1 condtional statements
ย 
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx 1Week 3 Section 1.4 Predicates and Quantifiers  As.docx
1Week 3 Section 1.4 Predicates and Quantifiers As.docx
ย 
Arguments in discreate structures and stuff
Arguments in discreate structures and stuffArguments in discreate structures and stuff
Arguments in discreate structures and stuff
ย 
1-19
1-191-19
1-19
ย 
Week 14 April 28 & 30 - Love and Death Castillo, Chap. 9 .docx
Week 14  April 28 & 30  - Love and Death Castillo, Chap. 9 .docxWeek 14  April 28 & 30  - Love and Death Castillo, Chap. 9 .docx
Week 14 April 28 & 30 - Love and Death Castillo, Chap. 9 .docx
ย 
Notes for logic
Notes for logicNotes for logic
Notes for logic
ย 
Journal 2
Journal 2Journal 2
Journal 2
ย 
ArgumentsA. Arguments are found in many texts and media .docx
ArgumentsA.   Arguments are found in many texts and media .docxArgumentsA.   Arguments are found in many texts and media .docx
ArgumentsA. Arguments are found in many texts and media .docx
ย 
Question 1 When orienting your reading, which of the following q.docx
Question 1 When orienting your reading, which of the following q.docxQuestion 1 When orienting your reading, which of the following q.docx
Question 1 When orienting your reading, which of the following q.docx
ย 
BICONDITIONAL STATEMENTS.pptx
BICONDITIONAL STATEMENTS.pptxBICONDITIONAL STATEMENTS.pptx
BICONDITIONAL STATEMENTS.pptx
ย 
Geometry 201 unit 2.2
Geometry 201 unit 2.2Geometry 201 unit 2.2
Geometry 201 unit 2.2
ย 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
ย 
Phil115 1 Intro
Phil115  1 IntroPhil115  1 Intro
Phil115 1 Intro
ย 
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx
4 Mistakes in Reasoning The World of Fallaciesboy at chalkboar.docx
ย 
Obj. 9 Inductive Reasoning
Obj. 9 Inductive ReasoningObj. 9 Inductive Reasoning
Obj. 9 Inductive Reasoning
ย 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoning
ย 

More from ShivareddyGangam

Student Voting Application for Election โ€“ Using SMS (1).pptx
Student Voting Application for Election โ€“ Using SMS (1).pptxStudent Voting Application for Election โ€“ Using SMS (1).pptx
Student Voting Application for Election โ€“ Using SMS (1).pptxShivareddyGangam
ย 
Project Management (2).pdf
Project Management (2).pdfProject Management (2).pdf
Project Management (2).pdfShivareddyGangam
ย 
The Product and Process(1).pdf
The Product and Process(1).pdfThe Product and Process(1).pdf
The Product and Process(1).pdfShivareddyGangam
ย 
Unit24_TopologicalSort (2).ppt
Unit24_TopologicalSort (2).pptUnit24_TopologicalSort (2).ppt
Unit24_TopologicalSort (2).pptShivareddyGangam
ย 
Lecture1_jps (1).ppt
Lecture1_jps (1).pptLecture1_jps (1).ppt
Lecture1_jps (1).pptShivareddyGangam
ย 
artificialintelligencea-200326090832.pdf
artificialintelligencea-200326090832.pdfartificialintelligencea-200326090832.pdf
artificialintelligencea-200326090832.pdfShivareddyGangam
ย 
Software Project Risks Management (1).pdf
Software Project Risks Management (1).pdfSoftware Project Risks Management (1).pdf
Software Project Risks Management (1).pdfShivareddyGangam
ย 
Introduction (1).pdf
Introduction (1).pdfIntroduction (1).pdf
Introduction (1).pdfShivareddyGangam
ย 
Unit 3 (1) (1).pdf
Unit 3 (1) (1).pdfUnit 3 (1) (1).pdf
Unit 3 (1) (1).pdfShivareddyGangam
ย 
Notion of Algorithms.pdf
Notion of Algorithms.pdfNotion of Algorithms.pdf
Notion of Algorithms.pdfShivareddyGangam
ย 
11_Automated_Testing.ppt
11_Automated_Testing.ppt11_Automated_Testing.ppt
11_Automated_Testing.pptShivareddyGangam
ย 
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptxOS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptxShivareddyGangam
ย 
Project Management.pdf
Project Management.pdfProject Management.pdf
Project Management.pdfShivareddyGangam
ย 
machinelearningengineeringslideshare-160909192132 (1).pdf
machinelearningengineeringslideshare-160909192132 (1).pdfmachinelearningengineeringslideshare-160909192132 (1).pdf
machinelearningengineeringslideshare-160909192132 (1).pdfShivareddyGangam
ย 

More from ShivareddyGangam (20)

Student Voting Application for Election โ€“ Using SMS (1).pptx
Student Voting Application for Election โ€“ Using SMS (1).pptxStudent Voting Application for Election โ€“ Using SMS (1).pptx
Student Voting Application for Election โ€“ Using SMS (1).pptx
ย 
Project Management (2).pdf
Project Management (2).pdfProject Management (2).pdf
Project Management (2).pdf
ย 
pca.ppt
pca.pptpca.ppt
pca.ppt
ย 
The Product and Process(1).pdf
The Product and Process(1).pdfThe Product and Process(1).pdf
The Product and Process(1).pdf
ย 
Unit24_TopologicalSort (2).ppt
Unit24_TopologicalSort (2).pptUnit24_TopologicalSort (2).ppt
Unit24_TopologicalSort (2).ppt
ย 
Lecture1_jps (1).ppt
Lecture1_jps (1).pptLecture1_jps (1).ppt
Lecture1_jps (1).ppt
ย 
2 semai.pptx
2 semai.pptx2 semai.pptx
2 semai.pptx
ย 
artificialintelligencea-200326090832.pdf
artificialintelligencea-200326090832.pdfartificialintelligencea-200326090832.pdf
artificialintelligencea-200326090832.pdf
ย 
Software Project Risks Management (1).pdf
Software Project Risks Management (1).pdfSoftware Project Risks Management (1).pdf
Software Project Risks Management (1).pdf
ย 
Introduction (1).pdf
Introduction (1).pdfIntroduction (1).pdf
Introduction (1).pdf
ย 
Unit 3 (1) (1).pdf
Unit 3 (1) (1).pdfUnit 3 (1) (1).pdf
Unit 3 (1) (1).pdf
ย 
Unit 1 (1).pdf
Unit 1 (1).pdfUnit 1 (1).pdf
Unit 1 (1).pdf
ย 
Strassen.ppt
Strassen.pptStrassen.ppt
Strassen.ppt
ย 
Notion of Algorithms.pdf
Notion of Algorithms.pdfNotion of Algorithms.pdf
Notion of Algorithms.pdf
ย 
11_Automated_Testing.ppt
11_Automated_Testing.ppt11_Automated_Testing.ppt
11_Automated_Testing.ppt
ย 
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptxOS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
ย 
Project Management.pdf
Project Management.pdfProject Management.pdf
Project Management.pdf
ย 
PP
PPPP
PP
ย 
chapter2.ppt
chapter2.pptchapter2.ppt
chapter2.ppt
ย 
machinelearningengineeringslideshare-160909192132 (1).pdf
machinelearningengineeringslideshare-160909192132 (1).pdfmachinelearningengineeringslideshare-160909192132 (1).pdf
machinelearningengineeringslideshare-160909192132 (1).pdf
ย 

Recently uploaded

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Callshivangimorya083
ย 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
ย 
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Callshivangimorya083
ย 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
ย 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
ย 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
ย 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
ย 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
ย 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
ย 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
ย 
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...amitlee9823
ย 
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 Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...amitlee9823
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
ย 

Recently uploaded (20)

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
ย 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
ย 
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
ย 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
ย 
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
ย 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
ย 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
ย 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
ย 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
ย 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
ย 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
ย 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
ย 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
ย 
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
ย 
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
ย 
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 Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
ย 

propositional_logic.pdf

  • 1. Lecture 1: Propositional Logic Syntax Semantics Truth tables Implications and Equivalences Valid and Invalid arguments Normal forms Davis-Putnam Algorithm 1
  • 2. Atomic propositions and logical connectives An atomic proposition is a statement or assertion that must be true or false. Examples of atomic propositions are: โ€œ5 is a primeโ€ and โ€œprogram terminatesโ€. Propositional formulas are constructed from atomic propositions by using logical connectives. Connectives false true not and or conditional (implies) biconditional (equivalent) A typical propositional formula is The truth value of a propositional formula can be calculated from the truth values of the atomic propositions it contains. 2
  • 3. Well-formed propositional formulas The well-formed formulas of propositional logic are obtained by using the construction rules below: An atomic proposition is a well-formed formula. If is a well-formed formula, then so is . If and are well-formed formulas, then so are , , , and . If is a well-formed formula, then so is . Alternatively, can use Backus-Naur Form (BNF) : formula ::= Atomic Proposition formula formula formula formula formula formula formula formula formula formula 3
  • 4. Truth functions The truth of a propositional formula is a function of the truth values of the atomic propositions it contains. A truth assignment is a mapping that associates a truth value with each of the atomic propositions . Let be a truth assignment for . If we identify with false and with true, we can easily determine the truth value of under . The other logical connectives can be handled in a similar manner. Truth functions are sometimes called Boolean functions. 4
  • 5. Truth tables for basic logical connectives A truth table shows whether a propositional formula is true or false for each possible truth assignment. If we know how the five basic logical connectives work, it is easy (in principle) to construct a truth table. 5
  • 6. Mistake in table for implication? Notice that is only if is and is . If is , then the implication will be . Could this possibly be correct? Some people feel that it is counterintuitive to say that the implication โ€œIf horses have wings, then elephants can danceโ€ is true, when we know that horses donโ€™t have wings and that elephants canโ€™t dance. There are four possible truth tables for implication : T1 T2 T3 T4 6
  • 7. Mistake in table for implication? First Argument: If we used T1, then would have the same table as . If we used T2, then would have the same table as . If we used T3, then would have the same table as โ€“even worse! Clearly, each of these three alternatives is unreasonable. Table T4 is the only remaining possibility. 7
  • 8. Mistake in table for implication? Second Argument: We would certainly want to be a tautology. Letโ€™s test each of the four possible choices for . T1 T2 T3 T4 Only T4 makes the implication a tautology. 8
  • 9. A more complex truth table Let be the formula To construct the truth table for we must consider all possible truth assignments for , , and . In this case there are such truth assignments. Hence, the table for will have 8 rows. In general, if the truth of a formula depends on propositions, its truth table will have rows. 9
  • 10. Special formulas A propositional formula is a tautology if for all . a contradiction if for all . satisfiable if for some . It is easy to see that is a tautology and that is a contradiction, The truth table on the previous page shows that the formula is a tautology. Note that is a contradiction iff is a tautology. is satisfiable iff is not a tautology. Major open problem: Is there a more efficient way to determine if a formula is a tautology (is satisfiable) than by constructing its truth table? 10
  • 11. Implications In the formula is the antecedent, hypothesis or premise is the consequent or conclusion Can be associated with 3 variants: Converse: Inverse: Contrapositive: An implication and its contrapositive are equivalent. Modus Ponens: Given and , conclude . Modus Tollens: Given and , conclude . 11
  • 12. Equivalences Two formulae and are equivalent iff for any truth assignment we have . Claim: and are equivalent iff is a tautology. Some Useful Equivalences that can be used to simplify complex formulas: 12
  • 13. When is an argument valid? An argument is an assertion that a set of statements, called the premises, yields another statement, called the conclusion. An argument is valid if and only if the conjunction of the premises implies the conclusion. In other words, if we grant that the premises are all true, then the conclusion must be true also. An invalid argument is called a fallacy. Unfortunately, fallacies are probably more common than valid arguments. In many cases, the validity of an argument can be checked by constructing a truth table. All we have to do is show that the conjunction of the premises implies the conclusion. 13
  • 14. Valid and Invalid Arguments Which of the following arguments are valid? 1. If I am wealthy, then I am happy. I am happy. Therefore, I am wealthy. 2. If John drinks beer, he is at least 18 years old. John does not drink beer. Therefore, John is not yet 18 years old. 3. If girls are blonde, they are popular with boys. Ugly girls are unpopular with boys. Intellectual girls are ugly. Therefore, blonde girls are not intellectual. 4. If I study, then I will not fail basket weaving 101. If I do not play cards to often, then I will study. I failed basket weaving 101. Therefore, I played cards too often. 14
  • 15. A More Complicated Example! The following example is due to Lewis Carroll. Prove that it is a valid argument. 1. All the dated letters in this room are written on blue paper. 2. None of them are in black ink, except those that are written in the third person. 3. I have not filed any of those that I can read. 4. None of those that are written on one sheet are undated. 5. All of those that are not crossed out are in black ink. 6. All of those that are written by Brown begin with โ€œDear Sir.โ€ 7. All of those that are written on blue paper are filed. 8. None of those that are written on more than one sheet are crossed out. 9. None of those that begin with โ€œDear sirโ€ are written in the third person. Therefore, I cannot read any of Brownโ€™s letters. 15
  • 16. Lewis Carrol example (cont.) Let be โ€œthe letter is dated,โ€ be โ€œthe letter is written on blue paper,โ€ be โ€œthe letter is written in black ink,โ€ be โ€œthe letter is written in the third person,โ€ be โ€œthe letter is filed,โ€ be โ€œI can read the letter,โ€ be โ€œthe letter is written on one sheet,โ€ be โ€œthe letter is crossed out,โ€ be โ€œthe letter is written by Brown,โ€ be โ€œthe letter begins with โ€˜Dear Sirโ€™ โ€œ 16
  • 17. Lewis Carrol example (cont.) Now, we can write the argument in propositional logic. 1. 2. 3. 4. 5. 6. 7. 8. 9. Therefore 17
  • 18. Negation Normal Form Some more useful equivalences: 18
  • 19. Negation Normal Form The negation of is simply This may not be very useful. Often desirable to simplify formula as much as possible using four tautologies above. The resulting formula is said to be in negation normal form. 19
  • 20. Disjunctive Normal Form Every propositional formula is equivalent to a formula in disjunctive normal form (DNF): where each is a literal (an atomic proposition or the negation of one). In short: . Every propositional formula is equivalent to a formula in conjunctive normal form (CNF): where each is a literal. In short: . How hard is it to check if CNF formula is a tautology? How about DNF? How about checking for satisfiability instead? 20
  • 21. Connectives From CNF (or DNF) it follows that no connectives other than are really needed. Since is equivalent to , we only need . Likewise, is sufficient. Likewise, is sufficient. But is not sufficient. NAND Consider the binary connective . Claim: alone is sufficient. 21
  • 22. Deciding satisfiability The fastest known algorithms for deciding propositional satisfiability are based on the Davis-Putnam Algorithm. A unit clause is a clause that consists of a single literal. function Satisfiable (clause list S) returns boolean; /* unit propagation */ repeat for each unit clause do delete from every clause containing delete from every clause of in which it occurs end for if is empty then return TRUE else if null clause is in then return FALSE end if until no further changes result end repeat /* splitting */ choose a literal occurring in if Satisfiable ( ) then return TRUE else if Satisfiable ( then return TRUE else return FALSE end if end function 22