CH2 - Slides

David W. Agler

The Pennsylvania State University

PL — Symbols, Syntax, and Semantics

PL: The Language of Propositional Logic

PL is a formal language used to study logic. It is comprised of:

  1. a set of symbols—its alphabet;
  2. a syntax—its grammar, expressed as formation rules; and
  3. a semantics—rules for assigning truth values such as \(T\) and \(F\) to well-formed formulas.

PL: Symbols

PL consists of the following symbols:

  1. An infinite number of propositional letters: uppercase Roman letters, with or without subscripted integers, such as \(A_1, A_2, A_3, B, C, \ldots, Z\).
  2. Five truth-functional operators: \(\vee, \rightarrow, \leftrightarrow, \neg,\wedge\)
  3. A left and right parenthesis: ( and ) to indicate the scope of truth-functional operators.

PL - Syntax

PL Formation Rules

Definition

A well-formed formula, or wff, is any formula that can be generated by some combination of the seven formation rules below.

PL Formation Rules Listed

  1. Every propositional letter of PL, such as \(A, B, C\), is a wff.
  2. If \(\phi\) is a wff, then \(\neg(\phi)\) is a wff.
  3. If \(\phi\) and \(\psi\) are wffs, then \((\phi\wedge\psi)\) is a wff.
  4. If \(\phi\) and \(\psi\) are wffs, then \((\phi\vee\psi)\) is a wff.
  5. If \(\phi\) and \(\psi\) are wffs, then \((\phi\rightarrow\psi)\) is a wff.
  6. If \(\phi\) and \(\psi\) are wffs, then \((\phi\leftrightarrow\psi)\) is a wff.
  7. Nothing else is a wff except what can be formed by repeated applications of rules 1–6.

Using the Formation Rules

Let’s construct \((\neg (P)\land Q)\)

Wffs in PL

  1. \(P\)
  2. \(\neg (P)\)
  3. \((P\rightarrow Q)\)
  4. \(\neg((P\vee\neg(Q)))\)
  5. \(\neg(\neg(P\wedge\neg(Q)))\)

Not wffs in PL

  1. \(P\neg\)
  2. \(PQ\)
  3. \(\vee\neg(Q)\)
  4. \(\neg\neg P\wedge\neg Q\vee S\)

Exercise

See book, Ex. 2.10, pp.47

Three Types of Wffs: Atomic Wffs

Definition

An atomic wff is a wff consisting only of a single propositional letter, such as \(P, R, S, D\).

Examples:

  • \(P\)
  • \(Q\)
  • \(A\)
  • \(B_{12}\)

Three Types of Wffs: Complex Wffs

Definition

A complex wff is a wff that contains at least one propositional letter and a truth-functional operator.

Examples:

  • \(\neg(P)\)
  • \((P\wedge Q)\)
  • \((P\rightarrow\neg(A))\)
  • \((A_1\rightarrow B_8)\)

Literal Wffs

Definition

A literal wff, or literal, is either an atomic wff \(P\) or a negated atomic wff \(\neg(P)\).

Examples:

  • \(P\)
  • \(\neg(P)\)
  • \(Q\)
  • \(\neg(Q_1)\)

Exercise

See book, Ex. 2.11, pp.49

Subformulas and Proper Parts

Let \(\phi\) and \(\psi\) be any PL-wffs.

Definition: Proper part

A wff \(\phi\) is a proper part of another wff \(\psi\) if and only if \(\phi\) is a wff that is constructed by the formation rules in the process of constructing \(\psi\) but not \(\psi\) itself.

Definition: Subformula (part)

A subformula (or part) \(\phi\) of \(\psi\) is any wff occurring as a proper part of \(\psi\), including \(\psi\) itself.

Examples

  • \((P\vee Q)\)
  • \((\neg(P)\vee Q)\)
  • \(P\)

Exercises

See book, Ex. 2.12, pp.51

