CS 4700: Artificial Intelligence

Size: px
Start display at page:

Download "CS 4700: Artificial Intelligence"

Transcription

1 CS 4700: Foundations of Artificial Intelligence Fall 2017 Instructor: Prof. Haym Hirsh Lecture 16

2 Cornell Cinema Thursday, April 13 7:00pm Friday, April 14 7:00pm Sunday, April 16 4:30pm

3 Cornell Cinema Thursday, April 13 7:00pm Co-Sponsored by CIS Friday, April 14 7:00pm Sunday, April 16 4:30pm

4 Today First Order Logic (R&N Ch 8-9) Tuesday, March 28 First Order Logic (R&N Ch 8-9) Machine Learning (R&N Ch 18)

5 Mother(Alice,Charlie) Father(Bob,Charlie) First-Order Logic: Examples

6 First-Order Logic: Examples Mother(Alice,Charlie) Father(Bob,Charlie) x,y Mother(x,y) Parent(x,y) x,y Father(x,y) Parent(x,y)

7 First-Order Logic: Examples Mother(Alice,Charlie) Father(Bob,Charlie) x,y Mother(x,y) Parent(x,y) x,y Father(x,y) Parent(x,y) x,y Parent(x,y) Ancestor(x,y) x,y,z Ancestor(x,y) Ancestor(y,z) Ancestor(x,z)

8 First-Order Logic: Examples Mother(Alice,Charlie) Father(Bob,Charlie) x,y Mother(x,y) Parent(x,y) x,y Father(x,y) Parent(x,y) x,y Parent(x,y) Ancestor(x,y) x,y,z Ancestor(x,y) Ancestor(y,z) Ancestor(x,z) x y Mother(y,x) x y Father(y,x)

9 First-Order Logic: Examples Mother(Alice,Charlie) Father(Bob,Charlie) x,y Mother(x,y) Parent(x,y) x,y Father(x,y) Parent(x,y) x,y Parent(x,y) Ancestor(x,y) x,y,z Ancestor(x,y) Ancestor(y,z) Ancestor(x,z) x y Mother(y,x) x y Father(y,x) x y Mother(x,y)

10 First Order Logic Sentence AtomicSentence ComplexSentence AtomicSentence Predicate Predicate(Arguments) Term = Term Arguments Term Term,Arguments Term Function(Arguments) Constant Variable ComplexSentence (Sentence) [Sentence] Sentence Sentence Sentence Sentence Sentence Sentence Sentence Quantifiers Sentence Quantifiers Quantifier Variables Quantifier Variables Quantifiers Quantifier Constant/Predicate/Function <strings starting with upper case letters> Variables Variable Variable,Variables Variable <strings comprised of lower case letters>

11 First Order Logic Sentence AtomicSentence ComplexSentence AtomicSentence Predicate Predicate(Arguments) Term = Term Arguments Term Term,Arguments Term Function(Arguments) Constant Variable ComplexSentence (Sentence) [Sentence] Sentence Sentence Sentence Sentence Sentence Sentence Sentence Quantifiers Sentence Quantifiers Quantifier Variables Quantifier Variables Quantifiers Quantifier Constant/Predicate/Function <strings starting with upper case letters> Variables Variable Variable,Variables Variable <strings comprised of lower case letters>

12 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates)

13 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates)

14 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates) 1,2 [x/socrates]

15 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates) 1,2 [x/socrates] 1. x,y Mother(x,y) Parent(x,y) 2. Mother(Alice,Charlie)

16 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates) 1,2 [x/socrates] 1. x,y Mother(x,y) Parent(x,y) 2. Mother(Alice,Charlie) Parent(Alice,Charlie)

17 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates) 1,2 [x/socrates] 1. x,y Mother(x,y) Parent(x,y) 2. Mother(Alice,Charlie) Parent(Alice,Charlie) 1,2 [x/alice, y/charlie]

18 Inference in First-Order Logic: Modus Ponens 1. x Man(x) Mortal(x) 2. Man(Socrates) Mortal(Socrates) 1,2 [x/socrates] 1. x,y Mother(x,y) Parent(x,y) Substitutions 2. Mother(Alice,Charlie) Parent(Alice,Charlie) 1,2 [x/alice, y/charlie]

19 Inference in First-Order Logic: Modus Ponens 1. x P(x,B) Q(x) 2. y P(A,y)

20 Inference in First-Order Logic: Modus Ponens 1. x P(x,B) Q(x) 2. y P(A,y) Q(A) 1,2 [x/a, y/b]

21 Inference in First-Order Logic: Modus Ponens 1. x,y,z Ancestor(x,y) Ancestor(y,z) Ancestor(x,z) 2. Ancestor(David,Ed) 3. Ancestor(Ed,Fran)

