Example: dental hygienist

LECTURE 7: PROPOSITIONAL LOGIC (1)

LECTURE 7: PROPOSITIONALLOGIC (1)Software EngineeringMike WooldridgeLecture 7 Software Engineering1 What is a LOGIC ? When most people say LOGIC , they meaneitherpropositional logicorfirst-orderpredicate LOGIC . However, the precise definition is quitebroad, and literally hundreds of logicshave been studied by philosophers,computer scientists and mathematicians. Any formal system can be considered alogic if it has: a well-definedsyntax; a well-definedsemantics; and a Wooldridge1 LECTURE 7 Software Engineering Thesyntaxof a LOGIC defines thesyntactically acceptable objects of thelanguage, which are properly calledwell-formed formulae(wff). (We shall justcall them formulae.)

2.1 The Connectives Now, the study of atomic propositions is pretty boring. We therefore now introduce a number of connectives which will allow us to build up complex propositions. The connectives we introduce are: ^ and (& or .) _ or (jor +): not (˘))implies (˙or !),iff (Some books use other notations; these are given in parentheses.) Mike ...

Tags:

  Logic, Connective, Propositional, Propositional logic

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of LECTURE 7: PROPOSITIONAL LOGIC (1)

1 LECTURE 7: PROPOSITIONALLOGIC (1)Software EngineeringMike WooldridgeLecture 7 Software Engineering1 What is a LOGIC ? When most people say LOGIC , they meaneitherpropositional logicorfirst-orderpredicate LOGIC . However, the precise definition is quitebroad, and literally hundreds of logicshave been studied by philosophers,computer scientists and mathematicians. Any formal system can be considered alogic if it has: a well-definedsyntax; a well-definedsemantics; and a Wooldridge1 LECTURE 7 Software Engineering Thesyntaxof a LOGIC defines thesyntactically acceptable objects of thelanguage, which are properly calledwell-formed formulae(wff). (We shall justcall them formulae.)

2 Thesemanticsof a LOGIC associate eachformula with ameaning. Theproof theoryis concerned withmanipulating formulae according tocertain Wooldridge2 LECTURE 7 Software Engineering2 PROPOSITIONAL LOGIC The simplest, and most abstract LOGIC wecan study is calledpropositional LOGIC . Definition:Apropositionis a statementthat can be eithertrueorfalse; it must beone or the other, and it cannot be both. EXAMPLES. The following arepropositions: the reactor is on; the wing-flaps are up; John Major is prime the following are not: are you going out somewhere? 2+3 Mike Wooldridge3 LECTURE 7 Software Engineering It is possible to determine whether anygiven statement is a proposition byprefixing it with:It is true that.

3 And seeing whether the result makesgrammatical sense. We now , these are the set of smallestpropositions. Definition:Anatomic propositionis onewhose truth or falsity does not depend onthe truth or falsity of any otherproposition. So all the above propositions are Wooldridge4 LECTURE 7 Software Engineering Now, rather than write out propositions infull, we will abbreviate them by usingpropositional variables. It is standard practice to use thelower-case roman lettersp,q,r,..to stand for propositions. If we do this, we must define what wemean by writing something like:LetpbeJohn Major is prime Minister. Another alternative is to write somethinglikereactorison, so that the interpretationof the PROPOSITIONAL variable Wooldridge5 LECTURE 7 Software The Connectives Now, the study of atomic propositions ispretty boring.

4 We therefore now introducea number ofconnectiveswhich will allowus to build upcomplex propositions. The connectives we introduce are: and (& or .) or (|or +) not ( ) implies ( or ) iff (Some books use other notations; these aregiven in parentheses.)Mike Wooldridge6 LECTURE 7 Software EngineeringAnd Any two propositions can be combined toform a third proposition called theconjunctionof the original propositions. Definition:Ifpandqare arbitrarypropositions, then theconjunctionofpandqis writtenp qand will be true iff bothpandqare Wooldridge7 LECTURE 7 Software Engineering We can summarise the operation of in atruth table. The idea of a truth table forsome formula is that it describes thebehaviour of a formula under all possibleinterpretations of the primitivepropositions the are included in theformula.

