First-order logic. Chapter 8, Sections 1 3

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

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

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

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

Logical Agents (AIMA - Chapter 7)

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

First Order Logic CSL 302 ARTIFICIAL INTELLIGENCE SPRING 2014

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


Table of Contents I. Artificial Intelligence 1

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

1. MacBride s description of reductionist theories of modality

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

Informed search algorithms

Game playing. Chapter 5, Sections 1 6

Description Logic in a nutshell

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

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

General Game Playing (GGP) Winter term 2013/ Summary

Constraint Satisfaction Problems: Formulation

Materials and Methods

GENOGRAM PACKET. Name: Date:

All the children are not boys

Pedigrees How do scientists trace hereditary diseases through a family history?

have to get on the phone or family members for the names of more distant relatives.

Propositional attitudes

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

Philosophy. AI Slides (5e) c Lin

LITERATURE CIRCLES Rules by Cynthia Lord

SCENARIO CARDS (ANGER) SCENARIO CARDS (ANGER) SCENARIO CARDS (ANGER) SCENARIO CARDS (ANGER)

MODALITY, SI! MODAL LOGIC, NO!

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

Automated Reasoning. Satisfiability Checking

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

Planning. AIMA2e Chapter 11. AIMA2e Slides, Stuart Russell and Peter Norvig, Completed by Kazim Fouladi, Fall 2008 AIMA2e Chapter 11 1

EARIN Jarosław Arabas Room #223, Electronics Bldg.

By Amalia Harte, Grade 5, Fox Mill Elementary School Herndon, Va.

Topic Present Past Future Speculating/ Theoretical Work/ Studies

22c:145 Artificial Intelligence

Family Communication Survey

Artificial Intelligence: An overview

Artificial Intelligence

HOUGHTON MIFFLIN HARCOURT

Lecture 6: Metagaming

CS 202, section 2 Final Exam 13 December Pledge: Signature:

PROBABILISTIC REASONING IN INTELLIGENT SYSTEMS NETWORKS OF PLAUSIBLE INFERENCE MORGAN KAUFMANN SERIES IN REPRESENTATION AND REASONING

CSc 372. Comparative Programming Languages. 23 : Prolog Basics. Department of Computer Science University of Arizona

By Amalia Harte, Grade 5, Fox Mill Elementary School Herndon, Va.

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

The attribution problem in Cognitive Science. Thinking Meat?! Formal Systems. Formal Systems have a history

term var nonvar compound atomic atom number Prolog Types CSc 372 Comparative Programming Languages 16 : Prolog Basics

Agents in the Real World Agents and Knowledge Representation and Reasoning

Sophia s War: A Tale of the Revolution By Avi

COMP9414: Artificial Intelligence Adversarial Search

HEREDITARY CANCER FAMILY HISTORY QUESTIONNAIRE

CISC 1600 Lecture 3.4 Agent-based programming

Homework 5 Answers PS 30 November 2013

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

COMP219: Artificial Intelligence. Lecture 17: Semantic Networks

Tableaux. Jiří Vyskočil 2017

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

Additional information >>> HERE <<<

Midterm. CS440, Fall 2003

A Logic for Social Influence through Communication

Binary Addition. Boolean Algebra & Logic Gates. Recap from Monday. CSC 103 September 12, Binary numbers ( 1.1.1) How Computers Work

COMP60421 Family History in OWL Edition 1.0

Protecting Family Relationships: Good Contact in Care

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

COMP219: Artificial Intelligence. Lecture 17: Semantic Networks

CSE 473 Artificial Intelligence (AI) Outline

Being a Good Citizen

Computer Science Faculty Publications

UMBC CMSC 671 Midterm Exam 22 October 2012

Artificial Intelligence

A New Earth Online Class

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

Monte Carlo Tree Search. Simon M. Lucas

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

How to AI COGS 105. Traditional Rule Concept. if (wus=="hi") { was = "hi back to ya"; }

EXERGY, ENERGY SYSTEM ANALYSIS AND OPTIMIZATION Vol. III - Artificial Intelligence in Component Design - Roberto Melli

The Basic Rules of Chess

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

Artificial Intelligence

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

How To Uncover Your Genealogy