22 Inference in First-Order Logic: Modus Ponens 1. x,y,z Ancestor(x,y) Ancestor(y,z) Ancestor(x,z) 2. Ancestor(David,Ed) 3. Ancestor(Ed,Fran) Ancestor(David,Fran) 1,2,3 [x/david, y/ed, z/fran]

23 Inference in First-Order Logic: Modus Ponens 1. x,y Ancestor(x,y) Ancestor(x,Child(y)) 2. Ancestor(Alice,Bob)

24 Inference in First-Order Logic: Modus Ponens 1. x,y Ancestor(x,y) Ancestor(x,Child(y)) 2. Ancestor(Alice,Bob) 3. Ancestor(Alice,Child(Bob)) 1,2 [x/a, y/bob]

25 Inference in First-Order Logic: Modus Ponens 1. x,y Ancestor(x,y) Ancestor(x,Child(y)) 2. Ancestor(Alice,Bob) 3. Ancestor(Alice,Child(Bob)) 1,2 [x/a, y/bob] 4. Ancestor(Alice,Child(Child(Bob))) 1,3 [x/a, y/child(bob)]

26 Inference in First-Order Logic: Modus Ponens 1. x Relative(x,Bob) Happy(x) 2. y Relative(Child(y),y)

27 Inference in First-Order Logic: Modus Ponens 1. x Relative(x,Bob) Happy(x) 2. y Relative(Child(y),y) Happy(Child(Bob)) 1,2 [x/child(y), y/bob]

28 Inference in First-Order Logic: Modus Ponens 1. x Relative(x,Friend(x)) Happy(x) 2. y Relative(Child(y),y)

29 Inference in First-Order Logic: Modus Ponens 1. x Relative(x,Friend(x)) Happy(x) 2. y Relative(Child(y),y)???? 1,2 [x/child(y), y/friend(x)] CYCLE!

30 Unification Unify(Man(x),Man(Socrates)) = [x/socrates] Unify(Mother(x,y),Mother(Alice,Charlie)) = [x/alice, y/charlie] Unify(P(x,B),P(A,y)) = [x/a, y/b] Unify(Ancestor(x,y),Ancestor(Alice,Child(Bob))) = [x/alice, y/child(bob)] Unify(Relative(x,Bob),Relative(Child(y),y)) = [x/child(y), y/bob] Unify(Relative(x,Friend(x)),Relative(Child(y),y)) = ERROR Occurs Check

31 Unification Unify(x,y,answer): {wrong!} If answer= fail then Return( fail ) Else if x=y then Return(answer) Else if Variable(x) then Return(answer+x/y) Else if Variable(y) then Return(answer+y/x) Else if Head(x)=Head(y) then For i=1 to #args(head(x)) answer answer+unify(arg(x,i),arg(y,i)) Return(answer) Else Return(Fail)

32 Unification Unify(x,y,answer): If answer= fail then Return( fail ) Else if x=y then Return(answer) Else if Variable(x) then Return(UnifyVar(x,y,answer)) Else if Variable(y) then Return(UnifyVar(y,x,answer)) Else if Head(x)=Head(y) then For i=1 to #args(head(x)) answer answer+unify(arg(x,i),arg(y,i)) Return(answer) Else Return(Fail)

33 Unification UnifyVar(x,y,answer) If x/val answer then Return(Unify(val,y,answer)) If y/val answer then Return(Unify(x,val,answer)) Else if OccursCheck(x,y) then Return( fail ) Else Return(answer+x/y)

34 Inference in First Order Logic First-order Horn clauses are an analogous subset of first-order logic They have analogs of forward chaining and backward chaining Uses unification to match rules and facts Prolog is a programming language based on backward chaining on first-order Horn clauses There is a conjunctive normal form for First-Order Logic There is a resolution inference rule for First-Order Logic

35 CNF Replace α β with α β everywhere [no more ] Replace (α β) with α β [push inward until Replace (α β) with α β you can t any more] Replace α with α [ only before prop symbols] Distribute over : Rewrite α (β γ) as (α β) (α γ)

36 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Distribute over : Rewrite α (β γ) as (α β) (α γ)

37 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Distribute over : Rewrite α (β γ) as (α β) (α γ)

38 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Distribute over : Rewrite α (β γ) as (α β) (α γ)

39 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Distribute over : Rewrite α (β γ) as (α β) (α γ)

40 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Standardize variables: If the same variable name is used in multiple places with multiple quantifiers, rename them so there is no duplication x P(x) x Q(x) becomes x P(x) z Q(z) [where z is new] Distribute over : Rewrite α (β γ) as (α β) (α γ)

41 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Standardize variables: If the same variable name is used in multiple places with multiple quantifiers, rename them so there is no duplication x P(x) x Q(x) becomes x P(x) z Q(z) [where z is new] Distribute over : Rewrite α (β γ) as (α β) (α γ)

42 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Standardize variables: If the same variable name is used in multiple places with multiple quantifiers, rename them so there is no duplication x P(x) x Q(x) becomes x P(x) z Q(z) [where z is new] Skolemization Distribute over : Rewrite α (β γ) as (α β) (α γ)

