First-Order Predicate Logic. Introduction to Intelligent Systems

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

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

THE PREDICATE CALCULUS

COMP3411: Artificial Intelligence 8. First Order Logic

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

First-Order Logic Syntax

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

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

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

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

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

Last time: Logic and Reasoning

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

Week 7 Prolog overview

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

First Order Logic and Resolution

6. Inference and resolution

Software Paradigms (Lesson 6) Logic Programming

Programming Language Concepts (20013) Preparation for the Final Exam

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

Logic as a Programming Language

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

Programming Language Concepts (20013) Preparation for the Final Exam

Logic Programming Paradigm

ARTIFICIAL INTELLIGENCE (CS 370D)

Solutions to Selected Exercises

will take you everywhere.

Going beyond propositional logic

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

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

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

Introduction to Prolog

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

Mathematical Logic

Automated Reasoning. Natural Deduction in First-Order Logic

First-Order Predicate Logic. CSCI 5582, Fall 2007

Lecture 7: January 15, 2014

Multi-agent and Semantic Web Systems: Representation

Introduction to predicate calculus

Advanced Logic and Functional Programming

Logic programming I. Henrik Boström Stockholm University. Facts Queries Rules Terms Recursion Lists Negation

Chapter 16. Logic Programming Languages ISBN

IF/Prolog V5.3. User s Guide. Siemens AG Austria

Logic Programming Languages

First-Order Logic (FOL)

Prolog. Reading: Sethi, Chapter 11. Overview. Predicate Calculus. Substitution and Unication. Introduction to Prolog. Prolog Inference Rules

First Order Logic Part 1

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

First-Order Logic PREDICATE LOGIC. Syntax. Terms

First Order Predicate Logic CIS 32

ITS336 Lecture 7 Prolog

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

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

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

First Order Logic Semantics (3A) Young W. Lim 6/1/17

Chapter 16. Logic Programming Languages

CS 4700: Artificial Intelligence

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

CPS 506 Comparative Programming Languages. Programming Language Paradigm

Software Paradigms (Lesson 7) Logic Programming & Software Engineering

CITS2211 Discrete Structures Logic

6.034 Notes: Section 5.1

7. Relational Calculus (Part I) 7.1 Introduction

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

For Wednesday. No reading Chapter 9, exercise 9. Must be proper Horn clauses

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

Artificial Intelligence

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

First Order Logic Semantics (3A) Young W. Lim 6/2/17

Knowledge Representation

logic with quantifiers (informally)

Sec Negative Goals ( Not ) 21

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 14. Example. Datalog syntax: rules. Datalog query. Meaning of Datalog rules

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

4.3 FURTHER PROGRAMMING

Predicate Logic CHAPTER What This Chapter Is About

Lecture 4: January 12, 2015

A review of First-Order Logic

Programming Paradigms

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

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

First order logic (Ch. 8)

Knowledge Representation Issues, Predicate Logic, Rules

Introduction to Logic Programming

CSE Discrete Structures

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

Visual Prolog Tutorial

Symbolic Programming Declarative Programming

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

What is Prolog? - 1. A Prolog Tutorial. Prolog Programming. What is Prolog? - 2. » Declaring some facts about objects and their relationships

Primitive goal based ideas

Formal Specification: Z Notation. CITS5501 Software Testing and Quality Assurance

COMP232 - Mathematics for Computer Science

Chapter 16. Logic Programming Languages ISBN

1. Logic as a subject matter is the study of logics, understood as models of acceptable inference patterns

simplicity hides complexity flow of control, negation, cut, 2 nd order programming, tail recursion procedural and declarative semantics and & or

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

Resolution in FO logic (Ch. 9)

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY REPRESENTATION OF KNOWLEDGE PART A

First order logic (Ch. 8)

Transcription:

First-Order Predicate Logic Introduction to Intelligent Systems

First-Order (Predicate) Logic Propositional logic assumes the world contains facts Predicate logic (like natural language) assumes the world contains: Objects: people, houses, numbers, colors, baseball games, wars, Relations: red, round, prime, brother of, bigger than, part of, comes between, Functions: father of, best friend, one more than, plus,

