Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
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.
Logic Use mathematical deduction to derive new knowledge.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Logic Concepts Lecture Module 11.
Knowledge Representation Methods
CS128 – Discrete Mathematics for Computer Science
CSE (c) S. Tanimoto, 2008 Propositional Logic
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.
From Chapter 4 Formal Specification using Z David Lightfoot
Knoweldge Representation & Reasoning
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Intro to Discrete Structures
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
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.
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.
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
SSK3003 DISCRETE STRUCTURES
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
Chapter Five Conditional and Indirect Proofs. 1. Conditional Proofs A conditional proof is a proof in which we assume the truth of one of the premises.
Propositional Logic. Topics Propositional calculus Deductions and prove Logical equivalence Tautologies Satisfiability.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Today’s Topics 11/17/15CS Fall 2015 (Shavlik©), Lecture 24, Week 111 Representing Knowledge in a Logic One way to get domain knowledge into a computer,
Outline Logic Propositional Logic Well formed formula Truth table
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
CT214 – Logical Foundations of Computing Darren Doherty Rm. 311 Dept. of Information Technology NUI Galway
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
Chapter 1 Logic and proofs
Logic.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Discrete Mathematics Logic.
COMP 1380 Discrete Structures I Thompson Rivers University
The Propositional Calculus
Propositional Logic and Methods of Inference
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Logical Agents Chapter 7.
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
COMP 1380 Discrete Structures I Thompson Rivers University
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
CS201: Data Structures and Discrete Mathematics I
Logical Agents Chapter 7 Andreas Geyer-Schulz and Chuck Dyer
Presentation transcript:

Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University

TRU-COMP3710 Propositional/Predicate Logic2 Course Outline Part I – Introduction to Artificial Intelligence Part II – Classical Artificial Intelligence Knowledge Representation Searching Knowledge Represenation and Automated Reasoning Propositinoal and Predicate Logic Inference and Resolution for Problem Solving Rules and Expert Systems Part III – Machine Learning Part IV – Advanced Topics Genetic Algorithms

TRU-COMP3710 Propositional/Predicate Logic3 Chapter Objectives

TRU-COMP3710 Propositional/Predicate Logic4 Chapter Outline Propositional logic 1. Introduction Introduction 2. What is logic? Why is logic used in Artificial Intelligence? What is logic? Why is logic used in Artificial Intelligence? 3. How to use logical operators How to use logical operators 4. How to translate an English statement with logic notations How to translate an English statement with logic notations 5. Let’s recall complex truth tables Let’s recall complex truth tables 6. Let’s recall tautology and contradictory Let’s recall tautology and contradictory 7. How to use equivalent propositions How to use equivalent propositions 8. How to logically use propositions – propositional logic How to logically use propositions – propositional logic 9. Introduction to predicate calculus Introduction to predicate calculus 10. Summary Summary

5 1. Introduction [Q] What is reasoning? [Wikipedia] Reason is the capacity for consciously making sense of things, applying logic, for establishing and verifying facts, and changing or justifying practices, institutions, and beliefs based on new or existing information. To form conclusions, inferences, or judgments [Q] How to automate reasoning? Need to know how to represent information, knowledge, facts and beliefs, and how to apply logic, …

6 [Q] How to formalize/validate our arguments? Argument = premises (proposition or statement) + conclusion To have confidence in the conclusion in your argument, the premises should be acceptable on their own merits or follow from other statements that are known to be true. [Q] Any logical forms for valid arguments? Examples Argument 1: If the program syntax is faulty or if program execution results in division by zero, then the computer will generate an error message. Therefore, if the computer does not generate, then the program syntax is correct and program execution does not result in division by zero. Argument 2: If x is a real number such that x 2, then x 2 > 4. Therefore, if x 2 /> 4, then x / 2. The common logical form of both of the above arguments: If p or q, then r. Therefore, if not r, then not p and not q. Is this logical form valid?

