Lecture 1 1 The Foundations: Logic and Proofs 1.1 Propositional Logic The Foundations: Logic & Proof Propositional Variables Propositional Calculus Definiton of a Proposition A proposition is a declarative sentence that is either true or false, but not both. Pigs have wings If pigs have wings then I have a million dollars. Pick up your socks! What's up, Doc? Long, long ago in a galaxy far, far away... This sentence is false. This sentence is true. What is a Proposition? JABBERWOCKY Lewis Carroll (from Through the Looking-Glass and What Alice Found There, 1872) `Twas brillig, and the slithy toves, Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!" He took his vorpal sword in hand: Long time the manxome foe he sought -So rested he by the Tumtum tree, And stood awhile in thought. And, as in uffish thought he stood, The Jabberwock, with eyes of flame, Came whiffling through the tulgey wood, And burbled as it came! One, two! One, two! And through and through The vorpal blade went snicker-snack! He left it dead, and with its head He went galumphing back. "And, has thou slain the Jabberwock? Come to my arms, my beamish boy! O frabjous day! Callooh! Callay!' He chortled in his joy. `Twas brillig, and the slithy toves, Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. Bit Operations Example Problem Introduction The textbook introduces propositions as familiar English sentences. However, it is important to understand that the underlying logical rules applied to a proposition depend on the assigned truth value of the predicates rather than their meaning. Conjunction a b F F F a Disjunction b a b a b F F F F T F F T T T F F T F T T T T T T T All the Binary Logical Operations 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 T p 0 1 q 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 p q q p q p q p p q p q , q p, p q p q p q p p q ,q p q q p , p q q p, p q T Puzzle Four friends have been identified as suspects for an unauthorized access into a computer system. They have made statements to the investigating authorities. Alice said, "Carlos did it." Bill said, "I did not do it." Carlos said, "Diana did it." Diana said, "Carlos lied when he said that I did it." a) If the authorities know that exactly one of the four is telling the truth, who did it? b) If the authorities know that exactly one of the four is lying, who did it?