ACRE Protocols are represented by Finite State Machines (FSMs). A protocol is a definition of how a valid interaction is expected to occur. A conversation refers to a single instance of two agents engaging in some interaction that follows a defined protocol. Thus, two conversations following the same protocol may involve different agents and/or different messages being exchanged.
Each protocol consists of a number of states, which are given names. At any point in time, a conversation will be in one of the states defined in the protocol definition. A protocol must have one start state, which a conversation is considered to be in if no messages have yet been transmitted. An end state is one where no more messages may be exchanged, according to the protocol. Upon reaching an end state, a conversation is finished. A protocol may define multiple states as being end states, for a variety of reasons.
In order to move a conversation between states, transitions are also defined. A transition is triggered whenever a message is transmitted between the participating agents that matches the definition of the transition as defined in the protocol. Each transition definition includes a number of requirements, all of which must be satisfied in order for it to be triggered:
- From State
- This is the name of the state from which this transition may be triggered. If the conversation is not in this state when a message is sent/received, this transition cannot be triggered.
- To State
- This is the name of the state in which the conversation will be if this transition is successfully triggered.
- This describes the agent that must send the message, in order for this transition to be triggered. Typically, this is a named variable, so that roles can be assigned to agents for the duration of a conversation. For example, if a transition is triggered that contains ?initiator as the sender, then the actual name of the agent sending the message is bound to the ?initiator variable for the duration of the conversation. For subsequent communications within the same conversation, only the agent that initially sent that message may send or receive a message that is to be sent or received by the ?initiator agent.
- This operates in the same way as for the Sender field, with the difference being that it describes the agent that is to receive the message.
- This is the performative of the message that is to trigger the transition. This should be a performative that follows the FIPA standards outlined in the FIPA Communicative Act Library Specification
- This describes the content that the message must contain in order to trigger the transition. Only content that matches against this description may trigger a transition. The matching of content is described below.
When a conversation is ongoing, as well as recording the name of the state it is currently in, any values that have previously been given to variables are also recorded. Initially, all variables used in the protocol definition do not have any values bound to them: this occurs as messages are matched against transition definitions to advance the conversation.
When message fields (sender, receiver, content) are examined to see if they can trigger a transition, this occurs in two phases: matching and binding.