Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 - - PowerPoint PPT Presentation

logic as a tool chapter 1 understanding propositional
SMART_READER_LITE
LIVE PREVIEW

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 - - PowerPoint PPT Presentation

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies Valentin Goranko Stockholm University September 2016 Goranko Propositions Proposition: statement which can be


slide-1
SLIDE 1

Goranko

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Valentin Goranko Stockholm University September 2016

slide-2
SLIDE 2

Goranko

Propositions

Proposition: statement which can be assigned a (unique) truth value: true or false. Some examples of propositions:

  • “The Sun is hot.”
  • The Moon is made of cheese.
  • “Two plus two equals twenty two.”
  • “The 1001st decimal digit of the number π is 7.”

Some non-examples:

  • “Are you bored?”
  • “Please, don’t go away!”
  • “She loves me.”
  • “x is an integer.”
  • “This sentence is false.”
slide-3
SLIDE 3

Goranko

Propositional logical connectives

  • not, called negation, denoted by ¬;
  • and, called conjunction, denoted by ∧ (or, sometimes by &);
  • or, called disjunction, denoted by ∨;
  • if . . . then . . . , called implication, or conditional, denoted by →;
  • . . . if and only if . . . ,

called equivalence, or biconditional, denoted by ↔.

slide-4
SLIDE 4

Goranko

Building composite propositions

Using the propositions “Two plus two equals five” and “The sun is hot” and the propositional connectives, we can produce:

  • “It is not the case that two plus two equals five”
  • “Two plus two equals five and the sun is hot”
  • “Two plus two equals five or the sun is hot”
  • “If two plus two equals five then the sun is hot”
  • “Two plus two equals five if and only if the sun is hot”

Likewise, using the propositions “Logic is fun”, “Logic is boring”, “Logic is easy” we can produce the composite proposition: “Logic is not fun or, if Logic is easy then Logic is fun and Logic is not boring.”

slide-5
SLIDE 5

Goranko

The propositional connectives as truth value functions

Each propositional connective acts on the truth values of the component propositions in a precise way:

  • ¬A is true if and only if A is false.
  • A ∧ B is true if and only if both A and B are true.
  • A ∨ B is true if and only if either of A or B (possibly both) is true.
  • A → B is true if and only if the truth of A implies the truth of B,

i.e., iff A is false or B is true.

  • A ↔ B is true if and only if A and B have the same truth-values.
slide-6
SLIDE 6

Goranko

Truth tables

These rules can be summarized in the following truth tables, where T stands for ‘true’ and stands for ’false’: p ¬p T F F T p q p ∧ q p ∨ q p → q p ↔ q T T T T T T T F F T F F F T F T T F F F F F T T

slide-7
SLIDE 7

Goranko

Applying the truth tables

Given that ‘Two plus two equals five’ is false and ‘The Sun is hot’ is true, using the truth-tables we obtain that: “It is not the case that two plus two equals five” is true; “Two plus two equals five and the Sun is hot” is false; “Two plus two equals five or the Sun is hot” is true; “If two plus two equals five, then the Sun is hot” is true. “Two plus two equals five if and only if the Sun is hot” is false.

slide-8
SLIDE 8

Goranko

Some comments on the truth tables

  • Conjunction is commutative: A ∧ B is equally true as B ∧ A.

But, these do not always mean the same! Compare “Bill pulled the trigger and Jack dropped dead” with “Jack dropped dead and Bill pulled the trigger”.

  • Disjunction is non-exclusive: “I shall win or I shall die” is still true if

I both win and die. Compare also with “I shall win unless I die”.

  • Implication is the most confusing of all.

Why should “False imply true” and “False imply false” be true? Because there is no good reason to declare them false! The implication A → B claims the truth of B only if A is true, else no claim is made. Thus, the implication A → B is false in only one case: when A is true and yet B is false.

slide-9
SLIDE 9

Goranko

Some equivalent forms of the implication

The implication is the most important and versatile propositional

  • connective. It can appear in variety of phrases:
  • If A then B
  • A implies B
  • A only if B
  • B whenever A
  • B if A
  • A is sufficient for B
  • B is necessary for A
slide-10
SLIDE 10

Goranko

Computing the truth value of a proposition

Suppose that “Logic is fun.”: T; “Logic is boring.”: F; “Logic is easy.”: T; To compute the truth value of the composite proposition: “Logic is not fun or, if Logic is easy then Logic is fun and Logic is not boring.” we first write it in a symbolic form. For that, we first analyse and clarify it syntax, by placing auxiliary parentheses to indicate the order of applying the logical connectives: “(Logic is not fun) or (if Logic is easy then (Logic is fun and Logic is not boring)).”

slide-11
SLIDE 11

Goranko

Computing the truth value of a proposition, cont’d