Operator Occurrences

  • Notice that there are two \(\neg\)’s in \(\neg(\neg(P)\rightarrow Q)\)
  • Each \(\neg\) is called an occurrence of the NOT operator.
  • identify an occurrence using whatever description is clearest:
    • “the leftmost NOT”
    • “the NOT next to \(P\)”; or
    • “the outer NOT.”

Exercises

See book, Ex. 2.13, pp.51

Scope

Definition

The scope of an occurrence of an operator in a PL wff \(\phi\) is the smallest subformula of \(\phi\) that contains that occurrence of the operator.

Examples of Scope

  • In \(\neg(P)\), the scope of \(\neg\) is \(\neg(P)\). It is the smallest subformula containing that occurrence of \(\neg\)
  • In \((P\vee Q)\), the scope of \(\vee\) is \((P\vee Q)\).
  • In \((\neg(P)\vee Q)\), the scope of \(\neg\) is \(\neg(P)\), while the scope of \(\vee\) is \((\neg(P)\vee Q)\).

To determine scope

  • To determine scope, you can just build the wff.
  • When the wff that is constructed when that operator is first introduced is the scope of that operator.
  • Let’s determine the scope of the rightmost \(\neg\) in \((\neg (P)\land \neg (Q))\)

Exercises

See book, Ex. 2.14, pp.53

Main Operator

Definition

The main operator of a PL wff is the truth-functional operator whose scope is the entire wff.

Examples of Main Operator

  • The main operator of \(\neg(P)\) is \(\neg\).
  • The main operator of \((P\wedge Q)\) is \(\wedge\).
  • The main operator of \((\neg(P)\vee Q)\) is \(\vee\).
  • The main operator of \(\neg((P\rightarrow Q))\) is \(\neg\).

Exercise

See book, Ex. 2.15, p.54

Simplification

Gross: \(\neg((\neg (P)\rightarrow \neg (Q)))\)

Why parentheses?

  • Parentheses exist so that the scope of the operators is precise (no ambiguity!)
  • \(\neg P\land Q\) could be
    • \(\neg ((P\land Q))\). Main operator is \(\neg\), OR
    • \((\neg (P)\land Q)\). Main operator is \(\land\)

Parentheses Convention 1

Definition - Convention 1

Parentheses may be omitted when applying the final formation rule for a wff \(\phi\) if that rule introduces a connective (\(\land, \lor, \to, \leftrightarrow\)). In other words, after a wff has been constructed, if the first and last symbol of a wff are parentheses, then those outer parentheses may be omitted.

  1. \((P\land Q)\) to \(P\land Q\)
  2. \(((P\land Q)\lor R)\) to \((P\land Q)\lor R\)
  3. \(((P\land Q)\lor (S\land R))\) to \((P\land Q)\lor (S\land R)\)

Parentheses Convention 2

Definition - Convention 2

Whenever the negation formation rule is applied, if the subformula used in its application is either a propositional letter or a negated wff, parentheses may be omitted.

  1. \(\neg (P)\) to \(P\)
  2. \(\neg(\neg (P))\) to \(\neg\neg P\)
  3. \(\neg(\neg (P\land Q))\) to \(\neg\neg (P\land Q)\)
  4. NOT: \(\neg ((P\land Q))\) to \(\neg P\land Q\)

Parentheses Convention 3

Definition - Convention 3

When applying the negation formation rule to a wff that is surrounded by a pair of parenthesis, it is not necessary to add an additional pair of parentheses. In other words, if both sides of pairs of parentheses do not contain any symbols between them, a single pair of parentheses may be omitted.

  1. \(\lnot ((P\land Q))\) to \(\lnot (P\land Q)\)

Exercise

See book, Ex. 2.16, pp.58

Literal Negation

The literal negation of a proposition \(\phi\) is formed by placing parentheses around \(\phi\) and applying the negation formation rule (or performing the operation in reverse).

  1. \(\phi \quad\mapsto\quad \neg(\phi)\)
  2. \(\neg (\phi) \quad\mapsto\quad \phi\)

Examples of Literal Negation

Wff Literal negation of wff
\(P\) \(\neg(P)\)
\((P\rightarrow R)\) \(\neg((P\rightarrow R))\)
\((\neg(P)\wedge R)\) \(\neg((\neg(P)\wedge R))\)

