# Programming Agents by Their Social Relationships: A Commitment-Based Approach
## 3 Social Relationships as Commitments
An agent will create engagements towards other agents in an attempt to achieve its goals. Moreover, since commitments concern the observ  
Figure 1: Commitment life cycle [32]. agents, they acquire a regulative value: debtors are expected to satisfy their engagements in order to avoid a norm violation. More concretely, commitments foster cooperation between agents. On the one hand, debtors are expected to behave so as to satisfy their detached commitments. On the other hand, a creditor in a commitment that is interested in its consequent condition, will act so as to bring about the antecedent condition, thus detaching the very same commitment, and by this very act claim, the consequent achievement. In this sense, commitments allow realizing a _relational representation of interaction_, where agents, by their own actions, directly create (normative) binds with others and use them to coordinate their activities. Commitment-based approaches generally assume a _social state_ to be available and inspectable by all the agents involved in an interaction. Such a social state is composed of all the commitments created during an interaction together with their states, according to the life-cycle described above. By relying on the social state, an agent can deliberate to create further commitments or to bring about a condition involved in some existing one. By means of commitments, thus, social relationships become first-class entities that are created and manipulated by the agents as resources, made available in their environment. It is, therefore, necessary to provide the agents the means to create, manipulate, observe, monitor, reason, and deliberate upon these social relationships. To this end, we rely on the well-known agents and artifacts meta-model [11; 12]. Following this perspective, an artifact is a computational, programmable system resource that can be observed and manipulated by agents, residing at the same abstraction level. Artifacts are typically used to model the environment in which agents are situated and on which they act. Furthermore, for their very nature, artifacts can encode a programmable and observable middleware that can be used as a means of communication and coordination between agents. We propose to define _dedicated commitment artifacts_, embodied in the environment in which agents are situated, to reify the sets of _social relationships_ that can be created during an interaction, available to agents as resources. Agents can then use these artifacts to coordinate and interact in a way that depends on their objectives and on the binds created with other agents. We interpret the usage of an artifact by an agent as the explicit acceptance of the implications of the social commitment the artifact reifies. This allows the interacting parties to perform _practical reasoning_, based on social expectations: a debtor of a commitment is expected to behave so as to satisfy the consequent commitment conditions; otherwise, a violation will be raised. Similarly, an agent could create a commitment to foster another agent to bring about a condition otherwise unachievable. **Example 1**. : **A Logistics Scenario**  
We present a use case inspired by a logistic scenario to show how commitments can be used in practice to support the interaction between agents. Let us consider a setting in which a _seller_ agent sells its products online and ships them to a _customer_ agent. In our scenario, sketched in Figure 2, the two agents, _seller_ and _customer_, are geographically far from each other, so they need to rely on multiple couriers for the shipment of the goods from their original location \(A\) to their destination \(D\). The route is divided into three parts. The first portion, from \(A\) to \(B\), is covered by two different trucks _trk1_ and _trk2_. The second portion, from \(B\) to \(C\), instead, is covered only by a plane \(pln1\). Finally, the last portion, from \(C\) to \(D\), is served again by two trucks _trk3_ and _trk4_.