You are on page 1of 6
64 Discrete Mathematies& its Applications principle. This idea is used in-the logic programming language Prolog. ‘A.variable or négation of a variable is called a literal, ‘A disjunction of literals is called a sum and a conjunction of literals is called a product. A clause is @ dis- junction of literals, ic, itis a sum, For any two clauses C, and Cy, ifthere isa literal L,in C, that is complementary to a literal L, in C,, then delete L, and L, from C, and C, respectively and construc the disjunction of the remaining clauses. The con- structed clause is a resolvent of C, and C,. Exataphe da: Suppose you have C.=PvOvR C= -PvaSvT ‘Then P and — P are complementary to each other. The resolvent of C and C, is obtained by deleting P ‘and —P from C, and C, respectively, and finding the disjunction of the remaining literals, In this case it is QvRv-SvT. < | ll nesolution Pipciple’,? As another way of proving that at argument is correct, we use the resolution | | “ aheorems Given two clauses C, and C,, a resofvent C of C, and C, isa logical corisequence of C, and Cy For example, consider the rules modus ponens and modus tollens. Modus ponens tule is Pa (P-> Q)-> Q Putting in clause form this amounts to GP GinPvo “The resolvent of C, end , is Q which is'the logical consequence of C, and Cy Similarly modus tellens rule is (P + Q) OP Putting in clause form Creve Gna - ‘The resolvent of C, and C, is ~ P which is the logical consequence C' aud C, Proof Consider two clauses C, and contains L and C, contain = L Writing C, as Lv C and Gas sLv Cy resolvent of C, and C, is C= Cf v Cy id Now we want to show C is the logical consequence of C, and C,:In essence, we want fo show that if C, and C, are true, Cis tue. “Assume C, and C, are true. Now there are two possibilities, Either L is ts of Lis false. 1fL is true, ~L is false and in order that C, is true, C; is tre, Hence C= Gj v Cy is te. Thé Foundations Logicard Proofs 65 Ie-Lis false, in order that C; is true, Cy is tue. Hence C= Cv Cy is tre, So whenever C; and C, are true Cis true dise Ul Hence Cis the logical consequence of C, and C, Th ie resolution priiciple Given a det S of cl ti ii There i lauses, a (resolution) deduction of C fio on Gy Se re st gttses uch that each C lter i. clas, ia Sor resolvent ‘elas moneda luction of C1 (empty classe) is called a refutation or a proof ofS, ae Ifyou fave an argument where P, ou fave an Pay vane P, de the preshises and. resoation principle, put ny Pin clause fom and add ot Cn une fore S23 be dered the auniet i valid "For exani ple, cot maids modisponens P tion jin, to geta proof using lause form. From this sequence, if] BP Lae In the clause form C, = P + G=4Pva ‘Take as C;, the negation of the conclusion,ie, =O, == From C, and C, by resolution you can get Q and from this and C, by resolution( {is anrved a. GP from C, and C, by resolution © C, . from C, and C, by resolution Cy 0 \W/ASGIERBIG We show that the following argument is correct. ‘ftoday is Tuesday, Ihave a test in Mathematics: cor Bconcmies.ftiy Beohomnics Professors sick, willnothavea test in Beononies, Toddy is Tuesday and my Beonomics Professors sick. Therefore, I have a test in Mateiatic. Conyerting to Jogical rgtat _ Let 7 denote “Today is Tuesday” i ‘Mf denote have atést in Matinatcs denote ‘Thave atest in Economics” 5 denote ‘My Economics Professor is sick’ ; So the premises are. T+ (Mv E) i S35 Tas cM Putting is clause form Cy: PV Mv E ic GinSvmE Ces : CLiaat (negation of voactasion) Now ie hae to check neti it ig pode to derive Coin Gy, Cj, Cy Co Ci Froic, anid) ys TV MS fom Cand GG MVS 66. Discrete Matheraties & ts Appleations fiomC,andC, Gy: fromCandC, Gt Hence the argument is correct < ‘uff Logic Programming: An important type of programming language is designed to reason using the rules of predicate logic. Prolog (from Programming in Logic), developed in the 1970s by computer scientists working in the area of atificial intelligence; isan example of such a language. Prolog programs include a set of declarations consisting of two types of statements, Prolog facts and Prolog rules Prolog facts define predi- Links Qe. cates by specifying the elements that satisty these predicates Prolog ules are ued to define new predicates using those already defined by Prolog facts. Example 28 illustrates these notions. Examplé12- Consider a Prolog program given facts telling it the instructor of each class and in which classes students are enrolled. The program uses these facts to answer queries concerning the professors who {each particular students. Such a program could use the predicates instnictor{p, c) and enrolled{s, c) to rep resent thtprofessr pis the instructor of eours cand that student is enrolled in course respectively. For example, the Prolog facts in such a program might include instructor (chan,math273) instructor (patel, ee222) instructor (grossman,c5301}) » enrolled (kevin, math273) enrolled(juana, e222) enzolled(juana,cs302) enrolled (kiko,mati273) enrolled (kiko, cs301) (Lowercase letters have been used for entries because Prolog considers names beginning with an upper- cave letter to be variables.) ‘Anow predicate feaches( p, s), representing that professor p teaches student s, can be defined using the Prolog nile teaches (p,5) instructor (pre), enrolled(s,c) which means that teaches(p, 3) is true ifthere exists a class c such that professor p isthe instructor of class and student « is enrolied in class c, (Note that a comma is used to represent « conjunction of predicates in Prolog. Similarly, a semicolon is used to represent a disjunction of piedicatés) Prolog answers queries using the facts and rules it is given. For example, using the facts én rules listed, the query enrolled (kevin, math273) produces the response yes because the fact enxo1 led(kevin, math273) was provided as input. The query . Penrolled (X, math273) produces the response kevin : kiko ‘To produce this response, Prolog determines all possible values of X for which enrolled(X, math273) has beet included as a Prolog fact, Similarly, to find all the professors who are instructors in classes being taken b Juana, we use the query 2eeaches (x, Juana) om ole ‘TheFoundations Logie and roofs 67 ‘This query returas ated groceman < ‘Now we shall consider the connection between resolution prtciple and Prolog. ‘A Horn clause is a clause with at most one non-negated literal, If all literals are negated, it is called a headless Horn clause. f one literal is non-negated, Wis called a feaded Horn clause. ~ Consider the following rule: ‘Aunt (x,y) :— Female (x), Sister (x, 2), Parent (2,3) Rule (1) ‘This means ifx is a Female and xis the Sister of : and 2 is a Parent of y, then xis the Aunt of y Suppose we want to conclude Sita is the Aunt of Mobi. ‘We have the following facts Female (Sita) -Fy Sister (Site, Geethe) — — F, Parent (Geetha, Mohan) — 7, ~ Instantiating the rule (1) we get ‘Aunt (Sita, Moan) :— Female (Sita), Sister (Sita, Geetha), Parent (Geetha, Mohan). Ench F, FF, isa headed Hom clause. Rule (1) can be writen in logical notation as Wx Vy Wa [(Pemale (x) 1 Sistor (x, 2) 0 Parent (z,9)) > Aunt (x, 9)] Using instantiation we get (Female (Sita) » Sister (Sita, Geetha) a Parent (Geetha, Mohan)) > Aunt (Sita, Mohan) Expressing as a clause this becomes ~ Female (Sita) « Sister (Sita, Geetha) » Parent (Geetha, Moban)) v Aimn (Sita, Mohan) Using DeMongan’s laws we get ~ Fernale (Sita) v ~y Sister (Sita, Geetha) v — Parent (Geetha, Mohan)) v Aunt (Sita, Mohan) ~ iR, (instantiation of rule 1) ‘The conclusion we want to derive is Aunt (Sita, Moban). Negeting the conclusion we get : ~ Aunt (Sita, Mohan) — NC (nogation of conclusion) * From F, Fy Fy IR, and NG, it can be seen that using resolution we can derive the empty clause, Hence lusion Aunt (Site, Moh) is correct. Note that in a rule in Prolog what.occurs on the left hand side of is the headed portion end what occurs in the right hand portion is the headless portion. Hence a rule nds to,a Hom clause. A fact consists ofa single nbtenégated literal and hence a Hom clase, THe conclusion derived is -— Aunt (Sita, Mohan) and for resolution we take the negation of the right hand side of ~. This isa headless Hom clause, ‘The question asked is ? Aunt (Sita, Mohan) and Prolog replies yes. ‘he goal is Aun! (Sta, Mohan) and Prolog rest find rules and facts and using proper instantiation ries {to see whether the goal is satisfied. This is called backward chaining. ‘Thus we see thatthe resolution principle is used inthe loge programming language Prolog, Is also used in ‘automatic theorem proving where-a prograin or software package is used to prove theorems, given the axioms, Falliies "' Several common fallacies arise in incorrect arguments. These fallacies resémble rales of inference but are based on contingencies rather than tautologies. These are discussed here to show the distine- tion between correct and incorrect reasoning, . The proposition [(p -> q).- 9] ~¥p is not a tautology, because itis false when p is false asd q is true, However, there are many incorrect arguments that trea this as a tautology. In other Links 68 ovscrete Mathemettes& its Applications wots, they treat the argument with premises pg and and conclusion pasa valid arguent form, which itis not. This type of incorrect reasoning is called the fallacy of affirming the conclusion, ExArTIple 13° Ls the following argument valid? {you do every problam inthis book, then you will learn discrete matheriatics. You learned discrete mathematics. Therefore, you did every problem in this book. Solutlon Let be the proposition "You di every problem inthis book.” Let be the proposition "You learned dene mathematics: Thea this angument is ofthe form: ip > q ad g then p. This isa example of an incorrect argument using the fallacy of affirming thie conclusion. Indeed, it is possible for You to learn discrete ane pematis in some way other than by doing every problem inthis book. (You may lean discrete ‘mathematics ty reading listening to lectures, doing some, but net all, the problems in tis book, an soon.) < ‘The proposition [(p -> 4) AF] ~>- is nota tautology, beeause iis false when pit else and qis true. “Maiy incomest arguments use this incorretly as rule of infereie. This type of inoorteet reasoning is called the fallacy of denying the hypothesis. Exdmple'q: Lerp andg he as in Example 10. Ifthe conditional siatement p—» q is true, and —p is true, Is tt eorrect to conclude that —q Is true? In other words, is it correct to assuine that you did not learn discrete mathematics 'you did not do every problem in the book, assuming that if you do every problem in this book, then you will learn discrete mathematics? : “solution It is possible that you learned discrete mathematics even if you did not do every problem in this aaaateryis incorect argument is ofthe form p> q and ~p imply —~g, Which is an example ofthe fallacy of denying the hypothesis. < *. pullag ot interehcetsr Quantified Stateiiehts We have discussed rules of inference for propositions. ‘We will now describe some important rules ‘of inference for statements involving ‘quantifiers, These rules of inference are used extensively in ‘mathematical arguments, often without being ‘explicitly mentioned. ‘Universal instantiation is the rule of inference used to conclude that P(c) is true, where c is a particular member of the domain, given the premise ‘vx PG). Universal instantiation is used when we conclude from the statement “All women are Wise” that “Lisa is Wise,” where Lisa is ‘niéinber of thé domain of all women. Te eel generalization nthe tule of inference tha sats tt Vs) ita, given the premise WAN) is true for all elements c in the domain. ‘Universal generalization is used when we show that Vx P(x) is true boy taking an arbitrary elemént c from the domaii and showing that P(c) ists. ‘The element c that we select oust be an arbitrary; and not a specific element ofthe domain. That is, when We ‘assert from Vx P(x) the exis- tence of an element ¢ in the doniain, we have no coutrol over ¢ and cannot thake any ‘other assumptions about other than it comes from the domain. “Universal generalization is used implicitly in many proofs in math~ ‘ematies and is seldom mentiotied | explicitly. However, the error of adding wiwarrdnted assumptions about the arbitrary element c when universal generalization is used is all too corttnén in incorrect reasoning. ‘Taicfential instantiation is the rile that allows us fo conclude that there isan element fp the doinain for which P(c) is true if we know that ‘3x P(x) is true, We cannot ‘select an arbitrary value of c hero, but ‘rather it must be ac for which P(c) is true. ‘Usually we have no knowledge ‘of what c is, only that it exists. Because it exists, we may give it a name (¢) and continue our argument. Existential generalization is the rule: ‘of inference that is tised to conclude that ‘x P(x) is true when a par- ticular element ¢ with P(c) true is known. ‘That is, if we know one element c in the ‘domain for which P(e} is ‘rue, then we know that 3x (3) is true We sui for quanti mpl computer in compu Solution | extr example Step Lvs . 206 3. back in this ¢ the book ‘Solutio: ‘The pre canbe Step Cesar een ami vacaaH ich sorete samed of an iserete ‘nates < is te. called istrue, liscrete s book, vin this acy of < sitions. ules of articular trom the Srnea, ‘hat P(e) «jis tre ve select thie exis- rns about jn math- bout the oinain for ‘rather it ecause it hen a pait- chP(0)is éxample 15). Show that the premises ‘computer science” and “Marla isa student in this class” impl ‘hse sh hse premier ‘The Foundations Logic ond Proofs 69 We summarize these rules of inference in Table 2. We will ilustrate how one of these rules of inference for quantified statements is used in Example 15, ‘in computer science.” i Table 2 Rules of inference for quantified statements. Rule of Inference PT Name ere ‘Universal instantiation Pe) safeties PC for an arbitrary ¢ Universal generalization Ve PO) ecified Sahay se ae) ‘Bxistential, instantiation +. Pe fortome oement sig ‘Pe) for some element © ® : 2 3xP@) t ‘ “Everyone in this discrete mathematics class has taken a course in ly the conclusion “Marla has taken a course Solution Let D(x) denote “x isin this discrete mathematics class,” and let C(x) denote “has taken'a course Extra FQ sion is C (Marla). Examples QJ The following steps can be used to establish the conclusion from the premises. step : Reason ae LD) + Cb) Promise 2.D(Marla) + C(Marla) Universal inslaitiation from (1) 3. D(Marla) Premise 4, C(Marla) ‘Modus ponens from (2) and (3) 8 in computer science.” Then the premises are Vx(D{x) > C(z)) and D (Maria). The conchae < “44 student in this class has not read the book, "and “Everyone in his class pasted the first exam” imply the conclusion “Someone who passed the frst exam has not read the book. * Solution “Let C(x) be is in this class,” B(x) be “x has read the book,” and P(x) be “x passed the first exam.” “The promises are 3x(C(a) a BEA) and Wx{ C(x) > PG). The conclusion is xP (x) A—B(). These steps can be used to establish the conclusion from the pre Step Reason 1. Sx(CQi) A—BG@) Premise 2. Cla) a+Bl@) ‘Existential instantiation from (1) 3. Cla) ‘Simplification from (2) 4. Vx(CX) + P@) “Premise 5. Cla) Pla) Universal instantiation from (4) , 6. Pa) ‘Modus ponens from (3) atid () 7, -B@) ‘Simplification from (2) 8 Pla) A—Bla) ‘Conjunction from (6) and (7) vd 9. 3x(P@) AB) —_ Existential generalization from (8)

You might also like