CSE (c) S. Tanimoto, 2008 Propositional Logic

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Inference Rules Universal Instantiation Existential Generalization
Introduction to Theorem Proving
Standard Logical Equivalences
Automated Reasoning Systems For first order Predicate Logic.
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.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Logic Use mathematical deduction to derive new knowledge.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Resolution Theorem Proving
Logic.
Logic Concepts Lecture Module 11.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
From Chapter 4 Formal Specification using Z David Lightfoot
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
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.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
MATH 224 – Discrete Mathematics
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 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.
Chapter Four Proofs. 1. Argument Forms An argument form is a group of sentence forms such that all of its substitution instances are arguments.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
CS6133 Software Specification and Verification
Proof Tactics, Strategies and Derived Rules CS 270 Math Foundations of CS Jeremy Johnson.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
Chapter 1 Logic and proofs
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
March 23 rd. Four Additional Rules of Inference  Constructive Dilemma (CD): (p  q) (r  s) p v r q v s.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Rules of Inference Section 1.6.
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
Logic Use mathematical deduction to derive new knowledge.
CS 270 Math Foundations of CS
Biointelligence Lab School of Computer Sci. & Eng.
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Chapter 7. Propositional and Predicate Logic
Foundations of Discrete Mathematics
Proof Tactics, Strategies and Derived Rules
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Presentation transcript:

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Propositional Logic: A (relatively) simple, formal approach to knowledge representation and inference Outline: Review of propositional logic terminology Proof by perfect induction Proof by Wang’s algorithm Proof by resolution CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Role of Logical Inference in AI The single most important inference method. But: Doesn't handle uncertain information well. Needs algorithmic help – prone to the combinatorial explosion. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Brief Introduction/Review: Propositional Calculus Note that the propositional calculus provides a foundation for the more powerful predicate calculus which is very important in AI and which we will study later. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic A Logical Syllogism If it is raining, then I am doing my homework. It is raining. Therefore, I am doing my homework. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Another Syllogism It is not the case that steel cannot float. Therefore, steel can float. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Terminology of the Propositional Calculus Proposition symbols: P, Q, R, P1, P2, ... , Q1, Q2, ..., R1, R2, ... Atomic proposition: a statement that does not specifically contain substatements. P: “It is raining.” Q: “Neither did Jack eat nor did he drink.” Compound proposition: A statement formed from one or more atomic propositions using logical connectives. P v Q: Either it is raining, or neither did Jack eat nor did he drink. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Logical Connectives Negation: P not P Conjunction: P  Q P and Q Disjunction: P v Q P or Q Exclusive OR: P <> Q P exclusive-or Q CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Logical Connectives (Cont) NAND: (P  Q) P nand Q NOR: (P v Q) P nor Q Implies: P  Q if P then Q P v Q CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Logically Complete Sets of Connectives {, v} form a logically complete set. P  Q = (P v Q) {, } form a logically complete set P  Q = (P  Q) {, } form a logically complete set P v Q = (P  Q) CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Syllogism: General Form Premise 1 Premise 2 ... Premise n -------------- Conclusion P1  P2  ...  Pn  C CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Modus Ponens: An important rule of inference P  Q conditional P antecedent --------- Q consequent aka the “cut rule” CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Modus Tollens: (modus ponens in reverse) P  Q conditional Q consequent denied --------- P antecedent denied Can be proved using “transposition” – taking the contrapositive of the conditional: P  Q  Q  P Q therefore, by modus ponens, P CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Algorithms for Logical Inference Issues: Goal-directed or not? Always exponential in time? Space? Intelligible to users? Readily applicable to problem solving? CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Proof by Perfect Induction Prove that P, P v Q  Q CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Perfect Induction: The process Express the syllogism as a conditional expression of the form P1  P2  ...  Pn  C Create a table with one column for each variable and each subexpression occurring in the formula Create one row for each possible assignment of T and F to the variables Fill in the entries for variables with all combinations of T and F. Fill in the entries for other subexpressions by evaluating them with the corresponding variable values in that row. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Perfect Induction: The process (cont) If the column for the overall syllogism has T in every row, then the syllogism is valid; otherwise it’s not valid. Alternatively, identify all rows in which all premises are true, and then check to see whether the conclusion in those rows is also true. If the conclusion is true in all those rows, then the syllogism is valid; otherwise, it is not valid. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Perfect Induction: Characteristics Goal-directed (compute only columns of interest) Always exponential in time AND space Somewhat understandable to non-technical users Straightforward algorithmically Not considered appropriate for general problem solving. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Another Strategy: Use Gradual Simplification Plus Divide-and-Conquer A method called Wang’s algorithm works backwards from the syllogism to be proved, gradually simplifying the goal(s) until they are either reduced to axioms or to obviously unprovable formulas. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Proof by Wang’s Algorithm Write the hypothesis as a “sequent” of form X  Y. (Eliminate ) Place the premises on the left-hand side separated by commas, and place the conclusion on the right hand side. 1. (P  (P v Q))  Q. 2. P, P v Q  Q. 3a. P, P  Q; 3b. P, Q  Q. 4a. P  Q, P; CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Wang’s Method (Cont.) Transform each sequent until it is either an “axiom” and is proved, or it cannot be further transformed. Note: Each rule removes one instance of a logical connective. And on the left: X, A  B, Y  Z becomes X, A, B, Y  Z Or on the right: X  Y, A v B, Z becomes X  Y, A, B, Z Not on the left: X, A, Y  Z becomes X, Y  Z, A Not on the right: X  Y, A, Z becomes X, A  Y, Z CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Wang’s Method (Cont.) Or on the left: X, A v B, Y  Z becomes X, A, Y  Z; X, B, Y  Z. And on the right: X  Y, A  B, Z becomes X  Y, A, Z; X  Y, B, Z. In a split, both of the new sequents must be proved. Axiom: A sequent in which any proposition symbol occurs at top level on both the left and right sides. e.g., P, P v Q  P CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Wang's Method: Characteristics Goal directed (begin with sequent to be proved) Sometimes exponential in time. Relatively space-efficient. Somewhat mysterious to non-technical users Algorithmically simple but more complex than perfect induction. Not considered appropriate for general problem solving. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Resolution An inference method called “resolution” is probably the most important one for logic programming and automatic theorem proving. Resolution can be considered as a generalization of modus ponens. It becomes very powerful in the predicate calculus when combined with a substitution technique known as “unification.” In order to use resolution, our logical formulas must first be converted to “clause form.” CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Clause Form Expressions such as P, P, Q and Q are called literals. They are atomic formulas to which a negation may be prefixed. A clause is an expression of the form L1 v L2 v ... v Lq where each Li is a literal. Any propositional calculus formula can be represented as a set of clauses. (P  (Q  R)) starting formula (P  (Q v R)) eliminate  ((P  Q) v (P  R)) distribute  over v. (P  Q)  (P  R) DeMorgan’s law (P v  Q)  (P v R) “ “ P v Q, P v R Double neg. and break into clauses CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Propositional Resolution Two clauses having a pair of complementary literals can be resolved to produce a new clause that is logically implied by its parent clauses. (Here are four separate examples.) e.g. Q v R v S, R v P  Q v S v P P v Q, Q v R  P v R P, P v R  R P, P  [] (the null clause) CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic Reductio ad Absurdum A proof by resolution uses RAA (proof by contradiction). Original syllogism: Premise 1 Premise 2 ... Premise n --------------- Conclusion Syllogism for RAA: Premise 1 Premise 2 ... Premise n Conclusion ---------------------- [] CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Example Proof Using Resolution Prove: (P  Q)  (Q  R)  (P  R) This happens to be named “hypothetical syllogism” Negate the conclusion: (P  Q)  (Q  R)  (P  R) Obtain clause form: P v Q, Q v R, P, R. Derive the null clause using resolution: Q resolving P with P v Q. R resolving Q with Q v R. F resolving R with R. CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic

Resolution: Characteristics Not necessarily goal directed (can be used in either forward-chaining or backward-chaining systems). Time and space requirements depend on the algorithm in which resolution is embedded. Can be made understandable to non-technical users Needs to be combined with a search algorithm. Can be very appropriate for general problem solving (e.g., using PROLOG) CSE 415 -- (c) S. Tanimoto, 2008 Propositional Logic