Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.

Similar presentations


Presentation on theme: "1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l."— Presentation transcript:

1 1 Chapter 7 Propositional and Predicate Logic

2 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l Truth Tables l Complex Truth Tables l Tautology l Equivalence l Propositional Logic

3 3 Chapter 7 Contents (2) l Deduction l Predicate Calculus Quantifiers  and  l Properties of logical systems l Abduction and inductive reasoning l Modal logic

4 4 What is Logic? l Reasoning about the validity of arguments. l An argument is valid if its conclusions follow logically from its premises – even if the argument doesn’t actually reflect the real world: nAll lemons are blue nMary is a lemon nTherefore, Mary is blue.

5 5 Logical Operators l AndΛ l OrV l Not ¬ l Implies → (if… then…) l Iff ↔ (if and only if)

6 6 What is a Logic? l What is a Logic? l _ A logic consists of three components: l 1. Syntax: A language for stating l propositions/sentences. l 2. Semantics: A way of determining whether a l given proposition/sentence is true or false. l (Model theory) l 3. Inference system: Rules for l inferring/deducing theorems from other l theorems.

7 7 Translating between English and Logic l Facts and rules need to be translated into logical notation. l For example: nIt is Raining and it is Thursday: R Λ T nR means “It is Raining”, T means “it is Thursday”.

8 8 Translating between English and Logic l More complex sentences need predicates. E.g.: nIt is raining in New York: nR(N) nCould also be written N(R), or even just R. l It is important to select the correct level of detail for the concepts you want to reason about.

9 9 Truth Tables l Tables that show truth values for all possible inputs to a logical operator. l For example: l A truth table shows the semantics of a logical operator.

10 10 Complex Truth Tables l We can produce truth tables for complex logical expressions, which show the overall value of the expression for all possible combinations of variables:

11 11 Tautology The expression A v ¬A is a tautology. l This means it is always true, regardless of the value of A. A is a tautology: this is written ╞ A l A tautology is true under any interpretation. l Example: A A l A V ¬A l An expression which is false under any interpretation is contradictory. l Example: A Λ ¬ A

12 12 Equivalence l Two expressions are equivalent if they always have the same logical value under any interpretation: A Λ B  B Λ A l Equivalences can be proven by examining truth tables.

13 13 Some Useful Equivalences l A v A  A l A Λ A  A l A Λ (B Λ C)  (A Λ B) Λ C l A v (B v C)  (A v B) v C l A Λ (B v C)  (A Λ B) v (A Λ C) l A Λ (A v B)  A l A v (A Λ B)  A l A Λ true  AA Λ false  false l A v true  trueA v false  A

14 14 Propositional Logic l Propositional logic is a logical system. l It deals with propositions. l Propositional Calculus is the language we use to reason about propositional logic. l A sentence in propositional logic is called a well-formed formula (wff).

15 15 Propositional Logic l The following are wff’s: l P, Q, R… l true, false l (A) l ¬A l A Λ B l A v B l A → B l A ↔ B

16 16 Deduction l The process of deriving a conclusion from a set of assumptions. l Use a set of rules, such as: AA → B B If A is true, and A implies B is true, then we know B is true. l (Modus Ponens) l If we deduce a conclusion C from a set of assumptions, we write: l {A 1, A 2, …, A n } ├ C

17 17 Deduction - Example

18 18 Predicate Logic l The first of these, predicate logic, involves using standard forms of logical symbolism which have been familiar to philosophers and mathematicians for many decades.

19 19 l Most simple sentences, l for example, ``Peter is generous'' or ``Jane gives a painting to Sam,'' l can be represented in terms of logical formulae in which a predicate is applied to one or more arguments

20 20 Predicate Calculus l Predicate Calculus extends the syntax of propositional calculus with predicates and quantifiers: nP(X) – P is a predicate. l First Order Predicate Calculus (FOPC) allows predicates to apply to objects or terms, but not functions or predicates.

21 21 Quantifiers  and  l  - For all: n xP(x) is read “For all x’es, P (x) is true”. l  - There Exists: n x P(x) is read “there exists an x such that P(x) is true”. l Relationship between the quantifiers: n xP(x)  ¬(x)¬P(x) n“If There exists an x for which P holds, then it is not true that for all x P does not hold”.

22 22 Existential Quantifier  -”there exists” l There are times when, rather than claim that something is true about all things, we only want to claim that it is true about at least one thing. l For example, we might want to make the claim that "some politicians are honest," but we would probably not want to claim this universally.

