First-order logic. Artificial Intelligence. Topic 13. Reading: Russell and Norvig, Chapter 8

Similar documents
c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 87

First-order logic. Chapter 7. AIMA Slides c Stuart Russell and Peter Norvig, 1998 Chapter 7 1

First Order Logic. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli rev 1.0, 10/1/2001 Page 1

First-order logic. Chapter 8, Sections 1 3

Logical Agents (AIMA - Chapter 7)

11/18/2015. Outline. Logical Agents. The Wumpus World. 1. Automating Hunt the Wumpus : A different kind of problem

5.4 Imperfect, Real-Time Decisions

5.4 Imperfect, Real-Time Decisions

Practical Aspects of Logic in AI

CSEP 573 Adversarial Search & Logic and Reasoning


First Order Logic CSL 302 ARTIFICIAL INTELLIGENCE SPRING 2014

22c181: Formal Methods in Software Engineering. The University of Iowa Spring Propositional Logic

Modal logic. Benzmüller/Rojas, 2014 Artificial Intelligence 2

Your Name and ID. (a) ( 3 points) Breadth First Search is complete even if zero step-costs are allowed.

Intelligent Agents. Introduction to Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 23.

CSC242 Intro to AI Spring 2012 Project 2: Knowledge and Reasoning Handed out: Thu Mar 1 Due: Wed Mar 21 11:59pm

1. MacBride s description of reductionist theories of modality

Artificial Intelligence: An overview

Description Logic in a nutshell

Table of Contents I. Artificial Intelligence 1

COMP9414/ 9814/ 3411: Artificial Intelligence. Week 2. Classifying AI Tasks

Propositional attitudes

General Game Playing (GGP) Winter term 2013/ Summary

Formal Verification. Lecture 5: Computation Tree Logic (CTL)

Logic and Artificial Intelligence Lecture 18

Game Mechanics Minesweeper is a game in which the player must correctly deduce the positions of

Midterm. CS440, Fall 2003

Overview Agents, environments, typical components

arxiv: v1 [math.co] 16 Aug 2018

Knowledge Representation and Reasoning

Artificial Intelligence. Topic 9. Planning. Search vs. planning Planning Languages and STRIPS State Space vs. Plan Space Partial-order Planning

Automated Reasoning. Satisfiability Checking

MATH 225: Foundations of Higher Matheamatics. Dr. Morton. Chapter 2: Logic (This is where we begin setting the stage for proofs!)