The literal negation of a wff is the negation of the entire formula, not merely a part of it (or the removal of the negation from the entire wff).

Literal Negations?

  1. \(\neg (P\lor \neg Q)\) and \(P\lor \neg Q\)?
  2. \(\neg P\land Q\) and \(P\land Q\)?

Exercise

See book, Ex. 2.17, pp.59

Types of Complex Wffs

Complex wffs can be categorized according to their main operator:

Form Main Operator Type of wff
\(\neg(\phi)\) \(\neg\) Negated wff
\((\phi\wedge \psi)\) \(\wedge\) Conjunction
\((\phi\vee \psi)\) \(\vee\) Disjunction
\((\phi\rightarrow \psi)\) \(\rightarrow\) Conditional
\((\phi\leftrightarrow \psi)\) \(\leftrightarrow\) Biconditional

Components of Complex Wffs

Some parts of complex wffs have special names:

  • A conjunction \((P\wedge R)\) contains two conjuncts, \(P\) and \(R\).
  • A disjunction \((P\vee R)\) contains two disjuncts, \(P\) and \(R\).
  • A conditional \((P\rightarrow R)\) contains an antecedent, \(P\), and a consequent, \(R\).

Negated form of each

Complex wffs can be categorized according to their main operator:

Form Main Operator Type of wff
\(\neg\neg (\phi)\) \(\neg\) Double negation
\(\neg(\phi\wedge \psi)\) \(\neg\) Negated Conjunction
\(\neg (\phi\vee \psi)\) \(\neg\) Negated Disjunction
\(\neg (\phi\rightarrow \psi)\) \(\neg\) Negated Conditional
\(\neg (\phi\leftrightarrow \psi)\) \(\neg\) Negated Biconditional

Exercise

See book, Ex. 2.18, pp.61

You should know

  1. how to ID symbols.
  2. how to ID a wff, its proper parts, subformulas.
  3. how to write a wff in simplified or non-simplified form
  4. how to ID scope and main operator
  5. how to write a wff’s literal negation
  6. the different types of wffs and types of complex wffs

Important

Syntax is fundamental so get a mastery of these skills!

PL – Semantics

PL: Semantics

PL is a set of symbols together with formation rules for combining those symbols. The symbols and wffs produced by the formation rules are meaningless until PL is interpreted.

Function

Definition

A function is a relation between two sets such that each input is related to one and only one output.

Function: Examples

Interpretation and Valuation

The semantics of PL involve two important functions:

  1. Interpretation function
  2. Valuation function

Interpretation Function

Definition

An interpretation of PL is a function that takes propositional letters as input and assigns each one a single truth value, \(T\) or \(F\), as output.

Valuation Defined

Definition

For any interpretation \(\mathscr{I}\), a valuation \(v\) assigns one and only one truth value to each wff in PL such that the following conditions hold.

Valuations

  1. \(v(R)=\mathscr{I}(R)\)
  2. \(v(\neg (\phi))=T\) iff \(v(\phi)=F\).
  3. \(v(\phi\wedge \psi)=T\) iff \(v(\phi)=T\) and \(v(\psi)=T\).
  4. \(v(\phi\vee \psi)=T\) iff \(v(\phi)=T\) or \(v(\psi)=T\).
  5. \(v(\phi\rightarrow \psi)=T\) iff \(v(\phi)=F\) or \(v(\psi)=T\).
  6. \(v(\phi\leftrightarrow \psi)=T\) iff \(v(\phi)=v(\psi)\)

Interpretation and Valuation

flowchart TD
    I["Interpretation in PL"] --> I2["Assigns T or F to propositional letters"]
    I2 --> V["Valuation in PL"]
    V --> V2["Assigns T or F to well-formed formulas"]

Valuation: Truth Tables

Truth tables provide a graphical display of the interpretation and valuation functions.

For one propositional letter:

Interpretation \(P\)
\(\mathscr{I}_1\) \(T\)
\(\mathscr{I}_2\) \(F\)