We now introduce symbolic names for the atomic propositions occurring in it, e.g: A : “Logic is fun.” B : “Logic is boring.” C : “Logic is easy.” Then, the proposition can be written symbolically as: (¬A) ∨ (C → (A ∧ ¬B)) Now, we compute its truth value step by step, applying the truth-tables

  • f the respective logical connectives:

(¬T) ∨ (T → (T ∧ ¬F)) = F ∨ (T → (T ∧ T)) = F ∨ (T → T) = F ∨ T = T.

slide-12
SLIDE 12

Goranko

Propositional formulae

Propositional constants: ⊤ which represents a true proposition, and ⊥ which represents a false proposition. Propositional variables: variables that range over propositions. Usually denoted by p, q, r, possibly with indices. Inductive definition of propositional formulae:

  • 1. Every propositional constant and every propositional variable is a

propositional formula.

  • 2. If A is a propositional formula then ¬A is a propositional formula.
  • 3. If A, B are propositional formulae then (A ∨ B), (A ∧ B) , (A → B),

(A ↔ B) are propositional formulae. Examples: ⊤, ¬⊤, p, ¬p, ¬¬p, ¬q, (p ∨ ¬q), ¬(p1 ∧ ¬(p2 → ¬p1)), . . . Outermost pairs of parentheses will often be omitted.

slide-13
SLIDE 13

Goranko

Construction trees, subformulae, main connectives

Construction tree: a tree with nodes labelled with propositional constants, variables, and propositional connectives, such that:

  • 1. Every leaf is labelled by a propositional constant or variable.
  • 2. Propositional constants and variables label only leaves.
  • 3. Every node labelled with ¬ has exactly one successor node.
  • 4. Every node labelled with any of ∧, ∨, →, ↔ has exactly two

successor nodes - left and right successor. Every construction tree defines a formula C, built starting from the leaves and going towards the root, by applying at every node the formula construction rule corresponding to the label at that node.

slide-14
SLIDE 14

Goranko

Construction tree of a formula

Leaves: propositional variables or constants unary connective ( ¬ ) binary connective ( ∨, ∧, →, ↔) the main connective The formulae constructed in the process are the subformulae of C. The connective labelling the root of the construction tree of a formula C is the main connective of C.

slide-15
SLIDE 15

Goranko

Construction tree: example

Formula: (p ∨ ¬(q ∧ ¬r)) → ¬¬r Construction tree r ¬ ∧ q ¬ ∨ p → ¬ ¬ r

slide-16
SLIDE 16

Goranko

Parsing tree of a formula

The parsing tree of a formula looks the same as the construction tree, but is produced in inverse order, starting from the main connective (of any), drawing edges to all main components, and then recursively producing the parsing trees for each of them. Leaves: propositional variables or constants unary connective ( ¬ ) binary connective ( ∨, ∧, →, ↔) the main connective

slide-17
SLIDE 17

Goranko

Parsing tree: example

Formula: (p ∨ ¬(q ∧ ¬r)) → ¬¬r Parsing tree r ¬ ∧ q ¬ ∨ p → ¬ ¬ r

slide-18
SLIDE 18

Goranko

Truth tables of propositional formulae

Example: (p ∨ ¬(q ∧ ¬r)) → ¬¬r

p q r ¬r ¬¬r q ∧ ¬r ¬(q ∧ ¬r) p ∨ ¬(q ∧ ¬r) (p ∨ ¬(q ∧ ¬r)) → ¬¬r T T T F T F T T T T T F T F T F T F T F T F T F T T T T F F T F F T T F F T T F T F T T T F T F T F T F F T F F T F F F

slide-19
SLIDE 19

Goranko

Simplified truth tables

p q r (p ∨ ¬ (q ∧ ¬ r)) → ¬ ¬ r T T T T T T T F F T T T F T T T F T T F T T T F F F T F T F T T T T F F F T T T F T T F F T T T F F T F F F T F F T T F T T T F F T T T F T F T F F F F T T T F T F T F F F T F F F

slide-20
SLIDE 20

Goranko

Tautologies

Tautology (or, propositionally valid formula): a formula that obtains truth value T for every assignment of truth values to the occurring

  • variables. Notation: |

= A. Examples: | = p ∨ ¬p, | = ¬(p ∧ ¬p), | = ((p ∧ (p → q)) → q) Testing tautologies with truth-tables: p q p → q p ∧ (p → q) (p ∧ (p → q)) → q T T T T T T F F F T F T T F T F F T F T

slide-21
SLIDE 21

Goranko

Contradictions, satisfiable formulae

Contradiction is a formula that always takes truth value F. Examples: p ∧ ¬p, ¬((p ∧ q) → p) Thus, the negation of a tautology is a contradiction and the negation of a contradiction is a tautology. A formula is satisfiable if it is not a contradiction. Example: p, p ∧ ¬q, etc.