SlideShare a Scribd company logo
Dr.Nermeen Kame
Cairo University
Fall 2022
Introduction to Logic
Propositional Logic
Syntax of Propositional Logic
Propositional Constants
Logical Operators
Semantics
Truth Assignments for propositional constants
Meaning of logical operators
Evaluation
Truth Assignments to values of compound sentences
Satisfaction
Values of compound sentences to truth assignments
Truth Tables
Agenda
A propositional vocablary is a set/sequence of primitive
symbols, called proposition constants.
Given a propositional vocabulary, a propositional
sentence is either (1) a member of the vocabulary or
(2) a compound expression formed from members of the
vocabulary and logical operators and parentheses.
(Details to follow.)
A propositional language is the set of all propositional
sentences that can be formed from a propositional
vocabulary.
Propositional Languages
By convention (in this course), proposition constants are
written as strings of alphanumeric characters beginning
with a lower case letter.
Examples:
raining
r32aining
rAiNiNg
rainingorsnowing
Non-Examples:
324567
raining.or.snowing
Proposition Constants
Negations:
¬raining
The argument of a negation is called the target.
Conjunctions:
(raining Ù snowing)
The arguments of a conjunction are called conjuncts.
Disjunctions:
(raining Ú snowing)
The arguments of a disjunction are called disjuncts.
Compound Sentences (part I)
Implications:
(raining Þ cloudy)
The left argument of an implication is the antecedent.
The right argument is the consequent.
Equivalences:
(cloudy Û raining)
Compound Sentences (part II)
¬raining
(raining Ù snowing)
(raining Ú snowing)
(raining Þ cloudy)
(cloudy Û raining)
¬(raining Ù snowing)
((raining Ù snowing) Þ cloudy)
(cloudy Þ (raining Ù snowing))
((cloudy Ù wet) Û (raining Ú snowing))
(¬raining Þ (cloudy Þ snowing))
Nested Compound Sentences
Dropping Parentheses is good:
(p Ù q) ® p Ù q
But it can lead to ambiguities:
((p Ú q) Ù r) ® p Ú q Ù r
(p Ú (q Ù r)) ® p Ú q Ù r
Parentheses Removal
Parentheses can be dropped when the structure of an
expression can be determined by precedence.
¬
Ù
Ú
Þ
Û
An operand surrounded by operators associates with
operator of higher precedence.
¬p Ú q ® ((¬p) Ú q)
p Ú q Ù r ® (p Ú (q Ù r))
p Ù q Þ r ® ((p Ù q) Þ r)
p Þ q Û r ® ((p Þ q) Û r)
Precedence
If surrounded by two occurrences of Ù or Ú, the operand
associates with the operator to the left.
p Ù q Ù r ® ((p Ù q) Ù r)
p Ú q Ú r ® ((p Ú q) Ú r)
If surrounded by two occurrences of Þ or Û, the
operand associates with the operator to the right.
p Þ q Þ r ® (p Þ (q Þ r))
p Û q Û r ® (p Û (q Û r))
Precedence (continued)
(a) All purple mushrooms are poisonous.
(b) A mushroom is poisonous only if it is purple.
(c) A mushroom is not poisonous unless it is purple.
(d) No purple mushroom is poisonous.
Natural Language Examples
Consider a propositional language with three proposition
constants—mushroom, purple, and poisonous—each
indicating the property suggested by its spelling. Using
these proposition constants, encode the following
English sentences as Propositional Logic sentences.
Vocabulary: purple, mushroom, poisonous
Natural Language Examples
Consider a propositional language with three proposition
constants—mushroom, purple, and poisonous—each
indicating the property suggested by its spelling. Using
these proposition constants, encode the following
English sentences as Propositional Logic sentences.
Vocabulary: purple, mushroom, poisonous
Purple mushrooms are poisonous.
mushroom Ù purple Þ poisonous
mushroom Þ (purple Þ poisonous)
Natural Language Examples
Vocabulary: purple, mushroom, poisonous
A mushroom is poisonous only if it is purple.
mushroom Þ (¬purple Þ ¬poisonous)
mushroom Þ (poisonous Þ purple)
mushroom Ù poisonous Þ purple
Natural Language Examples
Vocabulary: purple, mushroom, poisonous
A mushroom is not poisonous unless it is purple.
mushroom Þ (¬purple Þ ¬poisonous)
mushroom Þ (poisonous Þ purple)
mushroom Ù poisonous Þ purple
Natural Language Examples
Vocabulary: purple, mushroom, poisonous
No purple mushroom is poisonous
¬(mushroom Ù poisonous Ù purple)
mushroom Ù poisonous Þ ¬purple
Natural Language Examples
A propositional interpretation is an association between
the propositional constants in a propositional language
and the values T or F. (Later, written as 1 and 0.)
We sometimes view an interpretation as a Boolean vector
of values for the items in the signature of the language
(when the signature is ordered).
i = TFT
Propositional Interpretation
A sentential interpretation is an association between the
sentences in a propositional language and the truth values
T or F.
pi = T (p Ú q)i = T
qi = F (¬q Ú r)i = T
ri = T ((p Ú q) Ù (¬q Ú r))i = T
A propositional interpretation defines a sentential
interpretation by application of operator semantics.
Sentential Interpretation
Negation:
For example, if the interpretation of p is F, then the
interpretation of ¬p is T.
For example, if the interpretation of (pÙq) is T, then the
interpretation of ¬(pÙq) is F.
Operator Semantics
Conjunction: Disjunction:
NB: The type of disjunction here is called inclusive or,
which says that a disjunction is true if and only if at least
one of its disjuncts is true. This contrasts with exclusive
or, which says that a disjunction is true if and only if an
odd number of its disjuncts is true.
Operator Semantics (continued)
Implication:
NB: The semantics of implication here is called material
implication. Any implication is true if the antecedent is
false, whether or not there is a connection to the
consequent.
Operator Semantics (continued)
Equivalence:
Operator Semantics (concluded)
Interpretation i:
Compound Sentence
(p Ú q) Ù (¬q Ú r)
Evaluation
(T Ú F) Ù (¬F Ú T)
(T Ú F) Ù (T Ú T)
T Ù T
T
A truth table is a table of all possible interpretations
for the propositional constants in a language.
One column per constant.
One row per interpretation.
For a language with n constants,
there are 2n interpretations.
Truth Tables
Evaluation:
Satisfaction:
Evaluation versus Satisfaction
Method to find all propositional interpretations that
satisfy a given set of sentences:
(1)Form a truth table for the propositional constants.
(2) For each sentence in the set and each row in the truth
table, check whether the row satisfies the sentence. If
not, cross out the row.
(3) Any row remaining satisfies all sentences in the set.
(Note that there might be more than one.)
Satisfaction
qÞr
Satisfaction Example
qÞr
p ÞqÙr
Satisfaction Example (continued)
qÞr
p ÞqÙr
¬r
Satisfaction Example (concluded)
EXAMPLE–NATURAL LANGUAGE
The following examples concern three properties of people, and
we assign a different proposition constant to each of these
properties. We use the constant c to mean that a person is cool.
We use the constant f to mean that a person is funny. And we
use the constant p to mean that a person is popular.
EXAMPLE–NATURAL LANGUAGE
consider the English sentence
- If a person is cool or funny, then he is popular.
- A person is popular only if he is either cool or funny
- A person is popular if and only if he is either cool or funny.
- There is no one who is both cool and funny.
EXAMPLE–NATURAL LANGUAGE
Suppose we were to imagine a person who is cool and funny
and popular, i.e., the proposition constants c and f and p are
all true.
- Evaluate the sentence
- Evaluate the sentence
EXAMPLE–NATURAL LANGUAGE
Suppose we were to imagine a person who is cool and funny
and popular, i.e., the proposition constants c and f and p are
all true.
- Evaluate the sentence
Exercise 1
Consider a truth assignment in which p is true, q is false, r is
true. Use this truth assignment to evaluate the following
sentences.
Exercise 2
Consider the sentences shown below. There are three
proposition constants here, meaning that there are eight
possible truth assignments. How many of these assignments
satisfy all of these sentences?

