COMP3411: Artificial Intelligence 8. First Order Logic

Similar documents
E.g., Brother(KingJohn,RichardTheLionheart)

Vibhav Gogate University of Texas, Dallas Artificial Intelligence: CS 4365 First-order Logic

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

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

First-Order Predicate Logic. Introduction to Intelligent Systems

Introduction to Artificial Intelligence 2 nd semester 2016/2017. Chapter 8: First-Order Logic (FOL)

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

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

Planning II. Introduction to Artificial Intelligence CSE 150 Lecture 12 May 15, 2007

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

Last time: Logic and Reasoning

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

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

Search vs. planning. Planning. Search vs. planning contd. Outline

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

First-Order Logic Syntax

ARTIFICIAL INTELLIGENCE (CS 370D)

First Order Logic Part 1

Week 7 Prolog overview

CS-171, Intro to A.I. Mid-term Exam Summer Quarter, 2016

Logic as a Programming Language

First-Order Predicate Logic. CSCI 5582, Fall 2007

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

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

CS 8520: Artificial Intelligence

PRACTICAL file. Department: Computer Science and Engineering. Semester:

Knowledge Representation

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

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

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

Multi-agent and Semantic Web Systems: Representation

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

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

Assignment WS 2012/2013

First Order Logic and Resolution

a. Given that we search depth first from left to right, list all leaf nodes above that we need to search/expand. (35 Points)

A review of First-Order Logic

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

Introduction to predicate calculus

CSC242: Intro to AI. Lecture 8 LOGIC

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

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems

Module 8. Other representation formalisms. Version 2 CSE IIT, Kharagpur

Logic Programming Languages

Logic Languages. Hwansoo Han

CSC242: Intro to AI. Lecture 10. Tuesday, February 26, 13

Introduction to Prolog

Lecture 7: January 15, 2014

Logic (or Declarative) Programming Foundations: Prolog. Overview [1]

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

First-Order Logic (FOL)

First Order Predicate Logic CIS 32

CSC 501 Semantics of Programming Languages

Lecture 4: January 12, 2015

First-Order Logic. Cholwich Nattee. Sirindhorn International Institute of Technology Thammasat University. Lecture 9: First-Order Logic 1/60

THE PREDICATE CALCULUS

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

Chapter 16. Logic Programming Languages ISBN

First-Order Logic PREDICATE LOGIC. Syntax. Terms

Lecture 5 - Axiomatic semantics

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

Artificial Intelligence 2004 Planning: Situation Calculus

will take you everywhere.

Lecture Overview. CSE3309 Artificial Intelligence. The lottery paradox. The Bayesian claim. The lottery paradox. A Bayesian model of rationality

Chapter 16. Logic Programming Languages

THE RELATIONAL MODEL. University of Waterloo

Artificial Intelligence

Programming Paradigms

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Programming Language Concepts (20013) Preparation for the Final Exam

Introduction to dependent types in Coq

Automata Theory for Reasoning about Actions

Overview and summary. We have discussed

7. Relational Calculus (Part I) 7.1 Introduction

Introduction to Logic Programming

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

! model construction

6. Inference and resolution

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

CSE 20 DISCRETE MATH. Fall

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

Formal Structural Requirements. Functional Requirements: Why Formal? Revisiting SADT. A Formalization of RML/Telos. A Survey of Formal Methods

Advanced Logic and Functional Programming

One of the main selling points of a database engine is the ability to make declarative queries---like SQL---that specify what should be done while

Semantic Web Test

Topic A: Introduction to Prolog

An Evolution of Mathematical Tools

Chapter 16. Logic Programming. Topics. Predicate Calculus and Proving Theorems. Resolution. Resolution: example. Unification and Instantiation

Knowledge Representation

Description Logics. Description Logics and Databases

Announcements. The current topic: Prolog. Logic programming. Logic programming. Lab 2 has been marked.

CPS 506 Comparative Programming Languages. Programming Language Paradigm

First order logic (Ch. 8)

n n Try tutorial on front page to get started! n spring13/ n Stack Overflow!