43 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Standardize variables: If the same variable name is used in multiple places with multiple quantifiers, rename them so there is no duplication x P(x) x Q(x) becomes x P(x) z Q(z) [where z is new] Skolemization Distribute over : Rewrite α (β γ) as (α β) (α γ)

44 CNF Replace α β with α β everywhere Replace (α β) with α β Replace (α β) with α β Replace α with α Replace x with x Replace x with x Standardize variables: If the same variable name is used in multiple places with multiple quantifiers, rename them so there is no duplication x P(x) x Q(x) becomes x P(x) z Q(z) [where z is new] Skolemization Drop universal quantifiers Distribute over : Rewrite α (β γ) as (α β) (α γ)

45 Skolemization x P(x) becomes P(A) where A is a constant that is new

46 Skolemization x P(x) becomes P(A) where A is a new constant x,y z P(z) becomes P(F(x,y)) where F is a new function

47 Skolemization x P(x) becomes P(A) where A is a new constant x,y z P(z) becomes P(F(x,y)) where F is a new function Replace existentially quantified variables with Skolem functions new functions whose arguments are all universally quantified variables of higher scope

48 Resolution in First Order Logic Recall: (l α 1 α k ) where each α i and β j are propositional ( l β 1 β n ) symbols or their negations and l is a (α 1 α k β 1 β n ) propositional symbol

49 Resolution in First Order Logic Here: (l α 1 α k ) [l and l can be made identical by ( l β 1 β n ) substituting variables with terms] Subst(ѳ, α 1 α k β 1 β n ) [the necessary substitution] where ѳ = Unify(l, l )

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

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi is another way of showing that an argument is correct. Definitions: Literal: A variable or a negation of a variable is called a literal. Sum and Product: A disjunction of literals is called a sum and a

More information

Lecture 4: January 12, 2015

Lecture 4: January 12, 2015 32002: AI (First Order Predicate Logic, Interpretation and Inferences) Spring 2015 Lecturer: K.R. Chowdhary Lecture 4: January 12, 2015 : Professor of CS (VF) Disclaimer: These notes have not been subjected

More information

Lecture 7: January 15, 2014

Lecture 7: January 15, 2014 32002: AI (First order Predicate Logic, Syntax and Semantics) Spring 2014 Lecturer: K.R. Chowdhary Lecture 7: January 15, 2014 : Professor of CS (GF) Disclaimer: These notes have not been subjected to

More information

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

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements CPSC 121: Models of Computation Module 6: Rewriting predicate logic statements Module 6: Rewriting predicate logic statements Pre-class quiz #7 is due March 1st at 19:00. Assigned reading for the quiz:

More information

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence Knowledge Representation CS 486/686: Introduction to Artificial Intelligence 1 Outline Knowledge-based agents Logics in general Propositional Logic& Reasoning First Order Logic 2 Introduction So far we

More information

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13. 13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution Theorem Proving 13.3 PROLOG and Automated Reasoning 13.4

More information

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

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques Lecture 17 of 41 Clausal (Conjunctive Normal) Form and Resolution Techniques Wednesday, 29 September 2004 William H. Hsu, KSU http://www.kddresearch.org http://www.cis.ksu.edu/~bhsu Reading: Chapter 9,

More information

CS 360: Programming Languages Lecture 10: Logic Programming with Prolog

CS 360: Programming Languages Lecture 10: Logic Programming with Prolog CS 360: Programming Languages Lecture 10: Logic Programming with Prolog Geoffrey Mainland Drexel University Section 1 Administrivia Midterm Tuesday Midterm is Tuesday, February 14! Study guide is on the

More information

Advanced Logic and Functional Programming

Advanced Logic and Functional Programming Advanced Logic and Functional Programming Lecture 1: Programming paradigms. Declarative programming. From first-order logic to Logic Programming. Programming paradigms Programming paradigm (software engineering)

More information

Resolution in FOPC. Deepak Kumar November Knowledge Engineering in FOPC

Resolution in FOPC. Deepak Kumar November Knowledge Engineering in FOPC Resolution in FOPC Deepak Kumar November 2017 Knowledge Engineering in FOPC Identify the task Assemble relevant knowledge Decide on a vocabulary of predicates, functions, and constants Encode general knowledge

More information

Automatic Reasoning (Section 8.3)

Automatic Reasoning (Section 8.3) Automatic Reasoning (Section 8.3) Automatic Reasoning Can reasoning be automated? Yes, for some logics, including first-order logic. We could try to automate natural deduction, but there are many proof

More information

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

Chapter 16. Logic Programming. Topics. Unification. Resolution. Prolog s Search Strategy. Prolog s Search Strategy Topics Chapter 16 Logic Programming Summary (resolution, unification, Prolog search strategy ) Disjoint goals The cut operator Negative goals Predicate fail Debugger / tracer Lists 2 Resolution Resolution

