CLAIM : CLAIM : A Computational Language for A Computational Language for
Autonomous, Intelligent and Mobile agentsAutonomous, Intelligent and Mobile agents
Amal EL FALLAH-SEGHROUCHNI Alexandru SUNA
University of Paris 6University of Paris 6 University of Paris 9University of Paris 9
MotivationsMotivations Think and implement in the same
paradigm: agent
Meet the requirements of:– distribution– migration
Talk OutlineTalk Outline Programming distributed MAS
– Agent Oriented Languages– Ambient Calculus
CLAIM specifications– Agents– Agent’s Reasoning– Example
Implementation aspects– SyMPA– Mobility Protocol– Mobility Completeness
CLAIM Expressiveness Conclusion and perspectives
Agent Oriented LanguagesAgent Oriented Languages (1) (1)
1993, Y.Shoham agent oriented programming
Agents’ characteristics:Agents’ characteristics:
mentalmental state:• beliefs• goals (AgentSpeak, VIVA, 3APL, dMars)• obligations (Agent-0, Agent-K, PLACA)
reasoning mechanismsreasoning mechanisms
capabilities/servicescapabilities/servicesAgent-0, Agent-K, PLACA, AgentSpeak
languages : Agent-0, Agent-K, PLACA, AgentSpeak, VIVA, 3APL, dMars
planning:planning: PLACA, AgentSpeak, 3APL, dMars
communication:communication:
• agent reasoning, without communication :3APL, dMars
• message passing: Agent-0, Agent-K, PLACA, AgentSpeak,VIVA
concurrency:concurrency: AgentSpeak, 3APL, dMars
mobility:mobility: none
Agent Oriented Languages Agent Oriented Languages (2)(2)
Agents’ characteristics:Agents’ characteristics:
Ambient Calculus Ambient Calculus [Cardelli and Gordon, 98][Cardelli and Gordon, 98]
• Interest : improve the modeling of agents' mobilityAmbient :Ambient : • a bounded place
• a name, set of processes and sub-ambients
P,Q ::= processes M[P] ambient (n)P restriction 0 inactivity P | Q composition !P replication M.P capability action (x).P input action M output action
M ::= capabilities x variable n name in n enter into n out n exit out of n open n open n acid open from inside
mv in n move in n mv out n move out of n
+ Reduction rules+ Reduction rules
Ambient Calculus Ambient Calculus [Cardelli and Gordon, 98][Cardelli and Gordon, 98]
Reduction rules:
enter action: enter action: n[in m.P | Q] | m[R] m[n[P | Q] | R ]
exit action:exit action: m[n[out m.P | Q] | R] n[P | Q] | m[R]
replicationreplication: : !P !P | P
open action: open action: open n.P | n[Q] P | Q
other rules:other rules:mv in n.P | n[Q] n[ P | Q ] n[mv out n.P | Q ] P | n[Q]n[acid.P | Q ] P | Q
Communication: Communication: (x).P | M P { xM }
Our CLAIMOur CLAIM
An agent oriented programming language that homogeneously combines:
Intelligence, Autonomy and Mobility
Cognition, Interaction and Concurrence
Agent Languages Concurrent Languages
• goals• knowledge• capabilities• reasoning
• communication primitives
• mobility primitives
Agent DescriptionAgent Description
defineAgent agentName {parent = null | agentName ;knowledge = null | { knowledge;*} ;goals = null | { goal ;* } ;messages = null | { message ;* } ;capabilities = null | { capability ;* } ;processes = null | { process | * } ;agents = null | { agentName ;* } ;
}
defineAgentClass className { ... }newAgent agentName ( className )
Agent’s ComponentsAgent’s Components
knowledgeknowledge
knowledge = agentName (capabilityS,message,effect ) | proposition
goalsgoals
goal = proposition
parentparent
hierarchical structure ; Ambient-Calculus like
VariablesVariablesvariable : variable : ?x , where x could be: • agentName
• capabilitySignature• message• goal• effect
Examples:
forAllKnowledge(?Ag(cap1,?mess,?effect)) { process(?Ag) }
?Ag - all the agents in the knowledge base that have the capacity cap1
forAllAgents(?Ag : className) { process(?Ag) } ?Ag - all the sub-agents of the current agent that belong to the class className
Agents’ CommunicationAgents’ Communicationsend ( receiver, message [, c, [t] ] )
receiver:receiver: • agentName• ?Ag• all (broadcast )• this• ?Ag:className (multicast)
message:message:• proposition• messages concerning the knowledge
tell ( knowledge )askAllCapabilities ( agentName, agentName )askIfCapabiliy ( agentName,agentName,capabilityS )achieveCapability ( agentName,agentName,capabilityS )removeCapability (agentName, capabilityS )
• mobility messages
Messages concerning knowledgeMessages concerning knowledge
A.send(B,tell(knowledge))
the knowledge is added in the knowledge base
A.send(B,askAllCapabilities(A,B))
B.send(A,tell(B(capabilityS,message,effect )))
A.send(B,askIfCapabiliy(A,B,capabilityS))
B.send(A,tell(B(capabilityS,message,effect )))
A.send(B,achieveCapabiliy(A,B,capabilityS))
the capability is performed
A.send(B,removeCapability(A,capabilityS))
the knowledge about this capability is removed
Mobility messagesMobility messagesopenBy(Ag)
- ask open permission
openOK(Ag) ; openNotOK(Ag)- the agent Ag accepts / doesn’t accept to be open
wantOut(Ag)- ask exit permission
outOK(Ag) ; outNotOK(Ag) - the agent Ag gives / doesn’t give the permission
wantIn(Ag)- ask enter permission
inOK(Ag) ; inNotOK(Ag)- the agent Ag gives / doesn’t give the permission
Add permissions to
ambient-calculus primitives
CapabilitiesCapabilitiescapabilities :capabilities :
capability = capabilitySignature { message = null | message ; conditions = null | condition ; do { process }; effects = null | { proposition ;*}
}
condition = function(args*) | agentName.effect | ( condition ) | not condition | condition and condition | condition or condition
ProcessesProcesses
P ::= P.PpropositioninstructionfunctionName([arguments*])newAgent agentName( agentClass )in ( arg,agentName )out ( arg,agentName )moveTo( arg,agentName )open ( agentName )acidsend ( receiver, message [,c [,t]] )
processes :processes :forAllKnowledge (knowledge){ P }
forAllAgents (agentName){ P }
arg = this | clone | process
Agent’s ReasoningAgent’s Reasoning
Forward reasoning::
• choose a messages from the queue of messages• find the capabilities that have this activation message • verify the conditions of the chosen capabilities• execute the corresponding processes
Backward reasoning:
• choose a goal form the goal list• find the capabilities that allow to achieve the goal• verify the conditions of the chosen capabilities update the goals, ask for capabilities• execute the corresponding processes
ExampleExamplee-commerce
Company agent
• knows the names of some Buyer agents• can create Seller agents
Seller agent class
• can migrate• can negotiate with Buyer agents
Buyer agent class
• can negotiate with Seller agents
two solutionsforward reasoning
backward reasoning
Agent definitions Agent definitions (forward - 1)(forward - 1)
defineAgent Company { parent=null ; knowledge= { B1(Buy,buy(),null); B2(Buy,buy(),null); } goals=null; messages=null ; capabilities={
sendSeller { message=sendSeller() ; condition=null; do { newAgent S1(Seller).forAllKnowledge(?Ag(Buy,?mess?eff)) { send(S1,tell(?Ag(Buy,?mess,?eff))) }. send(S1,go()) } effects=null;}useData { message=arriveSeller(?Ag); condition=null; do { computeData() } effects=null;}
} processes= send(this,sendSeller()); agents=null ;}
Agent definitions Agent definitions (forward - 2)(forward - 2)defineAgentClass Seller {
parent=null ;knowledge= null;goals=null;messages=null ;capabilities={
goToBuyer {message=go();condition=null;do { forAllKnowledge(?B(Buy,mess,?eff)){
moveTo(this,?B).negotiate(?B) }.send(this,goToCompany()) }
effects=null;}goToCompany {
message = goToCompany() ; condition=null;do { moveTo(this,Company).send(Company,arriveSeller(this)) }effects=null;
}}processes= null ;agents=null ;
}
Run steps Run steps (forward)(forward)
CompanyCompany S1 : SellerS1 : Seller
send(this,sendSeller)
find capabilities
execute capability
sendSeller()
verify conditions:OK
find, verify, execute goToBuyer()
send(this,goToCompany())
find, verify, execute goToCompany
send(Company,arriveSeller(S1))
Find, verify, execute useData()
send(S1,go())
Agent definitions Agent definitions (backward - 1)(backward - 1)
defineAgent Company { parent=null ; knowledge= null; goals=haveData(); messages=null ; capabilities={
useData { message=arriveSeller(?Ag); condition= ?Ag:Seller.arriveToCompany(); do { computeData(); } effects=haveData();}
} processes= null; agents= { S1; }}
Agent definitions Agent definitions (backward - 2)(backward - 2)
defineAgentClass Seller {parent=Company ;knowledge={ B1(Buy,buy(),null); B2(Buy,buy(),null); }goals=null;messages=null ;capabilities={
goToBuyer {message=go(); condition=null;do { forAllKnowledge(?B(Buy,mess,?eff)){
moveTo(this,?B).negotiate(?B) }.send(this,goToCompany()) }
effects=endNegotiation();}goToCompany {
message = goToCompany() ; condition=this.endNegotiation();do { moveTo(this,Company).send(Company,arriveSeller(this)) }
effects=arriveToCompany();}
}processes= null ;agents=null ;
}
Run steps Run steps (backward)(backward)
CompanyCompany
find capabilities
useData(), effect=haveData()
verify conditions
goal=haveData()
?Ag:Seller.arriveToCompany()
S1 : SellerS1 : Seller
find capabilities
goHome(), effect=arriveHome()
verify conditions
this.endNegotiation()
find capabilities
verify conditions:null
execute capability
goToBuyer(), effect=endNegotiation()
SyMPA ArchitectureSyMPA Architecture(MASIF compliant)(MASIF compliant)
Agent System
Agent
Agent …
I/O
I/O
I/O
Agent System
Agent
Agent …
I/O
I/O
I/O
Central System
I/O
Agent System LevelAgent System Level
Interface + Editor
PSystemDefinitions Base
MASStructure
Interpret
Create agents
PAgent PAgent. . .
Agent LevelAgent Level
PAgent
agentfile
name.agd
Interface
waitmessages
runprocesses
verifygoals
selectcapabilities
selectcapabilities
visualisemodify
update update
Mobility ProtocolMobility Protocol
Agent A
in(this,B)
PSystem A
Agent B
PSystem B
Central System
getAgentIP(B)IP,port(System(B))
wantToSend(B)
IP,port(B)
wantIn(this,A)
inOK(this,B)
Save agent’s state
inAgent(A,B,agent) Restore agent
Update SMA
Update SMA
Verify authority
Mobility CompletenessMobility Completenessalgorithm MobilityOperationInput : agent, SMA
while (not SMA.structureCondition()) do wait(t1)if (SMA.structureCondition()) then
agent.saveState()agent.suspendAllProcesses()agent.askPermission()while (not agent.receivePermission() ) do wait(t2)if (agent.receivePermission()) then
SMA.update()while (not SMA.endUpdating()) do wait(t3)agent.restoreState()agent.resumeAllProcesses()
end ifelse
agent.removeProcess(this)agent.restoreState()agent.resumeAllProcesses()
end elseend if
Agents Definitions Agents Definitions (FIPA - 1)(FIPA - 1)
defineAgent Initiator {parent=null ;knowledge= null;goals=null;messages=null ;capabilities={ calForProposals {
message=callForProposals();condition=null;do { send(?Ag:Participant,cfp(this) ) }effects=null;
} rejectProposal {
message= propsose(?PAg);condition= reject() ;do { send(?PAg,rejectProposal(this)) }effects=null;
}
acceptProposal {message= propsose(?PAg) ;condition= accept() ;do { send(?PAg,acceptProposal(this)) }effects=null;
}}processes= send(this,callForProposals()) ;agents=null ;
}
Agents Definitions Agents Definitions (FIPA - 2)(FIPA - 2)
Agents Definitions Agents Definitions (FIPA - 3)(FIPA - 3)
defineAgentClass Participant {parent=null ;knowledge= null;goals=null;messages=null ;capabilities={ refuzeCFP {
message=cfp(?IAg) ;condition=notAccept();do { send(?IAg,refuse(this) ) }effects=null;
} notUnderstood {
message= cfp(?IAg); condition=notUnderstood() ;do { send(?IAg,notUnderstood(this) )}effects=null;
} acceptCFP {
message=cfp(?IAg); condition=accept();do { send(?IAg,propose(this) ) }effects=null;
}
Agents Definitions Agents Definitions (FIPA - 4)(FIPA - 4)
failure {message = acceptProposal(?IAg) ;
condition=failure();do { send(?IAg,failure(this) ) }effects=null;
} done {
message = acceptProposal(?IAg) ;condition=done();do { send(?IAg,informDone(this) ) }effects=null;
} ref {
message = acceptProposal(?IAg) ;condition=ref();do { send(?IAg,informRef(this) ) }effects=null;
}}processes= null ;agents=null ;
}
Conclusion: Main ContributionConclusion: Main ContributionCLAIM languageCLAIM language
• Goals, Knowledge, capacities• Backward reasoning: reactive behavior• Forward reasoning : goal driven behavior
• Communication primitives • Mobility primitives
SyMPA systemSyMPA system
• Easy design of distributed MAS • editing agents, interpret, agent interface
• Suitable platform for implementation• management, creation, execution, authentication, migration of agents• protocols for communication and mobility
Expressiveness
Completeness
PerspectivesPerspectives
Define an operational semantics of CLAIMDefine an operational semantics of CLAIM Enrich the languageEnrich the language
– add security primitives and data types
Extend de language possibilities
– develop libraries of agents
– endow agents with learning capacities
Improve SYMPA
– call functions/subroutines defined in other languages
– offer several mechanisms for the management of agents and agent systems
References References • Luca Cardelli, "Abstractions for Mobile Computation", in Secure Internet Programming: Security Issues for Mobile and Distributed Objects. Lecture Notes in Computer Science, Vol. 1603, Springer, pp. 51-94, 1999.
• Luca Cardelli, "Mobile Ambients Synchronisation", SRC Technical Note, 1997.
• Luca Cardelli, A.D. Gordon, "Mobile Ambients", in Foundations of Software Science and Computational Structures, Maurice Nivat (Ed.), Lecture Notes in Computer Science, Vol. 1378, Springer, pp. 140-155, 1998
• Winton H E Davies, Peter Edwards, "Agent-K: An Integration of AOP and KQLM", 1994.
• K.V.Hindriks, F.S.deBoer, W.van der Hoek, J.J.Ch.Meyer, "Agent Programming in 3APL", 1999
•M. d'Inverno, D. Kinny, M. Luck, M. Wooldridge, "A Formal Specification of dMARS", 1998.
• D. Milojicic, M. Breugst, I. Busse, J. Campbell, S. Covaci, B. Friedman, K. Kosaka, D. Lange, K. Ono, M. Oshima, C. Tham, S. Virdhagriswaran, J. White, "MASIF, The OMG Mobile Agent System Interoperability Facility", 1998.
• David Parks, "Agent-Oriented Programming: A Practical Evaluation", 1997.
• Yoav Shoham, "Agent Oriented Programming", Artificial Intelligence (60), pp.51-92, 1993.
• Christian F. Tschudin, "Mobile Agent Security", in Intelligent Information Agents - Agent based information discovery and management on the Internet, Springer, pp. 431-445, 1999.
• Gerd Wagner, "VIVA Knowledge-Based Agent Programming", 1996.
• D.Weerasooriya, Anand S. Rao, K. Ramamohanarao, "Design of a Concurrent Agent-Oriented Language", 1994.
References References