2 Propositional letters

Interpretation \(P\) \(Q\)
\(\mathscr{I}_1\) T T
\(\mathscr{I}_2\) T F
\(\mathscr{I}_3\) F T
\(\mathscr{I}_4\) F F

3 Propositional letters

Interpretation \(P\) \(Q\) \(R\)
\(\mathscr{I}_1\) T T T
\(\mathscr{I}_2\) T T F
\(\mathscr{I}_3\) T F T
\(\mathscr{I}_4\) T F F
\(\mathscr{I}_5\) F T T
\(\mathscr{I}_6\) F T F
\(\mathscr{I}_7\) F F T
\(\mathscr{I}_8\) F F F

4 Propositional letters

Interpretation \(P\) \(Q\) \(R\) \(S\)
\(\mathscr{I}_1\) T T T T
\(\mathscr{I}_2\) T T F T
\(\mathscr{I}_3\) T F T T
\(\mathscr{I}_4\) T F F T
\(\mathscr{I}_5\) F T T T
\(\mathscr{I}_6\) F T F T
\(\mathscr{I}_7\) F F T T
\(\mathscr{I}_8\) F F F T
\(\mathscr{I}_9\) T T T F
\(\mathscr{I}_{10}\) T T F F
\(\mathscr{I}_{11}\) T F T F
\(\mathscr{I}_{12}\) T F F F
\(\mathscr{I}_{13}\) F T T F
\(\mathscr{I}_{14}\) F T F F
\(\mathscr{I}_{15}\) F F T F
\(\mathscr{I}_{16}\) F F F F

Valuation: Atomic wff

\(v(P)=T = \mathscr{I}(P)\)

\(\mathscr{I}(P)\) \(v(P)\)
T T
F F

Valuation: Negation

\(v(\neg (\phi))=T\) iff \(v(\phi)=F\)

\(\phi\) \(\neg (\phi)\)
T F
F T

Valuation: Conjunction

\(v(\phi\wedge \psi)=T\) iff both \(v(\phi)=T\) and \(v(\psi)=T\).

\(\phi\) \(\psi\) \(\phi\wedge \psi\)
T T T
T F F
F T F
F F F

Valuation: Disjunction

\(v(\phi\vee \psi)=F\) iff both \(v(\phi)=F\) and \(v(\psi)=F\)

\(\phi\) \(\psi\) \(\phi\vee \psi\)
T T T
T F T
F T T
F F F

Equivalently: \(v(\phi\vee \psi)=T\) iff exactly one of the two disjuncts (\(\phi, \psi\)) is T or they are both true.

Valuation: Conditional

\(v(\phi\rightarrow \psi)=F\) iff \(v(\phi)=T\) and \(v(\psi)=F\).

\(\phi\) \(\psi\) \(\phi\rightarrow \psi\)
T T T
T F F
F T T
F F T

Equivalently: \(v(\phi\to \psi)=T\) iff \(v(\phi)=F\) or \(v(\psi)=T\), or both.

Valuation: Biconditional

\(v(\phi\leftrightarrow \psi)=T\) iff \(v(\phi)=v(\psi)\)

\(\phi\) \(\psi\) \(\phi\leftrightarrow \psi\)
T T T
T F F
F T F
F F T

Exercise

See book, Ex. 2.19, p.70

Exercise

See book, Ex. 2.20, p.72

PL – Translation

Atomic Wffs

Begin with a simple English proposition consisting of a subject and a predicate (S is P or S Ps):

  • Tek is kind.
  • The hat is red.
  • Liz runs.

Single letter

Each simple proposition can be translated using a single propositional letter:

  • Tek is kind. Trans: \(T\)
  • The hat is red. Trans: \(H\)
  • Liz runs. Trans: \(L\)

Choosing Letters

  • “John is kind” as \(J\).
  • “John is friendly” cannot also be \(J\)

Negated Wffs - Translation?

