CIS341 Artificial Intelligence

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

The Foundations: Logic and Proofs
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.
Logic Concepts Lecture Module 11.
CS128 – Discrete Mathematics for Computer Science
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
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.
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.
Discrete Mathematics and its Applications
Adapted from Discrete Math
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우.
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.
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.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
September1999 CMSC 203 / 0201 Fall 2002 Week #1 – 28/30 August 2002 Prof. Marie desJardins.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–7: (a) Formal System;(b) How to read research papers 3 rd August, 2010.
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.
Of 38 lecture 13: propositional logic – part II. of 38 propositional logic Gentzen system PROP_G design to be simple syntax and vocabulary the same as.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 The Foundations: Logic and Proofs Rules of inference.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
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 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
3. The Logic of Quantified Statements Summary
Introduction to Logic for Artificial Intelligence Lecture 2
Advanced Algorithms Analysis and Design
Computer Science cpsc322, Lecture 20
Propositional Calculus: Boolean Functions and Expressions
CSNB 143 Discrete Mathematical Structures
Knowledge Representation and Reasoning
COMP 1380 Discrete Structures I Thompson Rivers University
Logic programming ( Handbook of Logic in Artificial Intelligence, Vol) by D. M. Gabbay, C. Hogger, J.A. Robinson .
Proof Techniques.
Propositional Calculus: Boolean Algebra and Simplification
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.
Copyright © Cengage Learning. All rights reserved.
A Brief Summary for Exam 1
Applied Discrete Mathematics Week 1: Logic
First Order Logic Rosen Lecture 3: Sept 11, 12.
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Computer Science cpsc322, Lecture 20
This Lecture Substitution model
COMP 1380 Discrete Structures I Thompson Rivers University
Propositional Calculus
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Chapter 8 Natural Deduction
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

CIS341 Artificial Intelligence Weeks 8 – 11 Predicate calculus and tableau proofs Natural language syntax and parsing Search and problem solving Parsing as proof, proof as a search problem Coursework 2 proposed dates: Given out Friday March 13, due in Friday April 3rd 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Week 8: logic and inference revisited Revision of propositional logic Brief overview of proof techniques Introduction to predicate calculus Demonstration of tableau proofs on whiteboard 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Automated reasoning and formal logic Logic is concerned with validity of inference A central concern of 20th-century mathematical logic was to develop systematic, mechanical techniques for proving logical consequence The AI subfields of logic programming and automated reasoning have built on these efforts to develop systems to perform logical inferences. Considerations of speed and efficiency put limitations on the kinds of inference that can be implemented. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Overview of “classical” logic Just as many people understand the word music to refer to European classical music composed between the 17th and 20th centuries, so the word logic is often shorthand for a variant called classical logic. The remainder of these slides provide an overview of “classical” logic, comprising Boolean or propositional logic First-order predicate calculus (the words first-order are often omitted) There are many non-classical logics but they do not come into this course. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Some important terminology A proposition is something that can be true or false A proposition is consistent if it is possible for it to be true A proposition is inconsistent or contradictory if it is not possible for it to be true A proposition is a necessary truth or a tautology if it is not possible for it to be false. Class exercise 1: think up examples in each of these categories. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Boolean or propositional logic Boolean logic is so-called because logical formulas are interpreted in terms of Boolean “truth values” True or False T or F 1 or 0 The semantics of Boolean logic tells us how to calculate the truth values of complex formulas as a function of the truth values of their constituent “literals” using truth tables Simple propositions generally written P, Q etc. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Syntax of propositional logic Formulas of Boolean logic are made up of propositional letters P, Q, R etc and the symbols & or  : conjunction, read as “and”  : inclusive disjunction, read as “or”  or ~ : negation, read as “not”  or  : implication, read as “implies” or “if … then”  or  : biconditional, read as “if and only if” or “iff” 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Truth tables P Q P  Q True False P P True False 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Truth table for & P Q P  Q True False 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Truth table for implication Q P  Q True False 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Inference involving implication “If the solution is acid, the paper will turn red”. True  True: the solution is acid, the paper turns red. The implication is verified. True  False: the solution is acid, the paper does not turn red. The implication is falsified. False  True: the solution is not acid, the paper still turns red. False  False: the solution is not acid, the paper does not turn red. Is the implication verified or falsified in cases 3 and 4? 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Class/self-study exercise 2 Construct truth tables for: P  Q (P & Q) (P  Q) (P &  Q) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Validity of inference An inference is valid if it is not possible for the premises to be true and the conclusion false. Valid: P, P Q / Q (P  Q) / P Invalid: (P & Q) / P Q, P Q / P Validity in propositional logic can be checked using truth tables. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Some proof techniques Modus ponens P  Q; P / Q Modus tollens P  Q; Q / P Provide a “short cut” for calculating inferences without constructing truth tables. A proof theory consists of a set of such rules There are proof theories for propositional logic which allow all valid inferences to be proved. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Resolution rule Equivalent of modus ponens P  Q; P / Q Basis of logic programming Requires disjunctions with at most one positive literal, for example: (P & Q)  R =  (P & Q)  R = P   Q  R 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