Manchester Family History Advanced OWL Tutorial Edition 1.1

Day 6: Synergize. Synergize by playing at least 3 of the games below using either a deck of cards or using the number cards in the handout.

Expressing wishes and regrets. LEVEL NUMBER LANGUAGE Advanced B2_1047X_EN English

2017, Margot Starbuck

Default Reasoning in CHR

Sales Configurator Information Systems Design Theory

CIS/CSE 774 Principles of Distributed Access Control Exam 1 October 3, Points Possible. Total 60

Playful AI Education. Todd W. Neller Gettysburg College

Awareness in Games, Awareness in Logic

MTH 103 H Final Exam. 1. I study and I pass the course is an example of a. (a) conjunction (b) disjunction. (c) conditional (d) connective

2/6/2006 Team #7: Pez Project: Empty Clip Members: Alan Witkowski, Steve Huff, Thos Swallow, Travis Cooper Document: SRS

BEDTIME-GAME FOR THE WHOLE FAMILY

Transcription:

First-order logic Chapter 8, Sections 1 3 Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 1

Outline Why FOL? Syntax of FOL Semantics of FOL Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 2

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 Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 3

First-order logic Whereas propositional logic assumes that the world contains facts, first-order logic (like natural language) assumes that the world contains Objects: people, houses, numbers, theories, Ronald McDonald, colors, baseball games, wars, centuries... Relations: red, round, bogus, prime, multistoried..., sister of, brother of, bigger than, inside, part of, has color, occurred after, owns, comes between,... Functions: mother of, father of, best friend, third inning of, one more than, end of... Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 4

Syntax of FOL: Basic elements Constants John, 2, UCB,... Predicates Brother, >,... Functions Sqrt, LeftLeg,... Variables x, y, a, b,... Connectives Equality = Quantifiers Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 5

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(Richard, John) M arried(f ather(richard), M other(john)) Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 6

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. Brother(LeftLeg(Richard), John) Brother(Richard, John) Brother(John, Richard) King(Richard) King(John) Note: The last one is equivalent to: ( King(Richard)) King(John) and not: (King(Richard) King(John)) Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 7

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 Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 8

Models for FOL: Example crown person brother brother on head person king R $ J left leg left leg Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 9

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 Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 10

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! Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 11

variables sentence All kings are persons: x King(x) Person(x) Universal quantification 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 (King(Richard) Person(Richard)) (King(John) Person(John)) (King(TheCrown) Person(TheCrown)) (King(LeftLeg(Richard)) Person(LeftLeg(Richard)))... Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 12

A common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x King(John) Person(John) means Everything is both a king and a person Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 13

variables sentence Existential quantification King John has a crown on his head: x Crown(x) OnHead(x,John) 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 (Crown(Richard) OnHead(Richard, John)) (Crown(John) OnHead(John, John)) (Crown(T hecrown) OnHead(T hecrown, John)) (Crown(LeftLeg(Richard)) OnHead(LeftLeg(Richard), John))... Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 14

Another common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x Crown(x) OnHead(x, John) is true if there is anything that is not a crown! Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 15

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) Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 16

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) (Female(x) Parent(x,y)). A first cousin is a child of a parent s sibling x,y FirstCousin(x,y) p,ps Parent(p,x) Sibling(ps,p) Parent(ps,y)) Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 17

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., to say that Richard has at least two brothers: x,y Brother(x,Richard) Brother(y,Richard) (x = y) Without the final (x = y), it would just say that Richard has at least one brother. E.g., definition of (full) Sibling in terms of Parent: x,y Sibling(x,y) [ m,f (x=y) (m=f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y) ] Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 18

Example: The wumpus world Squares are breezy near a pit: Diagnostic rule infer cause from effect y Breezy(y) x Pit(x) Adjacent(x,y) Causal rule infer effect from cause x,y Pit(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 Pit(x) Adjacent(x,y)] Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 19

Summary First-order logic: objects and relations are semantic primitives syntax: constants, functions, predicates, equality, quantifiers Increased expressive power: sufficient to define the wumpus world Artificial Intelligence, spring 2013, Peter Ljunglöf; based on AIMA Slides c Stuart Russel and Peter Norvig, 2004 Chapter 8, Sections 1 3 20