\(v(\neg\phi)=T\) iff \(v(\phi)=F\).

  • What (in English) behaves just like this?
  • Add a word / phrase to a sentence \(S\) to make a new sentence \(S^*\)
  • Adding that word / phrases makes \(S^*\) T when \(S\) is F, and \(F\) when \(S\) is T.

Negated Wffs - Not

\(v(\neg\phi)=T\) iff \(v(\phi)=F\).

  • Form: not-P. T when P is F. F when P is T.
  • Sentence: It is not the case that Paul is happy
  • True when “Paul is happy” is F. False when “Paul is happy” is T.
  • Translation: \(\neg P\)

Conjunctions - Translation?

\(v(P\wedge Q)=T\) iff both \(P\) and \(Q\) are true.

  • What (in English) behaves just like this?
  • Add a word / phrase between \(P\) and \(Q\) and the new sentence \(\phi\) is T iff both \(P\) and \(Q\) are T.

Conjunctions - And

\(v(P\wedge Q)=T\) iff both \(P\) and \(Q\) are true.

  • Sentence: Paul is happy and Chris is sad.
  • Form: P and C
  • Translation: \(P\land C\)

Disjunctions

\(v(P\lor Q)=T\) iff \(P\) or \(Q\) are true.

  • Sentence: Paul is happy or Chris is sad.
  • Form: P or C
  • Translation: \(P\lor C\)

Inclusive and Exclusive “Or”

  • Inclusive: One or the other, or both.
  • Exclusive: One or the other, but not both.

Translating Exclusive Or

  1. Introduce a new operator: \(v(P\oplus Q)=T\) iff exactly one of \(P\) and \(Q\) is true.
  2. Use existing operators

Conditionals - Translation?

\(v(P\rightarrow Q)=F\) iff \(v(P)=T\) and \(v(Q)=F\).

  • What (in English) behaves just like this?
  • Add a word / phrase between \(P\) and \(Q\) and the new sentence \(\phi\) is F when \(P\) is T and \(Q\) is F.

Conditionals - If P then Q.

\(v(P\rightarrow Q)=F\) iff \(v(P)=T\) and \(v(Q)=F\).

  • Sentence: If you pay me $5 today, then I’ll pay you back $6.
  • Form: If P, then B
  • Translation: \(P\to B\)

Paradoxes of Material Implication

Translating “if P, then Q” as \(P\to Q\) seems wrong.

\(\phi\) \(\psi\) \(\phi\rightarrow \psi\)
T T T
T F F
F T
F F
  • If you pay me $5 today, then I’ll pay you back $6.
  • Fine for rows 1 and 2, but rows 3 and 4 are weird.

Paradoxes of Material Implication

When the antecedent is F, the conditional is automatically T.

  • If rain is made of spaghetti sauce, then God exists.
  • \(v(F\to ?)=T\)
  • \(P\to Q\) is T when \(P\) is F.

When the consequent is T, the conditional is automatically T.

  • If God exists, then there are dandelions on Earth.
  • \(v(?\to T)=T\)
  • \(P\to Q\) is T when \(Q\) is T.

Paradoxes of Material Implication

\(\phi\) \(\psi\) \(\phi\rightarrow \psi\)
T T T
T F F
F T ?
F F ?
  • There is a lot of debate about rows 3-4.
  • The debate is about
    • whether (3)-(4) should be T.
    • how to teach (3)-(4) is T.

Intuition Pump - Promises

  • A promise is false when the promise is broken and true when it is unbroken.
  • Let’s treat:
    • false conditionals as broken promises
    • true conditionals as unbroken promises

Intuition Pump - Example

  • “If you are kind, then you will go to heaven”
\(K\) \(H\) \(K\rightarrow H\)
T T
T F
F T
F F

Biconditionals

\(v(P\rightarrow Q)=T\) iff \(v(P)=v(Q)\).

  • Sentence: John is at the party if and only if Mary is at the party.
  • Form: J iff M
  • Translation: \(J\leftrightarrow M\)
  • Expanded: P iff Q is short for two conjoined conditionals: “if P then Q and if Q then P”.

Basic Translation Exercise

See book, Ex. 2.22, pp.81

