Baic ooitional and edicate logic The fundamental of deduction 1
Logic and it alication Logic i the tudy of the atten of deduction Logic lay two main ole in comutation: Modeling : logical entence ae the building block of comutation model Analyzing: logic oof ae fundamental fo eaoning about, and infeing oetie of comutational ytem model 2
Baic element in logic Declaative entence alo called ooition I any tatement which can be unambiguouly detemined to be eithe Tue o Fale Logical connective Connect logical tatement. Thee ae fou logical connective NAME Semantic Symbol Negation NO Conjunction Dijunction Imlication AND OR IF THEN 3
Atomic and comound entence An atomic entence i a ooition that doe not contain any logical connective Examle: A: 3 > 4 Thi i clealy a fale atomic entence A comound entence i a ooition comoed by two o moe entence linked with logical connective Examle: A: 3 > 4 2 > 3 Thi i a comound ooition ince it ha an imlication, but I thi ooition tue o fale? 4
oof ytem The eviou quetion cannot be oely anwe without a well-etablihed oof Sytem A oof ytem i a et of ule and oeation fo detemining the tuth value of a comound entence out of the tuth value of it atomic contituent Examle of oof ytem ae: Boolean algeba to be eviewed oon Natual deduction modu onen, modu tollen, etc. Not in the coe of thi coue 5
Vaiable In cience, vaiable ae lace holde of value. A uch, vaiable have: Meaning what the ymbol eeent Value any value in the domain of the vaiable Examle: Let eeent the hyical concet of time with a vaiable. Let t be the ymbol denoting the time The natual domain of t i the et of all nonnegative eal numbe. We wite: t : time when defining the meaning of ymbol t t = 1.25 econd when evaluating i.e. chooing a value in the domain of t 6
Boolean Vaiable A Boolean vaiable i any vaiable whoe domain i the et {0, 1} i.e. can take only the value 0 o 1 ooition ae nomally eeented by Boolean vaiable. The value that uch vaiable take ae conventionally inteeted a 0 if the ooition i fale and 1 if the ooition i tue Examle of a Boolean vaiable A : 3 i le than 3.2 meaning of ymbol A A = 1 value of A 7
ooitional v. edicate logic ooitional logic deal olely with ooition and logical connective Examle: A: 3 < 4 Clealy A=1 edicate logic add edicate and quantifie A edicate i a logical tatement that deend on one o moe vaiable not neceaily Boolean vaiable Examle: B y : x i le than y The definition and value of B y deend on x and y If x = 3 and y = 4, then B y = B3, 4 = 1 If x = 4 and y = 3, then B y = B4, 3 = 0 If x = + and y = /, the B y i in incile undefined 8
uantifie uantifie ae ued to declae ange of a edicate vaiable in which the edicate aume eithe 0 o 1, but no both. A edicate with no quantifie i aid to be a fee edicate Thee ae two quantifie NAME SEMANTIC SYMBOL Univeal Exitential FOR ALL THERE EXISTS 9
Illutation: ue of quantifie Conide the fee edicate A y:" x < y x < 2 y whee x and y ae eal numbe. Some value fo thi edicate ae: A.5,.9 = 1 A.5,.6 = 0 A.6,.5 = 1 A.9,.93 = 0 A.9,.96 = 1 " By imoing quantifie we may oduce the following tue edicate: B y :" x x 1 A y" C y :" y0 x y D y :" x x < E y :" y0 0 A y" 2 x < 1 A y" 2 x x < y < 1 A y" Remak: A edicate that i alway tue o alway fale can be teated a a ooition that i tue o fale, eectively. Thi i, it can be evaluated and analyzed with the tool of ooitional logic 10
ooitional logic A logical theoy that involve only ooition i.e. it ha no edicate i called ooitional Logic Thee ae two main veion of ooitional Logic: Semantic ooitional logic ooitional calculu Thee two veion diffe only in thei oof ule oof in emantic ooitional logic ae baed on Boolean algeba oof in ooitional calculu ae baed on the ocalled ule of natual deduction 11
Tuth table and valuation A valuation of a entence i an aignment any aignment of tuth value to the tatement that comoe the entence If we combine two tatement with a logical connective, the value of the eulting comound tatement i detemined by two thing: The choen valuation The emantic meaning of the logical connective The meaning of each connective unde all oible valuation i declaed in a tuth table 12
The tuth table of negation The imlet cae of tuth value i negation. In thi cae, thee i only one entence, and theefoe, only two oible valuation. The emantic i alo vey natual: if the entence i tue, it negation i fale, and vice vea. Thu, the tuth table of negation i imly A A 0 1 1 0
Dijunction and conjunction tuth table A B A B 0 0 0 0 1 0 1 0 0 1 1 1 A B A B 0 0 0 0 1 1 1 0 1 1 1 1 Thee ae fou oible valuation in each of thee cae 14
Imlication tuth table: Hyothei->Thei In imlication, the vaiable A eeent a hyothei tatement while the vaiable B, a thei tatement A B A B 0 0 1 0 1 1 1 0 0 1 1 1 The fit two ow in thi table indicate that when the hyothei i fale, the imlication will not diciminate between a tue o a fale thei. It will alway etun tue. Thee ae called vacuouly tue imlication The econd two ow tell a diffeent toy. In thi cae a we alway hoe in actice the hyothei i tue. Then, the tuth value of the thei i faithfully eflected in the value of the imlication. If the thei i fale, o i the imlication, and vice vea. 15
Comuting with tuth table We ae now in oition to anwe the quetion I A : 3 < 4 2 < 3 tue o fale? Anwe: Identify the atomic entence that comoe A. Let B : 3 < 4, and C : 2 < 3 Now, we ee that A ha the fom B C Since B = 0 and C = 0, fom the vey fit ow of the table of imlication we conclude that A i Tue although vacuouly! I thee a valuation making the tatement tue? 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 0 Ye: =0, =1 16
Equivalence between ooition Two ooition A and B ae aid to be equivalent if thei tuth value ae the ame in all oible valuation. Equivalence i denoted A B Equivalence i not the ame a equality: two ooition may be equivalent even if they diffe in thei meaning Equivalence i a hothand fo A B B A 17
Imotant equivalence Conjunctive fom of imlication Contaoitive fom of De Mogan ule Ditibutive ule R R imlication Idemotency ule Aociative ule Commutative ule 18 R R R R R R
Some alication Demontate that i equivalent to Demontate that i equivalent to q q oof: 19 oof: q q q q q q q
The negation of a edicate Negating a edicate that contain quantifie demand, in addition, the ue of the emantic table Thee negation ule mut be alied togethe with the eviouly dicued equivalence, when teating edicate a ooition UANTIFIER Univeal Exitential NEGATION Exitential Univeal 20
Yet anothe imotant equivalence The next equivalence decibe the actual negation oeation fo elemental edicate with quantifie Let x, y,..., z be a edicate. Then, y,..., z y,..., z x y,..., z y,..., z x y... z y,..., z y... z y,..., z 21
Illutation Let conide the negation of B :" x1 x A y" whee 2 2 A y :" x < y x < y " Anwe: B x1 x A y Remak: thi i, a exected, a fale tatement The infomal exeion y i a hot hand fo x y In geneal, the ymbol, i a to be taken a a hot hand fo and Thu, y x y and y0 x y 1 A y x y0 x y 1 A y 22
Comoed quantifie Alo common ae edicate whoe quantifie i a comoition of the univeal and the exitential quantifie Fo each x thee i a y uch that y i tue x y x, y Thee i an x uch that fo all y y i tue Thei negation ae Reectively x y x, y x x y y x x,, y y, and 23
Boolean fomula A Boolean fomula i a well-fomed combination of Boolean vaiable and logical connective q The combination I a Boolean fomula The combination q I not a Boolean fomula Any eeentation of a ooition in tem of Boolean vaiable and logical connective yield a Boolean fomula. 24
Two imotant oblem Given a combination of ymbol and logical connective: I it a Boolean fomula? Domain: A et of ymbol and logical connective Intance: A ting of ymbol and logical connective uetion: I the ting a Boolean fomula? Given a Boolean fomula: can we find a valuation that make it tue? Domain: All Boolean fomula Intance: A Boolean fomula uetion: I thee a valuation that make the fomula tue? 25