TRU-COMP3710 Propositional/Predicate Logic7 You may recall “Logic and Truth Tables” in COMP In this unit, Boolean logic Propositional logic Introduction to predicate calculus – first-order predicate logic Propositional logic will be used in the following unit to solve some problems. Based on rules, knowledge, and facts, Decide if a given query is valid. Topics

TRU-COMP3710 Propositional/Predicate Logic8 2. What is Logic? Logic: reasoning about the validity of arguments. An argument is valid if its conclusions follow logically from its premises (proposition or statement) – even if the argument doesn’t actually reflect the real world: Mary is a lemon. All lemons are blue. Therefore, Mary is blue. Logic is widely used as a representation method of AI, and allows us to easily reason about negatives (i.e., “NOT”) and disjunctions (,i.e., “OR”) One of the main weaknesses of traditional logic (i.e., Boolean logic) is its inability to deal with uncertainty. Later probabilistic method and fuzzy logic will be discussed to deal with uncertainty. Topics

TRU-COMP3710 Propositional/Predicate Logic9 3. How to Use Logical Operators Definition of statement A statement (or proposition) is a sentence that is true or false but not both. Examples Two plus two equals four = 4 I am a TRU student. x + y > 0???

TRU-COMP3710 Propositional/Predicate Logic10 Compound Statements Symbols used in complicated logical statements: ~not~pnegation of p  andp  qconjunction of p and q  orp  qdisjunction of p and q  exclusive orp  q Order of operations: ( ) and ~ have the higher precedence. ~p  q = (~p)  q ~(p  q)

TRU-COMP3710 Propositional/Predicate Logic11 And (conjunction)  Or (disjunction)  Not (negation)  or~ Implies (conditional)  (if… then…) Iff (biconditional)  (if and only if) Exclusive OR? Topics

TRU-COMP3710 Propositional/Predicate Logic12 4. Translating between English and Logic Facts and rules need to be translated into logical notation. For example: It is Raining and it is Thursday: R  T, where R represents “It is Raining”, T represents “it is Thursday”.

TRU-COMP3710 Propositional/Predicate Logic13 More complex sentences need predicates. That part of a proposition that is affirmed or denied about the subject. For example, in the proposition We are mortal, mortal is the predicate. E.g., It is raining in New York: R(N) Could also be written N(R), or even just R. [Q] How to express “It is not raining in New York”??? It is important to select the correct level of detail for the concepts you want to reason about.

TRU-COMP3710 Propositional/Predicate Logic14 Example It is not hot but it is sunny.It is neither hot nor sunny. ->It is not hot, and it is sunny.It is not hot, and it is not sunny. Let h = “it is hot” and s = “it is sunny.” Then the above statements can be translated as ~h  s~h  ~s Example Suppose x is a particular real number. Let p, q, and r symbolize “0 < x,” “x < 3,” and “x = 3.” respectively. Then the following inequalities x  30 < x < 30 < x  3 can be translated as q  rp  qp  (q  r) Topics

TRU-COMP3710 Propositional/Predicate Logic15 5. Truth Tables Tables that show truth values for all possible inputs to a logical operator. For example: [Q] Truth table for implies (  ) ??? A  B: A is the antecedent, and B is the consequent. A  B   A  B[Q] Can you prove it? How? A  B   B   A[Q] Can you prove it? How? [Q] Truth table for iff (  ) ???

TRU-COMP3710 Propositional/Predicate Logic16 We can produce truth tables for complex logical expressions, which show the overall value of the expression for all possible combinations of variables: Topics

TRU-COMP3710 Propositional/Predicate Logic17 6. Tautology and Contradictory A tautology is true under any interpretation. The expression A ˅ ¬A is a tautology. This means it is always true, regardless of the value of A. P is a tautology: this is written ╞ P An expression which is false under any interpretation is contradictory (or unsatisfiable). A  ¬A Some expressions are satisfiable, but not valid. This means that they are true under some interpretation, but not under all interpretations. A  B Topics

TRU-COMP3710 Propositional/Predicate Logic18 7. How to Use Equivalent Propositions Two expressions are equivalent if they always have the same logical value under any interpretation: A ˄ B  B ˄ A [Q] How to prove the above equivalence? Equivalences can be proven by examining truth tables. [Q] Are there more equivalences?

