1 / 34

CS 4100 Artificial Intelligence

CS 4100 Artificial Intelligence. Prof. C. Hafner Class Notes Feb 16, 2012. AI Planning – 3 approaches. 1. Strips approach: uses plan operators with preconditions and effects (addlist and deletelist)

rufus
Download Presentation

CS 4100 Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Feb 16, 2012

  2. AI Planning – 3 approaches • 1. Strips approach: uses plan operators with preconditions and effects (addlist and deletelist) • Solves sub-goals (preconditions) sequentially keeping track of all current knowledge as the state changes. • Flaw: actions to implement a sub-goal must be contiguous, preventing clever solutions when there is subgoal interference. • 2. Partial order planning uses a graph instead of a tree. “Threat links” can be inserted and resolved by re-ordering the graph mixing actions from different sub-goals.

  3. Initial State: Goal: A C B A B C Remember the “Sussman Anomaly” State I: (On A Table) (On C A) (On B Table) (Cleartop B) (Cleartop C) Goal: (On A B) (On B C)

  4. Nets Of Action Hierarchies on(a, b) S J on(b, c) clear(a) puton(a, b) S J clear(b) S J clear(b) puton(b, c) S J clear(c) Add a “threat” link to the network of plan actions

  5. Resolve threat with an “order” link clear(a) puton(a, b) S J clear(b) S J clear(b) puton(b, c) S J clear(c) clear(a) puton(a, b) S J clear(b) S J clear(b) puton(b, c) S J clear(c)

  6. clear(a) puton(a, b) J S clear(b) puton(b, c) S J clear(c) puton(c, X) clear(a) puton(a, b) J S clear(b) puton(b, c) S J clear(c)

  7. Final plan puton(c, X) clear(a) puton(b, c) puton(a, b) J S clear(b)

  8. 3. Planning using logic and resolution: The situation calculus • Key idea: represent a snapshot of the world, called a ‘situation’ or ‘state’ using first order logic (FOL) sentences. • ‘Fluents’ are statements that are true or false in a given world state, but can change e.g. ‘I am at home’ • States are object in the model space which constants, variables, and functions can reference. • Actions are FOL functions that map states to states. • A Result predicate exists to express the effects of actions

  9. To build a world model: Ontology DesignEspecially relevant to situation calculus • What kinds of objects exist? • What relationships? • What kinds of events and actions can occur ? • How do these change the world ? • How do we structure our models effectively ? • The Protégé tool for specifying Ontologies and World Models (Then we will return to the last Planning topic)

  10. Major Elements of Ontologies • Types (categories, concepts) and individuals • Entities or things (concrete or abstract, physical or social) • People, objects, universities , fields of study, . . . • Wines (Read or Re-read: Ontology 101 paper) • Events, actions , and processes • To model traveling, commerce, education, cooking, crime, politics, sports . . . • Types are organized into subclass/superclass taxonomies • Types can have individuals (instances) that aremembers of the type

  11. Major Elements of Ontologies • Types (categories, concepts) and individuals (cont.) • Relationships • Part-of relations (substructure, ingredient . . . ) • Propertieses (hair color, height, weight) • Role relations (author of a book, victim of a crime) • Spatial relations • Many other types of relationships • Types are organized into subclass/superclass taxonomies • Types can have individuals (instances) that aremembers of the type

  12. Reasoning with Ontologies • Taxonomic relationships relationships are transitive • If X isa Y and Y isa Z then X isa Z • Part-of relationships are also transitive • If X ispart Y and Y ispart Z then X ispart Z • Inheritance of relationships through the taxonomy • If Z hasa (part or role) Y and X isa Z then X hasa Y • Examples: • Human isa primate, primate isa mammal • Primate haspart arm, arm haspart hand • Crime hasa victim, murder isa crime

  13. Ontology Design • Ontologies define entities, events and relations as top-level categories • Every ontology includes a taxonomy (a tangled tree of ISA-linked concepts) • A true ontology also defines the structure of each concept (its slots), consisting of its properties, parts and roles (whose fillers are also concepts) • Some ontologies also include logicalrules of conceptual syntax (how to form more complex concepts out of more primitive ones using various operators. Example: restrictive modification such as middle-aged adult)

  14. Entity classes Ex: person, number, chair chair has a seat part person has a sex property Event classes Ex: an election, a concert, a murder events have time properties and roles (victim, candidate) physical events have location and time Relation classes Ex: employment, marriage, above (Traditional) marriage has roles: husband, wife filler class of husband = male human filler class of wife = female human The goal of ontology design: formally represent meaning so a computer can manipulate it.

  15. The importance of taxonomies • Topic taxonomy (Library Science) – supports search • Taxonomy of living things (Biology) – expresses and communicates scientific knowledge • AI taxonomy – supports automated reasoning • Domain taxonomy (Information Systems; semantic web) – supports intelligent IR and application design • LCC library of congress classification outline (printed in 41 volumes, more than 200,000 topics)

  16. University Degree Taxonomy (tangled) Degree Humanities Degree Undergrad Degree Science Degree Graduate Degree Biology Degree MS. in Biology

  17. For a general knowledge ontology, we need frameworks for formalizing: -- physical attributes (substances (liquid, solid, gas), shapes) -- time (points, intervals, units, durations, time properties of events, axioms for temporal reasoning) -- places and positions; spaces and objects -- qualities, quantities and measurements -- motion, change and causality -- human activities, motivations, typical behavior This requires hundreds of thousands/millions of concepts and associations. But for specific tasks we can create domain and task ontologies with a manageable number of concepts.

  18. Every database schema is a domain ontology • Every time you design an OO Program with some classes you are creating a domain or task ontology • Many web sites embody (implictly or explicitly) a domain ontology; for example a University web site probably has a concept: degree programs, arranged in a (possibly tangled) taxonomy.

  19. Seven steps to creating an ontology • Determine domain and scope • Consider re-using existing ontologies • Enumerate important concepts • Define the classes and class hierarchy (taxonomy) • Define the properties, parts and roles (slots) • Define the facets of the slots • Create instances Wine example from Noy & McGuinness, Ontology 101 We will continue this later with examples from Protégé showing how to build an ontology with this tool.

  20. Return to the situation calculus • Key idea: represent a snapshot of the world, called a ‘situation’ or ‘state’ using first order logic (FOL) sentences. • ‘Fluents’ are statements that are true or false in a given world state, but can change e.g. ‘I am at home’ • States are object in the model space which constants, variables, and functions can reference. • FOL functions apply to objects to represent an action • A Result function exists to map action X state  state

  21. Blocks world dynamics • Move function represents an action: Move(x, loc) • Use of the Result function: Result(Move(x, loc), si)  the state resulting from doing the Move action from si • Given an axiom about moving things: x loc s [ At(x, loc, Result(Move(x, loc), s)) ] “If you move some object to a location, then in the resulting state that object is at that location • At(B1, Top(B2), Result(Move(B1, Top(B2)), S0)) can be proved using Universal Instantiation (UI) - substituting ground (variable-free) terms for universally quantified variables

  22. Monkeys and Bananas Problem • The monkey-and-bananas problem is faced by a monkey standing under some bananas which are hanging out of reach from the ceiling. There is a box in the corner of the room that will enable the monkey to reach the bananas if he climbs on it. • Use situation calculus to represent this problem and solve it using resolution theorem proving.

  23. Ontology for Monkey/Banana problem • Fluents: Constants: • At(x, loc, s) - BANANAS • On(x, y, s) - MONKEY • Reachable(x, Bananas, s) - BOX • Has(x, y, s) - S0 • Other predicates - CORNER • Moveable(x), Climbable(x) - UNDER-BANANAS • Can-move(x) • Actions • Climb-on(x, y) -- Move(x, loc) • Reach(x, y) -- Push(x, y, loc)

  24. Monkey/Bananas axioms in Situation Calculus 1. ∀ x1, s1 [ Reachable(x1, BANANAS, s1)  Has(x1, BANANAS, Result(Reach(x1, BANANAS), s1)) ] If a person can reach the bananas then the result of reaching them is to have them. 2. ∀ s2 [At(BOX, UNDER-BANANAS, s2) ^ On(MONKEY, BOX, s2)  Reachable(MONKEY, BANANAS, s2) If a box is under the bananas and the monkey is on the box then the monkey can reach the bananas.

  25. Monkey/Bananas axioms 3. ∀ x3, loc3, s3 [ Can-move(x3)  At(x3, loc, Result(Move(x3, loc3), s3)) ] The result of moving to a location is to be at that location 4. ∀ x4, y4, s4 [∃ loc4 [At(x4, loc4, s4) ^ At(y4, loc4, s4)] ^ Climbable(y4)  On(x4, y4, Result(Climb-on(x4, y4), s4))] The result of climbing on an object is to be on the object 5. ∀ x5, y5, loc5, s5 [∃ loc [At(x, loc0, s) ^ At(y5, loc0, s5) ] ^ Moveable(y5)  At(y5, loc5, Result(Push(x5, y5, loc5), s5)) 6. <same>  At(x6, loc6, Result(Push(x6, y6, loc6), s6)) ] The result of x pushing y to a location is both x and y are at that location.

  26. Monkey/Bananas axioms (initial state S0) F1. Moveable(BOX) F2. Climbable(BOX) F3. Can-move(MONKEY) F4. At(BOX, CORNER, S0) F5. At(MONKEY, UNDER-BANANAS, S0) • To solve this for the goal Has(MONKEY, BANANAS, s): • Convert to clause form • Apply resolution to prove something like this: Has(MONKEY, BANANAS, Result(Reach( . . . ), Result(. .) . .), S0) which gives you the plan in reverse order. (don’t forget to standardize!)We need 2 additional “frame axioms” for the proof

  27. A Limitation of Situation Calculus: The Frame problem • I go from home (S) to the store, creating a new situation S’. In S’: • My friend is still at home • The store still sells chips • My age is still the same • Los Angeles is still the largest city in California… • How can we efficiently represent everything that hasn’t changed?

  28. Successor state axioms • Normally, things stay true from one state to the next -- unless an action changes them: At(p, loc, Result(a, s)) iff a = Go(p, x) or [At(p, loc, s) and a != Go(p, y)] • We need one or more of these for every fluent • Now we can use theorem proving (or possibly backward chaining) to deduce a plan: not very practical

  29. Frame Axioms for Monkey/Bananas world 7. ∀ x, y, loc, s [ At(x, loc, s)  At(x, loc, Result(Move(y, loc), s)) ] The location of an object does not change as a result of someone moving to the same location. 8. ∀ x, y, loc, s [ At(x, loc, s)  At(x, loc, Result(Climb-on(y, x), s)) ] The location of an object does not change as a result of someone climbing on it.

  30. Refutation Resolution as the theoretical basis of BC A query is conceptualized with existential variables: ? Likes(John, x) means ? ∃x Likes(John, x) to answer the question, assert its NEGATION, and attempt to derive a contradiction by RESOLVING TO THE EMPTY CLAUSE! ~ ∃x Likes(John, x) is equivalent to ∀ x ~ Likes(John, x), so add that to the KB and try to derive the empty clause Resolution rule: [A1 V A2 V . . . An] ^ [B1 V B2 V . . Bm V ~A1’] where A1 and A1’ unify --------------------------------------------------------------- [ A2’ V . . . An’ ] ^ [B1’ V B2’ V . . . Bm’] Likes(John, Pizza) ^ ~ Likes(John, x) resolves to { }, given {x/Pizza}

More Related