More Related Content

PPTX
Math in the modern world math as a language.pptx
PPTX
Chapter1 part1 : PROPOSITIONAL LOGIC || DISCRETE MATHEMATICS
PPTX
Chapter1p1.pptx
PDF
Propositional Logic Discrete Mathematics
PDF
General Mathematics. Quarter 2 Module 5.
DOCX
DOCX
PPT
Math in the modern world math as a language.pptx
Chapter1 part1 : PROPOSITIONAL LOGIC || DISCRETE MATHEMATICS
Chapter1p1.pptx
Propositional Logic Discrete Mathematics
General Mathematics. Quarter 2 Module 5.

Similar to 2-lecture_01.pdf (20)

PPTX
LOGIC.pptx. To uphold certainty in validity of mathematical statements or to ...
PPT
Propositional And First-Order Logic
PDF
Math logic student
PPT
desmath(1).ppt
PDF
Chapter 01 - p1.pdf
PPTX
Knnowledge representation and logic lec 11 to lec 15
PPTX
AI Propositional logic
PPTX
Logic in Computer Science Unit 2 (1).pptx
PPTX
Chapter1p1
PDF
Mathematical Logic
PPTX
Mathematical Logic Module 2-2 Math to the Modern World
PPT
PPTX
Drinkfromme.pptx
PPTX
CM 01 CP 02 Topic 04 Some Fundamentals of Logic.pptx
PPT
First order predicate logic - Artificial Intelligence
PPTX
logicj-160412050513.pptx
PPTX
Lecture_-_Logic.pptttttttttttttr5rr55rtt
DOCX
Propositional logic is a good vehicle to introduce basic properties of logic
PPTX
LOGIC in general mathematics123456789011
LOGIC.pptx. To uphold certainty in validity of mathematical statements or to ...
Propositional And First-Order Logic
Math logic student
desmath(1).ppt
Chapter 01 - p1.pdf
Knnowledge representation and logic lec 11 to lec 15
AI Propositional logic
Logic in Computer Science Unit 2 (1).pptx
Chapter1p1
Mathematical Logic
Mathematical Logic Module 2-2 Math to the Modern World
Drinkfromme.pptx
CM 01 CP 02 Topic 04 Some Fundamentals of Logic.pptx
First order predicate logic - Artificial Intelligence
logicj-160412050513.pptx
Lecture_-_Logic.pptttttttttttttr5rr55rtt
Propositional logic is a good vehicle to introduce basic properties of logic
LOGIC in general mathematics123456789011
Ad

