Chapter 7. Propositional and Predicate Logic

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.
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
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Knowledge Representation Methods
CS128 – Discrete Mathematics for Computer Science
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
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
Discrete Mathematics and its Applications
Copyright © Cengage Learning. All rights reserved.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Intro to Discrete Structures
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.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Pattern-directed inference systems
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
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.
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.
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.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
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
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Logic.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Advanced Algorithms Analysis and Design
CSE15 Discrete Mathematics 01/30/17
Knowledge Representation and Reasoning
Discrete Mathematics Logic.
COMP 1380 Discrete Structures I Thompson Rivers University
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
The Propositional Calculus
Knowledge Representation
Copyright © Cengage Learning. All rights reserved.
Propositional Logic and Methods of Inference
Logics for Data and Knowledge Representation
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
CS201: Data Structures and Discrete Mathematics I
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
CS 270 Math Foundations of CS
First Order Logic Rosen Lecture 3: Sept 11, 12.
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Logical Agents Chapter 7.
CS 416 Artificial Intelligence
CSNB234 ARTIFICIAL INTELLIGENCE
Chapter 9. Rules and Expert Systems
COMP 1380 Discrete Structures I Thompson Rivers University
Propositional Calculus
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
CS201: Data Structures and Discrete Mathematics I
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Logical Agents Chapter 7 Andreas Geyer-Schulz and Chuck Dyer
Habib Ullah qamar Mscs(se)
Presentation transcript:

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

Propositional/Predicate Logic Course Outline Part I – Introduction to Artificial Intelligence Part II – Classical Artificial Intelligence, and Searching Knowledge Representation Searching Search Methodologies Advanced Search Genetic Algorithms (relatively new study area) 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 TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic Chapter Objectives TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic Chapter Outline Propositional logic Introduction What is logic? Why is logic used in Artificial Intelligence? How to use logical operators How to translate an English statement with logic notations Let’s recall complex truth tables Let’s recall tautology and contradictory How to use equivalent propositions How to logically use propositions – propositional logic Introduction to predicate calculus Summary TRU-COMP3710 Propositional/Predicate Logic

1. Introduction [Q] What are expert systems? [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 (facts and/or observation). 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, …

[Q] How to formalize/validate our arguments? Argument = premises (propositions or statements) + 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 an error message, 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 or x > 2, then x2 > 4. For y, such that y2 /> 4, y /< -2 and y /> 2. The common logical form of both of the above arguments: If p or q, then r. Not r. Therefore not p and not q. Is this logical form valid?

Propositional/Predicate Logic Topics You may recall “Logic and Truth Tables” in MATH 1380. 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 interesting problems. Based on rules, knowledge, facts, and observation Decide if a given query is valid. TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic Topics 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. - conclusion 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”) However, one of the main weaknesses of traditional logic (i.e., Boolean logic) is its inability to deal with uncertainty and ambiguity. Later probabilistic method and fuzzy logic will be discussed to deal with uncertainty and ambiguity. premises TRU-COMP3710 Propositional/Predicate Logic

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. 2 + 2 = 4 I am a TRU student. x + y > 0 ??? TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic Compound Statements Symbols used in complicated logical statements: ~ not ~p negation of p  and p  q conjunction of p and q  or p  q disjunction of p and q  exclusive or p  q Order of operations: ( ) and ~ have the higher precedence. ~p  q = (~p)  q ~(p  q) TRU-COMP3710 Propositional/Predicate Logic

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

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

Propositional/Predicate Logic 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 Logic

Propositional/Predicate Logic Topics 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 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  3 0 < x < 3 0 < x  3 can be translated as q  r p  q p  (q  r) TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic 5. Truth Tables Tables that show truth values for all possible inputs to a logical operator. For example: [Q] Truth table for implication () ??? 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 Logic

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

6. Tautology and Contradictory Topics 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 always valid. This means that they are true under some interpretation, but not under all interpretations. A  B TRU-COMP3710 Propositional/Predicate Logic

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 Logic

Propositional/Predicate Logic 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 ˄ (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 Logic

Propositional/Predicate Logic Topics Some more TRU-COMP3710 Propositional/Predicate Logic

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 Logic

Propositional/Predicate Logic 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 Logic

Propositional/Predicate Logic 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: {A1, A2, …, An} ├ 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). The meaning is that if A is true (or valid), then B is true (or valid). [Q] What if A is false? B can be true or false. TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic  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 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 Logic

Propositional/Predicate Logic Reduction to absurdity (proof by contradiction)  A . _ Contradiction, i.e., false A  Induction (called deduction theorem) C__ A  C Some valid inference rules TRU-COMP3710 Propositional/Predicate Logic

Propositional/Predicate Logic Topics  Introduction A__ B  A Modus Tollens ~B, A  B ~A Some valid inference rules TRU-COMP3710 Propositional/Predicate Logic

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 Logic

Propositional/Predicate Logic Quantifiers  and   - For all: x P(x) is read “For all x’es, P (x) is true”. E.g., for all 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 Logic

Propositional/Predicate Logic Topics 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? TRU-COMP3710 Propositional/Predicate Logic

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