5 If there arendifferent atomic propositionsin some formula, then there are2ndifferentlines in the truth table for that formula.(This is because each proposition can takeone 1 of 2 values trueorfalse.) Let us writeTfor truth, andFfor the truth table forp qis:pqp qFFFFTFTFFTTTMike Wooldridge8 LECTURE 7 Software EngineeringOr Any two propositions can be combined bythe word or to form a third propositioncalled thedisjunctionof the originals. Definition:Ifpandqare arbitrarypropositions, then thedisjunctionofpandqis writtenp qand will be true iff eitherpis true, orqistrue, or bothpandqare Wooldridge9 LECTURE 7 Software Engineering The operation of is summarised in thefollowing truth table:pqp qFFFFTTTFTTTTMike Wooldridge10 LECTURE 7 Software EngineeringIf.

6 Then.. Many statements, particularly inmathematics, are of the form:ifpis true thenqis way of saying the same thing is towrite:pimpliesq. In PROPOSITIONAL LOGIC , we have aconnective that combines two propositionsinto a new proposition called theconditional, orimplicationof the originals,that attempts to capture the sense of sucha Wooldridge11 LECTURE 7 Software Engineering Definition:Ifpandqare arbitrarypropositions, then theconditionalofpandqis writtenp qand will be true iff eitherpis false orqistrue. The truth table for is:pqp qFFTFTTTFFTTTMike Wooldridge12 LECTURE 7 Software Engineering The operator is the hardest tounderstand of the operators we haveconsidered so far, and yet it is extremelyimportant.

7 If you find it difficult to understand, justremember that thep qmeans ifpistrue, thenqis true .Ifpis false, then we don t care aboutq, andby default, makep qevaluate toTinthis case. Terminology: if is the formulap q,thenpis theantecedentof andqis Wooldridge13 LECTURE 7 Software EngineeringIff Another common form of statement inmaths is:pis true if, and only if,qis true. The sense of such statements is capturedusing thebiconditionaloperator. Definition:Ifpandqare arbitrarypropositions, then thebiconditionalofpandqis written:p qand will be true iff both true; both Wooldridge14 LECTURE 7 Software Engineering The truth table for is:pqp qFFTFTFTFFTTT Ifp qis true, thenpandqare said to belogically equivalent.

8 They will be true underexactly the same Wooldridge15 LECTURE 7 Software EngineeringNot All of the connectives we have consideredso far have beenbinary: they have takentwoarguments. The final connective we consider here isunary. It only takesoneargument. Any proposition can be prefixed by theword not to form a second propositioncalled thenegationof the original. Definition:Ifpis an arbitrary propositionthen thenegationofpis written pand will be true iffpis false. Truth table for :p pFTTFMike Wooldridge16 LECTURE 7 Software EngineeringComments We cannestcomplex formulae as deeply aswe want. We can , ),(, todisambiguateformulae. EXAMPLES. Ifp,q,r,sandtare atomicpropositions, then all of the following areformulae:p q rp (q r)(p (q r)) s((p (q r)) s) twhereas none of the following is:p p q)p Mike Wooldridge17 LECTURE 7 Software Engineering3 Tautologies & Consistency Given a particular formula, can you tell ifit is true or not?

9 No you usually need to know the truthvalues of the component atomicpropositions in order to be able to tellwhether a formula is true. Definition:Avaluationis a function whichassigns a truth value to each primitiveproposition. In Modula-2, we might write:PROCEDURE Val(p : AtomicProp):BOOLEAN; Given a valuation, we can say for anyformula whether it is true or Wooldridge18 LECTURE 7 Software Engineering EXAMPLE. Suppose we have a valuationv, such that:v(p) =Fv(q) =Tv(r) =FThen we truth value of(p q) risevaluated by:(v(p) v(q)) v(r)(1)= (F T) F(2)=T F(3)=F(4)Line (3) is justified since we know thatF T= (4) is justified sinceT F= you can t see this, look at the truth tablesfor and.

10 Mike Wooldridge19 LECTURE 7 Software Engineering When we consider formulae in terms ofinterpretations, it turns out that some haveinteresting properties. Definition:1. A formula is atautologyiff it is trueundereveryvaluation;2. A formula isconsistentiff it is trueunderat least onevaluation;3. A formula isinconsistentiff it is notmade true underanyvaluation. Now, each line in the truth table of aformula correponds to a valuation. So, we can use truth tables to determinewhether or not formulae are Wooldridge20


Related search queries