Presentation is loading. Please wait.

Presentation is loading. Please wait.

For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5.

Similar presentations


Presentation on theme: "For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5."— Presentation transcript:

1 For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5

2 Program 2 Any questions?

3 Issue 4: Categories How are categories defined? What makes reasoning about categories hard?

4 Semantic Networks Use graphs to represent concepts and the relations between them. Simplest networks are ISA hierarchies Must be careful to make a type/token distinction: Garfield isa Cat Cat(Garfield) Cat isa Feline  x (Cat (x)  Feline(x)) Restricted shorthand for a logical representation.

5 Semantic Nets/Frames Labeled links can represent arbitrary relations between objects and/or concepts. Nodes with links can also be viewed as frames with slots that point to other objects and/or concepts.

6 First Order Representation Rel(Alive,Animals,T) Rel(Flies,Animals,F) Birds  Animals Mammals  Animals Rel(Flies,Birds,T) Rel(Legs,Birds,2) Rel(Legs,Mammals,4) Penguins  Birds Cats  Mammals Bats  Mammals Rel(Flies,Penguins,F) Rel(Legs,Bats,2) Rel(Flies,Bats,T) Opus  Penguins Bill  Cats Pat  Bats Name(Opus,"Opus") Name(Bill,"Bill") Friend(Opus,Bill) Friend(Bill,Opus) Name(Pat,"Pat")

7 Inheritance Inheritance is a specific type of inference that allows properties of objects to be inferred from properties of categories to which the object belongs. –Is Bill alive? –Yes, since Bill is a cat, cats are mammals, mammals are animals, and animals are alive. Such inference can be performed by a simple graph traversal algorithm and implemented very efficiently. However, it is basically a form of logical inference  x (Cat(x)  Mammal(x))  x (Mammal(x)  Animal(x))  x (Animal(x)  Alive(x)) Cat(Bill) |- Alive(Bill)

8 Backward or Forward Can work either way Either can be inefficient Usually depends on branching factors

9 Semantic of Links Must be careful to distinguish different types of links. Links between tokens and tokens are different than links between types and types and links between tokens and types.

10 Link Types

11 Inheritance with Exceptions Information specified for a type gives the default value for a relation, but this may be over­ridden by a more specific type. –Tweety is a bird. Does Tweety fly? Birds fly. Yes. –Opus is a penguin. Does Opus fly? Penguin's don't fly. No.

12 Multiple Inheritance If hierarchy is not a tree but a directed acyclic graph (DAG) then different inheritance paths may result in different defaults being inherited. Nixon Diamond

13 Nonmonotonicity In normal monotonic logic, adding more sentences to a KB only entails more conclusions. if KB |- P then KB  {S} |- P Inheritance with exceptions is not monotonic (it is nonmonotonic) –Bird(Opus) –Fly(Opus)? yes –Penguin(Opus) –Fly(Opus)? no

14 Nonmonotonic logics attempt to formalize default reasoning by allow default rules of the form: –If P and concluding Q is consistent, then conclude Q. –If Bird(X) then if consistent Fly(x)

15 Defaults with Negation as Failure Prolog negation as failure can be used to implement default inference. fly(X) :­ bird(X), not(ab(X)). ab(X) :­ penguin(X). ab(X) :­ ostrich(X). bird(opus). ? fly(opus). Yes penguin(opus). ? fly(opus). No

16 Planning

17 Search What are characteristics of good problems for search? What does the search know about the goal state? Consider the package problem on the exam: –How well would search REALLY work on that problem?

18 Search vs. Planning Planning systems: –Open up action and goal representation to allow selection –Divide and conquer by subgoaling –Relax the requirement for sequential construction of solutions

19 Planning in Situation Calculus PlanResult(p,s) is the situation resulting from executing p in s PlanResult([],s) = s PlanResult([a|p],s) = PlanResult(p,Result(a,s)) Initial state At(Home,S_0)   Have(Milk,S_0)  … Actions as Successor State axioms Have(Milk,Result(a,s))  [(a=Buy(Milk)  At(Supermarket,s))  Have(Milk,s)  a ...)] Query s=PlanResult(p,S_0)  At(Home,s)  Have(Milk,s)  … Solution p = Go(Supermarket),Buy(Milk),Buy(Bananas),Go(HWS),…] Principal difficulty: unconstrained branching, hard to apply heuristics

20 The Blocks World We have three blocks A, B, and C We can know things like whether a block is clear (nothing on top of it) and whether one block is on another (or on the table) Initial State: Goal State: A BC A B C

21 Situation Calculus in Prolog holds(on(A,B),result(puton(A,B),S)) :­ holds(clear(A),S), holds(clear(B),S), neq(A,B). holds(clear(C),result(puton(A,B),S)) :­ holds(clear(A),S), holds(clear(B),S), holds(on(A,C),S), neq(A,B). holds(on(X,Y),result(puton(A,B),S)) :­ holds(on(X,Y),S), neq(X,A), neq(Y,A), neq(A,B). holds(clear(X),result(puton(A,B),S)) :­ holds(clear(X),S), neq(X,B). holds(clear(table),S).

22 neq(a,table). neq(table,a). neq(b,table). neq(table,b). neq(c,table). neq(table,c). neq(a,b). neq(b,a). neq(a,c). neq(c,a). neq(b,c). neq(c,b).

23 Situation Calculus Planner plan([],_,_). plan([G1|Gs], S0, S) :­ holds(G1,S), plan(Gs, S0, S), reachable(S,S0). reachable(S,S). reachable(result(_,S1),S) :­ reachable(S1,S). However, what will happen if we try to make plans using normal Prolog depth­first search?

24 Stack of 3 Blocks holds(on(a,b), s0). holds(on(b,table), s0). holds(on(c,table),s0). holds(clear(a), s0). holds(clear(c), s0). | ?­ cpu_time(db_prove(6,plan([on(a,b),on(b,c)],s0,S)), T). S = result(puton(a,b),result(puton(b,c),result(puton(a,table),s0))) T = 1.3433E+01

25 Invert stack holds(on(a,table), s0). holds(on(b,a), s0). holds(on(c,b),s0). holds(clear(c), s0). ?­ cpu_time(db_prove(6,plan([on(b,c),on(a,b)],s0,S)),T). S = result(puton(a,b),result(puton(b,c),result(puton(c,table),s0))), T = 7.034E+00

26 Simple Four Block Stack holds(on(a,table), s0). holds(on(b,table), s0). holds(on(c,table),s0). holds(on(d,table),s0). holds(clear(c), s0). holds(clear(b), s0). holds(clear(a), s0). holds(clear(d), s0). | ?­ cpu_time(db_prove(7,plan([on(b,c),on(a,b),on(c,d)],s0,S)),T). S = result(puton(a,b),result(puton(b,c),result(puton(c,d),s0))), T = 2.765935E+04 7.5 hours!


Download ppt "For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5."

Similar presentations


Ads by Google