Progress in BDI Logic Programming with AgentSpeak(L)
Rafael H. Bordini
R.Bordini@csc.liv.ac.uk
Department of Computer Science University of Liverpool, U.K.
Progress in BDI Logic Programming with AgentSpeak(L) Rafael H. - - PowerPoint PPT Presentation
Progress in BDI Logic Programming with AgentSpeak(L) Rafael H. Bordini R.Bordini@csc.liv.ac.uk Department of Computer Science University of Liverpool, U.K. Summary Overview of AgentSpeak(L) AgentSpeak(XL) Interpreter Asymmetry Thesis
Rafael H. Bordini
R.Bordini@csc.liv.ac.uk
Department of Computer Science University of Liverpool, U.K.
Overview of AgentSpeak(L) AgentSpeak(XL) Interpreter Asymmetry Thesis Principles in AgentSpeak(L) AgentSpeak(F) Verification Ongoing and Future Work
29/11/02 Dagstuhl Seminar p.2/65
Programming language for BDI agents (faithful to the original conception of the BDI architecture) Natural extension of logic programming (neat notation) Proposed by Rao (MAAMAW 1996)
Logical, computable, agent oriented programming language Bridging the gap between BDI theory and practice
Abstract interpreter was further formalised using Z by d’Inverno and Luck Joint work with: Rodrigo Machado (UFRGS) First prototype interpreter: SIM Speak, based on SIM AGENT
29/11/02 Dagstuhl Seminar p.4/65
29/11/02 Dagstuhl Seminar p.5/65
‘
✄’ denotes achievement goals ‘
☎’ denotes test goals
29/11/02 Dagstuhl Seminar p.6/65
29/11/02 Dagstuhl Seminar p.7/65
An intention is as stack of partially instantiated plans An event is a pair
, where
✁is a triggering event and
☎is an intention If the intention
☎is the true intention, the event is called an external event, otherwise it is an internal event An AgentSpeak(L) agent is defined by a tuple
Selection functions:
✑✓✒selects an event from set
✔ ✑✓✕selects an option (i.e., an applicable plan)
✑✗✖selects an intention from the set
✘29/11/02 Dagstuhl Seminar p.8/65
Events Intentions BRF
Unify Context Execute Intention Event Unify Action Selected Event Beliefs Intention Events Beliefs Beliefs Beliefs
S
O
AgentSpeak(L) Agent
Intentions Selected Plans
...
New New
Intention New Subplan Push
6 5 2 1 3 7 4
Perception
Belief Base
Internal Events External Events Relevant Plans Applicable Plans Means Intended
SI S
E
Plan Library
Update Intention
29/11/02 Dagstuhl Seminar p.9/65
Joint work with: Ana Bazzan, Rafael Jannone, Daniel Basso, Rosa Vicari (UFRGS) and Victor Lesser (UMass) Combining Logic-Based and Decision-Theoretic Agent Frameworks Practical (initial) contribution:
using decision-theoretic task scheduling (TÆMS/DTC) to improve intention selection in AgentSpeak(L)
Selection functions were taken for granted Greater expressiveness
applications where quantitative reasoning is natural control over an agent’s set of intentions
29/11/02 Dagstuhl Seminar p.11/65
29/11/02 Dagstuhl Seminar p.12/65
Run locally by the interpreter, do not affect the environment (i.e., they take effect immediately) Can be used in the context as well as in the body of a plan Side effects: if they appear in the context of a relevant plan, they are executed even if the plan is not applicable Separate libraries for different types of extensions Empty library name: access to the standard library (arithmetic and relational operators)
29/11/02 Dagstuhl Seminar p.13/65
Access to libraries of actions List of (generic) properties associated with each plan in the set of intentions (in a dynamic way) Interpreting illocutionary forces and updating the appropriate data structures Unification algorithm allows uninstantiated variables in negated literals Events with no applicable plans can be either discarded or suspended (select more than one at a cycle) External actions may fail
29/11/02 Dagstuhl Seminar p.14/65
The DTC scheduler produces alternative sequences of method (action) execution for a given TÆMS task structure
it attempts to satisfy the criteria (quality, duration, and cost), relationships and deadlines as much as possible
We create a TÆMS task structure where the methods are plan labels (intended means) Programmers can set specific values for the scheduling criteria, relationships and deadlines of each plan (using internal actions from a specific library) The schedules returned by DTC for the TÆMS t.s. representing
✠defines the order in which to select intentions
29/11/02 Dagstuhl Seminar p.15/65
29/11/02 Dagstuhl Seminar p.16/65
29/11/02 Dagstuhl Seminar p.18/65
29/11/02 Dagstuhl Seminar p.19/65
29/11/02 Dagstuhl Seminar p.20/65
Bratman’s Asymmetry Thesis basically says two things: it is irrational for an agent to intend to do an action and also believe that it will not do it (intention-belief inconsistency) it is rational for an agent to intend to do an action but not believe that it will do it (intention-belief incompleteness) Rao & Georgeff added: it is rational for an agent to believe that it can do an action without necessarily intending it (belief-intention incompleteness)
29/11/02 Dagstuhl Seminar p.21/65
Label Principle AT1
INTEND
✂☎✄ ✆ ✝✟✞BEL
✂ ✞ ✄ ✆AT2
✠INTEND
✂☎✄ ✆ ✝BEL
✂☎✄ ✆AT3
✠BEL
✂☎✄ ✆ ✝INTEND
✂☎✄ ✆AT4
INTEND
✂☎✄ ✆ ✝✟✞DES
✂ ✞ ✄ ✆AT5
✠INTEND
✂☎✄ ✆ ✝DES
✂ ✄ ✆AT6
✠DES
✂☎✄ ✆ ✝INTEND
✂ ✄ ✆AT7
DES
✂☎✄ ✆ ✝✟✞BEL
✂ ✞ ✄ ✆AT8
✠DES
✂☎✄ ✆ ✝BEL
✂☎✄ ✆AT9
✠BEL
✂☎✄ ✆ ✝DES
✂☎✄ ✆29/11/02 Dagstuhl Seminar p.22/65
Agent:
✁ ✂ ✂ ✄ ☎✝✆ ✞✆Circumstance
✟is a tuple
set of intentions
✍set of events
✎the set of actions
✏The semantic rules define a transition relation
refers to component
✠The intention with plan
✖is denoted by
☎ ✗ ✖ ✘29/11/02 Dagstuhl Seminar p.23/65
29/11/02 Dagstuhl Seminar p.24/65
Auxiliary function
✁is the domain of all individual intentions (a stack of partially instantiated plans) Returns all achievement goals in the triggering event part of the plans For any
☎ ✝ ✁:
T
✆ ✄ ✞✟if
✖ ✄ ✌ ✄29/11/02 Dagstuhl Seminar p.25/65
te
☞ ✁ ✍ ✂ ✌✆✟ ✁ ✝ ✆ ✟ ✁ ✡29/11/02 Dagstuhl Seminar p.26/65
29/11/02 Dagstuhl Seminar p.27/65
Proof. The proof consists in showing an instance of a program with
✄ ☎in the triggering event of a plan but not including
☎in the set of beliefs. An instance of that plan may become an intended means (i.e., to be included in
✟ ✔) so that INTEND
✆✞✝ ✟✞✠ ✡ ☛ ✄ ☎ ✆holds, yet there is no guarantee that
☎will be believed by the agent at that point. So in this case we have a situation of intention–belief incompleteness.
29/11/02 Dagstuhl Seminar p.28/65
The details of the proof are as follows. Consider an agent
✁ ✄, where
☎✝✆ ✄ ✞✟and
✞ ✆ ✄ ✞ ✌ ✖ ✄✁ ✆ ✂T
✎ ✄✄✂ ✄ ☎ ✆ ✂ ✌ ✄✄✂ ✄ ☎ ✆ ✂T
✎, at
✟✝✆(the initial circumstance). Suppose that, from perception of the environment, a belief
✖ ✄✁ ✆is added to the agent’s belief base (i.e.,
☎ ✞ ✄ ✞ ✖ ✄✁ ✆ ✟). This belief revision generates an event so that the agent’s circumstance now is
✟ ✄T
✆ ✟ ✂ ✞ ✟ ✂ ✞✟ ✂ ✂ ✂ ✆(i.e.,
✟✠✟ ✄ ✞T
✆ ✟). From the configuration
, the following sequence of semantic rules would apply: (i) SelEv, (ii) Rel
✡, (iii) Appl
✡, (iv) SelAppl, (v) ExtEv, (vi) IntSel, and (vii) Achieve. Working out the details of the rule applications, and assuming for simplicity (but without loss of generality) that no further belief revision took place, this leads to a configuration
,
, where
☎✝✆ ✓ ✄ ✞ ✖ ✄✁ ✆ ✟, and
✟ ✓ ✄T
✗ ✌ ✖ ✄✁ ✆ ✂T
✎ ✄✄✂ ✄ ☎ ✆ ✘ ✟ ✂ ✞✟ ✂ ✞✟ ✂ ✂ ✂ ✆. In other words, the agent now has in
✟ ✟an internal event with triggering event
✌ ✄✄✂ ✄ ☎ ✆, generated by the (intended) plan for handling
✌ ✖ ✄✁ ✆.
29/11/02 Dagstuhl Seminar p.29/65
From that point the following semantic rules can be applied: (viii) SelEv, (ix) Rel
✡, (x) Appl
✡, (xi) SelAppl, (xii) IntEv. This sequence of rule applications leads to a configuration where
✟✕✔ ✄ ✞ ✌ ✖ ✄✁ ✆ ✂T
✎ ✄✄✂ ✄ ☎ ✆ ✗ ✌ ✄ ✂ ✄ ☎ ✆ ✂T
✎. In such configuration, by Definition 2, we see that INTEND
✆✞✝ ✟ ✠ ✡ ☛ ✄ ✂ ✄ ☎ ✆ ✆is true. However, it is possible that no further belief revision took place, which means that
counterexample that AT2 (i.e., INTEND
✆✞✝ ✟ ✠ ✡ ☛ ✄ ☎ ✆ ✁BEL
✆✞✝ ✟✞✠ ✡ ☛ ✄ ☎ ✆) does not hold.
✂✄From the lemma above it follows immediately that AT1 does not hold for AgentSpeak(L). The following lemma corresponds to stating that AT3 does hold for AgentSpeak(L).
29/11/02 Dagstuhl Seminar p.30/65
Proof. Follows immediately from Corollaries 1, 2, and 3.
✂✄29/11/02 Dagstuhl Seminar p.31/65
Proof. Rao and Georgeff proved that those logics satisfy other combinations of the asymmetry thesis principles.
✂✄29/11/02 Dagstuhl Seminar p.32/65
29/11/02 Dagstuhl Seminar p.34/65
29/11/02 Dagstuhl Seminar p.35/65
29/11/02 Dagstuhl Seminar p.36/65
Let
✖ ✁be any valid Promela boolean expression,
label,
✁be a variable ranging over agent labels, and
and
AgentSpeak(F) atomic and action formulæ except with no variables
language is defined inductively as follows:
29/11/02 Dagstuhl Seminar p.37/65
1.
✖ ✁is a wff; 2.
is a wff; 3.
✄Bel
,
✄Des
, and
✄Int
are wff; 4.
and
✄ ✁✂✁ ✄ ✁are wff, where
✝ ✞Bel
✂Des
✂Int
✟and
✁ranges over a finite set of agent labels; 5.
✄Does
is a wff;
and
☎are wff, so are
✄,
✄ ☎ ✆ ☎ ✆,
✄ ☎ ✝ ☎ ✆,
✄ ☎ ✁ ☎ ✆,
✄ ☎ ✞ ☎ ✆, always
✄ ✟ ☎ ✆, eventually
✄ ✠ ☎ ✆, until
✄ ☎ ✡ ☎ ✆, and “release”, the dual of until
✄ ☎ ☛ ☎ ✆;
29/11/02 Dagstuhl Seminar p.38/65
29/11/02 Dagstuhl Seminar p.40/65
29/11/02 Dagstuhl Seminar p.41/65
29/11/02 Dagstuhl Seminar p.42/65
Translating to Java rather than Promela (then using JPF2) Comparing the performance of Spin and JPF2 (in model checking AgentSpeak(F)) More realistic applications (autonomous spacecraft control)
29/11/02 Dagstuhl Seminar p.43/65
29/11/02 Dagstuhl Seminar p.45/65
29/11/02 Dagstuhl Seminar p.46/65
29/11/02 Dagstuhl Seminar p.47/65
The first component in the head of a plan is a triggering event:
☛✁ ✂ ✂ ✄ ✌If
✖is a plan of the form
☛, we define TrEv
✄ ✖ ✆ ✄ ☛✁and Ctxt
✄ ✖ ✆ ✄ ✍ ☛, which retrieve the triggering event and the context of the plan, respectively. AgentSpeak(L) Selection Functions:
✄ ✟ ✂event selection function
✄✆☎ ✝ ✂applicable plan sel. function
✄ ✔ ✂intention selection function
29/11/02 Dagstuhl Seminar p.48/65
29/11/02 Dagstuhl Seminar p.49/65
set of intentions,
✝set of events,
✡set of actions to be performed in the environment,
✠set of relevant plans,
✡ ✞set of applicable plans,
☛intention being considered,
☞plan being considered,
✌event being considered.
29/11/02 Dagstuhl Seminar p.50/65
29/11/02 Dagstuhl Seminar p.51/65
29/11/02 Dagstuhl Seminar p.52/65
29/11/02 Dagstuhl Seminar p.53/65
SelEv
✄ ✟ ✄ ✟ ✟ ✆ ✄where:
✟ ✓ ✟ ✄ ✟ ✟ ✑29/11/02 Dagstuhl Seminar p.54/65
Rel
✡RelPlans
✄ ✞ ✆ ✂ ☛✁ ✆where:
✟ ✓ ✄ ✄RelPlans
✄ ✞ ✆ ✂ ☛Rel
✁RelPlans
✄ ✞ ✆ ✂ ☛✁ ✆ ✄ ✞✟where:
✟ ✓ ✁ ✄29/11/02 Dagstuhl Seminar p.55/65
Appl
✡AppPlans
✄ ☎ ✆ ✂ ✟ ✄ ✆where:
✟ ✓ ✄ ✄ ✞ ✟ ✟ ✓ ☎ ✝ ✄AppPlans
✄ ☎✝✆ ✂ ✟ ✄ ✆Appl
✁AppPlans
✄ ☎ ✆ ✂ ✟ ✄ ✆ ✄ ✞✟where:
✟ ✓ ✄ ✄ ✞✟ ✟ ✓ ✁ ✄ ✟ ✓ ✟ ✄ ✟ ✟ ☞29/11/02 Dagstuhl Seminar p.56/65
SelAppl
✄ ☎ ✝ ✄ ✟ ☎ ✝ ✆ ✄ ✖where:
✟ ✓29/11/02 Dagstuhl Seminar p.57/65
ExtEv
T
✆ ✂ ✟where:
✟ ✓ ✔ ✄ ✟✕✔ ☞ ✞ ✗ ✖ ✘ ✟ ✟ ✓ ✁ ✄ ✟ ✓IntEv
where:
✟ ✓ ✔ ✄ ✟✕✔ ☞ ✞ ☎ ✗ ✖ ✘ ✟ ✟ ✓ ✁ ✄ ✟ ✓29/11/02 Dagstuhl Seminar p.58/65
IntSel
29/11/02 Dagstuhl Seminar p.59/65
Action
✄29/11/02 Dagstuhl Seminar p.60/65
Achieve
✄ ✁ ☎ ✞ ✞ ✄ ✁ ☎29/11/02 Dagstuhl Seminar p.61/65
Test
✡Test
✄ ☎✝✆ ✂where:
✟ ✓Test
✁Test
✄ ☎✝✆ ✂where:
✟ ✓Test
✄ ☎✝✆ ✂29/11/02 Dagstuhl Seminar p.62/65
AddBel
✄ ✁ ☎ ✞ ✞ ✄ ✁29/11/02 Dagstuhl Seminar p.63/65
DelBel
✄29/11/02 Dagstuhl Seminar p.64/65
ClrInt
✡where:
✟ ✓ClrInt
✁where:
✟ ✓29/11/02 Dagstuhl Seminar p.65/65