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

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

First-Order Predicate Logic. Introduction to Intelligent Systems

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

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

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

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

A review of First-Order Logic

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

First Order Logic and Resolution

Last time: Logic and Reasoning

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

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

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

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

Introduction to Logic Programming

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

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

First Order Logic Part 1

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

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

ARTIFICIAL INTELLIGENCE (CS 370D)

THE PREDICATE CALCULUS

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

First Order Predicate Logic CIS 32

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

Lecture 4: January 12, 2015

COMP4418 Knowledge Representation and Reasoning

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

Lecture 7: January 15, 2014

Logic Programming Paradigm

CITS2211 Discrete Structures Logic

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

Set 9: Planning Classical Planning Systems. ICS 271 Fall 2013

Software Paradigms (Lesson 6) Logic Programming

First-Order Predicate Logic. CSCI 5582, Fall 2007

Towards a Logical Reconstruction of Relational Database Theory

Knowledge Representation and Reasoning Logics for Artificial Intelligence

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

Set 9: Planning Classical Planning Systems. ICS 271 Fall 2014

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

Description Logics as Ontology Languages for Semantic Webs

6.034 Notes: Section 10.1

First-Order Logic (FOL)

Knowledge Representation

6.034 Notes: Section 5.1

Logic: TD as search, Datalog (variables)

Logic as a Programming Language

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

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

First-Order Logic PREDICATE LOGIC. Syntax. Terms

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

15-819M: Data, Code, Decisions

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

Propositional Calculus. Math Foundations of Computer Science

Proseminar on Semantic Theory Fall 2013 Ling 720 An Algebraic Perspective on the Syntax of First Order Logic (Without Quantification) 1

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Lee Pike. June 3, 2005

Predicate Logic and Quan0fies

Review Material: First Order Logic (FOL)

! model construction

Assignment 3: Logical Agents: Solutions

CMPS 277 Principles of Database Systems. Lecture #3

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

ROEVER ENGINEERING COLLEGE Elambalur,Perambalur DEPARTMENT OF CSE AI UNIT-I

Automatic Reasoning (Section 8.3)

l A family of logic based KR formalisms l Distinguished by: l Decidable fragments of FOL l Closely related to Propositional Modal & Dynamic Logics

What is the study of logic?

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

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

Resolution in FOPC. Deepak Kumar November Knowledge Engineering in FOPC

Resolution in FO logic (Ch. 9)

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions

Knowledge Representation. What is knowledge representation?

Part I Logic programming paradigm

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

Full Clausal Logic - Syntax: clauses

Inference in First-Order Logic

Automated Reasoning Systems

Introduction to predicate calculus

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

Multi-agent and Semantic Web Systems: Representation

Primitive goal based ideas

Week 7 Prolog overview

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

CS 8520: Artificial Intelligence

Artificial Intelligence 2004 Planning: Situation Calculus

CSE 20 DISCRETE MATH. Fall

Automated Reasoning. Natural Deduction in First-Order Logic

Logical reasoning systems

7. Relational Calculus (Part I) 7.1 Introduction

Markov Logic: Representation

A deterministic action is a partial function from states to states. It is partial because not every action can be carried out in every state

Formal Methods in Software Engineering 1

Lecture 9: Predicate Logic. First: Finish Propositional Logic in Haskell. Semantics in Haskell. Syntax In Haskell. CS 181O Spring 2016 Kim Bruce

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

DM841 DISCRETE OPTIMIZATION. Part 2 Heuristics. Satisfiability. Marco Chiarandini

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

Transcription:

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

Outline New ontology objects, relations, properties, functions New Syntax Constants, predicates, properties, functions New semantics meaning of new syntax Inference rules for Predicate Logic (FOL) Unification Resolution Forward-chaining, Backward-chaining Readings: Russel and Norvig Chapter 8 & 9

Propositional logic is not expressive Needs to refer to objects in the world, Needs to express general rules On(x,y) clear(y) All men are mortal Everyone who passed the age of 21 can drink One student in this class got perfect score Etc. First order logic, also called Predicate calculus allows more expressiveness

