Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

First-Order Logic Chapter 8.
Knowledge Representation using First-Order Logic CS 271: Fall 2007 Instructor: Padhraic Smyth.
March 2, 2006AI: Chapter 8: First-Order Logic1 Artificial Intelligence Chapter 8: First-Order Logic Michael Scherger Department of Computer Science Kent.
First-Order Logic.
Standard Logical Equivalences
10 주 강의 First-order Logic. Limitation of propositional logic A very limited ontology  to need to the representation power  first-order logic.
First-Order Logic Chapter 8.
SE Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language TELL: operator.
Artificial Intelligence Lecture No. 10 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
First-Order Logic. Limitations of propositional logic Suppose you want to say “All humans are mortal” –In propositional logic, you would need ~6.7 billion.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
First-Order Logic Chapter 8.
CS 561, Session Midterm format Date: 10/10/2002 from 11:00am – 12:20 pm Location: THH 101 Credits: 35% of overall grade Approx. 4 problems, several.
Knowledge Representation using First-Order Logic (Part II) Reading: Chapter 8, First lecture slides read: Second lecture slides read:
CS 561, Session Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language.
FIRST-ORDER LOGIC FOL or FOPC
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
Predicate Calculus.
CE An introduction to Artificial Intelligence CE Chapter 8: First Order Logic Ramin Halavati In which we notice that.
Propositional Logic Agenda: Other forms of inference in propositional logic Basics of First Order Logic (FOL) Vision Final Homework now posted on web site.
FIRST ORDER LOGIC Levent Tolga EREN.
Knowledge representation methods جلسه سوم. KR is AI bottleneck The most important ingredient in any expert system is knowledge. The power of expert systems.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language TELL: operator to.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
1 First-Order Logic Chapter 8. 2 Why FOL? –How do you say “All students are smart?” –Some students work hard –Hardworking students have good marks –If.
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Predicate Logic.
Limitation of propositional logic  Propositional logic has very limited expressive power –(unlike natural language) –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
CS 666 AI P. T. Chung First-Order Logic First-Order Logic Chapter 8.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 24, 2012.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
1 Propositional logic (cont…) 命題論理 Syntax&Semantics of first-order logic 構文論と意味論 Deducing hidden properties Describing actions Propositional logic (cont…)
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
First-Order Logic Chapter 8 (not 8.1). Outline Why FOL? Why FOL? Syntax and semantics of FOL Syntax and semantics of FOL Using FOL Using FOL Wumpus world.
First-Order Logic. Outline Why FOL? Syntax and semantics of FOL Using FOL Knowledge engineering in FOL.
LOGIC. Logic in general  Logics are formal languages for representing information such that conclusions can be drawn  Syntax defines the sentences in.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
5/16/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 12, 5/16/2005 University of Washington, Department of Electrical Engineering Spring.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 First Order Logic CS 171/271 (Chapter 8) Some text and images in these slides were drawn from Russel & Norvig’s published material.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
1 CS 2710, ISSP 2610 Chapter 8, Part 1 First Order Predicate Calculus FOPC.
B.Ombuki COSC 3P711 LOGIC: Knowledge representation Propositional Logic: ch.7 First-Order-Logic: ch.8.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 7 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
1/19 First-Order Logic Chapter 8 Modified by Vali Derhami.
First-Order Logic Chapter 8.
First-Order Logic.
Knowledge Representation using First-Order Logic
Course Instructor: kinza ch
First-Order Logic Chapter 8.
Artificial Intelligence First Order Logic
Notes 8: Predicate logic and inference
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
Artificial Intelligence: Agents and First-Order Logic
First-Order Logic Chapter 8.
First-order Logic Propositional logic (cont…)
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
Presentation transcript:

Artificial Intelligence First-Order Logic (FOL)

Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL

