Title: baylor
1baylors Planning Talk
2Announcements
- No class on Thursday
- Homework 5 is out
- 2 ontology questions, 4 planning
- Homework due next class
- Tuesday December 2
- Almost end of the semester
3Question What Is This?
4Why Is Knowing This Important?
5(No Transcript)
6How Do You Make Cupcakes?
- Buy ingredients
- Mix ingredients
- Bake
- Put on frosting
- Put on even more frosting
- Give to TA
7How Do You Write That In Logic?
8How Do You Write That In Logic?
- um, i dont know
- We havent seen any way to write actions
- Our logic has no sense of time
- If action giveCupcake turns hasCupcake from False
to True, what is the value of hasCupcake? - No way to say False now, True in future
- Could do if we used a new type of logic such as
temporal logic, event calculus, situation
calculus, etc. - Could pass time as a parameter to every
predicate - This is all kinda hard and messy
9What About Search?
10What About Search?
11Some Problems With Search
- Its a graph
- Means it can loop
- And in this case, it should (frosting x2)
- No obvious heuristic
- No way to specify ordering constraints
- Doesnt make sense to bake ingredients if you
havent mixed them together - Vague
- What exactly does each action do?
- How do we know if weve reached the goal?
12So How Do We Represent The Bribe-TA-With-Cupcake
Process?
- Both logic and search have problems
- Logic can represent facts but not actions
- Search cant facts but not actions
- Well, not facts and actions at the same time
- In CSP, we searched assignments, not actions
- Obvious solution use both
- States represented in logic
- Actions modify logic
- Solve the time problem each node on the path
has its own state (set of logic facts) - Heuristic Pick action that results in the most
goal conditions being satisfied
13STRIPS
- A representation of how action affects state
- Has preconditions to make sure you dont execute
an illegal action - One of the first (and oldest) planning languages
- Modern languages such as PDDL are based on STRIPS
- Cant do everything you want
- Some things are very hard to do
- Missing features on purpose
- Done for computational efficiency
- Uses closed-world assumption
14Action Schema Structure
Action(actionName(parm1, parm2,
parmEtc), PRECOND Predicate1(parm2)
? SomethingElse(parm1), ADD
SomePredicate(parm2) ? YetAnotherPredicate(parm2
), DELETE Predicate1(parm1))
15Action Schema Structure (version 2)
Action(actionName(parm1, parm2,
parmEtc), PRECOND Predicate1(parm2)
? SomethingElse(parm1), EFFECT
SomePredicate(parm2) ? YetAnotherPredicate(parm2
) ? Predicate1(parm1))
This is a slightly newer syntax that merges the
ADD and DELETE lists. You can use whichever you
prefer.
16Example STRIPS Action Schema
Action(giveCupcake(from, to, cupcake), PRECOND
Has(from, object) ? IsCupcake(cupcake), ADD
Has(to, cupcake), DELETE Has(from, cupcake))
17STRIPS Action Schema Rules
- You cannot use any variable not passed in as a
parameter - Global constants OK
- No disjunctions (?)
- No existential quantifiers
- No functions
- No negations in PRECOND
- But OK in the EFFECT clause
18Things You Cant Do In STRIPS
- Action(give(from, to, object),PRECOND from?to
- Action(give(from, to, object),PRECOND Have(to,
object) - Action(give(from, to, object),PRECOND ?place
At(from, place) ? At(to, place) - Action(stealsPurse(victim),EFFECT Have(victim,
all her stuff) - Action(stealsPurse(victim),EFFECT if
HadCash(victim) ? Crying(victim) - Goal HasResearchUniversityJob ? HasIndustryJob
You can do all this stuff in ADL
19Lets Play Spot The Problem!
20Good or Bad?
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ? Connected(from, to)
? - (Cost(ticket) lt Savings(person))
- ADD At(person, to)
- DELETE At(person, from)
21You Cannot Have Functions. Period.
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ? Connected(from, to)
? - (Cost(ticket) lt Savings(person))
- ADD At(person, to)
- DELETE At(person, from)
Functions recursion possibly infinite search
space STRIPS no likey functions
22Good or Bad?
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ? Connected(from, to)
- ADD At(person, to)
- DELETE At(person, from) ? Savings(person,
Price(ticket))
23Seriously, No Functions
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ?
- Connected(from, to)
- ADD At(person, to)
- DELETE At(person, from) ? Savings(person,
Price(ticket))
Just making sure you were paying attention
24Good or Bad?
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ? Connected(from, to)
? - (CanAfford(person, ticket) ? HasFreebie(person))
- ADD At(person, to)
- DELETE At(person, from)
25AND not OR
- Action( Buy(person, ticket, from, to),
- PRECOND At(person, from) ? Connected(from, to)
? - (CanAfford(person, ticket) ? HasFreebie(person))
- ADD At(person, to)
- DELETE At(person, from)
No disjunctions in STRIPS
26OK, Yeah, Its Bad. But Why?
- Action( Fly(plane, from, to),
- PRECOND At(plane, from) ?
- Connected(from, to) ? Broken(plane)
- EFFECT At(plane, to) ? At(plane, from)
27Be Positive
- Action( Fly(plane, from, to),
- PRECOND At(plane, from) ?
- Connected(from, to) ? Broken(plane)
- EFFECT At(plane, to) ? At(plane, from)
You cant negate things in preconditions (but
effects are OK)
28Whats Wrong With This
- Action( Go(person, from, to),
- PRECOND At(person, from) ?
- ?door Connects(door, from, to)
- EFFECT At(person, from) ? At(person, to)
29No Existentials
- Action( Go(person, from, to),
- PRECOND At(person, from) ?
- ?door Connects(door, from, to)
- EFFECT At(person, from) ? At(person, to)
You cannot use variables in the precondition that
arent in the argument list.
30In-Class Exercise
31Give the TA Cupcakes!!!
- Actions
- buyIngredients
- mixIngredients
- bake
- addFrosting
- giveToTA
- Predicates
- HaveIngredients(person)
- HaveBatter(person)
- HaveCupcake(person)
- IsFrosted(cupcake)
- TA is a constant