For Wednesday Read chapter 9, sections 1-4 Homework: –Chapter 8, exercise 6 May be done in groups.

Slides:



Advertisements
Similar presentations
Knowledge Representation using First-Order Logic
Advertisements

First-Order Logic Chapter 8.
Knowledge Representation using First-Order Logic CS 271: Fall 2007 Instructor: Padhraic Smyth.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
First-order logic: a more expressive KR language that can handle facts, objects, relations between objects, and object properties. Consider the statement.
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.
First-Order Logic Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 8 Spring 2004.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
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.
First-Order Logic Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 8 Spring 2007.
CS 561, Session Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 8 Jim Martin.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
LOGICAL AGENTS Yılmaz KILIÇASLAN. Definitions Logical agents are those that can:  form representations of the world,  use a process of inference to.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2005.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
Knowledge Representation using First-Order Logic (Part III) This lecture: R&N Chapters 8, 9 Next lecture: Chapter 13; Chapter (Please read lecture.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
A toy world for logical exploration The Wumpus example.
First-Order Logic Knowledge Representation Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read:
For Monday Read chapter 9 Homework: –Chapter 8, exercises 9 and 10.
For Wednesday No reading Homework –Chapter 8, exercises 9 and 10.
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.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
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.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
For Monday Read chapter 8 Homework: –Chapter 7, exercises 1, 8, and 9 May be done in pairs.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
For Friday Read chapter 8 Homework: –Chapter 7, exercise 1.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Friday, 17 September.
Logical Agents. Logical agents for the Wumpus World Three (non-exclusive) agent architectures: Reflex agents –Have rules that classify situations based.
1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their.
Logical Agents. Logical agents for the Wumpus World Three (non-exclusive) agent architectures: Reflex agents –Have rules that classify situations based.
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.
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…)
Lecture 8-1CS250: Intro to AI/Lisp FOPL, Part Deux Lecture 8-1 November 16 th, 1999 CS250.
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
For Wednesday Finish chapter 8 Homework: –Chapter 8, exercise 6 May be done in pairs.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
CMSC 671 Fall 2001 Class #12/13 – Thursday, October 11 / Tuesday, October 16.
Knowledge and reasoning – second part
First-Order Logic Chapter 8.
Logical Agents.
EA C461 – Artificial Intelligence Logical Agent
First-Order Logic Chapter 8.
Logical Agents.
Knowledge and reasoning – second part
First-order Logic Propositional logic (cont…)
Knowledge Representation I (Propositional Logic)
Predicates and Quantifiers
Logical Agents.
First-Order Logic Chapter 8.
Logical Agents.
First-order logic: a more expressive KR language that can handle facts, objects, relations between objects, and object properties. Consider the statement.
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

For Wednesday Read chapter 9, sections 1-4 Homework: –Chapter 8, exercise 6 May be done in groups

Program 1 Any questions?

Variable Scope The scope of a variable is the sentence to which the quantifier syntactically applies. As in a block structured programming language, a variable in a logical expression refers to the closest quantifier within whose scope it appears. –  x (Cat(x)   x(Black (x))) The x in Black(x) is universally quantified Says cats exist and everything is black In a well­formed formula (wff) all variables should be properly introduced: –  xP(y) not well­formed A ground expression contains no variables.

Relations Between Quantifiers Universal and existential quantification are logically related to each other: –  x ¬Love(x,Saddam)  ¬  x Loves(x,Saddam) –  x Love(x,Princess­Di)  ¬  x ¬Loves(x,Princess­Di) General Identities –  x ¬P  ¬  x P – ¬  x P   x ¬P –  x P  ¬  x ¬P –  x P  ¬  x ¬P –  x P(x)  Q(x)   x P(x)   x Q(x) –  x P(x)  Q(x)   x P(x)   x Q(x)

Equality Can include equality as a primitive predicate in the logic, or require it to be introduced and axiomitized as the identity relation. Useful in representing certain types of knowledge: –  x  y(Owns(Mary, x)  Cat(x)  Owns(Mary,y)  Cat(y) –  ¬(x=y)) –Mary owns two cats. Inequality needed to ensure x and y are distinct. –  x  y married(x, y)  z(married(x,z)  y=z) –Everyone is married to exactly one person. Second conjunct is needed to guarantee there is only one unique spouse.