Pros and cons of propositional logic Propositional logic is declarative:pieces of syntax correspond to facts. Propositional logic has expressive power to deal with partial information, using disjunction & negation. –(unlike most data structures and databases) Propositional logic is compositional: - the meaning of a sentence is a function of the meaning of its parts –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 to describe an Env with many objects concisely –(unlike natural language- syntax & semantic of English make it possible to describe the Env concisely. –E.g., cannot say "pits cause breezes in adjacent squares“ except by writing a separate rule about B & P for each square.

First-order u logic (FOL) FOL more expressive language than the PL. FOL is a general-purpose representation language that is based on an ontological commitment to the existence of objects & relations in the world. It builds on simple propositional logic by adding objects, predicates, variables and quantifiers. Whereas propositional logic assumes the world contains facts (can be T/F), FOL (like natural language) assumes the world contains –Objects: people, houses, numbers, colors, baseball games, wars, … –Relations: brother of, bigger than, part of, comes between, … –Properties: unary relation such as red, round –Functions: relations in which there is only 1 value for a giver input. i.e. father of, best friend, plus, …

Example “One Plus Two Equals Three “ Objects: One, Two, Three Relations: Equals Functions: Plus “Square neighboring the wumpus are smelly“ Objects: wumpus, square Relations: neighboring Property: smelly

Syntax and semantics In Propositional logic – every expression is a sentence In FOL = Sentences + Terms (which represents objects) Sentences - are built using quantifiers and predicate symbols Term : Logical expression that refers to an object = function (term 1,...,term n ) or constant or variable. = Brother (Samir, Ali) Ali, x,y

Syntax of FOL: Basic elements The basic syntactic elements of FOL are the symbols that stand for objects, relations & functions. Constants (stand for objects)Sarah, A, B,... Predicates (stand for relation) Brother, Round,... Functions (stand for function)FatherOf,... Variablesx, y, a, b,... Connectives , , , ,  Equality= Quantifiers , 

Atomic sentences It is formed from a predicate symbol followed by a parenthesized list of terms. Atomic sentence =predicate (term 1,...,term n ) or term 1 = term 2 E.g. Sister (Mona, Manal) They can have arguments that are complex terms E.g. Married(FatherOf(Ali),Sister (Mona))

Complex sentences Complex sentences are made from atomic sentences using logical connectives e.g. –  Sister(Mona,Alia) is true when Mona is not the sister of Alia. –Older (Reem, 20)   Younger(Reem, 20) if Reem is older than 20, then she is not younger than 20.

Truth in first-order logic Sentences are true with respect to a model and an interpretation Model contains 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

Truth Example Consider the interpretation in which –Sara  Sara Ibrahim –Mona  Mona Ibrahim –Sister  the sisterhood relation Under this interpretation, Sister(Sara; Mona) is true just in case Sara Ibrahim and Mona Ibrahim are in the sisterhood relation in the model

Models for FOL: Example A model containing 5 objects. These objects may be related in various ways: Binary relation – brother & on head Unary relations (properties) – person, crown & king Unary function – left leg

Quantification Quantification is a formula constructor that produces new formulas from old ones. Quantifier is a symbol- let us express properties of entire collections of objects, instead of listing the objects by name. In natural language - for all, for some; many, few, a lot, etc FOL contains 2 standard quantifiers: –Universal –existential

Universal quantification  e.g. All cats are mammals:  x Cats(x) => Mammals(x), for all x, if x is a cat, then x is a mammal Universal quantification makes statements about every object. Universal quantifiers often used with "implies" to form "rules.“ Everyone at PSU is smart :  x At(x, PSU) => Smart(x)  x P (any logical expression) is equivalent to the conjunction of instantiations of P At( Sara, PSU) => Smart(Sara)  At(Mary, PSU) => Smart(Mary) ... Typically,  is the main connective with  Common mistake: using  as the main connective with  :

Existential quantification  Existential quantification makes statements about some object. Someone at PSU is smart:  x At(x, PSU)  Smart(x)  x P is equivalent to the disjunctions of instantiations of P At( Sara, PSU) => Smart(Sara)  At(Mary, PSU) => Smart(Mary) ... Typically,  is the main connective with  Common mistake: using  as the main connective with  :

Properties of quantifiers To express more complex sentences, use multiple 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) “For every person, there is someone that person loves”  y  x Loves(x,y) “There is someone who is loved by every body” Quantifier duality: each can be expressed using the other (  &  are connected with each other through negation)  x Likes(x,IceCream)  x  Likes(x,IceCream)  x  Likes (x, Cabbage)  x Likes(x, Cabbage) The deMorgan rules for quantified and unquantified sentences are as follows  x  P =  x P  P   Q =  (P V Q )  x P =  x  P  (P  Q) =  P V  Q  x P =  x  P P  Q =  (  P V  Q )  x P =  x  P P V Q =  (  P   Q )

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. Mother(Mona) = Jenny The equality symbol can be used with negation to insist that two terms are not the same object. e.g. Mona has at least 2 sisters.  x,y Sister(Mona,x)  Sister(Mona,y)   (x=y)

Examples 1.All food are edible 2.Brothers are siblings 3.“Sibling" is symmetric relation ship (quantifiers of the same type) 4.One's mother is one's female parent Solutions: 1.  x food( x) => edible( x) 2.  x, y Brother(x, y)  Sibling(x, y). 3.  x, y Sibling(x, y)  Sibling(y, x). 4.  m, c Motherof(c) = m  (Female(m)  Parent(m, c))

Interacting with FOL KBs To add sentences to a knowledge base KB, we would call TELL. Such sentences are called assertions. e.g. TELL (KB, Mother(Nora)) // assert that Nora is a Mother TELL(KB,  x Mother(x)  Person (x)) // Mothers are persons To ask questions of the KB, we use ASK Questions asked using ASK are called queries e.g. ASK (KB, Mother(Nora))

In-class Activity Abeer, Mona and linda belong to the champions Club. –Every member of the club is either skier or a mountain climber. –No mountain climber likes rain, and all skiers like snow –linda dislikes whatever Abeer likes and likes whatever Abeer dislikes –Abeer likes rain and snow Is there any member of the club who is climber but not skier? Translate this problem into FOL Sentences?

Solution S(x) means x is a skier M(x) means x is a mountain climber L(x,y) means x likes y The English sentences in the prev slide can be translated into the following FOL:  x Clubmember(x) => S(x) V M (x) ~  x M(x)  L(x,rain)  x S(x) => L(x,snow)  y L(linda, y) ~L(Abeer,y) L(Abeer, rain) ^L(Abeer,snow)

Summary FOL can be used as the representation language for a KB agent. FOL is more powerful than propositional logic A possible world for FOL is defined by a set of : –objects and relations are semantic primitives –syntax: constants, functions, predicates, equality, quantifiers Complex sentences use connectives just like propositional logic, & quantified sentences allow the expression of general rules.

End of lecture