SlideShare a Scribd company logo
1 of 25
Propositional and
Predicate Logic
27 October 2022
Computer Science Department,
University of Sahiwal
1
Introduction
• classical logic that are necessary for the
understanding of formal development methods
• begin by presenting the propositional logic
– which deals with simple truthvalued
– statements that can be combined according to a set of
rules
• Further, present the predicate logic, which is an
essential tool needed in the formal specification
27 October 2022
Computer Science Department,
University of Sahiwal
2
Propositions
In classical logic, propositions are
statements that are either
TRUE or FALSE.
27 October 2022
Computer Science Department,
University of Sahiwal
3
Propositions Examples (True)
• The following are examples of propositions
that evaluate to TRUE:
There are seven days in a week
Paris is the capital of France
2 + 4 = 6
27 October 2022
Computer Science Department,
University of Sahiwal
4
Propositions Examples (False)
• The following propositions evaluate to FALSE:
The angles of a triangle add up to 360
London is the capital of France
2 - 4 = 7
27 October 2022
Computer Science Department,
University of Sahiwal
5
Examples with Symbol
• In mathematics we often represent a
proposition symbolically by a variable name
such as P or Q.
• For example:
P: I go shopping on Wednesdays
Q: 102.001 > 101.31
27 October 2022
Computer Science Department,
University of Sahiwal
6
• Occasions arise when it is not possible to
evaluate expressions precisely – maybe a
program terminated incorrectly, or perhaps
somebody tried to evaluate the square root of
a negative integer.
27 October 2022
Computer Science Department,
University of Sahiwal
7
• It is possible to account for such situations by
defining a three-valued logic, which allows a
proposition to take the value UNDEFINED as
well as TRUE or FALSE.
27 October 2022
Computer Science Department,
University of Sahiwal
8
Logical Connectives
• Simple propositions can be combined into
compound statements by operators called
logical connectives.
27 October 2022
Computer Science Department,
University of Sahiwal
9
Truth Tables
• The purpose of defining these connectives is
to provide a rigorous framework that gives
precise meaning to such words as ‘AND’ and
‘OR’ that occur in the natural language. The
way we give semantic meaning to these
connectives is to provide tables known as
truth tables,
27 October 2022
Computer Science Department,
University of Sahiwal
10
The AND operator
• The operator known as AND is represented by
the symbol “^”.
• The statement P AND Q is therefore
represented by:
P ^ Q
27 October 2022
Computer Science Department,
University of Sahiwal
11
Cont.
• The precise meaning of this operator is given
in the following truth table, where TRUE and
FALSE are represented by T and F, respectively.
• you can see that the first two columns of the
truth table provide all the possible
combinations of the values of P and Q.
• The final column shows the corresponding
value of the combined statement P Q.
27 October 2022
Computer Science Department,
University of Sahiwal
12
Truth table “AND” Operator
P Q P ^ Q
T T T
T F F
F T F
F F F
27 October 2022
Computer Science Department,
University of Sahiwal
13
Conjunction
• Combining two propositions with the AND
operator is known as conjunction.
• Individual proposition in the compound
statement is known as a conjunct.
27 October 2022
Computer Science Department,
University of Sahiwal
14
The OR operator
• The operator known as or is represented by
the symbol .
• The statement P or Q is therefore represented
by:
P V Q
27 October 2022
Computer Science Department,
University of Sahiwal
15
OR Example
• Thus if P represented the statement It is
raining and Q represented the statement
Today is Tuesday then:
• P v Q would represent the statement It is
raining or today is Tuesday.
• The precise meaning of this operator is given
in the following truth table.
27 October 2022
Computer Science Department,
University of Sahiwal
16
Truth table “OR” Operator
P Q P Q
T T T
T F T
F T T
F F F
27 October 2022
Computer Science Department,
University of Sahiwal
17
Disjunction
• Combining two propositions with the or
operator is known as disjunction.
• individual proposition in the compound
statement is known as a disjunct.
27 October 2022
Computer Science Department,
University of Sahiwal
18
The implication operator
• In defining an implication operator we
attempt to give meaning to the expression P
implies Q.
• The implication operator is represented by the
symbol ⇒. The statement P implies Q is
therefore represented by:
P ⇒ Q
27 October 2022
Computer Science Department,
University of Sahiwal
19
Cont.
• An alternative way of expressing implication is
if P then Q.
• Thus if P represented the statement “It is
Wednesday and Q represented the statement
I do the ironing” then:
• P ⇒ Q would represent the statement “If it is
Wednesday I do the ironing”.
• The truth table for implication appears next,
and requires some explanation.
27 October 2022
Computer Science Department,
University of Sahiwal
20
Truth table “implication” Operator
P Q P⇒Q
T T T
T F F
F T T
F F T
27 October 2022
Computer Science Department,
University of Sahiwal
21
Cont.
• The first two rows of the table capture the
central idea of implication: if the first and
second statements are both TRUE, then the
statement that the first implies the second is
also TRUE.
• whereas if the first is TRUE but the second is
not, then the statement that the first implies
the second is FALSE.
27 October 2022
Computer Science Department,
University of Sahiwal
22
Further Readings
• Palgrave Macmillan Formal Software
Development From VDM to Java by Quentin
Charatan and Aaron Kans (Chapter 2)
27 October 2022
Computer Science Department,
University of Sahiwal
23
Questions
Any Question Please?
You can contact me at: umber@uosahiwal.edu.pk
Your Query will be answered within one working day.
27 October 2022
Computer Science Department,
University of Sahiwal
24
Thanks
27 October 2022
Computer Science Department,
University of Sahiwal
25

