Propositionl models Historil models of omputtion Steven Lindell Hverford College USA 1/22/2010 ISLA 2010 1 Strt with fixed numer of oolen vriles lled the voulry: e.g.,,. Eh oolen vrile represents proposition, for exmple "tody it is rining". A propositionl model is n ssignment from those vriles to the vlues {T, F}. E.g. symol vlue 1/22/2010 ISLA 2010 2 T F T A Boolen funtion is mp from the set of ll proposition models to the set {F, T}. This representtion is lled truth-tle. In the exmple, f = the prity g = the mjority Boolen funtions f g F F F F F F F T T F F T F T F F T T F T T F F T F T F T F T T T F F T T T T T T Applition: inry ddition Exmple: 1100 + 1110 = 11010 Crry = 1 1 0 0 0 deiml A = 1 1 0 0 = 12 B = + 1 1 1 0 = 14 Sum = 1 1 0 1 0 = 26 1/22/2010 ISLA 2010 3 1/22/2010 ISLA 2010 4 Sum nd Crry Derive equtions for Sum nd Crry s funtion of,,. no. of 1's = 0 1 2 3 = + + Sum = 0 1 0 1 = + + (mod 2) Crry = 0 0 1 1 = ( + + 2) Using logil opertions: Sum = PARity Crry = ( ) ( ) ( ) MAJority Implementtion using swithes Output true iff onnetivity etween terminls. Due to Shnnon the most influentil mster's thesis of 20th entury [f. opposite hindrnes ] Boolen Connetion Piture Flse Open Closed 1/22/2010 ISLA 2010 5 1/22/2010 ISLA 2010 6 1
N.O. rely Off On Normlly Open SPST rely Boolen input Flse funtion formul 2-wy swith digrm gte digrm swithing iruit Connetion Open Closed Monotone Boolen funtions funtionl onnetion OR is prllel AND is series formul gte digrm swithing iruit ID 1/22/2010 ISLA 2010 7 1/22/2010 ISLA 2010 8 Mjority Normlly Closed SPST rely funtion formul MAJ(,, ) ( ) ( ) ( ) gte digrm swithing iruit N.C. rely Off On Boolen input Flse funtion formul gte digrm 2-wy swith digrm swithing iruit Connetion Closed Open T 1/22/2010 ISLA 2010 9 1/22/2010 ISLA 2010 10 3-wy (hngeover) swith Exlusive-OR An SPDT rely equivlent to n N.O. nd n N.C. rely mehnilly gnged together. ommon funtion formul gte digrm swithing iruit rely position Boolen input 3-wy swith digrm N.O. N.C. XOR Up Flse ommon Open Closed XR Down ommon Closed Open 1/22/2010 ISLA 2010 11 1/22/2010 ISLA 2010 12 2
Mjority revisited 4-wy swith There re four monotone symmetri funtions of three vriles: f 0 (,, ) = f 1 (,, ) = f 2 (,, ) = f 3 (,, ) = f 4 (,, ) = + + 0 + + 1 + + 2 + + 3 + + 4 lwys size: O(kn) k fixed O(n) depth n sme s OR the mjority sme s AND lwys Flse 0 1 2 3 Two 3-wy swithes omined together to form 4-wy swith. Input A Input B rely position Boolen input 4-wy swith digrm stright-thru ross-over Flse Input A Input B Input A Input B Output A Output A Output B Output A Output B Output B 1/22/2010 ISLA 2010 13 1/22/2010 ISLA 2010 14 Prity Multiple-input XOR Prtil use: ontrol light on stirwy 4-it dder Digrm of 4-it full dder funtion formul gte digrm swithing iruit PAR(,, ) Use this iruit to solve lter prolems. Sum i = s i = PAR( i, i, i ) Crry i = i+1 = MAJ( i, i, i ) 1/22/2010 ISLA 2010 15 1/22/2010 ISLA 2010 16 Crry look-hed rry generte 1 + 1 g i = i i rry propgte 0 + 1 = 1 + 0 p i = i i Mnhester Chin i = j < i [ j j ] ( k, i > k > j)[ k k ] rry terminte 0 + 0 t i = i i i 1 + G = i i s i = PAR( i, i, i ) nd ll i omputed simultneously g i 1.......... p i 1 p j+1 g j onstnt depth iruit T = i i 0 P = i i 1/22/2010 ISLA 2010 17 1/22/2010 ISLA 2010 18 3
Red-one sequentil omputtion Reson: reful mesure of red/write storge Memory: red-only; write-only; olivious ursor Conept: reds re destrutive for working memory (not input); sort of no-loning property Exmple: rry omputtion re-prenthesiztion := + + = + ( + ) Vlidity in ll (propositionl) models: trivil Form implition onsisting of the onjuntion of the premises rrows the onlusion. This is Boolen funtion too. Exmple: premises, ; onlusion (rry-out). Chek to see if ll rows of the truth-tle re true. 1/22/2010 ISLA 2010 19 1/22/2010 ISLA 2010 20 Summry Swithing iruits re omputtionl model for propositionl Boolen logi Propositionl vlidity is finite proedure. I.e. in fixed voulry V, there re finitely mny propositionl models, nd finitely mny Boolen funtions. It is simple mtter to determine whih of them re tutologies (just try out 2 V ). However, prmeterized y the voulry, this is o-np-omplete (the opposite of stisfiility). Predite models for term logi Fix voulry of predites: e.g. A, B, C. Eh predite represents some lss of elements, suh s "the set of ll students". A predite model onsists of domin (sometimes lled the universe) long with n ssignment whih interprets eh of the predites s suset of the domin. If the domin is ll people, then one of the predites ould represent the set of students. 1/22/2010 ISLA 2010 21 1/22/2010 ISLA 2010 22 Exmple Consider the model M = <D, S, M, W, L> given y Domin Students Men Women Logiins Ed Tnvi John Jne Lis Ashok Mollie Bo Mry Tnvi Ashok Mollie Ed John Ashok Bo Tnvi Jne Lis Mollie Mry Ed Tnvi Lis Bo 1/22/2010 ISLA 2010 23 Terms & Propositions Term: Tke model nd return derived predite. mle students: {, Ashok} non-logiins: {John, Jne, Ashok, Mollie, Mry} Proposition: ompre two terms Sttement Eqution Tehnilly, proposition ould e ny funtion from onstnts nd terms to {, Flse}. All P re Q No Women re Logiins W L = P Q Some P re Q P Q No P re Q Flse Mollie is student Mollie S P Q 1/22/2010 ISLA 2010 24 4
Vlidity Syllogism Exmple Symolilly Mjor premise Minor premise No helthy food is No P re M. fttening. All kes re fttening. All S re M. Conlusion No kes re helthy. No S re P. Cn use Ldd-Frnklin's Rule of Syllogism Terms Simple terms Atomi predites A, B, in originl voulry Complement T T is simple term Joining them together Union T 1 T 2 T 1 nd T 2 re terms Intersetion T 1 T 2 T 1 nd T 2 re terms Exmple: W L = women non-logiins 1/22/2010 ISLA 2010 25 1/22/2010 ISLA 2010 26 Bsi Sttements Given sujet nd predite terms S nd P: I $S P Some S re P. A "S P All S re P. If P is negted, we get the other two forms: O $S P Some S re not P. E "S P No S re P. Compound sttements Exmple: onsider T 1 nd T 2 to e the sttements "S (W L) All students re women or logiins. $L (M S) Some logiins re mle students. Cn omine sttements with disjuntion nd onjuntion to form: T 1 T 2 nd T 1 T 2. Exerise (negtion unneessry): Show O nd E forms re unneessry. Hint: push negtions down. 1/22/2010 ISLA 2010 27 1/22/2010 ISLA 2010 28 Numeril quntifiers Definition: A quntifier is monotone symmetri funtion from sets to Boolen. $ k S P " k S P there re t lest k S s whih re P ll exept t most k 1 S s stisfy P Exmple: k = 1 is ordinry $ / " quntifition Exerise: show there re no more Threshold gtes k or more inputs re one: for k = 1 this is OR. for k = n this is AND. Exerise : Show tht for fixed k, they n e implemented y depth 2, size n k iruits. Hint: use multiple input AND/OR gtes. However, Shnnon s ldder digrm: liner depth nd size. : n : k 1/22/2010 ISLA 2010 29 1/22/2010 ISLA 2010 30 5
Complexity of evlution Where do we go from here? Given predite model M nd formul φ, sk if M stisfies φ. The size of the input is M, or O( D ), proportionl to size of the domin. 1. Evlute ll terms using,,. 2. Quntify: numeril ordinry k S P S P k S P k S P S P < k S P = 3. Compute Boolen omintions Extend voulry, preserving liner size. How? llow mondi funtions (invertile) Chse the lure of liner-time omputtion. Insure: ompositionlity with queries of rity > 1 Find effiient norml forms for logi formule. Use: numeril quntifiers tht re not nested 1/22/2010 ISLA 2010 31 1/22/2010 ISLA 2010 32 6