CIS341 Artificial Intelligence - Goldsmiths Dept of Computing Tableau proof A “graphic” proof technique based on tree diagrams called semantic tableaux Will be covered in later slides Good tutorial in Wilfred Hodges, Logic Useful online tutorial at http://logic.philosophy.ox.ac.uk/main.htm designed for Oxford philosophy students Key point: there are many proof techniques which are all equally sound and complete, i.e. they will prove all and only valid arguments. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Shortcomings of propositional logic A simple proof: Fred is ill. If Fred is ill, he should not drive. So, Fred should not drive. In symbolic form: P = “Fred is ill'' Q = “Fred should not drive” Modus ponens: P  Q, P / Q 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Shortcomings of propositional logic (cont.) So far, so good. But what if Charlie is ill? Do we construct a separate rule for every individual? P2 = ``Charlie is ill'' Q2 = ``Charlie should not drive” P2  Q2 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

From propositional logic to predicate calculus Solution is to decompose statements into predicates and arguments: P(x) = “x is ill'' Q(x) = “x should not drive” P(x)  Q(x) Proof will look more like this: P(fred) P(fred)  Q(fred)  Q(fred) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

From propositional logic to predicate calculus (cont.) Boolean logic is the logic of propositions. Predicate calculus introduces predicates and arguments. Arguments can be constant terms or variables. Predicates have to be constant terms in the first-order predicate calculus. There are higher-order logics with predicate variables but we will not be concerned with them. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Quantifiers in predicate calculus I Implicational rules are generally written like this: x(P(x)  Q(x)) The upside–down A is called the universal quantifier: this means that the implication is true for all values of x (i.e. for any individual). Read as “for all x, P(x) implies Q(x)” Can also be read as “all Ps are Q” or “all Ps Q”: x(fish(x)  swim(x)) x(cow(x)  mammal(x)) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Quantifiers in predicate calculus II The existential quantifier  means that statement that follows it is true of some individual, though we may not know which. x(Px & Qx) Read as: “there exists an x such that P(x) and Q(x)” “some P is a Q” “some Ps Q” x(mammal(x) & lays-eggs(x)) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Quantifiers in predicate calculus III You may have noticed that  generally goes with the conjunction “&” and  goes with the implication “” This is very important. What would the following mean? Are they true? x(fish(x)  sings(x)) x(cow(x) & mammal(x)) This is probably what beginning logic students most often get wrong. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Quantifiers in predicate calculus IV Multiple quantifiers can be combined in the same formula: x(student(x)  y (tutor(y,x))) Every student has a tutor x(professor(x) & y(course(y) & teach(x,y))) There is a professor who does not teach any courses 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Duality of first-order quantifiers The quantifiers  and  can be defined in terms of each other, using Boolean equivalences: x(P(x)  Q(x)) = x(P(x)  Q(x)) = x(P(x) & Q(x)) x(P(x) & Q(x)) = x(P(x) & Q(x)) = x(P(x)  Q(x)) Class/self-study exercise 3: Convince yourself that the above equivalences are correct. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Class/self-study exercise 3 Convert the following to predicate calculus: All mammals are vertebrates. Not all vertebrates are mammals. Only fish swim. Some primates have tails. No primates have feathers. Rhinos eat either leaves or grass. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Inference in predicate calculus Techniques such as modus ponens and tableau proof are applicable to predicate calculus, with extra complications caused by the use of variables. Example – given the premises: x(P(x)  Q(x)) y(Q(y)  R(y)) P(fred) we can infer via modus ponens or using tableaux (several steps omitted): Q(fred); R(fred) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Beginning tableau proofs The Tableau method uses a standard technique of proof by contradiction: To show whether an argument is valid, attempt to show that the premises are inconsistent with the negation of the conclusion To show whether a complex proposition is a tautology, attempt to show that its negation is inconsistent (see whiteboard and handouts) 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing

Useful further reading Books: A very short introduction to logic, Graham Priest, OUP. A clear and stimulating guide to basic concepts of logic. Logic, Wilfred Hodges, Penguin. Goes into a lot more detail than Priest, useful for reference/revision. Website Introduction to logic, http://logic.philosophy.ox.ac.uk/main.htm Tutorial on propositional and predicate logic aimed at Oxford philosophy students. May not display correctly in all browsers. Seems to work best in Internet Explorer. 11/11/2018 CIS341 Artificial Intelligence - Goldsmiths Dept of Computing