Unit 4: Computer as a logic machine Propositional logic Boolean algebra Logic gates Computer as a logic machine: symbol processor Development of computer The credo of early AI Reference copyright c 2013 Hyeong In Choi 1 / 26
Propositional Logic Atomic statement (logical variable, propositional variable) e.g. p: Two plus two equals four q: Apple is a mineral. Each atomic statement is always either true or false. We use a single lower-case Roman alphabet to denote an atomic statement, which is also called a logical variable Logical variable must have the unambiguously decidable value T (true) or F (false) 2 / 26
Propositional Logic Logical Connectives Atomic statements are combined to yield a more complex statement using the following logical connectives NOT OR AND IMPLY 3 / 26
Propositional Logic Statement (expression, formula) A, B, C a well-formed expression involving variables, connectives and parentheses (there is a precise definition of well-formed expression and an algorithm to check if an expression is well-formed) non-sense expressions like p q, A B, ( A) B are not allowed (by checking if the statement in question is well-formed) statement can be just single logical variable or it could be a more complicated statements created by combining simpler statements using connectives and parentheses the value of a statement is T or F, depending on the values of the variables contained therein 4 / 26
Propositional Logic Truth Table NOT( ) p T F p F T 5 / 26
Propositional Logic Truth Table (Cont d) OR( ) p q p q T T T T F T F T T F F F 6 / 26
Propositional Logic Truth Table (Cont d) AND( ) p q p q T T T T F F F T F F F F 7 / 26
Propositional Logic Truth Table (Cont d) IMPLY( ) The truth value of p q is defined as follows p q p q T T T T F F F T T F F T The reason to assert p q is true when p is false is that the only case this conditional statement (p q) is manifestly false is when p=t and q=f ; therefore, all other cases are taken to be true 8 / 26
Propositional Logic Truth Table (Cont d) IMPLY( ) p q p p q T T F T T F F F F T T T F F T T p q and p q have the same truth value; hence they are deemed logically identical 9 / 26
Propositional Logic Truth Table (Cont d) Example p q q p p (q p) T T T T T F T T F T T T F F F T p (q p) is always true no matter which truth value p or q has such always-true statement is called a theorem and is denoted by adding : sign in front of the statement, i,e., : p (q p) means p (q p) is a theorem 10 / 26
Propositional Logic Truth Table (Cont d) Example (Contraposition) p q p q p q q p (p q) ( q p) T T F F T T T T F F T F F T F T T F T T T F F T T T T T (p q) ( q p) is always true no matter which truth value p or q has thus : (p q) ( q p) 11 / 26
Boolean algebra Set: S={0,1} two elements Algebraic operations: addition(+) & multiplication( ) + 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 1 12 / 26
Boolean algebra Correspondence with Propositional Logic T 1 F 0 + OR AND Involution 0 = 1 1 = 0 involution(-) negation( ) 13 / 26
Boolean algebra All laws of arithmetic hold for Boolean algebra commutative law a + b = b + a a b = b a associative law (a + b) + c = a + (b + c) (a b) c = a (b c) distributive law a (b + c) = (a b) + (a c) a + (b c) = (a + b) (a + c) 14 / 26
Boolean algebra additive unit: 0 0 + a = a = a + 0 multiplicative unit: 1 1 a = a = a 1 involution (de Morgan s law) a + b = a b a b = a + b 15 / 26
Logic Gates AND a c b OR a c b XOR (Exclusive OR) c = a b c = a + b a b c c = a b = a b + ā b 0 1 0 0 1 1 1 0 16 / 26
Logic Gates NOT a c c = ā NAND a b NOR a b c c c = ab = ā + b (a + b) = ā b 17 / 26
Logic Gates Half Adder Regard 0 and 1 as single-digit binary numbers Sum rule for a+b 0 + 0 0 0 carry sum { 1 + 0 0 1 1, if a b s: sum= 0, if a = b { c: carry= 1, if a = b = 1 0, else 0 + 1 0 1 1 + 1 1 0 18 / 26
Logic Gates Logic circuit for half adder a b s { 1, if a b s = a b = a b + āb = 0, if a = b { 1, if a = b = 1 c = a b = 0, else c 19 / 26
Logic Gates Full Adder A logic circuit to add two multi-digit binary numbers. (Example) 1 0 1 1 + 1 0 0 1 1 0 1 0 0 Compuer Architecture Each logic variable is represented physically by voltage level. e.g. in positive logic circuit 1 High voltage (2.8 5 volts) 0 Low voltage (0 0.4 volts) negative logic: high & low voltages are reversed 1 Low voltage (0 0.4 volts) 0 High voltage (2.8 5 volts) Logic gates are constructed as transistor circuits embedded in IC (integrated circuit) ship 20 / 26
Compuser as a logic machine:symbol processor The fundamental operational principle behind computer is Boolean algebra (propositional logic) Everything, including numbers, is (represented by) logical symbol(s) Then why not use computer as a symbol processor? 21 / 26
Development of computer Computer s are dreamed up by many mathematicians for many centuries Pascals adding machine Babbage s difference engine and analytical engine (19 th century) First programmable mechanical computer First programmer: Countess Ada Lovelace (daughter of Lord Byron) Turing Machine: purely mathematical construct Von Neumann: stored program architecture ENIAC (Electron Numerical Integrator And Computer) by Mauchly and Eckert (1946) With about 17,000 vacuum tubes; 7,000 diodes; weighing 27t Computers later evloved into transistor- and IC-based machine of the present day. 22 / 26
Development of computer All computers are logically the same: Turing machine movie Any computer can emulate any other computer: Universal Turing machine as opposed to old machine that is dedicated to one unique task Software is a means to realize such universality in practice: with one computer, we can do a whole bunch of disparate things 23 / 26
The credo of early AI What is intelligence? Isn t it just a rational expression of things and concepts? Why can t one manipulate symbols and realize that intelligence? Mind is a symbolic processing entity and so is computer Since computer is nothing but a logical symbol processing machine, why not use it to realize intelligence? movie 24 / 26
The credo of early AI I am convinced that machinese can and will think. I don t mean that machines will behave like men. I don t think for very long time we are gonna have difficult problem of distinguishing man from a robot. i don t think my daughter will ever marry a computer. But i think computers will be doing the things men do when we say they are thinking. I am convinced that machines can and will think in our life time. (Oliver G. Selfridge) movie 25 / 26
Reference Martin Davis: The Universal Computer, W. W. Norton & Co., 2000 최형인 : 명제계산 (Propositional Calculus) 2004 최형인 : 현대컴퓨터개요 2005 (1) (2) 26 / 26