Limitations of propositional logic KB needs to express general rules (and specific cases) All men are mortal; Socrates is a man, therefore mortal Combinatorial explosion Exactly one student in the class got perfect score Propositional logic P 1 P 2 P n For all i,j : P i P j First order logic x[p(x) y[x y P(y)]] Q : exactly two students have perfect score?

FOL : syntax 1. Terms refer to objects Constants : a, b, c, Variables : x, y, Can be free or bound Functions (over terms) : f, g, Ground term : constants + fully instantiated functions (no variables) : f(a) 2. Predicates E.g. P(a), Q(x), Unary = property, arity>1 = relation between objects Atomic sentences Evaluate to true/false Special relation = 3. Logical connectives : 4. Quantifiers : Typically want sentences wo free variables (fully quantified) 5. Function vs Predicate FatherOf(John) vs Father(X,Y) [Father(FatherOf(John),John)] Q : BrotherOf(John) vs Brothers(X,Y)?

Semantics: Worlds The world consists of objects that have properties. There are relations and functions between these objects Objects in the world, individuals: people, houses, numbers, colors, baseball games, wars, centuries Clock A, John, 7, the-house in the corner, Tel-Aviv Functions on individuals: father-of, best friend, third inning of, one more than Relations: brother-of, bigger than, inside, part-of, has color, occurred after Properties (a relation of arity 1): red, round, bogus, prime, multistoried, beautiful

Truth in first-order logic World contains objects (domain elements) and relations/functions among them Interpretation specifies referents for constant symbols objects predicate symbols relations function symbols functions Sentences are true with respect to a world and an interpretation 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

Semantics: Interpretation An interpretation of a sentence (wff) is wrt world that has a set of constants, functions, relations An interpretation of a sentence (wff) is a structure that maps Constant symbols of the language to constants in the worlds, n-ary function symbols of the language to n-ary functions in the world, n-ary predicate symbols of the language to n-ary relations in the world Given an interpretation, an atom has the value true if it denotes a relation that holds for those individuals denoted in the terms. Otherwise it has the value false Example: Block world: A, B, C, Floor, On, Clear World: On(A,B) is false, Clear(B) is true, On(C,F) is true

The formulas: Example of Models (Blocks World) On(A,F) Clear(B) Clear(B) and Clear(C) On(A,F) Clear(B) or Clear(A) Clear(B) Clear(C) Possible interpretations where the KB is true: Checking truth value of Clear(B) Map B (sentence) to B (interpretation) Map Clear (sentence) to Clear (interpretation) Clear(B) is true iff B is in Clear On = {<B,A>,<A,F>,<C,F>} Clear = {<C>,<B>} On = {<A,F>, <B,F>,<C,F>} Clear = {<A>,<B>,<C>} On = {<C,A>,<A,F>,<B,F>} Clear = {<C>,<B>}

Semantics : PL vs FOL Language KB : CNF over prop symbols Possible worlds (interpretations) Semantics: an interpretation maps prop symbols to {true,false} KB : CNF over predicates over terms (fn + var + const) Note : const, fn, pred symbols Semantics: an interpretation has obj s and maps : const symbols to const s, fn symbols to fn s, pred symbols to pred s Note : const s, fn s, pred s Note : var s not mapped!

Semantics: Models An interpretation satisfies a sentence if the sentence has the value true under the interpretation. Model: An interpretation that satisfies a sentence is a model of that sentence Validity: Any sentence that has the value true under all interpretations is valid Any sentence that does not have a model is inconsistent or unsatisfiable If a sentence w has a value true under all the models of a set of sentences KB then KB logically entails w Note : In FOL a set of possible worlds is infinite Cannot use model checking!!!

Quantification Universal and existential quantifiers allow expressing general rules with variables Universal quantification Syntax: if w is a sentence (wff) then x w is a wff. All cats are mammals x Cat ( x) Mammal ( x) It is equivalent to the conjunction of all the sentences obtained by substitution the name of an object for the variable x. Cat( Spot) Cat( Rebbeka) Cat( Felix),,,, Mammal( Spot) Mammal( Rebbeka) Mammal( Felix)

holding for