Higher­Order Logic FOPC is called first­order because it allows quantifiers to range over objects (terms) but not properties, relations, or functions applied to those objects. Second­order logic allows quantifiers to range over predicates and functions as well: –  x  y [ (x=y)  (  p p(x)  p(y)) ] Says that two objects are equal if and only if they have exactly the same properties. –  f  g [ (f=g)  (  x f(x) = g(x)) ] Says that two functions are equal if and only if they have the same value for all possible arguments. Third­order would allow quantifying over predicates of predicates, etc.

Alternative Notations Prolog: cat(X) :- furry(X), meows(X), has(X, claws). good_pet(X) :- cat(X); dog(X). Lisp: (forall ?x (implies (and (furry ?x) (meows ?x) (has ?x claws)) (cat ?x)))

A Kinship Domain  m,c Mother(c) = m  Female(m)  Parent(m, c)  w,h Husband(h, w)  Male(h)  Spouse(h,w)  x Male(x)   Female(x)  p,c Parent(p, c)  Child(c, p)  g,c Grandparent(g, c)   p Parent(g, p)  Parent(p, c)  x,y Sibling(x, y)  x  y   p Parent(p, x)  Parent(p, y)  x,y Sibling(x, y)  Sibling(y, x)

Axioms Axioms are the basic predicates of a knowledge base. We often have to select which predicates will be our axioms. In defining things, we may have two conflicting goals –We may wish to use a small set of definitions –We may use “extra” definitions to achieve more efficient inference

A Wumpus Knowledge Base Start with two types of sentence: –Percepts: Percept([stench, breeze, glitter, bump, scream], time) Percept([Stench,None,None,None,None],2) Percept(Stench,Breeze,Glitter,None,None],5) –Actions: Action(action,time) Action(Grab,5)

Agent Processing Agent gets a percept Agent tells the knowledge base the percept Agent asks the knowledge base for an action Agent tells the knowledge base the action Time increases Agent performs the action and gets a new percept Agent depends on the rules that use the knowledge in the KB to select an action

Simple Reflex Agent Rules that map the current percept onto an action. Some rules can be handled that way: action(grab,T) :- percept([S, B, glitter, Bump, Scr],T). Simplifying our rules: stench(T) :- percept([stench, B, G, Bu, Scr],T). breezy(T) :- percept([S, breeze, G, Bu, Scr], T). at_gold(T) :- percept([S, B, glitter, Bu, Scr], T). action(grab, T) :- at_gold(T). How well can a reflex agent work?

Situation Calculus A way to keep track of change We have a state or situation parameter to every predicate that can vary We also must keep track of the resulting situations for our actions Effect axioms Frame axioms Successor-state axioms

Frame Problem How do we represent what is and is not true and how things change? Reasoning requires keeping track of the state when it seems we should be able to ignore what does not change

Wumpus Agent’s Location Where agent is: at(agent, [1,1], s0). Which way agent is facing: orientation(agent,s0) = 0. We can now identify the square in front of the agent: location_toward([X,Y],0) = [X+1,Y]. location_toward([X,Y],90) = [X, Y+1]. We can then define adjacency: adjacent(Loc1, Loc2) :- Loc1 = location_toward(L2,D).

Changing Location at(Person, Loc, result(Act,S)) :- (Act = forward, Loc = location_ahead(Person, S), \+wall(loc)) ; (at(Person, Loc, S), A \= forward). Similar rule required for orientation that specifies how turning changes the orientation and that any other action leaves the orientation the same

Deducing Hidden Properties breezy(Loc) :- at(agent, Loc, S), breeze(S). Smelly(Loc) :- at(agent, Loc, S), Stench(S). Causal Rules smelly(Loc2) :- at(wumpus, Loc1, S), adjacent(Loc1, Loc2). breezy(Loc2) :- at(pit, Loc1, S), adjacent(Loc1, Loc2). Diagnostic Rules ok(Loc2) :- percept([none, none, G, U, C], T), at(agent, Loc1, S), adjacent(Loc1, Loc2).

Preferences Among Actions We need some way to decide between the possible actions. We would like to do this apart from the rules that determine what actions are possible. We want the desirability of actions to be based on our goals.

Handling Goals Original goal is to find and grab the gold Once the gold is held, we want to find the starting square and climb out We have three primary methods for finding a path out –Inference (may be very expensive) –Search (need to translate problem) –Planning (which we’ll discuss later)