CS251 at CCUT Week 2: Propositional Logic

Open Logic Text

Image from "AN ACTUAL TEXTBOOK, AND: PHOTOS!" by Richard Zach is licensed under CC BY 4.0

Another good logic textbook, Sets, Logic, Computation is an open source textbook which you can download at the Open Logic Project


During the first meeting, we talked a little bit about the background of logic and we looked at some arguments, identifying the premises and conclusions and translating them to Chinese.

Let's take a quick look at a couple more examples to warm up.

Examples:


This week, we will begin to look at a language of logic, which we can use to represent arguments we find in English or Chinese and formally investigate their logical properties.

Outline:

A Language of Logic

A language of logic consists of a number of things:

  1. A vocabulary of symbols used in the language.
  2. A list or set of rules governing what strings of symbols (called formulas) are grammatically or syntactically well-formed in the language.
  3. A semantics for the language, specifying the meanings for the symbols.

The Language

Because we always start discussing a logical system by discussing the language it uses, it is worth pausing to discuss the notion of using language to study language.

These comprise the first two parts of the logical system: a vocabulary and a syntax or grammar.

Metalanguage and Object Language

The languages of the systems we study are symbolic logical languages. They use symbols such as \rightarrow and \lor, not found in ordinary English or Chinese.

However, we will talk and read about these logical languages in ordinary English or Chinese.

Whenever one language is used to discuss to study another, we can distinguish between the language that is being studied, called the object language, from the language in which we conduct the study, called the metalanguage.

What one is the object language and which one is the metalanguage for this course?

In this course, the object languages will be propositional logic (referred to as truth functional logic in the forallx textbook) and predicate calculus (referred to as first order logic in the textbook). In CS250, set theory was the main object language you studied.

Often we will use the metalanguage (English or Chinese or example) to prove things about the object language. Proving things already requires logical vocabulary! Fortunately English (and Chinese) has words like all, or, and, if, and so on. These are some of the logical vocabulary of English.

Propositional Logic

While I am here, we will study the Propositional Logic (PL) also called Truth Functional Logic (TFL) in the textbook. It's called the propositonal logic because the word 'proposition' means "sentence," and this is the logic of sentences.

Logical Vocabulary

The Propositional Logic, like any language contains a volcabulary. In this case, it is pretty small, so it is easy to study.

Logical Connectives: ¬\neg, \land, \lor, \rightarrow, and \leftrightarrow

These are called, in order from left to right, "negation," "conjunction," "disjunction," "conditional," and "biconditional."

Atomic Sentences: Uppercase letters: A, B, C, ... P, Q, R

Sentence Schema (sentence variables): lowercase letters: p, q, r\textit{p, q, r}

Parentheses: ( ), [ ], { }

Syntax

Propositional logic also has a syntax, rules that govern the structure of sentences in the language.

Are the following sentences well-formed?

Semantics and Principle of Bivalence

In studying languages, we often distinguish the syntax from the semantics of the language. The semantics of a language refers to the meanings.

In the propositional logic, the meaning of a sentence is its truth conditions. For this class, we will consider just two truth values: true and false. And we will assume the principle of bivalance

Principle of Bivalence: Each sentence of our language must be either true or false, not both, not neither.

So we will assume that each sentence is either true or false.

Back to Top

Atomic Sentences

CCUT is in Changchun.

This can be represented by a single capital letter, AA. Atomic sentences are the basic building blocks of our language. Sentences are called atomic if they cannot be broken down into more basic parts.

In the propositional logic, sentences are either atomic or they are compound. Compound sentences are built up from sentences and the logical connectives mentioned above.

Compound Sentences

We have some idea of what the logical connectives mean, since we used English words to describe them. However, their precise meaning is given by a truth table.

A truth table is a table which represents all of the possible truth values a sentence of the propositional logic can take.

Here are the truth tables for our logical connectives:

p q p \land q p \lor q ¬\negp p \rightarrow q
T T T T F T
T F F T F F
F T F T T T
F F F F T T

These truth tables give the semantics for the logical connectives. Notice that these are lower case pp and qq, indicating that these are sentence schema (or sentence variables).

Pattern Matching

So the compound sentence A(BC)A \rightarrow (B \lor C) has the form pqp \rightarrow q.

This type of pattern matching is important to understand.

Back to Top

"Not"

Not or negation is a unary connective. This means that it "connects" only to one sentence.

If pp is a well-formed sentence, then we can attach not to it: ¬p\neg p

The semantics for not are given by the following truth table:

p ¬p\neg p
T F
F T