TRU-COMP3710 Propositional/Predicate Logic19 A ˅ A  ??? A ˄ A  ??? A ˄ (B ˄ C)  (A ˄ B) ˄ C A ˅ (B ˅ C)  (A ˅ B) ˅ C A ˄ (B ˅ C)  (A ˄ B) ˅ (A ˄ C) A ˅ (B ˄ C)  (A ˅ B) ˄ (A ˅ C) A ˄ (A ˅ B)  ??? A ˅ (A ˄ B)  ??? A ˄ true  ???A ˄ false  ??? A ˅ true  ???A ˅ false  ??? [Q] DeMorgans’ Laws ??? [Q] Why do we need these equivalences? By using the above and other equivalences, logical expressions can be simplified.

TRU-COMP3710 Propositional/Predicate Logic20 Some more Topics

TRU-COMP3710 Propositional/Predicate Logic21 8. How to Use Propositions Propositional logic in this chapter is a logical system. It deals with propositions. Propositional calculus is the language we use to reason about propositional logic. A sentence in propositional logic is called a well-formed formula (wff) (or sentence).

TRU-COMP3710 Propositional/Predicate Logic22 Propositional calculus: BNF (Backus-Naur Form) – The following are wff’s: P, Q, R…propositional symbols true, false (A) ¬A A ˄ B A ˅ B A → B A ↔ B Any combination of wff’s is a wff. [Q] Is P  Q  (B   C)  A  B  D  (  E) a wff ???

TRU-COMP3710 Propositional/Predicate Logic23 Deduction: the process of deriving a conclusion from a set of assumptions. Will be discussed in the following unit again to solve some problems. If we deduce a conclusion C from a set of assumptions, we write: {A 1, A 2, …, A n } ├ C If C can be concluded without any assumption ├ C The inference rule A ├ B is expressed as A B Given A, B is deduced (or concluded). It is like if A is true, then B is true.

TRU-COMP3710 Propositional/Predicate Logic24  introduction Given A and B, we can deduce A  B. A, B{A, B} ├ A ˄ B A ˄ B  introduction A _ A  B  elimination A  B A B  elimination (called Modus Ponens) A, A  B[Q] Can you prove? B   elimination   A A Some valid inference rules

TRU-COMP3710 Propositional/Predicate Logic25 Reduction to absurdity: Reductio Ad Absurdum (proof by contradiction)  A. _ Contradiction, i.e., false A  Induction (called deduction theorem) A. C __ A  C

TRU-COMP3710 Propositional/Predicate Logic26  Introduction A __ B  A Modus Tollens ~B, A  B ~A Topics

TRU-COMP3710 Propositional/Predicate Logic27 9. Introduction to Predicate Calculus Predicate Calculus extends the syntax of propositional calculus with predicates and quantifiers: P(X) – P is a predicate. First Order Predicate Calculus (FOPC) allows predicates to apply to objects or terms, but not functions or predicates. Just introduction in this unit. Predicate calculus is used in solving more complex problems.

TRU-COMP3710 Propositional/Predicate Logic28 Quantifiers  and   - For all:  x P(x) is read “For all x’es, P (x) is true”. E.g., for all pine TRU COMP students, they are smart.  - There Exists:  x P(x) is read “there exists an x such that P(x) is true”. E.g., there is a TRU COMP student who is not smart. Relationship between the quantifiers:  x P(x)  ¬ (  x)¬P(x) “If There exists an x for which P holds, then it is not true that for all x P does not hold”.

TRU-COMP3710 Propositional/Predicate Logic29 Properties of Logical Systems Four factors to consider of: Soundness: Is every theorem valid? Completeness: Is every tautology a theorem? Decidability: Does an algorithm exist that will determine if a wff is valid? Monotonicity: Can a valid logical proof be made invalid by adding additional premises or assumptions? Topics

TRU-COMP3710 Propositional/Predicate Logic Summary Propositional logic Propositions Boolean logic Deduction; inference rules Topics