5. Propositional Logic Truth functions
The Lecture What are truth functions?
! Truth functions are generalizations of the familiar connectives ¬, ∧, ∨, →, !. ! Computers are ultimately based on truth functions that are welded into microprosessors inside the computer. ! Truth functions have interesting mathematical properties.
Last Jouko Väänänen: Propositional logic viewed Truth function
! A truth function (also called a connective) is any function f from the set {0,1}n to the set {0,1}, for some n.. ! A truth function of n variables is called n-ary. A 2-ary truth function is called binary. ! Truth functions can be identified with truth tables. ! We have already defined the connectives ¬, ∧, ∨, →, ! ! We identify these with the corresponding truth functions.
Last Jouko Väänänen: Propositional logic viewed More binary truth functions
x y f(x,y) x y f(x,y) 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 x y f(x,y) x y f(x,y) 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed There are exactly 16 binary truth functions
¬ ∧ ! → v
1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Last Jouko Väänänen: Propositional logic viewed A ternary truth function
x y z f 1 1 1 (x,y,z)0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 0 1
Last Jouko Väänänen: Propositional logic viewed A new connective: Sheffer stroke, also known as NAND
Last Jouko Väänänen: Propositional logic viewed Definability of truth functions
! Disjunction can be defined in terms of negation and conjunction: A ∨ B = ¬(¬A ∧ ¬B) ! Sheffer stroke A|B can be defined in terms of negation and conjunction: A|B = ¬(A ∧ B) ! Negation and conjunction can be defined in terms of the Sheffer stroke: ¬A = A|A A∧B = (A|B)|(A|B)
Last Jouko Väänänen: Propositional logic viewed Universal sets of connectives
! A set T of truth functions is universal if every truth function can be defined in terms of functions in T. A function f is universal if the set {f} is. ! Every truth function can be defined in terms of the Sheffer stroke, i.e. the Sheffer stroke is a universal connective. ! Microprocessors are built from ”gates” that are essentially connectives. It suffices to manufacture Sheffer stroke (NAND) gates as all others can be built from them. ! {¬,∧}, {¬,∨}, {¬,→} are also universal.
Last Jouko Väänänen: Propositional logic viewed Propositional formulas define truth functions
! Suppose A is a propositional formula
built from proposition symbols p1,...,pn. ! A defines the following truth function:
fA(x1,...,xn)=the truth value of A under
the valuation that gives pi the value xi for i=1,...,n.
Last Jouko Väänänen: Propositional logic viewed Propositional formulas cover all truth functions
! Theorem: Every truth x y z f(x,y,z) function is defined by some propositional 1 1 1 1 formula. 1 1 0 0 ! Proof: Look at the truth 1 0 1 1 table of f and pick the rows where f gets value 1 0 0 0 1. 0 1 1 0 ! We represent f as the 0 1 0 1 ”disjunction” of those rows. 0 0 1 0 0 0 0 0
Last Jouko Väänänen: Propositional logic viewed Capturing a truth function with a formula
! We look for a propositi- p0 p1 p2 A onal formula the truth 1 1 1 1 table of which has 1 on exactly the same rows 1 1 0 0 as f. 1 0 1 1 1 0 0 0 ! A=(p0 ∧ p1 ∧ p2) ∨ 0 1 1 0 (p0 ∧ ¬p1 ∧ p2) ∨ 0 1 0 1 (¬p0 ∧ p1 ∧ ¬p2) 0 0 1 0 ! If there is no row with one, 0 0 0 0 we let A be p0∧ ¬p0 .
Last Jouko Väänänen: Propositional logic viewed Applications
! {¬,∧,∨} is a universal set of connectives, even just {¬,∧}. ! Every propositional formula A can be expressed in an equivalent form
A1 ∨ ... ∨ An,
where each Ai is of the form
B1 ∧ ... ∧ Bm,
and each Bi is a proposition symbol or its negation. This is the disjunctive normal form (denoted DNF) of A.
Last Jouko Väänänen: Propositional logic viewed