More information

CS 416, Artificial Intelligence Midterm Examination Fall 2004

CS 416, Artificial Intelligence Midterm Examination Fall 2004 CS 416, Artificial Intelligence Midterm Examination Fall 2004 Name: This is a closed book, closed note exam. All questions and subquestions are equally weighted. Introductory Material 1) True or False:

More information

6. Inference and resolution

6. Inference and resolution Computer Science and Software Engineering University of Wisconsin - Platteville 6. Inference and resolution CS 3030 Lecture Notes Yan Shi UW-Platteville Read: Textbook Chapter 8 Part of the slides are

More information

THE PREDICATE CALCULUS

THE PREDICATE CALCULUS 2 THE PREDICATE CALCULUS Slide 2.1 2.0 Introduction 2.1 The Propositional Calculus 2.2 The Predicate Calculus 2.3 Using Inference Rules to Produce Predicate Calculus Expressions 2.4 Application: A Logic-Based

More information

Logic as a Programming Language

Logic as a Programming Language Logic as a Programming Language! Logic can be considered the oldest programming language! Aristotle invented propositional logic over 2000 years ago in order to prove properties of formal arguments! Propositions

More information

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried 15-780: Graduate AI Lecture 2. Proofs & FOL Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried 1 Admin 2 Audits http://www.cmu.edu/hub/forms/esg-audit.pdf 3 Matlab tutorial When

More information

Knowledge & Reasoning

Knowledge & Reasoning Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of representing large bodies of knowledge 1 Logical

More information

Module 7. Knowledge Representation and Logic (Rule based Systems) Version 2 CSE IIT, Kharagpur

Module 7. Knowledge Representation and Logic (Rule based Systems) Version 2 CSE IIT, Kharagpur Module 7 Knowledge Representation and Logic (Rule based Systems) 7.1 Instructional Objective The students should understand the use of rules as a restricted class of first order logic statements The student

More information

Automated Reasoning Systems

Automated Reasoning Systems Automated Reasoning Systems Resolution Theorem Proving: Prover9 Temur Kutsia RISC, Johannes Kepler University of Linz, Austria kutsia@risc.uni-linz.ac.at May 11, 2011 Prover9 Automated theorem prover from

More information

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

Resolution (14A) Young W. Lim 6/14/14 Copyright (c) 2013-2014. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free

More information

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

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II CS221 / Autumn 2017 / Liang & Ermon Lecture 17: Logic II Review: ingredients of a logic Syntax: defines a set of valid formulas (Formulas) Example: Rain Wet Semantics: for each formula, specify a set of

More information

First-Order Predicate Logic. CSCI 5582, Fall 2007