23 23  l A way that mathematicians often phrase this is "there exists a politician who is honest." l Our abbreviation for "there exists" is " ", which is called the existential quantifier because it claims the existence of something. l If we use P for the predicate "is a politician" and H for the predicate "is honest," we can write "some politicians are honest" as:  x[Px Hx].

24 24 Properties of Logical Systems l Soundness: Is every theorem valid? l Completeness: Is every tautology a theorem? l Decidability: Does an algorithm exist that will determine if a wff is valid? l Monotonicity: Can a valid logical proof be made invalid by adding additional premises or assumptions?

25 25 Abduction and Inductive Reasoning l Abduction: BA → B A l Not logically valid, BUT can still be useful. l In fact, it models the way humans reason all the time: nEvery non-flying bird I’ve seen before has been a penguin; hence that non-flying bird must be a penguin. l Not valid reasoning, but likely to work in many situations.

26 26 Inductive Reasoning l Inductive Reasoning enable us to make predictions based on what has happened in the past. l Example: “The Sun came up yesterday and the day before, and everyday I know before that, so it will come up again tomorrow.”

27 27 Three Kinds of Reasoning l Broadly speaking there are 3 kinds of reasoning: l deductive – Based on the use of modus ponens and other deductive rules and reasoning. l abductive – Based on common fallacy. l inductive – Based on history (what has happened in the past)

28 28 Examples l A deductive argument consists of n premisses and a conclusion. l If the argument is valid, then if the premisses are true the conclusion must be true: l Premiss 1: If it's raining then the streets are wet Premiss 2: It's raining ----------------- Therefore the streets are wet

29 29 l All horses have brains Herman is a horse -------------- Therefore Herman has a brain

30 30 When Conclusion Does Not Follow From the Premisses l The following are invalid: l If it's raining then the streets are wet The streets are wet --------------- Therefore it's raining l All horses have brains Herman has a brain --------------- Therefore Herman is a horse

31 31 Examples of Invalid Arguments l The following two arguments are invalid: l If it's raining then the streets are wet The streets are wet -------------- Therefore it's raining l All horses have brains Herman has a brain -------------- Therefore Herman is a horse

32 32 More on Deductive Reasoning l An argument can have any number of premisses: l If p then q If q then r If r then s If s then t p ------- l Therefore t

33 33 Abductive reasoning l Abduction is "reasoning backwards". We start with some facts and reason back to a hypothesis. E.g. l If someone has measles they have spots and a sore throat Jimmy has spots and a sore throat ------------------------ Therefore Jimmy has measles l This isn't formally valid, of course. In fact it is a famous fallacy, called "confirming the consequent".

34 34 An Earlier Example l If it's raining then the streets are wet The streets are wet -------------- Therefore it's raining l Nevertheless this does seem to be how doctors work. l They use abduction to generate hypotheses, which they then test (for instance, by doing a blood test).

35 35 Inductive reasoning l Inductive reasoning is reasoning from particular cases or facts to a general conclusion: l raven 1 is black raven 2 is black.. raven n is black ----------- Therefore all ravens are black

36 36 More Examples l horse 1 has a brain horse 2 has a brain.. horse n has a brain ------------- Therefore all horses have brains l These go from SOME to ALL: l All observed (i.e. some) Xs have property P ------------------------------- Therefore all Xs have P

37 37 Limitations l This isn't formally valid. l The conclusion does not formally follow from the observed facts. l At one time people believed that all observed swans are white, therefore all swans are white. l This is false, of course, because there are black swans in Western Australia!

38 38 Modal logic l Modal logic is a higher order logic. l Allows us to reason about certainties, and possible worlds. l If a statement A is contingent then we say that A is possibly true, which is written: ◊A l If A is non-contingent, then it is necessarily true, which is written: AA

39 39 Reasoning in Modus Logic l The following rules are examples of the axioms that can be used to reason in modus logic: l  A ◊A l  ¬ A ¬ ◊A l ◊A ¬  A l We cannot draw truth tables to prove them; however, you can reason by your understanding of the meaning of the operators.

40 40 Class Exercise l Draw a truth table for the following expressions: 1. ¬A Λ(AVB)Λ(BVC) l 2. ¬A Λ(AVB)Λ(BVC)Λ ¬D


Download ppt "1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l."

Similar presentations


Ads by Google