Quantification: Existential Existential quantification : an existentially quantified sentence is true if it is true for some object Equivalent to disjunction: xsister( x, Spot) Cat( x) Sister(Spot, Spot) Cat(Spot) Sister(Rebecca,Spot) Cat(Rebecca) Sister(Felix,Spot) Cat(Felix) Sister(Richard,Spot) Cat(Richard)... We can mix existential and universal quantification.

some holding for

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 in the world y x Loves(x,y) Everyone in the world is loved by at least one person x Likes(x,IceCream) x Likes(x,IceCream) not true that P(X) holds for all X exists X for which P(X) is false x Likes(x, Broccoli) x Likes(x, Broccoli) 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 E.g., definition of Sibling in terms of Parent: x,y Sibling(x,y) [ (x = y) m,f (m = f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y)]

The kinship domain: Using FOL Objects are people Properties include gender and they are related by relations such as parenthood, brotherhood, marriage predicates: Male, Female (unary) Parent, Sibling, Daughter, Son... Function: Mother Father Brothers are siblings x,y Brother(x,y) Sibling(x,y) One's mother is one's female parent m,c Mother(c) = m (Female(m) Parent(m,c)) Sibling is symmetric x,y Sibling(x,y) Sibling(y,x)

Knowledge engineering in FOL 1. Identify the task 2. Assemble the relevant knowledge; identify important concepts 3. Decide on a vocabulary of predicates, functions, and constants 4. Encode general knowledge about the domain 5. Encode a description of the specific problem instance 6. Pose queries to the inference procedure and get answers 7. Debug the knowledge base

The electronic circuits domain One-bit full adder

The electronic circuits domain 1. Identify the task Does the circuit actually add properly? (circuit verification) 2. Assemble the relevant knowledge Composed of I/O terminals, connections and gates; Types of gates (AND, OR, XOR, NOT) Irrelevant: size, shape, color, cost of gates 3. Decide on a vocabulary Alternatives : Type(X 1 ) = XOR Type(X 1, XOR) XOR(X 1 )

The electronic circuits domain 4. Encode general knowledge of the domain t 1,t 2 Connected(t 1, t 2 ) Signal(t 1 ) = Signal(t 2 ) t Signal(t) = 1 Signal(t) = 0 1 0 t 1,t 2 Connected(t 1, t 2 ) Connected(t 2, t 1 ) g Type(g) = OR Signal(Out(1,g)) = 1 n Signal(In(n,g)) = 1 g Type(g) = AND Signal(Out(1,g)) = 0 n Signal(In(n,g)) = 0 g Type(g) = XOR Signal(Out(1,g)) = 1 Signal(In(1,g)) Signal(In(2,g)) g Type(g) = NOT Signal(Out(1,g)) Signal(In(1,g))

The electronic circuits domain 5. Encode the specific problem instance Type(X 1 ) = XOR Type(A 1 ) = AND Type(O 1 ) = OR Type(X 2 ) = XOR Type(A 2 ) = AND Connected(Out(1,X 1 ),In(1,X 2 )) Connected(In(1,C 1 ),In(1,X 1 )) Connected(Out(1,X 1 ),In(2,A 2 )) Connected(In(1,C 1 ),In(1,A 1 )) Connected(Out(1,A 2 ),In(1,O 1 )) Connected(In(2,C 1 ),In(2,X 1 )) Connected(Out(1,A 1 ),In(2,O 1 )) Connected(In(2,C 1 ),In(2,A 1 )) Connected(Out(1,X 2 ),Out(1,C 1 )) Connected(In(3,C 1 ),In(2,X 2 )) Connected(Out(1,O 1 ),Out(2,C 1 )) Connected(In(3,C 1 ),In(1,A 2 ))

The electronic circuits domain 6. Pose queries to the inference procedure What are the possible sets of values of all the terminals for the adder circuit? i 1,i 2,i 3,o 1,o 2 Signal(In(1,C_1)) = i 1 Signal(In(2,C 1 )) = i 2 Signal(In(3,C 1 )) = i 3 Signal(Out(1,C 1 )) = o 1 Signal(Out(2,C 1 )) = o 2 7. Debug the knowledge base May have omitted assertions like 1 0

Summary First-order logic: objects and relations are semantic primitives syntax: constants, functions, predicates, equality, quantifiers Increased expressive power: sufficient to define wumpus world