First-Order Predicate Logic. CSCI 5582, Fall 2007 First-Order Predicate Logic CSCI 5582, Fall 2007 What Can t We Do in FOPL? We can t take anything back once we ve asserted it. We can t make statements about relations themselves (e.g., Brother is a commutative

More information

CSE20: Discrete Mathematics

CSE20: Discrete Mathematics Spring 2018 Summary Last time: Today: Introduction to Basic Set Theory (Vardy) More on sets Connections between sets and logic Reading: Chapter 2 Set Notation A, B, C: sets A = {1, 2, 3}: finite set with

More information

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

(More) Propositional Logic and an Intro to Predicate Logic. CSCI 3202, Fall 2010 (More) Propositional Logic and an Intro to Predicate Logic CSCI 3202, Fall 2010 Assignments Next week: Guest lectures (Jim Martin and Nikolaus Correll); Read Chapter 9 (but you can skip sections on logic

More information

Section 2.4: Arguments with Quantified Statements

Section 2.4: Arguments with Quantified Statements Section 2.4: Arguments with Quantified Statements In this section, we shall generalize the ideas we developed in Section 1.3 to arguments which involve quantified statements. Most of the concepts we shall

More information

CS 321 Programming Languages and Compilers. Prolog

CS 321 Programming Languages and Compilers. Prolog CS 321 Programming Languages and Compilers Prolog Prolog PROgramming LOGic Algorithm = Logic + Control Logic programming deals with computing relations rather than functions. To understand Prolog one must

More information

Inference in First-Order Logic

Inference in First-Order Logic Inference in First-Order Logic Proofs Unification Generalized modus ponens Forward and backward chaining Completeness Resolution Logic programming CS 561, Session 16-18 1 Inference in First-Order Logic

More information

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried 15-780: Graduate AI Lecture 2. Proofs & FOL Geoff Gordon (this lecture) Tuomas Sandholm TAs Byron Boots, Sam Ganzfried 1 Admin 2 Audits http://www.cmu.edu/hub/forms/esg-audit.pdf 3 Review 4 What is AI?

More information

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

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

Inference in First-Order Logic

Inference in First-Order Logic Inference in First-Order Logic Proofs Unification Generalized modus ponens Forward and backward chaining Completeness Resolution Logic programming CS 460, Session 16-18 1 Inference in First-Order Logic

More information

What is all the Fuzz about?

What is all the Fuzz about? What is all the Fuzz about? Fuzzy Systems: Introduction CPSC 533 Christian Jacob Dept. of Computer Science Dept. of Biochemistry & Molecular Biology University of Calgary Fuzzy Systems in Knowledge Engineering

More information

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman 15-780: Graduate AI Lecture 2. Proofs & FOL Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman 1 Admin Recitations: Fri. 3PM here (GHC 4307) Vote: useful to have one tomorrow? would

More information

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers. CSE 240, Fall, 2013 Homework 2 Due, Tuesday September 17. Can turn in class, at the beginning of class, or earlier in the mailbox labelled Pless in Bryan Hall, room 509c. Practice Problems: 1. Consider

More information

Q1:a. Best first search algorithm:

Q1:a. Best first search algorithm: Q1:a Best first search algorithm: 1. Open=[A10]; closed=[] 2. Evaluate A10; open=[c20,b30,d40];closed=[a10] 3. Evaluate C20; open=[b30,g35,d40,h40]; closed=[c20, A10] 4. Evaluate B30; open=[e10,f20,g35,d40,h40];

More information

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman

15-780: Graduate AI Lecture 2. Proofs & FOL. Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman 15-780: Graduate AI Lecture 2. Proofs & FOL Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman 1 Admin Recitations: Fri. 3PM here (GHC 4307) Vote: useful to have one tomorrow? would

More information

First-Order Logic (FOL)

First-Order Logic (FOL) First-Order Logic (FOL) FOL consists of the following parts: Objects/terms Quantified variables Predicates Logical connectives Implication Objects/Terms FOL is a formal system that allows us to reason

More information

First Order Logic and Resolution

First Order Logic and Resolution Artificial Intelligence CS 6364 Professor Dan Moldovan Section 6 First Order Logic and Resolution First Order Logic (First Order Predicate Calculus) n n There is need to access components of a sentence.

More information

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

For Wednesday. No reading Chapter 9, exercise 9. Must be proper Horn clauses For Wednesday No reading Chapter 9, exercise 9 Must be proper Horn clauses Same Variable Exact variable names used in sentences in the KB should not matter. But if Likes(x,FOPC) is a formula in the KB,

More information

CS 360: Programming Language Concepts Lecture 15 Logic Programming

CS 360: Programming Language Concepts Lecture 15 Logic Programming Reference: Ch. 12.1-12.5 CS 360: Programming Language Concepts Lecture 15 Logic Programming I. Logic Programming (Generally) What is logic programming? A logic program is a collection of declarations,

More information

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

Prolog. Reading: Sethi, Chapter 11. Overview. Predicate Calculus. Substitution and Unication. Introduction to Prolog. Prolog Inference Rules Prolog Reading: Sethi, Chapter 11. Overview Predicate Calculus Substitution and Unication Introduction to Prolog Prolog Inference Rules Programming in Prolog - Recursion - List Processing - Arithmetic

More information

Logic Programming Languages

Logic Programming Languages Logic Programming Languages Introduction Logic programming languages, sometimes called declarative programming languages Express programs in a form of symbolic logic Use a logical inferencing process to

More information

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

Notes for Chapter 12 Logic Programming. The AI War Basic Concepts of Logic Programming Prolog Review questions Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions The AI War How machines should learn: inductive or deductive? Deductive: Expert => rules =>

More information

Logical reasoning systems

Logical reasoning systems Logical reasoning systems Theorem provers and logic programming languages Production systems Frame systems and semantic networks Description logic systems CS 561, Session 19 1 Logical reasoning systems

More information

CS 4700: Artificial Intelligence

CS 4700: Artificial Intelligence CS 4700: Foundations of Artificial Intelligence Fall 2017 Instructor: Prof. Haym Hirsh Lecture 5 Piazza course website is up: piazza.com/cornell/spring2017/cs4700 The researchers found that when apples

More information

Introduction to predicate calculus

Introduction to predicate calculus Logic Programming Languages Logic programming systems allow the programmer to state a collection of axioms from which theorems can be proven. Express programs in a form of symbolic logic Use a logical

More information

CS 561: Artificial Intelligence

CS 561: Artificial Intelligence CS 561: Artificial Intelligence Instructor: TAs: Sofus A. Macskassy, macskass@usc.edu Nadeesha Ranashinghe (nadeeshr@usc.edu) William Yeoh (wyeoh@usc.edu) Harris Chiu (chiciu@usc.edu) Lectures: MW 5:00-6:20pm,

More information

Resolution in FO logic (Ch. 9)

Resolution in FO logic (Ch. 9) Resolution in FO logic (Ch. 9) Review: CNF form Conjunctive normal form is a number of clauses stuck together with ANDs Each clause can only contain ORs, and logical negation must appears right next to

More information

will take you everywhere.

will take you everywhere. Prolog COMP360 Logic will get you from A to B. Imagination will take you everywhere. Albert Einstein Prolog Assignment A programming assignment in Prolog has been posted on Blackboard Upload your.pl file

More information

What is the study of logic?

What is the study of logic? Chapter 2: The Representation of Knowledge Expert Systems: Principles and Programming, Fourth Edition What is the study of logic? Logic is the study of making inferences given a set of facts, we attempt

More information

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs CSE 311: Foundations of Computing Lecture 8: Predicate Logic Proofs Last class: Propositional Inference Rules Two inference rules per binary connective, one to eliminate it and one to introduce it Elim

More information

Linear Clause Generation by Tableaux and DAGs

Linear Clause Generation by Tableaux and DAGs kovasznai 2007/8/10 11:27 page 109 #1 5/1 (2007), 109 118 tmcs@inf.unideb.hu http://tmcs.math.klte.hu Linear Clause Generation by Tableaux and DAGs Gergely Kovásznai Abstract. Clause generation is a preliminary

More information

Introduction to dependent types in Coq

Introduction to dependent types in Coq October 24, 2008 basic use of the Coq system In Coq, you can play with simple values and functions. The basic command is called Check, to verify if an expression is well-formed and learn what is its type.

More information

Chapter 16. Logic Programming Languages

Chapter 16. Logic Programming Languages Chapter 16 Logic Programming Languages Chapter 16 Topics Introduction A Brief Introduction to Predicate Calculus Predicate Calculus and Proving Theorems An Overview of Logic Programming The Origins of

More information

Propositional logic (Ch. 7)

Propositional logic (Ch. 7) Propositional logic (Ch. 7) Announcements Writing 3 due Sunday - ideally use for project - if you haven't decided project by then, you will have to redo this work Logic: definitions We say that two sentences

More information

Full Clausal Logic - Syntax: clauses

Full Clausal Logic - Syntax: clauses Full Clausal Logic - Syntax: clauses compound terms aggregate objects Add function symbols (functors), with an arity; constants are 0-ary functors. object proposition functor : single word starting with

More information

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

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig. Artificial Intelligence Chapters Reviews Readings: Chapters 3-8 of Russell & Norvig. Topics covered in the midterm Solving problems by searching (Chap. 3) How to formulate a search problem? How to measure

More information

Week 7 Prolog overview

Week 7 Prolog overview Week 7 Prolog overview A language designed for A.I. Logic programming paradigm Programmer specifies relationships among possible data values. User poses queries. What data value(s) will make this predicate

More information

Chapter 16. Logic Programming Languages ISBN

Chapter 16. Logic Programming Languages ISBN Chapter 16 Logic Programming Languages ISBN 0-321-49362-1 Chapter 16 Topics Introduction A Brief Introduction to Predicate Calculus Predicate Calculus and Proving Theorems An Overview of Logic Programming

More information

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

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday For next Tuesday Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday Any questions? Program 1 Imperfect Knowledge What issues arise when we don t know

More information

Using first order logic (Ch. 8-9)

Using first order logic (Ch. 8-9) Using first order logic (Ch. 8-9) Review: First order logic In first order logic, we have objects and relations between objects The relations are basically a list of all valid tuples that satisfy the relation

More information

Inf2D 12: Resolution-Based Inference

Inf2D 12: Resolution-Based Inference School of Informatics, University of Edinburgh 09/02/18 Slide Credits: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann Last time Unification: Given α and β, find θ such that αθ = βθ Most general unifier

More information

Formal Predicate Calculus. Michael Meyling

Formal Predicate Calculus. Michael Meyling Formal Predicate Calculus Michael Meyling May 24, 2013 2 The source for this document can be found here: http://www.qedeq.org/0_04_07/doc/math/qedeq_formal_logic_v1.xml Copyright by the authors. All rights

More information

Topic 1: Introduction to Knowledge- Based Systems (KBSs)

Topic 1: Introduction to Knowledge- Based Systems (KBSs) Topic 1: Introduction to Knowledge- Based Systems (KBSs) 1.5 Introduction to Logic Programming (Prolog) 32 Simple example: Algorithm for checking sorted list? We all know how to check if a list is sorted:

More information

Using first order logic (Ch. 8-9)

Using first order logic (Ch. 8-9) Using first order logic (Ch. 8-9) Review: First order logic In first order logic, we have objects and relations between objects The relations are basically a list of all valid tuples that satisfy the relation

More information

Programming Systems in Artificial Intelligence Introduction

Programming Systems in Artificial Intelligence Introduction Click to add Text Programming Systems in Artificial Intelligence Introduction Siegfried Nijssen 23/02/16 Discover thediscover world at the Leiden world University at Leiden University Programming Paradigms

More information

Answers. The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 3 MODULE, AUTUMN SEMESTER KNOWLEDGE REPRESENTATION AND REASONING

Answers. The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 3 MODULE, AUTUMN SEMESTER KNOWLEDGE REPRESENTATION AND REASONING Answers The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 3 MODULE, AUTUMN SEMESTER 2016-2017 KNOWLEDGE REPRESENTATION AND REASONING Time allowed TWO hours Candidates may complete the front

More information

Deduction Rule System vs Production Rule System. Prof. Bob Berwick. Rules Rule

Deduction Rule System vs Production Rule System. Prof. Bob Berwick. Rules Rule Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.034 Artificial Intelligence, Fall 2003 Recitation 2, September 11/12 Rules Rule Prof. Bob Berwick Agenda

More information

Proofs are Programs. Prof. Clarkson Fall Today s music: Proof by Paul Simon

Proofs are Programs. Prof. Clarkson Fall Today s music: Proof by Paul Simon Proofs are Programs Prof. Clarkson Fall 2017 Today s music: Proof by Paul Simon Review Previously in 3110: Functional programming in Coq Logic in Coq Today: A fundamental idea that goes by many names...

More information

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

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

6.034 Notes: Section 10.1

6.034 Notes: Section 10.1 6.034 Notes: Section 10.1 Slide 10.1.1 A sentence written in conjunctive normal form looks like ((A or B or not C) and (B or D) and (not A) and (B or C)). Slide 10.1.2 Its outermost structure is a conjunction.

More information

CS 4700: Artificial Intelligence

CS 4700: Artificial Intelligence CS 4700: Foundations of Artificial Intelligence Fall 2017 Instructor: Prof. Haym Hirsh Lecture 8 Today Informed Search (R&N Ch 3,4) Adversarial search (R&N Ch 5) Adversarial Search (R&N Ch 5) Homework

More information

Principles of Programming Languages Topic: Logic Programming Professor Lou Steinberg

Principles of Programming Languages Topic: Logic Programming Professor Lou Steinberg Principles of Programming Languages Topic: Logic Programming Professor Lou Steinberg 1 Logic Programming True facts: If I was born in year B, then in year Y on my birthday I turned Y-B years old I turned

More information

SECTION 1.5: LOGIC PROGRAMMING

SECTION 1.5: LOGIC PROGRAMMING SECTION 1.5: LOGIC PROGRAMMING William DeMeo williamdemeo@gmail.com University of South Carolina February 7, 2013 SPECIFYING FACTS AND RULES We populate our Prolog database with facts using predicates,

More information

Chapter 16. Logic Programming Languages ISBN

Chapter 16. Logic Programming Languages ISBN Chapter 16 Logic Programming Languages ISBN 0-321-49362-1 Chapter 16 Topics Introduction A Brief Introduction to Predicate Calculus Predicate Calculus and Proving Theorems An Overview of Logic Programming

More information

15-780: Graduate AI Lecture 5. Logic, Planning. Geoff Gordon (this lecture) Ziv Bar-Joseph TAs Geoff Hollinger, Henry Lin

15-780: Graduate AI Lecture 5. Logic, Planning. Geoff Gordon (this lecture) Ziv Bar-Joseph TAs Geoff Hollinger, Henry Lin 15-780: Graduate AI Lecture 5. Logic, Planning Geoff Gordon (this lecture) Ziv Bar-Joseph TAs Geoff Hollinger, Henry Lin Review Review CSPs (definition, examples) Sudoku, jobshop scheduling Over-, under-,

More information

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Knowledge Representation and Reasoning Logics for Artificial Intelligence Knowledge Representation and Reasoning Logics for Artificial Intelligence Stuart C. Shapiro Department of Computer Science and Engineering and Center for Cognitive Science University at Buffalo, The State

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 37 Resolution Rules If some literals can be unified, the same algorithm should be able

More information

Proofs are Programs. Prof. Clarkson Fall Today s music: Two Sides to Every Story by Dyan Cannon and Willie Nelson

Proofs are Programs. Prof. Clarkson Fall Today s music: Two Sides to Every Story by Dyan Cannon and Willie Nelson Proofs are Programs Prof. Clarkson Fall 2016 Today s music: Two Sides to Every Story by Dyan Cannon and Willie Nelson Review Currently in 3110: Advanced topics Futures Monads Today: An idea that goes by

More information

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

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson Lecture Notes 15 Number systems and logic CSS 501 - Data Structures and Object-Oriented Programming Professor Clark F. Olson Number systems The use of alternative number systems is important in computer

More information

CPSC 121 Midterm 2 Friday November 13th, 2015

CPSC 121 Midterm 2 Friday November 13th, 2015 CPSC 121 Midterm 2 Friday November 13th, 2015 [10] 1. For each of the following statements: Rewrite the statement using predicate logic. Write down ALL of the proof strategies (from the list given below),

More information

First Order Predicate Logic CIS 32

First Order Predicate Logic CIS 32 First Order Predicate Logic CIS 32 Functionalia Demos? HW 3 is out on the web-page. Today: Predicate Logic Constructing the Logical Agent Predicate Logic First-order predicate logic More expressive than

More information

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems 1. Search trees for the state-space graph given below: We only show the search trees corresponding

More information

First Order Logic. Introduction to AI Bert Huang

First Order Logic. Introduction to AI Bert Huang First Order Logic Introduction to AI Bert Huang Review Propositional logic syntax and semantics Inference in propositional logic: table, inference rules, resolution Horn clauses, forward/backward chaining

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

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

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language What is a Logic Program Introduction to Logic Programming Foundations, First-Order Language Temur Kutsia Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at

More information

References. Topic #16: Logic Programming. Motivation. What is a program? Prolog Program Structure

References. Topic #16: Logic Programming. Motivation. What is a program? Prolog Program Structure References Topic #16: Logic Programming CSE 413, Autumn 2004 Programming Languages Slides from CSE 341 S. Tanimoto See Chapter 16 of the text Read 16.1, 16.4, 16.5, 16.6 (skip 16.6.7) Skim 16.7, 16.8 http://www.cs.washington.edu/education/courses/413/04au/

More information

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

DM841 DISCRETE OPTIMIZATION. Part 2 Heuristics. Satisfiability. Marco Chiarandini DM841 DISCRETE OPTIMIZATION Part 2 Heuristics Satisfiability Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline 1. Mathematical Programming Constraint

More information

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

simplicity hides complexity flow of control, negation, cut, 2 nd order programming, tail recursion procedural and declarative semantics and & or simplicity hides complexity flow of control, negation, cut, 2 nd order programming, tail recursion simple and/or composition of goals hides complex control patterns not easily represented by traditional

More information

Introduction to Logic Programming

Introduction to Logic Programming Introduction to Logic Programming Foundations, First-Order Language Temur Kutsia RISC, Johannes Kepler University Linz, Austria kutsia@risc.jku.at What is a Logic Program Logic program is a set of certain

More information

First-Order Predicate Logic. Introduction to Intelligent Systems

First-Order Predicate Logic. Introduction to Intelligent Systems 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

More information

The Idea Underlying Logic Programming. CSci 8980, Fall 2012 Specifying and Reasoning About Computational Systems An Introduction to Logic Programming

The Idea Underlying Logic Programming. CSci 8980, Fall 2012 Specifying and Reasoning About Computational Systems An Introduction to Logic Programming The Idea Underlying CSci 8980, Fall 2012 Specifying and Reasoning About Computational Systems An Introduction to Department of Computer Science and Engineering University of Minnesota Lectures in Fall

More information

Symbolic Programming Declarative Programming

Symbolic Programming Declarative Programming CS370 Symbolic Programming Declarative Programming LECTURE 2: Introduction to Prolog park@cs.kaist.ac.kr Computer Science Department Korea Advanced Institute of Science and Technology http://nlp.kaist.ac.kr/~cs370

More information

Outline. Implementing a basic general game player. Foundations of logic programming. Metagaming: rule optimisation. Logic Programming.

Outline. Implementing a basic general game player. Foundations of logic programming. Metagaming: rule optimisation. Logic Programming. Outline 1 Implementing a basic general game player Foundations of logic programming Metagaming: rule optimisation 2 Uses of Logic Use logical reasoning for game play Computing the legality of moves Computing

More information

Prolog. Logic Programming vs Prolog

Prolog. Logic Programming vs Prolog Language constructs Prolog Facts, rules, queries through examples Horn clauses Goal-oriented semantics Procedural semantics How computation is performed? Comparison to logic programming 1 Logic Programming

More information

CPS 506 Comparative Programming Languages. Programming Language Paradigm

CPS 506 Comparative Programming Languages. Programming Language Paradigm CPS 506 Comparative Programming Languages Logic Programming Language Paradigm Topics Introduction A Brief Introduction to Predicate Calculus Predicate Calculus and Proving Theorems An Overview of Logic

More information

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

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction

More information

Lecture Outlines. CSCI- 360 Section R Spring 2016 Wei- Min Shen

Lecture Outlines. CSCI- 360 Section R Spring 2016 Wei- Min Shen Lecture Outlines CSCI- 360 Section- 30304R Spring 2016 Wei- Min Shen Wk1 Ch1: Introduction * Welcome * Class structures/rules (syllabus, HM, projects, tests) * What is AI? * What are the related fields

More information

Lee Pike. June 3, 2005

Lee Pike. June 3, 2005 Proof NASA Langley Formal Methods Group lee.s.pike@nasa.gov June 3, 2005 Proof Proof Quantification Quantified formulas are declared by quantifying free variables in the formula. For example, lem1: LEMMA

More information

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

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information