Higher-Order Logic. Specification and Verification with Higher-Order Logic

Chapter 16. Logic Programming Languages ISBN

Proving the Correctness of Distributed Algorithms using TLA

Fundamentals of Discrete Mathematical Structures

CSE 20 DISCRETE MATH. Winter

Transcription:

COMP9414/9814/3411 16s1 First Order Logic 1 COMP3411: Artificial Intelligence 8. First Order Logic Overview First Order Logic Universal and Existential Quantifiers Russell & Norvig, Chapter 8. Fun with Sentences Keeping Track of Change Planning Situation Calculus COMP9414/9814/3411 16s1 First Order Logic 2 Syntax of First Order Logic COMP9414/9814/3411 16s1 First Order Logic 3 Logics in General Objects: people, houses, numbers, theories, colors, football games, wars, centuries... Predicates: red, round, bogus, prime, multistoried,... brother of, bigger than, inside, part of, has color, occurred after, owns, comes between,... Functions: father of, best friend, third inning of, one more than,... Language Ontology Epistemology Propositional logic facts true / false / unknown First-order logic facts, objects, relations true / false / unknown Temporal logic facts, objects, relations, times true / false / unknown Probability theory facts degree of belief Fuzzy logic facts + degree of truth known interval value

COMP9414/9814/3411 16s1 First Order Logic 4 Syntax of First-order logic COMP9414/9814/3411 16s1 First Order Logic 5 Sentences Constants Gold,Wumpus,[1, 2],[3, 1], etc. Predicates Ad jacent(), Smell(), Breeze(), At() Functions Result() Variables x, y, a, t,... Connectives Equality = Quantifiers Atomic sentence = predicate(term 1,...,term n ) or term 1 = term 2 Term = f unction(term 1,...,term n ) or constant or variable e.g. At(Agent,[1,1],S 0 ) Holding(Gold,S 5 ) Complex sentences are made from atomic sentences using connectives S, S 1 S 2, S 1 S 2, S 1 S 2, S 1 S 2 e.g. Pit(x) Ad jacent(x,y) COMP9414/9814/3411 16s1 First Order Logic 6 Universal Quantification COMP9414/9814/3411 16s1 First Order Logic 7 Universal Quantification variables sentence Where there s glitter, there s gold: x Glitter(x) At(Gold, x) x P is equivalent to the conjunction of instantiations of P Glitter([1,1]) At(Gold,[1,1]) Glitter([1,2]) At(Gold,[1,2]) Glitter([1,3]) At(Gold,[1,3])... Typically, is the main connective with Common mistake: using as the main connective with x Glitter(x) At(Gold, x) means There is Glitter everywhere and Gold everywhere.

COMP9414/9814/3411 16s1 First Order Logic 8 Existential Quantification COMP9414/9814/3411 16s1 First Order Logic 9 Existential Quantification variables sentence Some sheep are black x Sheep(x) Black(x) x P is equivalent to the disjunction of instantiations of P Sheep(Dolly) Black(Dolly) Sheep(Lassie) Black(Lassie) Sheep(Skippy) Black(Skippy)... Typically, is the main connective with Common mistake: using as the main connective with x Sheep(x) Black(x) is true if there is anyone who is not at sheep! COMP9414/9814/3411 16s1 First Order Logic 10 Properties of Quantifiers COMP9414/9814/3411 16s1 First Order Logic 11 Fun with Sentences x y is the same as y x (Why?) x y is the same as y x (Why?) x y is not the same as y x x y Loves(x, y) There is a person who loves everyone in the world y x Loves(x, y) Everyone in the world is loved by at least one person Quantifier duality: each can be expressed using the other x Likes(x, IceCream) x Likes(x, Broccoli) x Likes(x, IceCream) x Likes(x, Broccoli) Brothers are siblings Sibling is symmetric One s mother is one s female parent A first cousin is a child of a parent s sibling