From: AAAI Technical Report FS Compilation copyright 1994, AAAI ( All rights reserved.

MODALITY, SI! MODAL LOGIC, NO!

UMBC CMSC 671 Midterm Exam 22 October 2012

What is Artificial Intelligence? Alternate Definitions (Russell + Norvig) Human intelligence

Philosophy. AI Slides (5e) c Lin

All the children are not boys

Neuro-Fuzzy and Soft Computing: Fuzzy Sets. Chapter 1 of Neuro-Fuzzy and Soft Computing by Jang, Sun and Mizutani

Awareness in Games, Awareness in Logic

Strict Finitism Refuted? Ofra Magidor ( Preprint of paper forthcoming Proceedings of the Aristotelian Society 2007)

COMP9414/ 9814/ 3411: Artificial Intelligence. 2. Environment Types. UNSW c Alan Blair,

CS 188 Introduction to Fall 2014 Artificial Intelligence Midterm

Introduction to cognitive science Session 3: Cognitivism

A State Equivalence and Confluence Checker for CHR

Add Another Blue Stack of the Same Height! : ASP Based Planning and Plan Failure Analysis

A review of Reasoning About Rational Agents by Michael Wooldridge, MIT Press Gordon Beavers and Henry Hexmoor

Knowledge Management for Command and Control

Sensor Robot Planning in Incomplete Environment

Outline. Introduction to AI. Artificial Intelligence. What is an AI? What is an AI? Agents Environments

How to Enrich Description Logics with Fuzziness

COMP310 Multi-Agent Systems Chapter 3 - Deductive Reasoning Agents. Dr Terry R. Payne Department of Computer Science

Philosophical Foundations. Artificial Intelligence Santa Clara University 2016

Lecture 6: Metagaming

COMP219: Artificial Intelligence. Lecture 17: Semantic Networks

The Fear Eliminator. Special Report prepared by ThoughtElevators.com

Tableaux. Jiří Vyskočil 2017

Co-evolution of agent-oriented conceptual models and CASO agent programs

The SOCS Computational Logic Approach to the Specification and Verification of Agent Societies

ROBOT CONTROL VIA DIALOGUE. Arkady Yuschenko

COMP219: Artificial Intelligence. Lecture 17: Semantic Networks

Agents in the Real World Agents and Knowledge Representation and Reasoning

arxiv: v1 [cs.ai] 20 Feb 2015

Gilbert Peterson and Diane J. Cook University of Texas at Arlington Box 19015, Arlington, TX

An Ambient Agent Model for Monitoring and Analysing Dynamics of Complex Human Behaviour

Goal-Directed Tableaux

Chapter 1: Introduction to Neuro-Fuzzy (NF) and Soft Computing (SC)

CS 380: ARTIFICIAL INTELLIGENCE RATIONAL AGENTS. Santiago Ontañón

CMSC 421, Artificial Intelligence

A Logic for Social Influence through Communication

Team Name: 1. Remember that a palindrome is a number (or word) that reads the same backwards and forwards. For example, 353 and 2112 are palindromes.

DVA325 Formal Languages, Automata and Models of Computation (FABER)

My papers are on the above web page. This paper is

Towards Ontology Engineering

A DESIGN ASSISTANT ARCHITECTURE BASED ON DESIGN TABLEAUX

Default Reasoning in CHR

10/12/2015. SHRDLU: 1969 NLP solved?? : A sea change in AI technologies. SHRDLU: A demonstration proof. 1990: Parsing Research in Crisis

A Historical Example One of the most famous problems in graph theory is the bridges of Konigsberg. The Real Koningsberg

Donkey Pluralities: Plural Information States vs. Non-atomic Individuals

FICTIONAL HIERARCHIES AND MODAL THEORIES OF FICTION JOHANNES SCHMITT USC SCHOOL OF PHILOSOPHY

Modelling a player s logical actions through the game Hunt The Wumpus

A Model-Based Critique Tool for Policy Deliberation

GENOGRAM PACKET. Name: Date:

Heuristic Evaluation Functions for General Game Playing

Midterm Examination. CSCI 561: Artificial Intelligence

CS:4420 Artificial Intelligence

On the GED essay, you ll need to write a short essay, about four

CS 480: GAME AI TACTIC AND STRATEGY. 5/15/2012 Santiago Ontañón

Section Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46

The K.U.Leuven CHR System: Implementation and Application

Artificial Intelligence. Shobhanjana Kalita Dept. of Computer Science & Engineering Tezpur University

CSEP 573 Applications of Artificial Intelligence Winter 2011 Assignment 3 Due: Wednesday February 16, 6:30PM

Plan for the 2nd hour. What is AI. Acting humanly: The Turing test. EDAF70: Applied Artificial Intelligence Agents (Chapter 2 of AIMA)

From Purple Prose to Machine-Checkable Proofs: Levels of rigor in family history tools

Webs of Belief and Chains of Trust

Planning and Optimization

Artificial Intelligence

A new approach to termination analysis of CHR

Transcription:

Artificial Intelligence Topic 13 First-order logic Reading: Russell and Norvig, Chapter 8 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 86

Outline Why FOL? Syntax and semantics of FOL Fun with sentences Wumpus world in FOL c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 87

Pros and cons of propositional logic Propositional logic is declarative: pieces of syntax correspond to facts Propositional logic allows partial/disjunctive/negated information (unlike most data structures and databases) Propositional logic is compositional: meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2 Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context) Propositional logic has very limited expressive power (unlike natural language) E.g., cannot say pits cause breezes in adjacent squares except by writing one sentence for each square c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 88

First-order logic Whereas propositional logic assumes world contains facts, first-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, theories, Ronald McDonald, colors, baseball games, wars, centuries... Relations: 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, end of... c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 89

Logics in general Language Ontological Epistemological Commitment Commitment 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 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 90

Syntax of FOL: Basic elements Constants KingJohn, 2, UCB,... Predicates Brother, >,... Functions Sqrt, Lef tlegof,... Variables x, y, a, b,... Connectives Equality = Quantifiers c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 91

Atomic sentences Atomic sentence = predicate(term 1,..., term n ) or term 1 = term 2 Term = function(term 1,..., term n ) or constant or variable E.g., Brother(KingJohn, RichardT helionheart) > (Length(Lef tlegof(richard)), Length(Lef tlegof(kingjohn))) c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 92

Complex sentences 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. Sibling(KingJohn, Richard) Sibling(Richard, KingJohn) >(1, 2) (1, 2) >(1, 2) >(1, 2) c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 93

Truth in first-order logic Sentences are true with respect to a model and an interpretation Model contains 1 objects (domain elements) and relations among them Interpretation specifies referents for constant symbols objects predicate symbols relations function symbols functional relations An atomic sentence predicate(term 1,..., term n ) is true iff the objects referred to by term 1,..., term n are in the relation referred to by predicate c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 94

Models for FOL: Example Models for FOL: Example crown person brother brother on head person king R $ J left leg left leg Chapter 8 10 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 95

Truth example Consider the interpretation in which Richard Richard the Lionheart John the evil King John Brother the brotherhood relation Under this interpretation, Brother(Richard, John) is true just in case Richard the Lionheart and the evil King John are in the brotherhood relation in the model c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 96

Models for FOL: Lots! Entailment in propositional logic can be computed by enumerating models We can enumerate the FOL models for a given KB vocabulary: For each number of domain elements n from 1 to For each k-ary predicate P k in the vocabulary For each possible k-ary relation on n objects For each constant symbol C in the vocabulary For each choice of referent for C from n objects... Computing entailment by enumerating FOL models is not easy! c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 97

