7
2APL Simon Lynch [email protected] NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

2APL Simon Lynch [email protected] NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

Embed Size (px)

Citation preview

Page 1: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

2APL

Simon Lynch [email protected]

NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

Page 2: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

2APL is BDI

BDI = Beliefs, Desires, Intentions- what??

erm... informational, motivational& deliberative states -what??

ok... assumed info about the world (B)main objectives (D)plan of things to achieve (I)

Page 3: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

eg: bomb disposal with Harry & Sally

Page 4: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

harry

example initial belief base of harry...

Beliefs:

bomb(3,4).

clean(blockWorld) :- not bomb(X,Y), not carry(bomb).

example goal base...

Goals :

clean( blockWorld )

Page 5: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

harry...

example belief updates...

BeliefUpdates:

{bomb(X,Y)} RemoveBomb(X,Y) {not bomb(X,Y)}

{true} AddBomb(X,Y) {bomb(X,Y)}

{carry(bomb)} Drop() {not carry(bomb)}

{not carry(bomb)} PickUp() {carry(bomb)}

Page 6: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

harry...

example of planning goal rules

PG-rules :

clean(blockWorld) <- bomb(X,Y) |

{ goto(X,Y);

@blockworld( pickup(), L1 );

PickUp();

RemoveBomb(X,Y);

goto(0,0);

@blockworld( drop(), L2 );

Drop()

}

Page 7: 2APL Simon Lynch s.c.lynch@tees.ac.uk NB: examples & code taken from 2APL user guide & tutorial (Dastani 2007)

harry...

example of procedural rules of harry...

PC-RULES :

message(sally, inform, bombAt(X,Y)) <- true |

{ if (not bomb(A,B) ) then

{ AddBomb(X,Y);

adoptz( clean(blockWorld) )

}

else

{ AddBomb(X,Y)

}

}