More Related Content

More from Malik252995 (6)

Required
Required Required
Required
 
Required
Required Required
Required
 
Required
Required Required
Required
 
Formal Method
Formal Method Formal Method
Formal Method
 
Formal Method
Formal Method Formal Method
Formal Method
 
Formal Method
Formal MethodFormal Method
Formal Method
 

Recently uploaded

Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
IJECEIAES
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
drjose256
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
Sampad Kar
 

Recently uploaded (20)

Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
AI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdfAI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdf
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 

Operation Research

  • 1. Propositional and Predicate Logic 27 October 2022 Computer Science Department, University of Sahiwal 1
  • 2. Introduction • classical logic that are necessary for the understanding of formal development methods • begin by presenting the propositional logic – which deals with simple truthvalued – statements that can be combined according to a set of rules • Further, present the predicate logic, which is an essential tool needed in the formal specification 27 October 2022 Computer Science Department, University of Sahiwal 2
  • 3. Propositions In classical logic, propositions are statements that are either TRUE or FALSE. 27 October 2022 Computer Science Department, University of Sahiwal 3
  • 4. Propositions Examples (True) • The following are examples of propositions that evaluate to TRUE: There are seven days in a week Paris is the capital of France 2 + 4 = 6 27 October 2022 Computer Science Department, University of Sahiwal 4
  • 5. Propositions Examples (False) • The following propositions evaluate to FALSE: The angles of a triangle add up to 360 London is the capital of France 2 - 4 = 7 27 October 2022 Computer Science Department, University of Sahiwal 5
  • 6. Examples with Symbol • In mathematics we often represent a proposition symbolically by a variable name such as P or Q. • For example: P: I go shopping on Wednesdays Q: 102.001 > 101.31 27 October 2022 Computer Science Department, University of Sahiwal 6
  • 7. • Occasions arise when it is not possible to evaluate expressions precisely – maybe a program terminated incorrectly, or perhaps somebody tried to evaluate the square root of a negative integer. 27 October 2022 Computer Science Department, University of Sahiwal 7
  • 8. • It is possible to account for such situations by defining a three-valued logic, which allows a proposition to take the value UNDEFINED as well as TRUE or FALSE. 27 October 2022 Computer Science Department, University of Sahiwal 8
  • 9. Logical Connectives • Simple propositions can be combined into compound statements by operators called logical connectives. 27 October 2022 Computer Science Department, University of Sahiwal 9
  • 10. Truth Tables • The purpose of defining these connectives is to provide a rigorous framework that gives precise meaning to such words as ‘AND’ and ‘OR’ that occur in the natural language. The way we give semantic meaning to these connectives is to provide tables known as truth tables, 27 October 2022 Computer Science Department, University of Sahiwal 10
  • 11. The AND operator • The operator known as AND is represented by the symbol “^”. • The statement P AND Q is therefore represented by: P ^ Q 27 October 2022 Computer Science Department, University of Sahiwal 11
  • 12. Cont. • The precise meaning of this operator is given in the following truth table, where TRUE and FALSE are represented by T and F, respectively. • you can see that the first two columns of the truth table provide all the possible combinations of the values of P and Q. • The final column shows the corresponding value of the combined statement P Q. 27 October 2022 Computer Science Department, University of Sahiwal 12
  • 13. Truth table “AND” Operator P Q P ^ Q T T T T F F F T F F F F 27 October 2022 Computer Science Department, University of Sahiwal 13
  • 14. Conjunction • Combining two propositions with the AND operator is known as conjunction. • Individual proposition in the compound statement is known as a conjunct. 27 October 2022 Computer Science Department, University of Sahiwal 14
  • 15. The OR operator • The operator known as or is represented by the symbol . • The statement P or Q is therefore represented by: P V Q 27 October 2022 Computer Science Department, University of Sahiwal 15
  • 16. OR Example • Thus if P represented the statement It is raining and Q represented the statement Today is Tuesday then: • P v Q would represent the statement It is raining or today is Tuesday. • The precise meaning of this operator is given in the following truth table. 27 October 2022 Computer Science Department, University of Sahiwal 16
  • 17. Truth table “OR” Operator P Q P Q T T T T F T F T T F F F 27 October 2022 Computer Science Department, University of Sahiwal 17
  • 18. Disjunction • Combining two propositions with the or operator is known as disjunction. • individual proposition in the compound statement is known as a disjunct. 27 October 2022 Computer Science Department, University of Sahiwal 18
  • 19. The implication operator • In defining an implication operator we attempt to give meaning to the expression P implies Q. • The implication operator is represented by the symbol ⇒. The statement P implies Q is therefore represented by: P ⇒ Q 27 October 2022 Computer Science Department, University of Sahiwal 19
  • 20. Cont. • An alternative way of expressing implication is if P then Q. • Thus if P represented the statement “It is Wednesday and Q represented the statement I do the ironing” then: • P ⇒ Q would represent the statement “If it is Wednesday I do the ironing”. • The truth table for implication appears next, and requires some explanation. 27 October 2022 Computer Science Department, University of Sahiwal 20
  • 21. Truth table “implication” Operator P Q P⇒Q T T T T F F F T T F F T 27 October 2022 Computer Science Department, University of Sahiwal 21
  • 22. Cont. • The first two rows of the table capture the central idea of implication: if the first and second statements are both TRUE, then the statement that the first implies the second is also TRUE. • whereas if the first is TRUE but the second is not, then the statement that the first implies the second is FALSE. 27 October 2022 Computer Science Department, University of Sahiwal 22
  • 23. Further Readings • Palgrave Macmillan Formal Software Development From VDM to Java by Quentin Charatan and Aaron Kans (Chapter 2) 27 October 2022 Computer Science Department, University of Sahiwal 23
  • 24. Questions Any Question Please? You can contact me at: umber@uosahiwal.edu.pk Your Query will be answered within one working day. 27 October 2022 Computer Science Department, University of Sahiwal 24
  • 25. Thanks 27 October 2022 Computer Science Department, University of Sahiwal 25