As we can see, negation gives us the opposite truth value of the original sentence.

"The Earth is not the center of the universe"

How do we translate this and what is the truth value?


Let R mean "The widget is replaceable."

  1. The widget can be replaced.
  2. The widget is irreplaceable.
  3. The widget is not irreplaceable.

How should we translate these?

But be careful!

  1. Jane is happy.
  2. Jane is unhappy.

We might translate 1 to HH, but 2 shouldn't be translated as ¬H\neg H. It may be that Jane is neither happy nor unhappy. The point here is that "Jane is not happy" does not necessarily mean the same thing as "Jane is unhappy."

Back to Top

"And" and "Conjunction"

I went to the party and I had fun.

p q p \land q
T T T
T F F
F T F
F F F

Examples

  1. Barbara is athletic and energetic.
  2. Barbara and Adam are both athletic.
  3. Although Barbara is energetic, she is not athletic.
  4. Adam is athletic, but Barbara is more athletic than him.

Back to Top

"Or" and "Disjunction"

I go to the party or I study.

p q p \lor q
T T T
T F T
F T T
F F F

Or is inclusive.

Examples

  1. Either Faye will play videogames, or she will watch
    movies.
  2. Either Faye or Ali will play videogames with me.
  3. Either you will not have soup, or you will not have salad.
  4. You will have neither soup nor salad.
  5. You get either soup or salad, but not both.

Back to Top

"If... then..."

If I goto the party, then I will not study.

p q p \rightarrow q
T T T
T F F
F T T
F F T

Examples

  1. If Jean is in Paris, then Jean is in France.

  2. Jean is in France only if Jean is in Paris.

  3. For Jean to be in Paris, it is necessary that Jean be in France.

  4. It is a necessary condition on Jean’s being in Paris that she
    be in France.

  5. For Jean to be in France, it is sufficient that Jean be in Paris.

  6. It is a sufficient condition on Jean’s being in France that she be in Paris

Do you understand the conditional?

Puzzle: Each card has a letter (consonant or vowel) on one side, and a number (odd or even) on the other.

Rule: If there's a vowel on one side of the card, there is always an odd number on the other.

Challenge: How many of the pictured cards must you turn over to see if any break this rule?
cards

Back to Top


A Logic Puzzle

Four men and four women were nominated for two positions on the school board. One man and one woman were eleted to the positions. Suppose the men are named AA, BB, CC, and DD and the women are named EE, FF, GG, and HH. Further, suppose that the following four statements are true:

Who were the two people elected to the school board?

Hint:

Let the capital AA, BB, CC, and so on stand for the statements "AA was elected," "BB was elected, "CC was elected" and so on.

We know that one man and one woman were elected. In other words, we know that some long sentence of the form (AE)(AF)(AG)(AH)(BE)(BF)...(A \wedge E) \vee (A \wedge F) \vee (A \wedge G) \vee (A \wedge H) \vee (B \wedge E) \vee (B \wedge F) ... is true. In particular, we know that one of those disjuncts is true and the others are false.

We are given that (symbolizing 1-4 and finding some equivalences):

 
 
 
 
 
 
 
 
 
 
 
 
 

Solution:

So we can find the two people elected to the school board by determining which disjunct from our long sentence satisfies (or makes true) 1--4. Only (BE)(B \wedge E) satisfies 1-4.

So BB and EE were the two people elected to the school board.


Exercises

Translations:

  1. Mary is in Barcelona.
  2. Those fruits are apples or they are not.
  3. Those fruits are neither apples nor oranges.
  4. If Professor Plum was murdered, then either Colonel Mustard or Mrs. White did it.
  5. If you didn’t grow up speaking English it is difficult to understand many jokes made in English but, if you watch enough television, you can learn many of those jokes.

Answers
Back to Top


 
 
 
 
 
 
 
 
 
 
 
 
 

Answers

Back to Exercises

  1. MM
    MM is the atomic proposition "Mary is in Barcelona."

  1. A¬AA \lor \neg A
    AA - "Those fruits are apples."

  1. ¬(AO)\neg (A \lor O)
    AA - "Those fruits are apples."
    OO - "Those fruits are oranges."

  1. P(MW)P \rightarrow (M \lor W)
    PP - "Professor Plum was murdered."
    MM - "Colonel Mustard did it."
    WW - "Mrs. White did it."

  1. (¬GJ)(WL)(\neg G \rightarrow J) \land (W \rightarrow L)
    GG - "You grew up speaking English."
    JJ - "It is difficult to understand many jokes made in English."
    WW - "You watched enough TV."
    LL - "You can learn many English jokes."