0% found this document useful (0 votes)
10 views18 pages

Disc Lec2 The Foundations of Logic - Part I

discrete structures

Uploaded by

Basma Mostafa
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)
10 views18 pages

Disc Lec2 The Foundations of Logic - Part I

discrete structures

Uploaded by

Basma Mostafa
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/ 18

FACULTY OF ARTIFICIAL INTELLIGENCE

AND INFORMATICS

Discrete Structure (CS 104)

The Foundations: Logic and Proofs

Part (I)
Chapter 1: The Foundations- Logic
and Proofs

1. Propositional Logic
2. Applications of Propositional Logic
3. Propositional Equivalences
Logic is Crucial for
Mathematical Reasoning
• The rules of logic specify the meaning of
mathematical statements and help us reason with
statements such as:

“There exists an integer that is not the sum of


two squares”

• Used for designing electronic circuitry


Digital Logic
Propositional Logic
Propositional Logic

• Propositional Logic is a system based on


propositions.
• A proposition is a (declarative) statement that is either
true or false (not both).
• We say that the truth value of a proposition is either
true (T) or false (F).
• Corresponds to 1 and 0 in digital circuits
Propositional logic
• Simple types of statements, called propositions, are
treated as atomic building blocks for more complex
statements
1) Alexandria is a port or a holiday resort.
2) Alexandria is not a port.
Therefore, Alexandria is a holiday resort
Proposition
Consider the following sentences.

1. What time is it?


2. Read this carefully.
3. x + 1 = 2.
4. x + y = z.

Sentences 1 and 2 are not propositions because they


are not declarative sentences.
Sentences 3 and 4 are not propositions because they
are neither true nor false.
Logical Operators
• About a dozen logical operators
– Similar to algebraic operators + * - /
• We use letters to denote propositional variables
(or sentential variables)
p, q, r, s,…
• In the following examples,
p = “Today is Friday”
q = “Today is my birthday”
Propositional connectives

• Propositional logic has four connectives

Name Read as Symbol


negation ‘not’ ¬
conjunction ‘and’ ∧
disjunction ‘or’ ∨
implication ‘if…then…’ 
Logical operators: Not

• A “not” operation switches (negates) the


truth value
• Symbol: ¬ or ~ p ¬p
• ¬p = “Today is not Friday” T F
F T
Logical operators: And

• An “and” operation is true if both


operands are true
p q p∧q
• Symbol: ∧
T T T
p = “Today is Friday “ T F F
q = “today is my birthday“ F T F
• p∧q = “Today is Friday and today is F F F
my birthday”
Logical operators: OR

• An “or” operation is true if either operands are true


p q p∨q
• Symbol: ∨
T T T
p = “Today is Friday “ T F T
q = “today is my birthday“ F T T
• p∨q = “Today is Friday or F F F

today is my birthday (or possibly both)”


Logical operators: XOR

• An “XOR” operation is true if one of p and q is true

• Symbol:
p = “Today is Friday “
q = “today is my birthday“
Logical operators: Conditional

p q p→q
T T T
T F F
F T T
F F T
Logical operators: Conditional
• A conditional means “if p then q”
• Symbol: →
• p→q = “If today is
Friday, then today p q p→q

is my birthday” T T T
T F F
• p→q=¬p∨q F T T
F F T
Logical operators: Bi-conditional

EXAMPLE
p = “You can take the flight,”
q = “You buy a ticket.”
Then p q is the statement

Solution
“You can take the flight if and only if you buy a
ticket.”
Boolean Operators Summary
not not and or xor conditional Bi-conditional

p q ¬p ¬q p∧q p∨q p⊕q p→q p↔q

T T F F T T F T T

T F F T F T T F F

F T T F F T T T F

F F T T F F F T T

• Learn what they mean, don’t just memorize the


table!

You might also like