Syntax of Predicate Calculus Symbols represent constants, variables, functions, or predicates: Constants begin with a lower-case letter bill, john, etc. The constants true and false are reserved as truth symbols Variables begin with an upper-case letter For example, X, is a variable that can represent any constant Functions have input and produce an output plus(5,4) The arity of a function is the number of arguments For example, plus has an arity of 2 Predicates are similar to functions, but return true A predicate names a relationship between objects in the world For example, father(bill, john) means that bill is the father of john father(bill, X) refers to any child of bill

Semantics of Predicate Calculus Quantification of variables is important When a variable appears in a sentence, that variable serves as a placeholder For example, the X in likes(george, X) Any constant allowed under the interpretation can be substituted for it in the expression Substituting kate or susie for X forms the statement likes(george, kate) or likes(george, susie)

Sentences in Predicate Calculus Sentences are created by combining predicates using logical operators (the same as used for propositional calculus) and quantifiers Examples: likes(george, kate) friend(x, george) helps(x, X) has_children(ben, plus(2, 3)) friend(father_of(david, X), father_of(andrew, Y)) likes, friend, helps and father_of are predicates plus is a function

Sentences in Predicate Calculus When a variable appears in a sentence, it refers to unspecified objects in the domain. First order predicate calculus includes two additional symbols, the variable quantifiers and, that constrain the meaning of a sentence: Y friend(y, peter) X likes(x, ice_cream)

Quantifiers and The universal quantifier X p(x) is read For all X, p(x) is true The existential quantifier X p(x) is read There exists an X such that p(x) is true Relationship between the quantifiers: X p(x) ( X) p(x) There exists an X for which p(x) is true is equivalent to it is not true that for all X p(x) does not hold

Universal Quantification Typically, is the main connective with Example: Everyone at RIT is smart : X at(x, rit) smart(x) Common mistake: using as the main connective with : X at(x, rit) smart(x) means Everyone is at RIT and everyone is smart

Existential Quantification Typically, is the main connective with Example: Someone at RIT is smart : X at(x, rit) smart(x) Common mistake: using as the main connective with : X at(x, rit) smart(x) This means: If RIT has a student then that student is smart.

Properties of Quantifiers X Y is the same as Y X X Y is the same as Y X X Y is not the same as Y X X Y loves(x,y) There is a person who loves everyone Y X loves(x,y) Everyone is loved by someone Quantifier duality: each can be expressed using the other: X likes(x, icecream)= X likes(x, icecream) X likes(x, broccoli) = X likes(x, broccoli)

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 For example, the definition of sibling in terms of parent is: X,Y ( (X = Y) M,F (M = F) parent(m,x) parent(f,x) parent(m,y) parent(f,y) sibling(x,y))

Using First-Order Logic First-order rules for the kinship domain: Brothers are male siblings X,Y (male(x) sibling(x,y) brother(x,y)) sibling is symmetric X,Y (sibling(y,x) sibling(x,y)) One's mother is one's female parent M,C (female(m) parent(m,c) mother(m,c))

Using First-Order Logic For example, given the following facts: mother(eve,abel) mother(eve,cain) father(adam,abel) father(adam,cain) And the following rules: X,Y (father(x,y) mother(x,y) parent(x,y)) X,Y,Z (parent(x,y) parent(x,z) sibling(y,z)) One can conclude that cain and abel are siblings (or half-siblings)

Examples of First-Order Predicates If it doesn t rain on Monday, Tom will go to the mountains. weather(rain, monday) go(tom, mountains) Emma is a Doberman pinscher and a good dog. is_a(emma,doberman) good_dog(emma) All basketball players are tall. X (basketball_player(x) tall(x)) Some people like anchovies. X (person(x) likes(x, anchovies)) If wishes were horses, beggars would ride. equal(wishes, horses) ride(beggars) Nobody likes taxes. X likes(x, taxes)

Blocks World Example c a b d A collection of logical clauses describes the important properties and relationships in a Blocks World: on(c,a) on(b,d) ontable(a) ontable(d) clear(b) clear(c) hand_empty Suppose you want to define a test to determine whether all blocks are clear (have nothing stacked on top of them): X ( Y on (Y, X)) clear(x). For all X, if there does not exist a Y such that Y is on X, then X is clear.