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.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logic Concepts Lecture Module 11.
Valid Arguments An argument is a sequence of propositions. All but the final proposition are called premises. The last statement is the conclusion. The.
Knowledge Representation Methods
CS128 – Discrete Mathematics for Computer Science
Models -1 Scientists often describe what they do as constructing models. Understanding scientific reasoning requires understanding something about models.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
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.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2.1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Discrete Mathematics and its Applications
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
Predicates and Quantifiers
Artificial Intelligence Reasoning. Reasoning is the process of deriving logical conclusions from given facts. Durkin defines reasoning as ‘the process.
Intro to Discrete Structures
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
0 Validity & Invalidity (Exercises) December 23, 2005.
Chapter 1 Logic Section 1-1 Statements Open your book to page 1 and read the section titled “To the Student” Now turn to page 3 where we will read the.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Discrete Structures (DS)
Pattern-directed inference systems
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
SSK3003 DISCRETE STRUCTURES
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 8.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
0 Validity & Invalidity (Exercises) All dogs have two heads. 2. All tigers are dogs. ___________________________________ 3. All tigers have two.
Propositional Logic. Topics Propositional calculus Deductions and prove Logical equivalence Tautologies Satisfiability.
LECTURE 19 THE COSMOLOGICAL ARGUMENT CONTINUED. THE QUANTUM MECHANICAL OBJECTION DEPENDS UPON A PARTICULAR INTERPRETATION WE MIGHT REASONABLY SUSPEND.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
Predicate Calculus. Topics Predicate calculus First-order predicate calculus Properties of logical systems – soundness, – completeness, – monotonicity,
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
1 Lecture 3 The Languages of K, T, B and S4. 2 Last time we extended the language PC to the language S5 by adding two new symbols ‘□’ (for ‘It is necessary.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
CT214 – Logical Foundations of Computing Darren Doherty Rm. 311 Dept. of Information Technology NUI Galway
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 4- Logic.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Propositional and Predicate Logic
CS201: Data Structures and Discrete Mathematics I
CS201: Data Structures and Discrete Mathematics I
First Order Logic Rosen Lecture 3: Sept 11, 12.
Back to “Serious” Topics…
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
CS201: Data Structures and Discrete Mathematics I
Logical and Rule-Based Reasoning Part I
CS201: Data Structures and Discrete Mathematics I
Introduction to Computational Linguistics
Presentation transcript:

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 Truth Tables l Complex Truth Tables l Tautology l Equivalence l Propositional Logic

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 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 Logical Operators l AndΛ l OrV l Not ¬ l Implies → (if… then…) l Iff ↔ (if and only if)

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 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 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 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 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 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 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 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 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 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 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 Deduction - Example

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 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 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 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 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  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 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 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 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 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 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 l All horses have brains Herman is a horse Therefore Herman has a brain

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 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 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 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 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 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 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 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 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 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 Class Exercise l Draw a truth table for the following expressions: 1. ¬A Λ(AVB)Λ(BVC) l 2. ¬A Λ(AVB)Λ(BVC)Λ ¬D