(Imperative and) Declarative
Programming Languages for
João Alexandre Leite
CENTRIA - New University of Lisbon
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005
Declarative vs Imperative
► Declarative description Imperative implementation
A grandchild to x is a child of one read(person);
of x’s children.
for i := 1 to maxp do
if p[i;1] = person then
► Imperative description I
To find a grandchild of x, first find for j := 1 to maxp do
a child of x. Then find a child of if p[j;1] = p[i;2] then
that child. write(p[j;2]);
► Imperative description II
To find a grandchild of x, first find
a parent-child pair and then od
check if the parent is a child of x. fi
► Imperative description III od
To find a grandchild of x,
compute the factorial of 123, then
find a child of x. Then find a child Declarative implementation
of that child. gc(X,Z) :- c(X,Y), c(Y,Z).
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 2
Declarative vs Imperative
Describe HOW to Describe WHAT the
solve the problem problem is
A sequence of
Program A set of statements
C, Fortran, Ada, PROLOG, LISP, OZ
JAVA HASKELL, ASP
Fast, Specialized General, Readable,
programs Correct (?) programs
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 3
Logic Based MAS
► ConGolog [De Giacomo et al.] ► FLUX [Thielscher et al.]
► 3APL [Dastani et al.] ► JASON [Bordini et al.]
► IMPACT [Subrahmanian et al.] ► DALI [Costantini et al.]
► Conc. MetateM [Fisher et al.] ► KARO [van Linder et al.]
► AgentSpeak(L) [Rao et al.] ► PROSOCS [Stathis et al.]
► DyLog [Baldoni et al.] ► MINERVA [Leite et al.]
► hhf [Delzanno et al.] ► ALIAS [Ciampolini et al.]
► AGENT 0 [Shoham] ► ...
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 4
CLIMA & DALT
► Constantly increasing number of submitted papers (35
papers each in last editions)
► Covering most topics seen in current MAS research:
Protocols Social Norms
Learning Architectures and Environments
Cooperation Belief Revision and Update
Communication Programming Languages
Verification Software Engineering
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 5
How are these systems implemented?
PROLOG Common LISP
► ConGolog ► AGENT 0
► Conc. MetateM JAVA
► DyLog ► IMPACT
► hhf ► JASON
► DALI JAVA & PROLOG
► MINERVA ► 3APL
► ALIAS ► PROSOCS
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 6
► On the opportunities MAS provides to DLs...
The high (and increasing) complexity of MAS calls for
Declarative Languages are guilty until proven innocent!!
► On speed of DLs...
Drop the “it’s only for prototyping” excuse
Tackle “proper” implementations
Work together with major DL implementation groups
► On ease of programming DLs and training costs...
Train students at undergraduate level
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 7
► Generic DLs (not developed ad-hoc for MAS
development) such as PROLOG, Oz, Haskell,
Scheme, ... could be used to develop such
systems, but is it really more helpful?
► Pure declarative implementations or hybrid?
► How can DLs be used together with imperative
► How can DLs facilitate the MAS development?
► It seems that DLs can be applied to define the
high-level behavior of an agent. Where else?
PROMAS@AL3-TF2 Ljubljana, March 1st, 2005 8