agent programming in dribble from beliefs to goals with plans birna van riemsdijk wiebe van der hoek...

30
Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Post on 20-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Agent programming in Dribble

from beliefs to goals with plans

Birna van RiemsdijkWiebe van der HoekJohn-Jules Ch. Meyer

Page 2: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 2

Motivation

◊ Our group has done work on agent programming languages in the past– 3APL: beliefs and goals-to-do– GOAL: beliefs and goals-to-be

◊ Natural question: how to combine these?

Page 3: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 3

Answer: Dribble

◊ Dribble is an agent programming language containing:– Beliefs– Goals-to-be– Goals-to-do (Plans)

Page 4: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 4

Mental States

◊ Mental state – Belief base : set of prop. forms– Goal base : set of prop. forms– Plan : sequence of ‘basic

elements’ (imperative program)

Page 5: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 5

Belief and Goal Formulas

◊ Belief formulas• B

◊ Goal formulas

• G• logical consequences of particular goal

are also goals, if not believed

◊ Logical combinations

Page 6: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 6

Plans

◊ Plan is sequence of basic elements◊ Basic elements:

•Basic action •Abstract plan•If-then-else construct

Page 7: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 7

Basic Actions

◊ Basic action•executable •belief update•goal update: goals removed when

realised (thru commitment strategy)

Page 8: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 8

Abstract plans

◊ Abstract plan•not executable •abstraction mechanism (compare

procedures) •translation into basic actions

Page 9: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 9

If-then-else

◊ If-then-else construct if then 1 else 2 fi

•executable •plan update

Page 10: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 10

Executing Basic Actions

◊ A basic action has as effects:– Belief update

•E.g. after execution of moveLeft, the agent believes to have moved left

– Goal update•Indirect, side effect of belief update

via commitment strategy

Page 11: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 11

Commitment Strategy

◊ Commitment strategy– connection between beliefs and goals

– when are goals dropped?• when believed to have been achieved

Page 12: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 12

Goal Rules

◊ Goal rules have form – taken from GOAL : a– used for plan selection

– is condition on beliefs and/or goals• Beliefs: specify when the plan could be

executed• Goals: specify what the plan is good for

Page 13: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 13

Goal Rules (ctd)

– applicable in E iff E (selection of new plan only if current plan is empty)

– resulting mental state is (adoption of plan )

Page 14: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 14

PR Rules

◊ Practical Reasoning (PR) rules:h b

– taken from 3APL– is condition on beliefs– employed for

• Creating plans : p a;b;c

• Modifying plans : h b

• Modeling reactive behaviour : E b

Page 15: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 15

PR Rules (ctd)

– applicable in h iff h

– resulting mental state is b (adoption of plan b instead of h )

Page 16: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 16

Operational Semantics

◊ Operational semantics based on transition system

• definition of mental state transformations

◊ Transition rule for basic action execution

• T(a,) defines update of by executing action a

Page 17: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 17

Transition rules

◊ Application of goal rule g:

E EapplyRule(g)

Page 18: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 18

Transition Rules

◊ Execution of a basic action a:

T(a,) = ’_______________________aExecute(a) ’’E

where ’\’

Page 19: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 19

Summary So Far

◊ Dribble agent– Mental state

• belief base, goal base, plan

– Goal rules• plan selection

– PR rules• plan creation and modification

Page 20: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 20

Dynamic Logic

– specify and verify properties of programs

– programs: syntactic constructs in the logic

– p: possible to execute p and halt in state satisfying

– program is transformation function on states: reason about state transformations

Page 21: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 21

Logic for Dribble

◊ Dynamic logic for Dribble– transformations on mental states

caused by:• goal and PR rule application and action

execution

– reason about state transformations• reason about rule application and action

execution of meta-actions

Page 22: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 22

Syntax

◊ : sequence of meta-actions• applyRule(g), applyRule(), execute(a),

execute(if-then-else)

◊ : mental state formula• B(), G(), Com()

Page 23: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 23

Semantics

◊ r* : semantics of meta-actions• transformation function on mental states through

meta-actions ◊ interpretation of diamond formulas:

– r*

◊ Com formulas– Com’’

Page 24: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 24

Semantics

◊ Semantics of applyRule(g)

for g: ’

r* (applyRule(g)) (’

if = E and

Page 25: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 25

Correspondence

◊ Mental state transitions

- defined by transition system(meaning of Dribble agent)

- defined by actions in the logic

(by means of the r* function)

Page 26: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 26

Correspondence (ctd)

◊ Correspondence of logic and operational semantics– transition defined by actions in

the logic transition defined by transition system

– properties of actions in logic: properties of Dribble agent

Page 27: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 27

Some Validities

◊ Results of meta-actions• [applyRule(g)] Com()

• Com(h) [applyRule()]Com(b)

• Com(a;) [a] [execute(a)](Com() )

• Com(if;) [execute(if)] Com(1), where if = if then 1 else 2 fi

[Where g: and : h b]

Page 28: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 28

Some Validities (ctd)

◊ Realisability of meta-actions• Com(E) applyRule(g)T• Com(h) applyRule()

Com(b)

• Com(a;) aT execute(a)Com() • Com(if;) execute(if) T, where if = if then 1 else 2 fi

[Where g: and : h b]

Page 29: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 29

Conclusion

◊ agent programming language– incorporating goals and planning

features– formally defined semantics

◊ programming logic– a first attempt to reason about these

‘self-modifying’ programs (via meta-actions)

Page 30: Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer

Utrecht University John-Jules Meyer 30

Future Work

◊ incorporate first-order languages◊ selection of goal from wish base◊ explicit goal adopt and drop actions◊ drop goal when believed to be

unachievable◊ investigation of use of adding goal

formulas in PR rules