Chapter 7 Propositional and Predicate Logic 1 Chapter

  • Slides: 40
Download presentation
Chapter 7 Propositional and Predicate Logic 1

Chapter 7 Propositional and Predicate Logic 1

Chapter 7 Contents (1) l l l l What is Logic? Logical Operators Translating

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

Chapter 7 Contents (2) l l l Deduction Predicate Calculus Quantifiers and Properties of

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

What is Logic? l l Reasoning about the validity of arguments. An argument is

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

Logical Operators And l Or l Not l Implies l Iff l Λ V

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

What is a Logic? l l l l l What is a Logic? _

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

Translating between English and Logic Facts and rules need to be translated into logical

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

Translating between English and Logic l More complex sentences need predicates. E. g. :

Translating between English and Logic l More complex sentences need predicates. E. g. : n It is raining in New York: n R(N) n Could 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. 8

Truth Tables that show truth values for all possible inputs to a logical operator.

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

Complex Truth Tables l We can produce truth tables for complex logical expressions, which

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: 10

Tautology l l l The expression A v ¬A is a tautology. This means

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

Equivalence l Two expressions are equivalent if they always have the same logical value

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

Some Useful Equivalences l l l l l A A A A v. A

Some Useful Equivalences l l l l l A A A A v. A A Λ (B Λ C) (A Λ B) Λ C v (B v C) (A v B) v C Λ (B v C) (A Λ B) v (A Λ C) Λ (A v B) A v (A Λ B) A A Λ true A A v true A Λ false A v false A 13

Propositional Logic Propositional logic is a logical system. l It deals with propositions. l

Propositional Logic 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). l 14

Propositional Logic l l l l l The following are wff’s: P, Q, R…

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

Deduction The process of deriving a conclusion from a set of assumptions. l Use

Deduction The process of deriving a conclusion from a set of assumptions. l Use a set of rules, such as: A A→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, …, An} ├ C l 16

Deduction - Example 17

Deduction - Example 17

Predicate Logic l The first of these, predicate logic, involves using standard forms of

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. 18

Most simple sentences, l for example, ``Peter is generous'' or ``Jane gives a painting

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 l 19

Predicate Calculus l Predicate Calculus extends the syntax of propositional calculus with predicates and

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

Quantifiers and l - For all: n l x. P(x) is read “For all

Quantifiers and l - For all: n l x. P(x) is read “For all x’es, P (x) is true”. - There Exists: n x P(x) is read “there exists an x such that P(x) is true”. l Relationship between the quantifiers: x. P(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”. n 21

Existential Quantifier -”there exists” There are times when, rather than claim that something is

Existential Quantifier -”there exists” 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. l 22

 l l A way that mathematicians often phrase this is "there exists a

l l A way that mathematicians often phrase this is "there exists a politician who is honest. " Our abbreviation for "there exists" is " ", which is called the existential quantifier because it claims the existence of something. 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]. 23

Properties of Logical Systems Soundness: Is every theorem valid? l Completeness: Is every tautology

Properties of Logical Systems 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? l 24

Abduction and Inductive Reasoning l l l Abduction: B A→B A Not logically valid,

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

Inductive Reasoning enable us to make predictions based on what has happened in the

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. ” l 26

Three Kinds of Reasoning l l Broadly speaking there are 3 kinds of reasoning:

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

Examples l l l A deductive argument consists of n premisses and a conclusion.

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

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

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

When Conclusion Does Not Follow From the Premisses l l l The following are

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

Examples of Invalid Arguments l l l The following two arguments are invalid: If

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

More on Deductive Reasoning l l l An argument can have any number of

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

Abductive reasoning l l l Abduction is "reasoning backwards". We start with some facts

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

An Earlier Example l l l If it's raining then the streets are wet

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

Inductive reasoning l l Inductive reasoning is reasoning from particular cases or facts to

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

More Examples l l l horse 1 has a brain horse 2 has a

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

Limitations l l This isn't formally valid. The conclusion does not formally follow from

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

Modal logic l l Modal logic is a higher order logic. Allows us to

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

Reasoning in Modus Logic l l l The following rules are examples of the

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

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

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