Sei sulla pagina 1di 9

CMPUT 272 (Stewart) University of Alberta Lecture 1

Reading: Epp 2.1, 2.2

Symbolic / Formal Logic


• a language: uses symbols to represent statements
• rules of inference: patterns for reasoning about symbolic statement forms

We begin with propositional logic – we will study predicate logic later.

Definition. A statement (or proposition) is a sentence that is true or false.

Examples: The earth is a sphere.


3≤2
The earth is not a sphere and 3 ≤ 2.
The third example is a compound statement: a combination of simpler state-
ments. Whether a compound statement is true or false depends on whether
its component statements are true or false, and how they are combined.

We use variables to encode simple statements, and combine variables with


logical connectives to encode compound statements.

The logical connectives (operators) are:


∧ and
∨ or
∼ not in some textbooks the symbol ¬ is used for not
→ if-then sometimes called implies
↔ if-and-only-if
Examples:
p = “The earth is a sphere.”
q = “3 ≤ 2”
“The earth is not a sphere and 3 ≤ 2.” ∼p∧q

1
Definition. A statement form is an expression made up of statement variables,
logical constants, logical connectives, and parentheses, as follows:
1. Each statement variable is a statement form.
2. Each logical constant (t, c) is a statement form.
3. If p is a statement form then so is ∼ p. negation
4. If p and q are statement forms then so are
(p ∧ q) conjunction
(p ∨ q) disjunction
(p → q) implication / conditional
(p ↔ q) equivalence / biconditional
5. All statement forms of propositional logic are obtained as above.

Example: Show that this is a statement form:


( ( p ∧ q ) ∨ ( ∼r ∧ ( r ↔ p ) ) )

2
Each statement form has a truth value, T (true) or F (false), which depends
on the truth values of its constants and variables, and the meanings of the
connectives.

• The truth value of the logical constant t is T.


• The truth value of the logical constant c is F.
• The truth values of all other statement forms depend on
– the truth values of the variables and
– the definitions of the logical connectives.

3
Each logical connective is defined by a truth table:
not – negation
p ∼p
F T
T F

and – conjunction
p q (p ∧ q)
F F F
F T F
T F F
T T T

or – disjunction
p q (p ∨ q)
F F F
F T T
T F T
T T T

if-then / implies – conditional / implication


p q (p → q)
F F T
F T T
T F F
T T T

if and only if / iff – biconditional / equivalence


p q (p ↔ q)
F F T
F T F
T F F
T T T

4
The truth value of a compound statement form can be evaluated by sub-
stituting in the truth values of the statement variables and combining them
using the truth tables for the logical connectives.

Example:

Suppose the statement variables p, q, and r have the following truth values:

p is T , q is F , and r is T .

What is the truth value of the following statement form?

( ( p ∧ q ) ∨ ( ∼r ∧ ( r ↔ p ) ) )

5
From now on, we adopt an order of evaluation of the connectives and omit
unnecessary parentheses (but use enough parentheses to avoid ambiguity):

∧, ∨
→, ↔

The main connective of a compound statement form is


• the last connective added in a construction of the (fully parenthesized)
statement form according to the definition
• the last connective to be evaluated when determining the truth value of
the statement form

6
To express the truth values of a statement form under all possible truth values
of the statement variables, use a truth table.

Example.
p q r p∧q ∼r r↔p ∼ r ∧ (r ↔ p) (p ∧ q) ∨ (∼ r ∧ (r ↔ p))

F F F

F F T

F T F

F T T

T F F

T F T

T T F

T T T

There are 2k rows in the truth table for a statement form with k variables.

7
The meaning of →
p→q

antecedent - consequent
hypothesis - conclusion
LHS - RHS

A conditional statement means:


if the LHS is true, then the RHS is true.

When are these statements false?


• “If you get 90% then you pass the course.”

• “If a candy bar is labelled peanut-free then it is peanut-free.”

• “If 0=1 then 5=7.”

8
On the island of knights and knaves
A says: “If I am a knight then so is B.”

Is there enough information to determine what A and B are?


knights, knaves, or one of each?

Potrebbero piacerti anche