Artificial Intelligence First-Order Logic

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Artificial Intelligence
Rules of Inference Rosen 1.5.
CPS 270: Artificial Intelligence First-Order Logic Instructor: Vincent Conitzer.
Some Prolog Prolog is a logic programming language
Resolution Proof System for First Order Logic
First-Order Logic.
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: – Constant symbols (i.e., the "individuals"
Resolution.
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Logic 3 Tautological Implications and Tautological Equivalences
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
CPS 170: Artificial Intelligence Propositional Logic Instructor: Vincent Conitzer.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Inference in FOL Compared to predicate logic, more abstract reasoning and specific conclusions.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Theory and Applications
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Friday, 17 September.
9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
1 Inference in First Order Logic CS 171/271 (Chapter 9) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Reasoning using First-Order Logic
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
1 Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 2: Logic & Incidence Geometry Back To the Very Basic Fundamentals.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Introduction to Logic for Artificial Intelligence Lecture 2
Instructor: Vincent Conitzer
The Hebrew University of Jerusalem
Artificial Intelligence
CS201: Data Structures and Discrete Mathematics I
Instructor: Vincent Conitzer
CSE 311 Foundations of Computing I
Prolog IV Logic, condensed.
CPS 570: Artificial Intelligence Logic
CPS 570: Artificial Intelligence First-Order Logic
Artificial Intelligence First-Order Logic
Artificial Intelligence Propositional Logic
CS201: Data Structures and Discrete Mathematics I
RESOLUTION.
CPS 570: Artificial Intelligence Logic
Presentation transcript:

Artificial Intelligence First-Order Logic Seyed Hashem Davarpanah Davarpanah@usc.ac.ir University of Science and Culture

Limitations of propositional logic So far we studied propositional logic Some English statements are hard to model in propositional logic: “If your roommate is wet because of rain, your roommate must not be carrying any umbrella” Pathetic attempt at modeling this: RoommateWetBecauseOfRain => (NOT(RoommateCarryingUmbrella0) AND NOT(RoommateCarryingUmbrella1) AND NOT(RoommateCarryingUmbrella2) AND …)

Problems with propositional logic No notion of objects No notion of relations among objects RoommateCarryingUmbrella0 is instructive to us, suggesting there is an object we call Roommate, there is an object we call Umbrella0, there is a relationship Carrying between these two objects Formally, none of this meaning is there Might as well have replaced RoommateCarryingUmbrella0 by P

Elements of first-order logic Objects: can give these names such as Umbrella0, Person0, John, Earth, … Relations: Carrying(., .), IsAnUmbrella(.) Carrying(Person0, Umbrella0), IsUmbrella(Umbrella0) Relations with one object = unary relations = properties Functions: Roommate(.) Roommate(Person0) Equality: Roommate(Person0) = Person1

Reasoning about many objects at once Variables: x, y, z, … can refer to multiple objects New operators “for all” and “there exists” Universal quantifier and existential quantifier for all x: CompletelyWhite(x) => NOT(PartiallyBlack(x)) Completely white objects are never partially black there exists x: PartiallyWhite(x) AND PartiallyBlack(x) There exists some object in the world that is partially white and partially black

Practice converting English to first-order logic “John has an umbrella” there exists y: (Has(John, y) AND IsUmbrella(y)) “Anything that has an umbrella is not wet” for all x: ((there exists y: (Has(x, y) AND IsUmbrella(y))) => NOT(IsWet(x))) “Any person who has an umbrella is not wet” for all x: (IsPerson(x) => ((there exists y: (Has(x, y) AND IsUmbrella(y))) => NOT(IsWet(x))))

More practice converting English to first-order logic “John has at least two umbrellas” there exists x: (there exists y: (Has(John, x) AND IsUmbrella(x) AND Has(John, y) AND IsUmbrella(y) AND NOT(x=y)) “John has at most two umbrellas” for all x, y, z: ((Has(John, x) AND IsUmbrella(x) AND Has(John, y) AND IsUmbrella(y) AND Has(John, z) AND IsUmbrella(z)) => (x=y OR x=z OR y=z))

Even more practice converting English to first-order logic… “Duke’s basketball team defeats any other basketball team” for all x: ((IsBasketballTeam(x) AND NOT(x=BasketballTeamOf(Duke))) => Defeats(BasketballTeamOf(Duke), x)) “Every team defeats some other team” for all x: (IsTeam(x) => (there exists y: (IsTeam(y) AND NOT(x=y) AND Defeats(x,y))))

Is this a tautology? “Property P implies property Q, or propery P implies property Q (or both)” for all x: ((P(x) => Q(x)) OR (Q(x) => P(x))) (for all x: (P(x) => Q(x)) OR (for all x: (Q(x) => P(x)))

Relationship between universal and existential for all x: a is equivalent to NOT(there exists x: NOT(a))

Something we cannot do in first-order logic We are not allowed to reason in general about relations and functions The following would correspond to higher-order logic (which is more powerful): “If John is Jack’s roommate, then any property of John is also a property of Jack’s roommate” (John=Roommate(Jack)) => for all p: (p(John) => p(Roommate(Jack))) “If a property is inherited by children, then for any thing, if that property is true of it, it must also be true for any child of it” for all p: (IsInheritedByChildren(p) => (for all x, y: ((IsChildOf(x,y) AND p(y)) => p(x))))

Axioms and theorems Axioms: basic facts about the domain, our “initial” knowledge base Theorems: statements that are logically derived from axioms

SUBST SUBST replaces one or more variables with something else For example: SUBST({x/John}, IsHealthy(x) => NOT(HasACold(x))) gives us IsHealthy(John) => NOT(HasACold(John))

Instantiating quantifiers From for all x: a we can obtain SUBST({x/g}, a) there exists x: a SUBST({x/k}, a) where k is a constant that does not appear elsewhere in the knowledge base (Skolem constant) Don’t need original sentence anymore

Instantiating existentials after universals for all x: there exists y: IsParentOf(y,x) WRONG: for all x: IsParentOf(k, x) RIGHT: for all x: IsParentOf(k(x), x) Introduces a new function (Skolem function) … again, assuming k has not been used previously

Generalized modus ponens for all x: Loves(John, x) John loves every thing for all y: (Loves(y, Jane) => FeelsAppreciatedBy(Jane, y)) Jane feels appreciated by every thing that loves her Can infer from this: FeelsAppreciatedBy(Jane, John) Here, we used the substitution {x/Jane, y/John} Note we used different variables for the different sentences General UNIFY algorithms for finding a good substitution

Keeping things as general as possible in unification Consider EdibleByWith e.g., EdibleByWith(Soup, John, Spoon) – John can eat soup with a spoon for all x: for all y: EdibleByWith(Bread, x, y) Anything can eat bread with anything for all u: for all v: (EdibleByWith(u, v, Spoon) => CanBeServedInBowlTo(u,v)) Anything that is edible with a spoon by something can be served in a bowl to that something Substitution: {x/z, y/Spoon, u/Bread, v/z} Gives: for all z: CanBeServedInBowlTo(Bread, z) Alternative substitution {x/John, y/Spoon, u/Bread, v/John} would only have given CanBeServedInBowlTo(Bread, John), which is not as general

Resolution for first-order logic for all x: (NOT(Knows(John, x)) OR IsMean(x) OR Loves(John, x)) John loves everything he knows, with the possible exception of mean things for all y: (Loves(Jane, y) OR Knows(y, Jane)) Jane loves everything that does not know her What can we unify? What can we conclude? Use the substitution: {x/Jane, y/John} Get: IsMean(Jane) OR Loves(John, Jane) OR Loves(Jane, John) Complete (i.e., if not satisfiable, will find a proof of this), if we can remove literals that are duplicates after unification Also need to put everything in canonical form first