Agent programming in Dribble from beliefs to goals
Agent programming in Dribble from beliefs to goals with plans Birna van Riemsdijk Wiebe van der Hoek John-Jules Ch. Meyer John-Jules Meyer
Motivation ◊ Our group has done work on agent programming languages in the past – 3 APL: beliefs and goals-to-do – GOAL: beliefs and goals-to-be ◊ Natural question: how to combine these? Utrecht University John-Jules Meyer 2
Answer: Dribble ◊ Dribble is an agent programming language containing: – Beliefs – Goals-to-be – Goals-to-do (Plans) Utrecht University John-Jules Meyer 3
Mental States ◊ Mental state s, g, p – Belief base s : set of prop. forms – Goal base g : set of prop. forms – Plan p : sequence of ‘basic elements’ (imperative program) Utrecht University John-Jules Meyer 4
Belief and Goal Formulas ◊ Belief formulas • s, g, p |= Bj s |= j ◊ Goal formulas • s, g, p |= Gy y s g • logical consequences of particular goal are also goals, if not believed ◊ Logical combinations Utrecht University John-Jules Meyer 5
Plans ◊ Plan is sequence of basic elements ◊ Basic elements: • Basic action • Abstract plan • If-then-else construct Utrecht University John-Jules Meyer 6
Basic Actions ◊ Basic action • executable • belief update • goal update: goals removed when realised (thru commitment strategy) Utrecht University John-Jules Meyer 7
Abstract plans ◊ Abstract plan • not executable • abstraction mechanism (compare procedures) • translation into basic actions Utrecht University John-Jules Meyer 8
If-then-else ◊ If-then-else construct if b then p 1 else p 2 fi • executable • plan update Utrecht University John-Jules Meyer 9
Executing Basic Actions ◊ A basic action has as effects: – Belief update • E. g. after execution of move. Left, the agent believes to have moved left – Goal update • Indirect, side effect of belief update via commitment strategy Utrecht University John-Jules Meyer 10
Commitment Strategy ◊ Commitment strategy – connection between beliefs and goals – when are goals dropped? • when believed to have been achieved Utrecht University John-Jules Meyer 11
Goal Rules ◊ Goal rules have form j p – taken from GOAL : j a – used for plan selection – j is condition on beliefs and/or goals • Beliefs: specify when the plan could be executed • Goals: specify what the plan is good for Utrecht University John-Jules Meyer 12
Goal Rules (ctd) – applicable in s, g, E iff s, g, E |= j (selection of new plan only if current plan is empty) – resulting mental state is s, g, p (adoption of plan p) Utrecht University John-Jules Meyer 13
PR Rules ◊ Practical Reasoning (PR) rules: ph | b pb – taken from 3 APL – b is condition on beliefs – employed for • Creating plans : p | b a; b; c • Modifying plans : ph | b pb • Modeling reactive behaviour : E | b pb Utrecht University John-Jules Meyer 14
PR Rules (ctd) – applicable in s, g, ph p iff s, g, ph p |= b – resulting mental state is s, g, pb p (adoption of plan pb instead of ph ) Utrecht University John-Jules Meyer 15
Operational Semantics ◊ Operational semantics based on transition system • definition of mental state transformations ◊ Transition rule for basic action execution • T(a, s) defines update of s by executing action a Utrecht University John-Jules Meyer 16
Transition rules ◊ Application of goal rule g: j p s, g, E |= j _____________ s, g, E apply. Rule(g) s, g, p Utrecht University John-Jules Meyer 17
Transition Rules ◊ Execution of a basic action a: T(a, s) = s’ ____________ s, g, a Execute(a) s’, g’, E where g’ = g {y g | s’ |= y} Utrecht University John-Jules Meyer 18
Summary So Far ◊ Dribble agent – Mental state • belief base, goal base, plan – Goal rules • plan selection – PR rules • plan creation and modification Utrecht University John-Jules Meyer 19
Dynamic Logic – specify and verify properties of programs – programs: syntactic constructs in the logic – p j: possible to execute p and halt in state satisfying j – program is transformation function on states: reason about state transformations Utrecht University John-Jules Meyer 20
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 Utrecht University John-Jules Meyer 21
Syntax ◊ a : sequence of meta-actions • apply. Rule(g), apply. Rule( ), execute(a), execute(if-then-else) ◊ m : mental state formula • B(j), G(y), Com(p) Utrecht University John-Jules Meyer 22
Semantics ◊ r* : semantics of meta-actions • transformation function on mental states through meta-actions ◊ interpretation of diamond formulas: – s, g, p |= a m r* (a) ( s, g, p ) |= m ◊ Com formulas – s, g, p |= Com(p’) p = p’ Utrecht University John-Jules Meyer 23
Semantics ◊ Semantics of apply. Rule(g) for g: j p’ : r* (apply. Rule(g)) ( s, g, p ) = s, g, p’ , if p = E and s, g, p |= j Utrecht University John-Jules Meyer 24
Correspondence ◊Mental state transitions - defined by transition system (meaning of Dribble agent) - defined by actions in the logic (by means of the r* function) Utrecht University John-Jules Meyer 25
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 Utrecht University John-Jules Meyer 26
Some Validities ◊ Results of meta-actions • [apply. Rule(g)] Com(p) • Com(ph p) [apply. Rule( )]Com(pb p) • Com(a; p) [a]b [execute(a)](Com(p) b) • Com(if; p) b [execute(if)] Com(p 1 p), where if = if b then p 1 else p 2 fi [Where g: j Utrecht University p and : ph | b pb] John-Jules Meyer 27
Some Validities (ctd) ◊ Realisability of meta-actions • Com(E) j apply. Rule(g) T • Com(ph p) b apply. Rule( ) Com(pb p) • Com(a; p) a T execute(a) Com(p) • Com(if; p) execute(if) T, where if = if b then p 1 else p 2 fi [Where g: j Utrecht University p and : ph | b pb] John-Jules Meyer 28
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 metaactions) Utrecht University John-Jules Meyer 29
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 Utrecht University John-Jules Meyer 30
- Slides: 30