COMP9414/9814/3411 16s1 First Order Logic 12 Fun with Sentences COMP9414/9814/3411 16s1 First Order Logic 13 Reactive agent for the Wumpus World Brothers are siblings x,y Brother(x,y) Sibling(x,y) Sibling is symmetric x,y Sibling(x,y) Sibling(y,x) One s mother is one s female parent x,y Mother(x,y) (Female(x) Parent(x,y)) A first cousin is a child of a parent s sibling x, yfirstcousin(x, y) p, ps Parent(p, x) Sibling(ps, p) Parent(ps, y) Reflex action: t AtGold(t) Action(Grab, t) Reflex with internal state: do we have the gold already? t AtGold(t) Holding(Gold, t) Action(Grab, t) Holding(Gold,t) cannot be observed. Therefore, keeping track of change is essential. Also, how do we know if we are on our way in or out of the cave? COMP9414/9814/3411 16s1 First Order Logic 14 Deducing Hidden Properties COMP9414/9814/3411 16s1 First Order Logic 15 Keeping Track of Change Properties of locations: x,t At(Agent,x,t) Smell(t) Smelly(x) x,t At(Agent,x,t) Breeze(t) Breezy(x) Squares are breezy near a pit: Causal rule infer effect from cause x,y Pit(x) Ad jacent(x,y) Breezy(y) Diagnostic rule infer cause from effect y Breezy(y) x Pit(x) Ad jacent(x,y) Facts hold in situations, rather than eternally e.g. Holding(Gold,Now) rather than just Holding(Gold) Situation calculus is one way to represent change: Adds a situation argument to each non-eternal predicate e.g. Now denotes a situation in Holding(Gold,Now) Situations are connected by the Result function Result(a,s) is the situation that results from doing a is s Gold Definition for the Breezy predicate (combines Causal and Diagnostic): y Breezy(y) [ x Pit(x) Ad jacent(x,y)] Gold S 0 S 1 Forward

COMP9414/9814/3411 16s1 First Order Logic 16 Describing actions I COMP9414/9814/3411 16s1 First Order Logic 17 Describing actions II Effect axiom describe changes due to action s AtGold(s) Holding(Gold, Result(Grab, s)) Frame axiom describe non-changes due to action s HaveArrow(s) HaveArrow(Result(Grab, s)) Frame problem: find an elegant way to handle non-change (a) representation avoid frame axioms (b) inference avoid repeated copy-overs to keep track of state Qualification problem: true descriptions of real actions require endless caveats what if gold is slippery or nailed down or... Ramification problem: real actions have many secondary consequences what about the dust on the gold, wear and tear on gloves,... Successor-state axioms solve the representational frame problem. Each axiom is about a predicate (not an action per se): P true afterwards [an action made P true P true already and no action made P false] For holding the gold: a, s Holding(Gold, Result(a, s)) [(a=grab AtGold(s)) (Holding(Gold,s) a Release)] COMP9414/9814/3411 16s1 First Order Logic 18 Making Plans COMP9414/9814/3411 16s1 First Order Logic 19 Making Plans: a Better Way Initial condition in KB (knowledge base): At(Agent,[1,1],S 0 ) At(Gold,[1,2],S 0 ) Query: Ask(KB, s Holding(Gold, s)) i.e., in what situation will I be holding the gold? Answer: s=result(grab,result(forward,s 0 )) i.e., go forward and then grab the gold This assumes that the agent is interested in plans starting at S 0 and that S 0 is the only situation described in the KB. Represent plans as action sequences [a 1,a 2,...,a n ] PlanResult(p,s) is the result of executing p in s Then the query Ask(KB, p Holding(Gold,PlanResult(p,S 0 ))) has the solution p =[Forward, Grab] Definition of PlanResult in terms of Result: s PlanResult([],s)=s a, p, s PlanResult([a p], s) = PlanResult(p, Result(a, s)) Planning systems are special-purpose reasoners designed to do this type of inference more efficiently than a general-purpose reasoner.

COMP9414/9814/3411 16s1 First Order Logic 20 Summary First-order logic: objects and relations are semantic primitives syntax: constants, functions, predicates, equality, quantifiers Increased expressive power: sufficient to define Wumpus World Situation calculus: conventions for describing actions and change can formulate planning as inference on a knowledge base