Universal quantification variables sentence Everyone at Berkeley is smart: x At(x, Berkeley) Smart(x) x P is true in a model m iff P is true with x being each possible object in the model Roughly speaking, equivalent to the conjunction of instantiations of P (At(KingJohn, Berkeley) Smart(KingJohn)) (At(Richard, Berkeley) Smart(Richard)) (At(Berkeley, Berkeley) Smart(Berkeley))... c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 98

A common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x At(x, Berkeley) Smart(x) means Everyone is at Berkeley and everyone is smart c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 99

Existential quantification variables sentence Someone at Stanford is smart: x At(x, Stanford) Smart(x) x P is true in a model m iff P is true with x being some possible object in the model Roughly speaking, equivalent to the disjunction of instantiations of P (At(KingJohn, Stanf ord) Smart(KingJohn)) (At(Richard, Stanf ord) Smart(Richard)) (At(Stanf ord, Stanf ord) Smart(Stanf ord))... c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 100

Another common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x At(x, Stanf ord) Smart(x) is true if there is anyone who is not at Stanford! c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 101

Properties of quantifiers 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) c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 102

Fun with sentences Brothers are siblings c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 103

Fun with sentences Brothers are siblings x, y Brother(x, y) Sibling(x, y). Sibling is symmetric c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 104

Fun with sentences 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 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 105

Fun with sentences 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) (F emale(x) P arent(x, y)). A first cousin is a child of a parent s sibling c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 106

Fun with sentences 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) (F emale(x) P arent(x, y)). A first cousin is a child of a parent s sibling x, y F irstcousin(x, y) p, ps P arent(p, x) Sibling(ps, p) P arent(ps, y) c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 107

Equality term 1 = term 2 is true under a given interpretation if and only if term 1 and term 2 refer to the same object E.g., 1 = 2 and x (Sqrt(x), Sqrt(x)) = x are satisfiable 2 = 2 is valid E.g., definition of (full) Sibling in terms of P arent: x, y Sibling(x, y) [ (x = y) m, f (m = f) P arent(m, x) P arent(f, x) P arent(m, y) P arent(f, y)] c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 108

Interacting with FOL KBs Suppose a wumpus-world agent is using an FOL KB and perceives a smell and a breeze (but no glitter) at t = 5: T ell(kb, P ercept([smell, Breeze, N one], 5)) Ask(KB, a Action(a, 5)) I.e., does KB entail any particular actions at t = 5? Answer: Y es, {a/shoot} substitution (binding list) Given a sentence S and a substitution σ, Sσ denotes the result of plugging σ into S; e.g., S = Smarter(x, y) σ = {x/hillary, y/bill} Sσ = Smarter(Hillary, Bill) Ask(KB, S) returns some/all σ such that KB = Sσ c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 109

Knowledge base for the wumpus world Perception b, g, t P ercept([smell, b, g], t) Smelt(t) s, b, t P ercept([s, b, Glitter], t) AtGold(t) Reflex: 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 keeping track of change is essential c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 110

Deducing hidden properties Properties of locations: x, t At(Agent, x, t) Smelt(t) Smelly(x) x, t At(Agent, x, t) Breeze(t) Breezy(x) Squares are breezy near a pit: Diagnostic rule infer cause from effect y Breezy(y) x P it(x) Adjacent(x, y) Causal rule infer effect from cause x, y P it(x) Adjacent(x, y) Breezy(y) Neither of these is complete e.g., the causal rule doesn t say whether squares far away from pits can be breezy Definition for the Breezy predicate: y Breezy(y) [ x P it(x) Adjacent(x, y)] c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 111

Keeping track of change Facts hold in situations, rather than eternally E.g., Holding(Gold, NKeeping ow) rathertrack than just of change Holding(Gold) SituationFacts calculus hold inissituations, one wayrather to represent than eternally change in FOL: E.g., Holding(Gold, N ow) rather than just Holding(Gold) Adds a situation argument to each non-eternal predicate E.g., Situation Nowcalculus in Holding(Gold, is one way to represent Now) change denotes in FOL: a situation Adds a situation argument to each non-eternal predicate E.g., Now in Holding(Gold, Now) denotes a situation Situations are connected by the Result function Result(a, Situations s) is the are situation connected by that the Result resultsfunction from doing a in s Result(a, s) is the situation that results from doing a in s PIT Gold PIT PIT Gold PIT PIT S 1 PIT S 0 Forward Chapter 8 27 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 112

Describing actions I 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,... c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 113

Describing actions II 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)] c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 114

Making plans Initial condition in KB: 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(F orward, 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 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 115

Making plans: A better way Represent plans as action sequences [a 1, a 2,..., a n ] P lanresult(p, s) is the result of executing p in s Then the query Ask(KB, p Holding(Gold, P lanresult(p, S 0 ))) has the solution {p/[f orward, Grab]} Definition of P lanresult in terms of Result: s P lanresult([ ], s) = s a, p, s P lanresult([a p], s) = P lanresult(p, Result(a, s)) Planning systems are special-purpose reasoners designed to do this type of inference more efficiently than a general-purpose reasoner c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 116

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 in FOL can formulate planning as inference on a situation calculus KB c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 First-order logic Slide 117