Plnning gent: single gent or multi-gent Stte: complete or Incomplete (logicl/probbilistic) stte of the worl n/or gent s stte of knowlege ctions: worl-ltering n/or knowlege-ltering (e.g. sensing) eterministic or non-eterministic (logicl/stochstic) Gol onition: stisficing or optimizing finl-stte or temporlly extene/control knowlege/script optimizing: preferences or cost or utility or Resoning: offline or online (fully observble, prtilly observble) Plns: sequentil, prtil orer, conformnt, contingent, conitionl (controller) 2 Plnning gent: single gent or multi-gent Stte: complete or Incomplete (logicl/probbilistic) stte of the worl n/or gent s stte of knowlege ctions: worl-ltering n/or knowlege-ltering (e.g. sensing) eterministic or non-eterministic (logicl/stochstic) Gol onition: stisficing or optimizing finl-stte or temporlly extene/control knowlege/script optimizing: preferences or cost or utility or Resoning: offline or online (fully observble, prtilly observble) Plns: sequentil, prtil orer, conformnt, contingent, conitionl (controller) 3 Sitution lculus First we look t how to moel ynmic worls within firstorer logic. The sitution clculus is n importnt formlism evelope for this purpose. Sitution lculus uiling locks Situtions Fluents ctions Sitution lculus is (mostly) first-orer lnguge. Inclue in the omin of iniviuls specil set of objects clle situtions. Of these S 0 is specil istinguishe constnt which enotes the initil sitution. 24 25 1
Specifying the effects of ctions Specifying the effects of ctions ction preconitions: ertin things must hol for ctions to hve preictble effect. pickup(c) this ction is only pplicble to situtions S when cler(c,s) hnempty(s) is true. ction effects: ctions mke certin things true n certin things flse. holing(c, o(pickup(c), S)) X. hnempty(o(pickup(x),s)) ction effects re conitionl on their preconition being true. S,X. ontble(x,s) cler(x,s) hnempty(s) holing(x, o(pickup(x),s)) hnempty( o(pickup(x),s)) ontble(x, o(pickup(x,s)) cler(x, o(pickup(x,s)). Green inictes sitution term 32 33 Two types of resoning. The Frme Problem Two common types of queries : 1. Preicting the effects of given sequence of ction E.g., on(b,c, o(stck(b,c), o(pickup(b), s 0 )) ) Fining n effective wy of specifying the noneffects of ctions, without hving to explicitly write them ll own is the frme problem. 2. omputing sequence of ctions tht chieve gol conitions E.g., S. on(b,c,s) on(c,,s) Goo solutions hve been propose, n the sitution clculus hs been powerful wy of eling with ynmic worls: Logic-bse high-level robotic progrmming lnguges 39 43 2
omputtion Problems lthough the sitution clculus is very powerful representtion. It is not lwys efficient enough to use to compute sequences of ctions. The problem of computing sequence of ctions to chieve gol is plnning From Sitution lculus to STRIPS Next we will stuy some less expressive representtions tht support more efficient plnning. 44 45 STRIPS representtion. STRIPS (Stnfor Reserch Institute Problem Solver.) is wy of representing ctions. ctions re moele s wys of moifying the worl. since the worl is represente s W-K, STRIPS ction represents wy of upting the W-K. Now ctions yiel new K s, escribing the new worl the worl s it is once the ction hs been execute. Sequences of Worls In the sitution clculus where in one logicl sentence we coul refer to two ifferent situtions t the sme time. on(,b,s 0 ) on(,b,s 1 ) In STRIPS, we woul hve two seprte W-K s. One representing the initil stte, n nother one representing the next stte (much like serch where ech stte ws represente in seprte t structure). 56 57 3
STRIPS ctions: pickup(x): Pre: {hnempty, cler(x), ontble(x) s: {holing(x) Dels: {hnempty, cler(x), ontble(x) pickup(x) is clle STRIPS opertor. prticulr instnce e.g. pickup() is clle n ction. Opertion of STRIPS ction. For prticulr STRIPS ction (groun instnce) to be pplicble to stte ( W-K) every fct in its preconition list must be true in K. This mounts to testing membership since we hve only tomic fcts in the preconition list. If the ction is pplicble, the new stte is generte by removing ll fcts in Dels from K, then ing ll fcts in s to K. 59 60 Opertion of Strips ction: pre = {hnmpty, cler(b), ontble(b) pickup(b) = {holing(b) el = {hnmpty, cler(b), ontble(b) STRIPS locks Worl Opertors. pickup(x) Pre: {cler(x), ontble(x), hnempty : {holing(x) Del: {cler(x), ontble(x), hnempty putown(x) Pre: {holing(x) : {cler(x), ontble(x), hnempty Del: {holing(x) K = {hnempty cler(c), cler(b), on(c,), ontble(), ontble(b) K = { holing(b), cler(c), on(c,), ontble() 61 62 4
STRIPS locks Worl Opertors. unstck(x,y) Pre: {cler(x), on(x,y), hnempty : {holing(x), cler(y) Del: {cler(x), on(x,y), hnempty stck(x,y) Pre: {holing(x),cler(y) : {on(x,y), hnempty, cler(x) Del: {holing(x),cler(y) Plnning s Serch Problem Given W-K representing the initil stte, set of STRIPS or DL (ction Description Lnguge) opertors, n gol conition we wnt to chieve (specifie either s conjunction of fcts, or s formul) The plnning problem is to etermine sequence of ctions tht when pplie to the initil W-K yiel n upte W-K which stisfies the gol. This is known s the clssicl plnning tsk. 63 71 Plnning s Serch This cn be trete s serch problem. The initil W-K is the initil stte. The ctions re opertors mpping stte ( W-K) to new stte (n upte W-K). The gol is stisfie by ny stte (W-K) tht stisfies the gol.. move(b,c) move(c,b) move(c,tble) move(,b) 72 73 5
Problems Serch tree is generlly quite lrge rnomly reconfiguring 9 blocks tkes thousns of PU secons. The representtion suggests some structure. Ech ction only ffects smll set of fcts, ctions epen on ech other vi their preconitions. Plnning lgorithms re esigne to tke vntge of the specil nture of the representtion. Plnning We will look t one technique: Relxe Pln heuristics use with heuristic serch. The heuristics re omin inepenent. s such they re prt of clss of so-clle omin-inepenent heuristic serch for plnning 74 75 STRIPS locks Worl Opertors. pickup(x) Pre: {hnempty, ontble(x), cler(x) : {holing(x) Del: {hnempty, ontble(x), cler(x) putown(x) Pre: {holing(x) : {hnempty, ontble(x), cler(x) Del: {holing(x) unstck(x,y) Pre: {hnempty, cler(x), on(x,y) : {holing(x), cler(y) Del: {hnempty, cler(x), on(x,y) stck(x,y) Pre: {holing(x),cler(y) : {hnempty, cler(x), on(x,y) Del: {holing(x),cler(y) 79 Grphpln-style Relxe Pln Grph b c on(,b), ontble(c), ontble(), cler(), cler(), hnempty unstck(,b) pickup() S 0 0 b c on(,b), ontble(c), ontble(), cler(), hnempty, cler(), holing(), cler(b), holing() S 1 this is not stte s some of these fcts cnnot be true t the sme time! 80 6
Grphpln-style Relxe Pln Grph Grphpln-style Relxe Pln Grph b c unstck(,b) from pickup() 0 on(,b), ontble(c), ontble(), cler(), cler(), hnempty, holing(), cler(b), holing() S 1 putown(), putown(), stck(,b), stck(,), stck(,), stck(,b), stck(,), unstck(b,c) 1 Impossible, but we on t know becuse we ignore els. b c on(,b), ontble(c), ontble(), cler(), cler(), hnempty unstck(,b) pickup() S 0 0 b c on(,b), ontble(c), ontble(), cler(), hnempty, cler(), holing(), cler(b), holing() S 1 this is not stte! 81 82 on(,b), ontble(c), ontble(), cler(), cler(), hnempty, holing(), cler(b), holing() S 1 putown(), putown(), stck(,b), stck(,), stck(,b), stck(,), pickup(), unstck(b,c) 1 legen: [pre]ct[] G = {f 6,f 5,f 1 83 93 7
legen: [pre]ct[] G = {f 6,f 5, f 1 We split G into G P n G N : Gol: f 6,f 5,f 1 ctions: [f 1 ] 1 [f 4 ] [f 2 ] 2 [f 5 ] [f 2,f 4,f 5 ] 3 [f 6 legen: [pre]ct[] G = {f 6,f 5,f 1 G N = {f 6 (newly chieve) G p = {f 5, f 1 (chieve before) 94 95 legen: [pre]ct[] G = {f 6,f 5, f 1 ountcts(g,s 2 ) G P ={f 5, f 1 //lrey in S1 G N = {f 6 //New in S2 = { 3 //s ll in G N //the new gol: G P Pre() G 1 = {f 5,f 1,f 2,f 4 Return 1 + ountcts(g 1,S 1 ) Now, we re t level S1 G 1 = {f 5,f 1,f 2,f 4 ountcts(g 1,S 1 ) We split G into G P n G N : 96 97 8
Now, we re t level S1 G 1 = {f 5,f 1,f 2,f 4 ountcts(g 1,S 1 ) Now, we re t level S1 G 1 = {f 5,f 1,f 2,f 4 ountcts(g 1,S 1 ) G P ={f 1,f 2 //lrey in S0 G N = {f 4,f 5 //New in S1 = { 1, 2 //s ll in G N //the new gol: G P Pre() G 2 = {f 1,f 2 Return 2 + ountcts(g 2,S 0 ) We split G 1 into G P n G N : We split G 1 into G P n G N : G N = {f 5,f 4 G P = {f 1,f 2 98 99 Now, we re t level S1 ountcts(g 2,S 0 ) G N ={f 1,f 2 //lrey in S0 G P = { //New in S1 = { //No ctions neee. Return 0 Now, we re t level S1 ountcts(g 2,S 0 ) G N ={f 1,f 2 //lrey in S0 G P = { //New in S1 = { //No ctions neee. Return 0 G 2 = {f 1,f 2 We split G 2 into G P n G N : G N = {f 1,f 2 G P = { 100 G 2 = {f 1,f 2 We split G 2 into G P n G N : G N = {f 1,f 2 G P = { So, in totl ountcts(g,s2)=1+2+0=3 101 9
Using the Heuristic First, buil lyere structure from stte S tht reches gol stte. ountctions: counts how mny ctions re require in relxe pln. Use this s our heuristic estimte of the istnce of S to the gol. This heuristic tens to work better with greey best-first serch rther thn * serch Tht is when we ignore the cost of getting to the current stte. missibility minimum size pln in the elete relxe problem woul be lower boun on the optiml size of pln in the rel problem. n coul serve s n missible heuristic for *. However, ountctions oes NOT compute the length of the optiml relxe pln. The choice of which ction set to use to chieve G P ( just chieve prt of G ) is not necessrily optiml it is miniml, but not necessry minimum. Furthermore even if we picke true minimum set t ech stge of ountctions, we might not obtin minimum set of ctions for the entire pln---the set picke t ech stte influences wht set cn be use t the next stge! 102 103 missibility It is NP-Hr to compute the optiml length pln even in the relxe pln spce. So ountctions cnnot be me into n missible heuristic without mking it much hrer to compute. Empiriclly, refinements of ountctions performs very well on number of smple plnning omins. 104 10