Using first order logic (Ch. 8-9)

Similar documents
Using first order logic (Ch. 8-9)

First order logic (Ch. 8)

First order logic (Ch. 8)

Resolution in FO logic (Ch. 9)

Propositional logic (Ch. 7)

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

CSI30. Chapter 1. The Foundations: Logic and Proofs Rules of inference with quantifiers Logic and bit operations Specification consistency

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

Resolution (14A) Young W. Lim 6/14/14

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

COMP4418 Knowledge Representation and Reasoning

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

Propositional logic (Ch. 7)

Inf2D 12: Resolution-Based Inference

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Formal Predicate Calculus. Michael Meyling

Deduction Rule System vs Production Rule System. Prof. Bob Berwick. Rules Rule

Solutions to Selected Exercises

CS 416, Artificial Intelligence Midterm Examination Fall 2004

Semantics and First-Order Predicate Calculus

(More) Propositional Logic and an Intro to Predicate Logic. CSCI 3202, Fall 2010

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

CSE 20 DISCRETE MATH. Fall

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

THE PREDICATE CALCULUS

Lecture 4: January 12, 2015

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Section 2.4: Arguments with Quantified Statements

CSE 20 DISCRETE MATH. Winter

First Order Logic and Resolution

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

Homework 1 CS 1050 A Due:

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Logical reasoning systems

Question about Final Exam. CS 416 Artificial Intelligence. What do we like about propositional logic? First-order logic

ARTIFICIAL INTELLIGENCE (CS 370D)

THE LOGIC OF QUANTIFIED STATEMENTS

ITCS 6150 Intelligent Systems. Lecture 13 First-Order Logic Chapter 8

CS 4700: Artificial Intelligence

Back to the knights and knaves island

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below:

Automated type-checking for the ramified theory of types of the Principia Mathematica of Russell and Whitehead

CSE 473 Lecture 12 Chapter 8. First-Order Logic. CSE AI faculty

Multi-Place Predicates and Multiple Quantifiers

6.034 Notes: Section 10.1

Predicate Calculus. Problems? Syntax. Atomic Sentences. Complex Sentences. Truth

Verification of Data-Aware Processes Data Centric Dynamic Systems

Logic Programming. Let us have airline flight information of the form: 1. Application Domains: 2. Definitions

Declarative Programming. 2: theoretical backgrounds

Topic A: Introduction to Prolog

ECE Spring 2018 Problem Set #2 Due: 3/14/18

Last time: Logic and Reasoning

Logic Languages. Hwansoo Han

6.034 Notes: Section 11.1

First Order Predicate Logic CIS 32

STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH

Logic and its Applications

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Logic Programming and Resolution Lecture notes for INF3170/4171

Resolution in FOPC. Deepak Kumar November Knowledge Engineering in FOPC

An Introduction to Programming and Proving in Agda (incomplete draft)

Chapter 16. Logic Programming. Topics. Unification. Resolution. Prolog s Search Strategy. Prolog s Search Strategy

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Introduction to dependent types in Coq

Notes for Chapter 12 Logic Programming. The AI War Basic Concepts of Logic Programming Prolog Review questions

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

First Order Logic. Introduction to AI Bert Huang

Outline. Forward chaining Backward chaining Resolution. West Knowledge Base. Forward chaining algorithm. Resolution-Based Inference.

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Set 7: Predicate logic Chapter 8 R&N. ICS 271 Fall 2015

What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora

First-Order Logic PREDICATE LOGIC. Syntax. Terms

Inference in First-Order Logic

Self-reproducing programs. And Introduction to logic. COS 116: 3/6/2008 Sanjeev Arora

Proving Theorems with Athena

First Order Logic Part 1

BB4W. KS3 Programming Workbook INTRODUCTION TO. BBC BASIC for Windows. Name: Class:

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs

DISCRETE MATHEMATICS

News English.com Ready-to-use ESL / EFL Lessons

Logic as a Programming Language

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2014

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

Basic Foundations of Isabelle/HOL

Introduction to Sets and Logic (MATH 1190)

Lecture 1: Conjunctive Queries

6. Inference and resolution

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems

CS 561: Artificial Intelligence

Chapter 16. Logic Programming Languages ISBN

Transcription:

Using first order logic (Ch. 8-9)

Review: First order logic In first order logic, we have objects and relations between objects The relations are basically a list of all valid tuples that satisfy the relation We can also have variables that represent objects often used in conjunction with quantifiers:

First order logic Let's translate English into first order logic: Everyone in class is sitting in a seat If someone is sitting in a seat it is occupied At least one seat is not occupied No one is sharing a seat Objects: People (p1, p2,...), Chairs (c1, c2,...) Relations: InClass(x), InSeat(x,y), Occupied(x) person chair

First order logic Everyone in class is sitting in a seat If someone is sitting in a seat it is occupied At least one seat is not occupied No one is sharing a seat

First order logic More practice? General guide: https://cs.nyu.edu/faculty/davise/ai/folguide.pdf Examples: http://www.uobabylon.edu.iq/eprints/publication_5_29514_1380.pdf https://math.stackexchange.com/questions/2209569/how-to-translate-the-following-sentences-into-first-order-logic

First order logic To express the top left cell for mindsweep in propositional logic, we had to write: How would you write the whole current knowledge for all 5 cells in first order logic? (not the game logic, just current state) Hint: What are objects? Relations?

First order logic First order logic: Then we just also need to say that cells can only have one number/bomb

Using First order logic The rest of chapter 8 is boring, so we will skip (though good practice for logic representation) We will go ahead into Ch. 9 and talk about how to use first order logic to query against First we will look at how we can simplify some of the quantifiers

Universal instantiation With a universal quantifier,, this means you can replace it with any object For example: Objects = {Sue, Bob, Devin} Sentence = You can conclude:

Existential instantiation With an existential quantifier,, there is some object that makes this true... So you give it a name of a new object (that is equal to an existing object) Objects = {Spider, Dragon, Pangolin} Sentence = You can conclude: where

Convert to propositional logic You can convert first order logic back into propositional logic by using instantiation Objects = {Tree, Car} Sentences: Instantiation:

Convert to propositional logic Once you have this, you can treat each relation/object as a single proposition uniquely identified by the characters... could turn into:... and we could use our old techniques to ask information

Convert to propositional logic This explanation glosses over two important facts... what?

Convert to propositional logic This explanation glosses over two important facts... what? 1. Equals 2. Functions (1) is easier to tackle as you can remove this when doing instantiation/enumeration You simply remove the invalid statements

Remove equality Removing = after instantiation: Object={A,B} Sentence: Instantiation: Remove conflicts:

Converting functions I have skimmed on functions, but similar to math functions they can be applied repeatedly Define: PlusPlus(x): PlusPlus(1) = 2 PlusPlus(PlusPlus(1)) = 3... and so on (no limit to number of functions) When converting to prop. logic, you have to apply functions everywhere possible...

Converting functions This means the propositional logic conversion might have an infinite number of propositions A theorem shows you only need a finite number of function calls to decide entailment Step 1: See if entailed with no functions Step 2: See if entailed with 1 function call Step 3: See if entailed with 2 function calls Step 4:...

Converting functions At some finite step, if entailment is possible it will be found Unfortunately, how many is unknown so it is impossible to find if something is not entailed in the propositional logic (this is semi-decidable) Even without functions if there are p k-ary relations with n objects, you get: O(p*n^k)

Unification A unification is a substitution for variables that creates a valid sentence by specifying a map between variables and objects For example, consider: What variables can we unify/substitute?

Unification First sentence is the only one with variables, there are 9 options (only 6 if x y) One unification is {x/sue, y/devin} We cannot say {x/devin, y/alex}, as this is creates a contradiction

General modus ponens We do not need to convert to propositional logic to use some rules of reasoning Modus ponens can be applied even if there are variables, as long as we can unify them: We can unify the top sentence with {x/hippo}, so we can conclude:

General modus ponens If you want to use this general modus ponens, finding the unification can be expensive You basically need to try all substitutions, though you can store your data in smart ways to make look-up much more quickly Using just general modus ponens, you can do basic inference with first order logic (what is the problem??)

General modus ponens Objects = {Cat, Dog, Frog, Rat, Sally, Jane} Is Sally happy? How about Party(Sally, Frog)?

General modus ponens We can substitute {x/sally} here with MP: To get: Then sub. {x/sally, y/frog} with MP here: To get: However, we cannot tell if Sally is happy, as we cannot unify:

General modus ponens You try! Can you get Grilled(Bread)? How about Grilled(Chicken)?

General modus ponens You try! Can you get Grilled(Bread)? Yes How about Grilled(Chicken)? No