Title: Concurrent Programming for DAI
1Concurrent Programming for DAI
- Gul A. Agha Needem Jamali
2Concurrent Programming
- Concurrent programming introduces many
challenges - A key challenge is the difficulty of programming
parallel and distributed architectures - Some models are very low-level (shared variables
model). - One approach would be to use concurrent objects
in a reflective architecture. - Using agent programming is such an architecture.
3Patterns of Concurrent Problem Solving.
- Three common Patterns
- Pipelined Concurrency
- Enumeration of potential solutions and the
concurrent testing of these solutions. - Divide and Conquer
- Concurrent elaboration of different sub problems
and joining the solutions. - No interaction between the procedures.
- Cooperative problem solving.
- Processes dynamically interact in order to solve
the problem.
4Agent Programming Paradigms
- A few agent programming languages
- Agent Oriented Programming (AOP).
- Concurrent MetateM.
- Telescript.
- Actors.
- I will present all four, with a focus on Actors.
5Agent Programming Paradigms
- A few agent programming languages
- Agent Oriented Programming (AOP).
- Introduction to Multiagent Systems (Wooldridge).
- An Overview of Agent Oriented Programming
(Shoham). - Concurrent MetateM.
- Telescript.
- Actors.
6Agent Oriented Programming (AOP)
- Due to Yoav Shoham (Stanford).
- Based on cognitive and societal view of
computation. - An agent is an entity that functions continuously
and autonomously in an environment in which other
agents exist. - An agents state is viewed as consisting of
mental components such as beliefs, capabilities,
choices, commitments and desires. - Agenthood is in the mind of the programmer.
- What makes a system - an agent, is the fact that
one has chosen to analyze and control it in these
mental terms.
7Agent Oriented Programming AGENT0
- Shoham has developed a basic programming
language to support AOP AGENT0. - An agent is specified in terms of four sets
- Capabilities (Things the agent can do).
- Initial beliefs (Things the agent
knows/believes). - Initial Commitments.
- Commitment rules.
8Agent Oriented Programming AGENT0 - 2
- The component which determines how the agent acts
is the commitment-rules set. - A commitment rule consists of three components
- A message condition.
- A mental condition.
- An action.
- The rule fires if the agent received a message
that matches the message condition, and the
agents beliefs match the mental condition. - The agent than becomes committed to the action.
9Agent Oriented Programming AGENT0 - 3
- An action may be private (sends no message), or
communicative(sends messages). - Messages are constrained to three type
- Request.
- Unrequest.
- Inform.
10Agent Oriented Programming AGENT0 Example
- A commitment rule example
- COMMIT(
- ( agent, REQUEST, DO(time, action)
- ), msg condition
- ( B,
- now, Friend agent AND
- CAN(self, action) AND
- NOT time, CMT(self, anyaction)
- ), mental condition
- self,
- DO(time, action) )
11Agent Oriented Programming AGENT0 Main Loop
- Read all current messages, update beliefs, and
hence commitments when necessary. - Execute all commitments for the current cycle
where the capability condition of the associated
action is satisfied. - Goto (1).
12AOP - Properties of the Agents Components
- The programmer may assume several properties of
the agents components - Internal consistency.
- Good faith.
- Introspection.
- Persistence of mental state.
13Agent Programming Paradigms
- A few agent programming languages
- Agent Oriented Programming (AOP).
- Concurrent MetateM.
- Introduction to Multiagent Systems (Wooldridge).
- Telescript.
- Actors.
14Concurrent MetateM
- Due to Michael Fisher.
- Based on the direct execution of logical
formulae. - An agent is programmed by giving it a temporal
logic specification of the behavior it should
exhibit.
15Concurrent MetateM - Execution
- Agents execution
- Iteratively build a logical model for the
temporal agents specification. - It is possible to prove that the procedure used
to execute an agent specification is correct. - If it is possible to satisfy the specification,
then the agent will do so.
16Concurrent MetateM Agent Structure
- Communication through broadcast message passing.
- An agent has two main components
- An interface
- Computational engine
17Concurrent MetateM Agent Structure - Interface
- The interface consists of three components
- Unique Agent ID.
- Environment propositions.
- Component propositions.
- Example Stack(pop, push)popped, full.
Agent ID
Component propositions
Environment propositions
18Concurrent MetateM Agent Structure - Engine
- An agent specification is given as a set of
program rules, which are temporal logic of the
formulae of the form - antecedent about the past
- ? consequent about present and future.
- The name of the paradigm Declarative past and
imperative future.
19Concurrent MetateM Syntax
- PML Propositional MetateM Logic.
20Concurrent MetateM Syntax Example