Recently uploaded (20)

PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
advance database management system book.pdf
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Classroom Observation Tools for Teachers
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Hazard Identification & Risk Assessment .pdf
Unit 4 Skeletal System.ppt.pptxopresentatiom
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
advance database management system book.pdf
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Final Presentation General Medicine 03-08-2024.pptx
Weekly quiz Compilation Jan -July 25.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Classroom Observation Tools for Teachers
202450812 BayCHI UCSC-SV 20250812 v17.pptx
RMMM.pdf make it easy to upload and study
Practical Manual AGRO-233 Principles and Practices of Natural Farming
A systematic review of self-coping strategies used by university students to ...
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Paper A Mock Exam 9_ Attempt review.pdf.
History, Philosophy and sociology of education (1).pptx
Hazard Identification & Risk Assessment .pdf
Ad

2-lecture_01.pdf

  • 1. Dr.Nermeen Kame Cairo University Fall 2022 Introduction to Logic Propositional Logic
  • 2. Syntax of Propositional Logic Propositional Constants Logical Operators Semantics Truth Assignments for propositional constants Meaning of logical operators Evaluation Truth Assignments to values of compound sentences Satisfaction Values of compound sentences to truth assignments Truth Tables Agenda
  • 3. A propositional vocablary is a set/sequence of primitive symbols, called proposition constants. Given a propositional vocabulary, a propositional sentence is either (1) a member of the vocabulary or (2) a compound expression formed from members of the vocabulary and logical operators and parentheses. (Details to follow.) A propositional language is the set of all propositional sentences that can be formed from a propositional vocabulary. Propositional Languages
  • 4. By convention (in this course), proposition constants are written as strings of alphanumeric characters beginning with a lower case letter. Examples: raining r32aining rAiNiNg rainingorsnowing Non-Examples: 324567 raining.or.snowing Proposition Constants
  • 5. Negations: ¬raining The argument of a negation is called the target. Conjunctions: (raining Ù snowing) The arguments of a conjunction are called conjuncts. Disjunctions: (raining Ú snowing) The arguments of a disjunction are called disjuncts. Compound Sentences (part I)
  • 6. Implications: (raining Þ cloudy) The left argument of an implication is the antecedent. The right argument is the consequent. Equivalences: (cloudy Û raining) Compound Sentences (part II)
  • 7. ¬raining (raining Ù snowing) (raining Ú snowing) (raining Þ cloudy) (cloudy Û raining) ¬(raining Ù snowing) ((raining Ù snowing) Þ cloudy) (cloudy Þ (raining Ù snowing)) ((cloudy Ù wet) Û (raining Ú snowing)) (¬raining Þ (cloudy Þ snowing)) Nested Compound Sentences
  • 8. Dropping Parentheses is good: (p Ù q) ® p Ù q But it can lead to ambiguities: ((p Ú q) Ù r) ® p Ú q Ù r (p Ú (q Ù r)) ® p Ú q Ù r Parentheses Removal
  • 9. Parentheses can be dropped when the structure of an expression can be determined by precedence. ¬ Ù Ú Þ Û An operand surrounded by operators associates with operator of higher precedence. ¬p Ú q ® ((¬p) Ú q) p Ú q Ù r ® (p Ú (q Ù r)) p Ù q Þ r ® ((p Ù q) Þ r) p Þ q Û r ® ((p Þ q) Û r) Precedence
  • 10. If surrounded by two occurrences of Ù or Ú, the operand associates with the operator to the left. p Ù q Ù r ® ((p Ù q) Ù r) p Ú q Ú r ® ((p Ú q) Ú r) If surrounded by two occurrences of Þ or Û, the operand associates with the operator to the right. p Þ q Þ r ® (p Þ (q Þ r)) p Û q Û r ® (p Û (q Û r)) Precedence (continued)
  • 11. (a) All purple mushrooms are poisonous. (b) A mushroom is poisonous only if it is purple. (c) A mushroom is not poisonous unless it is purple. (d) No purple mushroom is poisonous. Natural Language Examples Consider a propositional language with three proposition constants—mushroom, purple, and poisonous—each indicating the property suggested by its spelling. Using these proposition constants, encode the following English sentences as Propositional Logic sentences.
  • 12. Vocabulary: purple, mushroom, poisonous Natural Language Examples Consider a propositional language with three proposition constants—mushroom, purple, and poisonous—each indicating the property suggested by its spelling. Using these proposition constants, encode the following English sentences as Propositional Logic sentences.
  • 13. Vocabulary: purple, mushroom, poisonous Purple mushrooms are poisonous. mushroom Ù purple Þ poisonous mushroom Þ (purple Þ poisonous) Natural Language Examples
  • 14. Vocabulary: purple, mushroom, poisonous A mushroom is poisonous only if it is purple. mushroom Þ (¬purple Þ ¬poisonous) mushroom Þ (poisonous Þ purple) mushroom Ù poisonous Þ purple Natural Language Examples
  • 15. Vocabulary: purple, mushroom, poisonous A mushroom is not poisonous unless it is purple. mushroom Þ (¬purple Þ ¬poisonous) mushroom Þ (poisonous Þ purple) mushroom Ù poisonous Þ purple Natural Language Examples
  • 16. Vocabulary: purple, mushroom, poisonous No purple mushroom is poisonous ¬(mushroom Ù poisonous Ù purple) mushroom Ù poisonous Þ ¬purple Natural Language Examples
  • 17. A propositional interpretation is an association between the propositional constants in a propositional language and the values T or F. (Later, written as 1 and 0.) We sometimes view an interpretation as a Boolean vector of values for the items in the signature of the language (when the signature is ordered). i = TFT Propositional Interpretation
  • 18. A sentential interpretation is an association between the sentences in a propositional language and the truth values T or F. pi = T (p Ú q)i = T qi = F (¬q Ú r)i = T ri = T ((p Ú q) Ù (¬q Ú r))i = T A propositional interpretation defines a sentential interpretation by application of operator semantics. Sentential Interpretation
  • 19. Negation: For example, if the interpretation of p is F, then the interpretation of ¬p is T. For example, if the interpretation of (pÙq) is T, then the interpretation of ¬(pÙq) is F. Operator Semantics
  • 20. Conjunction: Disjunction: NB: The type of disjunction here is called inclusive or, which says that a disjunction is true if and only if at least one of its disjuncts is true. This contrasts with exclusive or, which says that a disjunction is true if and only if an odd number of its disjuncts is true. Operator Semantics (continued)
  • 21. Implication: NB: The semantics of implication here is called material implication. Any implication is true if the antecedent is false, whether or not there is a connection to the consequent. Operator Semantics (continued)
  • 23. Interpretation i: Compound Sentence (p Ú q) Ù (¬q Ú r) Evaluation (T Ú F) Ù (¬F Ú T) (T Ú F) Ù (T Ú T) T Ù T T
  • 24. A truth table is a table of all possible interpretations for the propositional constants in a language. One column per constant. One row per interpretation. For a language with n constants, there are 2n interpretations. Truth Tables
  • 26. Method to find all propositional interpretations that satisfy a given set of sentences: (1)Form a truth table for the propositional constants. (2) For each sentence in the set and each row in the truth table, check whether the row satisfies the sentence. If not, cross out the row. (3) Any row remaining satisfies all sentences in the set. (Note that there might be more than one.) Satisfaction
  • 30. EXAMPLE–NATURAL LANGUAGE The following examples concern three properties of people, and we assign a different proposition constant to each of these properties. We use the constant c to mean that a person is cool. We use the constant f to mean that a person is funny. And we use the constant p to mean that a person is popular.
  • 31. EXAMPLE–NATURAL LANGUAGE consider the English sentence - If a person is cool or funny, then he is popular. - A person is popular only if he is either cool or funny - A person is popular if and only if he is either cool or funny. - There is no one who is both cool and funny.
  • 32. EXAMPLE–NATURAL LANGUAGE Suppose we were to imagine a person who is cool and funny and popular, i.e., the proposition constants c and f and p are all true. - Evaluate the sentence - Evaluate the sentence
  • 33. EXAMPLE–NATURAL LANGUAGE Suppose we were to imagine a person who is cool and funny and popular, i.e., the proposition constants c and f and p are all true. - Evaluate the sentence
  • 34. Exercise 1 Consider a truth assignment in which p is true, q is false, r is true. Use this truth assignment to evaluate the following sentences.
  • 35. Exercise 2 Consider the sentences shown below. There are three proposition constants here, meaning that there are eight possible truth assignments. How many of these assignments satisfy all of these sentences?