PL — Complex Translations

PL: Complex Translations

  • \(P\) and \(Q\) and \(R\);
  • \(P\) or \(Q\) or \(R\);
  • neither \(P\) nor \(Q\);
  • not both \(P\) and \(Q\);
  • \(P\) only if \(Q\);
  • \(P\) even if \(Q\).

Multiple Ands and Ors

Complex propositions chained together by “and” or “or” can be translated using multiple instances of \(\wedge\) or \(\vee\).

  • John is tall and Mary is happy and Frank is sweet: \((J\wedge M)\wedge F\)
  • I will go to the store, or stay home, or go to a party: \(S\vee(H\vee P)\)

Multiple Ands and Ors: Ambiguous

Mixing “ands” and “ors” in a chain create ambiguous sentences:

  1. Sentence: You can have eggs and bacon or toast.
  2. Translation: \(E\land B\vee T\)

Is it?

  1. \((E\land B)\vee T\), or
  2. \(E\land (B\vee T)\)

Neither P Nor Q

“Neither P nor Q” is not-\(P\) and not-\(Q\)

  • (\(\neg P\wedge\neg Q\))
  • John is neither happy nor angry: \(\neg H\wedge\neg A\).
  • Liz is neither tired nor hungry.: \(\neg T\wedge\neg H\).
  • The defendant was neither present at the scene nor involved in the planning. \(\neg P\land \lnot I\)

Not Both P and Q

“Not both P and Q” does not mean:

  1. both \(P\) and \(Q\) are false
  2. not-\(P\) and not-\(Q\)

It means that it is not the case that both are true (together). The conjunction is false.

Not Both P and Q - Tip

  • Both P and Q = \(P\land Q\)
  • NOT Both P and Q = \(\neg (P\land Q)\)
\(P\) \(Q\) \(P\land Q\) \(\neg (P\land Q)\)
T T T F
T F F T
F T F T
F F F T

Not Both P and Q - Examples

  • John is not both happy and angry: \(\neg(H\wedge A)\).
  • A number is not both even and odd: \(\neg (E\land O)\)
  • The defendant cannot be convicted of and acquitted of the same offense in the same proceeding. \(\neg (C\land A)\)

Exclusive Or

Two senses of “or”:

  • Inclusive: P or Q, or both: \(P\vee Q\).
  • Exclusive: P or Q, but not both: \(P\oplus Q\) or \((P\vee Q)\wedge\neg(P\wedge Q)\)
  1. You may choose either tea or coffee, but not both. \((T\lor C)\land \lnot (T\land C)\)
  2. The light is either on or off, but not both. \((O\lor F)\land \lnot (O\lor F)\)

Complex Translation Exercise 1

See book, Ex. 2.26, pp.89-90,

P Only If Q

“P only if Q” means

Sentence PL
P requires Q \(P\to Q\)
P is not the case if Q is not the case \(\neg Q\to \neg P\)
Whenever P is the case, Q is the case \(P\to Q\)
if P then Q \(P\to Q\)

P Only If Q - Examples

  • John will go to the party only if Mary goes: \(\neg M\rightarrow\neg J\).
  • John will be found guilty only if he committed the crime: \(\neg C\rightarrow\neg G\).
  • The car will start only if there is gas in it: \(C\to G\).

P Even If Q

“P even if Q” expresses that P is the case regardless of the truth or falsity of Q.

Translate it simply as: \(P\)

P Even If Q - Examples

  • John will go to the party even if Mary goes: \(P\).
  • The stock market will go up even if no one buys stock: \(S\).
  • You will be ruined even if you are found not guilty: \(R\).

Further Reading

  • Geoffrey Hunter, Metalogic: An Introduction to the Metatheory of Standard First Order Logic. University of California Press, 1971.
  • Theodore Sider, Logic for Philosophy. Oxford University Press, 2010.
  • Donald W. Loveland, Richard E. Hodel, and S. G. Sterrett, Three Views of Logic: Mathematics, Philosophy, and Computer Science. Princeton University Press, 2014.