0% found this document useful (0 votes)
21 views21 pages

AI Introduction & Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views21 pages

AI Introduction & Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Introduction to propositional

logic
Artificial intelligence
• Artificial Intelligence is the subfield of
Computer Science devoted to developing
programs that enable computers to display
behavior that can (broadly) be characterized
as intelligent.
How?
logic
• Logic refers to both the study of modes of
reasoning (which are valid and which are
fallacious) and the use of valid reasoning.
• It is studied primarily in the disciplines of
philosophy, mathematics, semantics, and
computer science.
• It examines general forms that arguments may
take.
• In mathematics, it is the study of valid inferences
within some formal language
logic
• Symbolic logic is the study of symbolic abstractions that
capture the formal features of logical inference.
• Symbolic logic is often divided into two branches:
– Propositional logic and
– Predicate logic.

• Mathematical logic is an extension of symbolic logic into


other areas, in particular to the study of model theory, proof
theory, set theory, and recursion theory.
Propositional logic
• Propositional Calculus is the study of the
logical relationships between propositions. A
proposition will be any sentence that is either
true or false, but not both.

• A simple language that is useful for showing


key ideas and definitions
Propositional logic
• User defines a set of propositional symbols,
like P and Q. User defines the semantics of
each of these symbols. For example,
– P means "It is hot"
– Q means "It is humid"
– R means "It is raining"
Propositional logic
• We can build compound propositions by using
logical connectives.
• Examples of compound propositions is "Snow
is white and the sky is clear“,
“if Mary not at home then Mary at school”
• We will use 5 logical connectors:
 (not), (and), (or),  (if-then),  (if and only
if).
Propositional logic
• What is the meaning of the following PL
sentences:
– (P  Q)  R
–QP
–Q
– P  Q  (P  Q)  (Q  P)
Propositional logic
– (P  Q)  R (here meaning "If it is hot and humid,
then it is raining")
– Q  P (here meaning "If it is humid, then it is
hot")
– Q (here meaning "It is humid.")
– P  Q  (P  Q)  (Q  P) (here meaning “if it is
hot then it is humid, and if it is humid then it is
hot”)
•Giving the following sentences:
P: Ali is a good teacher
Q: Ahmed is a good teacher
R: Ali’s students hate math
S: Ahmed’s students hate math

•Express the following into a propositional logic:


1. Ali is a good teacher and his students do not hate math.
2. Either Ali is a good teacher, or his students hate math.
Either Ahmed is a good teacher or he is not.
3. Ali’s students both hate and do not hate math.
4. It is not true that either Ahmed is a good teacher or his
students hate math.
Answer
1. P Λ¬R
2. P νR
3. Q ν¬Q
4. R Λ¬R
5. R Λ¬R
6. ¬(Q νS)
Propositional logic
• Given the truth values of all of the constituent
symbols in a sentence, that sentence can be
"evaluated" to determine its truth value (True
or False). This is called an interpretation of the
sentence.
Example
• Construct the truth table for the following
formula (evaluate the interpreation):
¬ (P ΛQ) Λ(¬R).
Answer
Propositional logic
• The formula is true in every interpretation.
Therefore it is a valid formula.
Propositional logic
• The formula is false in every interpretation.
Therefore it is an inconsistent formula.
Determine whether the following
formula valid or inconsistent
• ( (P  Q )   Q )   P
It is a valid formula !
Determine whether the following
formula valid or inconsistent
• ( (P  Q )   Q )  P
It is an inconsistent formula !

You might also like