Keywords

1 Introduction

Open multi-agent systems (MAS) are societies in which autonomous, heterogeneous and independently designed agents can work towards similar or different ends [14]. In order to cope with the heterogeneity, autonomy and diversity of interests among the different members, norms have been used. In the scope of Sociology, norms are rules that a society or a group use to define appropriate and inappropriate values, beliefs, attitudes and behaviors [2]. In MAS, norms are being used to regulate the behavior of the agents by describing the actions that can be performed (permissions), actions that must be performed (obligations), and actions that cannot be performed (prohibitions). They represent a way for agents to understand their responsibilities and the responsibilities of the others.

One of the major challenges on the specification of norms is the identification of normative conflicts. Although there are several works that have proposed solutions for the checking of conflicts, the majority focus on the identification of simple conflicts that occurs when a given action is simultaneously prohibited and obliged (or permitted) for a particular entity. Those approaches are not able, for instance, to check for conflicts between two norms that regulate different, but related actions, and that govern the behavior of different, but related entities. In order to be able to identify those set of conflicts it is necessary to understand the application domain, i.e., it is important to figure out how the elements that compose a norm (for instance, the actions being regulated and the entities whose behavior is being regulated) are related to each other.

In this context, this paper presents an approach for checking the conflicts between norms that is based on the description of the elements and the relationships among the elements of the application. By using such description it is possible to figure out how the elements that constitute two norms are related and consider such information when checking for conflicts. The conflict checker is then able to identify conflicts between norms even though the elements identified in the norms are not the same.

This paper is organized as follows. In Sect. 2 we state the definition of norm being used in this paper. In Sect. 3 we describe the relationships to relate the elements that compose norms. Together with such relationships we describe a set of rules to be followed when checking for conflicts between the norms by taking into account how the entities are related. In Sect. 4 we detail how a norm that regulates the execution of an action influences on the execution of related actions by taking into account the deontic concept applied to the norm. Section 5 describes a motivational example and the Java program that implements the proposed conflict checker. Section 6 presents some related work and, finally, Sect. 7 states some conclusions and future work.

2 Norm Definition

In this section we introduce a simplified specification of norms by following our previous work on the normative modeling language NormML [4]. We consider that a norm prohibits or obliges an entity to execute an action in a given context during a certain period of time. We also assume that everything is permitted unless a prohibition is described. Therefore, we do not consider norms stating permission. Besides, we assume that agents (and organizations) play roles in organization and inhabit environment. Such relationships are defined in Sect. 3.

Several normative specifications, modeling languages, methodologies and organizational models define norm in similar ways. In all of them, a norm is always associated with a deontic concept, an entity and an action (or state) that is being regulated. In Definitions 1, 3 and 4 we present the definition of norm, entity and action.

Definition 1: (Norm) A norm n is a tuple of the form {deoC, c, e, a, ac, dc, s}, where deoC is a deontic concept from the set {obligation or prohibition}, c \( \in \) C is the context (among a set of contexts) where the norm is defined, e \( \in \) E is the entity whose behavior is being regulated, a \( \in \) A is the action (from a set of actions) being regulated, ac \( \in \) Cd indicates the condition (from a set of conditions) that activates the norm, dc \( \in \) Cd is the condition that deactivates the norm and s indicates the state of the norm from the set {fulfilled, violated, none}. None indicates that the norm has not been fulfilled or violated yet.

The context of a norm indicates the scope where the norm is defined. A norm must be fulfilled only when the entity is executing in such context. Outside its context, the norm is not valid. Almost all approaches consider that a norm is defined in the context of an organization. Some of them consider that a context can be an interaction or a scene, for example.

Definition 2: (Context) A context c is a tuple of the form {name, cType} where name is the name of the context and cType is the type of the context from the set {organization, environment, none}. A norm can be defined in the scope of an organization or an environment. When a norm applies to an organization, the entity must only comply with the norm when it is executing in the scope of such organization. When a norm applies to an environment, the entity must only comply with the norm when it is executing in the context of such environment. If a norm does not specify the context, we consider that the norm applies to all contexts. In such case, the attribute name is not specified.

In this paper we consider that a norm can be defined to regulate the behavior of an agent itself, a role, an organization or all agents in a given context.

Definition 3: (Entity) An entity e is a tuple of the form {name, eType}, where name is the name of the entity and eType is the type of the entity from the set {agent, role, organization, all}. If a norm applies to all, it applies to all agents executing in a given context. In such case, the attribute name is not specified.

Definition 4: (Action) An action is a tuple of the form {name, setStates}, where name is the name of the action and setStates is the set of states that the action achieves when it is executed.

A norm restricts the execution of an action after the activation condition is fired and before the deactivation condition is trigged. The works analyzed present several ways to describe the period during while a norm is active. For simplicity, we are considering in this paper that the activation (and deactivation) condition of a norm is an, as in Definition 5.

Definition 5: (Condition) An activation condition ac and a deactivation condition dc state an event in time that can be a data, the execution of an action, the fulfillment of a norm, and so on.

3 Entities Relationships

The seven relationships presented in this section are based on the relationships stated in NormML and they are: inhabit, play, playin, ownership, inheritance, composition and refinement. Besides describing the relationships, we also point out a set of rules that should be followed when considering the conflicts between norms. Such rules state the consequences of applying a norm to an entity when such entity is related to others. The purpose of the rules is to state the transitive relationships of the norms applied to related entities. Therefore, the rules are described after presented each relationship.

It is important to stress that the set of relationships can be enlarged. The set of relationships were defined following our previous work [4] but is not limited to it. When defining new relationships it is also important to describe the rules that define the transitive relationships of the norms applied to different but related entities.

  • Inhabit: it relates an entity to the environment that it inhabits. The relationship can be applied in the following cases: agent x environment; organization x environment. Rule 1 states the relation between a norm defined in the context of the environment and the behavior of the entities executing in such environment.

Rule 1 . If a norm applies in the scope of an environment, such norm applies to all entities that inhabit such environment.

For instance, if a norm N1 defined in the scope of the campus of a school prohibits the carry of guns, and the specification of the application states that the agent Mary executes in (or inhabits) that campus, she must fulfill N1: Mary is prohibited of carrying guns.

  • Play: it relates an entity to the roles that it can play. Such relationship can be applied to the following entities: agent x role; organization x role. Rule 2 defines the consequences of defining a norm applied to an agent (or organization) when it is playing roles and a norm applied to a role played by agents (or organizations), respectively.

Rule 2. If a norm applies to a role, it applies to all agents (or organization) playing such role. When a norm applies to a role, it does not care about the entity that plays the role. Any entity playing such role must follow the norm.

For instance, let’s suppose that Mary is a security guard and there is a norm N2 stating that security guards can carry guns in the scope of the school. In this example, we can clearly see that N1 and N2 are in conflict since the former norm prohibits every agent to carry guns and the latter permits security guards to carry guns.

  • Playin: it relates an entity and the organization where it is playing the role. Such relationship is applied to the following entities: agent x organization; organization x organization. Rule 3 states what happens to the entities playing roles in an organization when a norm applies to such organization.

Rule 3. If a norm applies to an organization, it applies to any entity playing role in such organization. Any entity executing in an organization must comply with the norms applied to such organization.

For instance, if a norm N3 states that everyone in the school must use uniforms, Mary, as a security guard of such school, must use uniforms.

  • Ownership: it states the roles defined in the scope of an organization. Such relationship is defined to the following entities: role x organization. Rule 4 relates a norm applied to an organization and the roles being played in the organization.

Rule 4. If a norm applies to an organization, it applies to all roles being played in such organization. If a role is being executed in such organization, the entity executing such role must comply with the norm.

Following our example, considering norm N3 and knowing that such school has secretaries and students, they all are obliged to use uniforms.

  • Hierarchy: it defines that an element is the superelement of another called the subelement. Such relationship can be applied to the following entities: agent x agent; organization x organization; role x role; environment x environment. Rules 5, 6, 7, 8, and 9 state that a norm applied to a superentity also applies to its subentities.

Rule 5. If a norm is defined in the scope of an environment, the norm also applies in the scope of all its subenvironment.

Rule 6. If a norm is defined in the scope of a superorganization, the norm also applies in the scope of all its suborganizations.

Rule 7. If a norm applies to a superorganization, the norm also applies to all its suborganizations.

Rule 8. If a norm applies to a superagent, it also applies to all its descendent in a hierarchy of agents.

Rule 9. If a norm applies to a superrole, it also applies to all its descendent in a hierarchy of role.

For instance, following rule 7, if a norm is defined in the scope of the school, it also applies in the scope of all its departments. In the next section we detail the composition and the refinement relationships applied among actions since the analyses of such relationships depends on the deontic concepts indicated in the norms.

4 Actions Relationships

In this section we discuss how a norm that regulates the execution of a given action influences on the execution of the actions related to such action. Different relationships can be used to connect actions. Some examples of action relationships are: (i) refinement: an action is a refinement of another [1]; (ii) composition: an action is composed of other actions [7, 10, 16]; (iii) dependency: an action can only be executed after the execution of another action [16]; and (iv) orthogonal: two actions cannot be executed at the same time [13]. In this paper we discuss two action relationships: action refinement and action composition. In this paper we concentrate on these two. In order to exemplify such relationships, let’s consider the two very simple examples below:

E.g.1: (refinement relationship) to walk and to fly are actions that specialize to move.

E.g.2: (composition relationship) to clean the house is an action composed, in this example, of three other actions: to do the laundry, to clean the floor and to wash the dishes.

4.1 Action Refinement

If the refinement relationship is defined between two actions, it means that there is an action called subaction that is more specific than another action called superaction and that the superaction is an abstractFootnote 1 action. Being more specific, the execution of the subaction achieves the goal of executing the superaction, and may also achieve other goals. The states that should be achieved by executing the superaction are a subset of the states achieved by executing the subaction. If there is more than one subaction for a given superaction, it is necessary to execute only one subaction in order to achieve the goal of executing the superaction.

Definition 6: Let’s consider setStates(j) the set of states achieved by executing an action j and subActs(j) the set of subactions of j. For all actions i being a subaction of j, the set of states achieved by j is a subset of the states achieved by executing i.

Obligation: If the norm applied to the superaction is an obligation, it means that the entity, whose behavior is being regulated by the norm, is obliged to execute the superaction and achieve its states. If such superaction has more than one subaction and knowing that the states achieved by the superaction are a subset of the states achieved by any subaction (Definition 6), when one of the subactions is executed (in the period during while the norm is active), the entity fulfills its obligation. In order to illustrate such case, let’s consider that there is a norm obligating an entity to move. Thus, if it walks or if it flies, it will fulfill the norm. On the other hand, if the entity does not execute any of its subaction (in the period during while the norm is active), the entity will violate the obligation. The equations below formalize the fulfillment and violation of such norm.

(1)
(2)

where n is the norm, n.e.executed(i) means that the entity e whose behavior is being regulated by the norm n has executed action i in the period during while the norm was activated and n.e.notexecuted(i) means that the entity e has not executed the action i in the period during while the norm n was activated. The equations below formalize the fulfillment and violation of such norm and Rule 11 relates an obligation applies to a superaction and the norms apply to the subactions.

Rule 10. If there is an obligation applied to a superaction (and knowing that such action is abstract), there must be at least one subaction that is not being prohibited for being executed at related contexts, by related entities in related periods of time.

Prohibition: If the norm applied to the superaction is a prohibition, it means that the entity, whose behavior is being regulated by the norm, is prohibited to execute the superaction and achieve any of its states. If such superaction has more than one subaction and knowing that the states achieved by the superaction are a subset of the states achieved by any of its subactions (Definition 6), if the entity executes any subaction (in the period during while the norm is active), it will be violating its prohibition. For instance, let’s assume that there is a norm prohibiting an entity to move. If it walks or if it flies it will be violating the norm. On the other hand, if the entity does not execute any subaction (in the period during while the norm is active), it will fulfill the norm. Equations 3 and 4 formalize the fulfillment and violation of such norm and Rule 11 relates a prohibition applies to a superaction and the norms applied to the subactions.

(3)
(4)

Rule 11. If there is a prohibition applied to a superaction (and knowing that such action is abstract), there must be no subaction being obligated for being executed at related contexts, by related entities in related periods of time.

4.2 Action Composition

If the composition relationship is defined between two actions, it means that there is an action called part that is part of the action called whole and that the whole action is an abstract action. The states achieved by executing the whole action are the union of the states achieved by executing all its parts. Therefore, in order to achieve the goals of executing the whole action it is necessary to execute all its parts.

Definition 7: Let’s consider setStates(j) the set of states achieved by executing an action j, partAct(j) the set of actions part of j and n the number of parts of j.

Obligation: If the norm applied to the whole action is an obligation, it means that the entity is obliged to execute the whole action and achieve its states. If such whole action has more than one part and knowing that the states achieved by each part are a subset of the states achieved by the whole (Definition 7), the entity is obliged to execute all its parts (in the period during while the norm is active) in order to fulfill the obligationFootnote 2. If one of the parts is not executed, the norm will be violated. Let’s use the example of reviewing a paper in order to exemplify such normative condition. If there is a norm obligating an entity of reviewing a paper, in order to fulfill such norm the entity needs to read the paper and also to send the revision. Equations 5 and 6 formalize the fulfillment and violation of such norm and Rule 12 relates an obligation applies to the whole action and the norms applied to its parts.

(5)
(6)

Rule 12. If there is an obligation applied to a whole action, there must be no norm prohibiting the same entity to execute any of the parts of such whole action at related contexts, by related entities in related periods of time.

Prohibition: If the norm applied to the whole action is a prohibition, it means that the entity is prohibited to execute the whole action and achieve any of its states. If such whole action has more than one part, the agent will fulfill the prohibition if it does not execute one of the parts (in the period during while the norm is active). On the other hand, the agent will violate the prohibition if it executes all its parts (in the period during while the norm is active). The agent is only violating the prohibition if it executes all the parts. For instance, if there is a norm prohibiting an entity of reviewing a paper, the act of reading the paper does not violate the norm. Equations 7 and 8 formalize the fulfillment and violation of such norm and Rule 13 relates a prohibition applied to the whole action and the norms applied to its parts.

(7)
(8)

Rule 13. If there is a prohibition applied to a whole action, there must be no norms obligating the same entity to execute all parts of such whole action at related contexts, by related entities in related periods of time.

5 Conflict Checker

Before presenting the program that checks for conflicts between norms taking into account the system specification, we present a motivational example. In this example, we demonstrate that two, apparently, not related norms can be in conflict.

5.1 Motivational Example

When a conflict between two norms occurs an agent is not able to comply with the conflicting norms since whatever it does or refrain from doing will violate one of the norms dealing to a social constraint being broken. If the agent fulfills one of the norms, it automatically violates the other and vice-versa. Having said that, this section presents a conflict checker that takes two norms and the system specification in order to figure out if the norms are in conflict.

The system specification is important when checking for conflicts because to answer the question “Are these two norms in conflict?” it is necessary to understand the relation between the contexts where the two norms are defined, the relationship between the refereed entities whose behaviors are being regulated, and the relationship between the actions regulated by the norms. Without considering the relationships between such elements, the conflict checker may conclude that the two norms are not in conflict since they are applied in different contexts, to different entities, and regulate different actions. However, if the elements and their relationships are provided the conflict checker may conclude the opposite.

In order to illustrate the need for considering the system specification when checking for conflicts let’s take a look in the following example. Below we describe two norms by following Definition 1 and the part of the system specification applied to the example.

Norm1: In the university, professors are obliged to give talks.

Norm 2: In the computer science department, researchers are prohibited to teach.

System Specification:

  • “DepCS is a sub-organization of university”. (depCS, university, compositon)

  • “Researcher is a descendent of professor”. (professor, researcher, hierarchy)

  • “Teach is the subaction of giveTalks”. (giveTalks, teach, hierarchy)

Without considering the information about the application domain, we may say that these two norms are not in conflict since they are not applied in the same context, to the same entity executing the same action. However, by taking into account the system specification, the rules and definitions above, we conclude the opposite. By applying Rule 7 (described in Sect. 3) to the example and considering that the Computer Science department is a sub-organization of University, we can say that norm 1 also applies to such department and, thus, such norm can be rewritten as follows:

Following the system specification, researches are professors, i.e., the role research is a descendent of the role professor. Then, by applying rule 9, norm 1.a can be rewritten:

Finally, the specification states that to teach is a specialization of to giveTalks (that is a superaction). By applying Definition 6 to norm1.b we rewrite such norm as follows:

After such analysis, we are able to conclude that norm 2 and the norm 1 are in conflict.

5.2 The Program

The program for the checking of conflicts is based on the rewriting of the norms in order to normalize them. If the scope of a norm includes the scope of another norm, the more general norm can be rewritten to comply with the more specific norm. Similar to unification [5], we rewrite the more general norm when the scopes of the norms overlap. Note that we locally rewrite the norm, i.e., the norm is rewritten only in the scope of the conflict checker and the system version of the norm is not modified.

The rules and definitions described in Sects. 3 and 4 are used when rewriting the norms. We explain the conflictChecker program (see Algorithm 1) by referencing such rules and definitions and also by pointing out the lines of the Java method presented below. In this paper the system specification is described as an object that stores a set of relationships between entities and a set of relationships between actions, by following definitions in Sects. 3 and 4.

The algorithm starts by checking if the contexts of the norms are related, as explained below and detailed in Algorithm 2:

  1. (a)

    If the contexts are the same, it is not necessary to rewrite any norm;

  2. (b)

    If the context of a norm is not defined, it means that the norm applies in any context. Therefore, the context of such norm is rewritten in order to comply with the context of the other norm (see Definition 2);

  3. (c)

    If both contexts are organizations (or both are environment) and there is a hierarchy relationship between them, the norm whose context is the supercontext is rewritten in order to comply with the subcontext (see Rules 5 and 6);

  4. (d)

    If the context of one norm is an organization and the other is an environment, and the organization inhabits the environment, the norm whose context is the environment is rewritten to comply with the organization (see Rule 1);

If the contexts are related, the algorithm checks if the entities described in both norms are related, as shown in Algorithm 3 and detailed below:

  1. (a)

    If the entities are the same, it is not necessary to rewrite the norms;

  2. (b)

    If both entities are agents, roles or organizations, and there is a hierarchy relationship between them, the norm whose entity is the superentity is rewritten in order to comply with the subentity (see Rules 7, 8 and 9);

  3. (c)

    If one of the norms applies to an agent (or organization) and the other to a role, and the entities are related by the play relationship, the norm whose entity is the role is rewritten in order to comply with the norm whose entity is the agent (or organization) (see Rule 2);

  4. (d)

    If one of the norms applies to an agent (or organization) and the other to an organization, and these entities are related by the playin relationship, the norm whose entity is the organization where the role is being played is rewritten in order to comply with entity of the other norm (see Rule 3).

  5. (e)

    If one norm is applied to a role and the other to an organization, and the role and organization are related to the ownership relationship, the norm whose entity is the organization is rewritten (see Rule 4).

If the entities are related, the program checks if the constraints intersect, i.e., if the period during while one norm is active intersects with the period during while the other norm is active. If it is the case, the program analyzes if the actions are related, as follows (see Algorithm 4):

  1. (a)

    If the actions are the same, it is not necessary to rewrite the norms;

  2. (b)

    If the actions are related by the refinement relationship:(i) If the supernorm is a prohibition and the subnorm an obligation, the norms are in conflict (see Rule 11); and (ii) If the supernorm is an obligation, the algorithm checks if there is a norm applied to the subnorm that is not being prohibited (see Rule 10);

  3. (c)

    If the actions are related by the composition relationship: (i) If the wholenorm is an obligation, the norms are in conflict if there is a norm prohibiting the execution of a part (see Rule 12); and (ii) If the wholenorm is a prohibition, the algorithm checks if there is a norm applied to the partnorm that is not being obliged (see Rule 13);

6 Related Work

Although there are several approaches that propose solutions for the checking of conflicts between norms, the majority focuses on conflicts that occur when two norms simultaneous prohibit and obligate (or prohibit and permit) the execution of the same action by the same entity. The authors in [9, 14, 16, 17] propose mechanism not only to detect but also to resolve conflicts focusing on conflicting norms that regulate exactly the same behavior. In [15] the authors distinguish conflicts from inconsistences and propose solution for norms that regulate virtual organizations. Similar to our approach their mechanisms for the checking of conflicts use unification to find out if the norms overlap. However, it is out of the scope of those papers to figure out conflicts between norms that regulate the behavior of different entities executing different actions.

On the other hand, authors in [6, 7, 10] propose mechanisms for checking indirect conflicts. The approaches [6, 7] focus on the checking of conflicts by taking into account that normative positions of one activity are propagated to other activities. In [6] the authors present an approach dedicated to detect normative conflicts by considering that multiple, concurrent and related activities are executed by agents. The authors in [7] present an approach for detecting conflicts among norms that regulate composed actions. They state that an activity can be composed of several sub-activities and that the conflict-free normative positions of an activity propagate to its sub-activities. The conflicts occur when the normative position of a sub-activity contradicts the normative positions coming from the super-activity. Besides stating the conflict-cases, in our approach we also describe if the execution of a subaction (called in this paper part action) implies the fulfillment or violation of the norm applies to the superaction (called in this paper whole action). In [10] the authors propose mechanisms to address conflicts by taking into account the domain-specific relationships among actions. They propose the used of composition and delegation as possible relationships among actions.

There are other approaches that concern about detecting and resolving conflicts on legal environments. The works presented in [3, 11, 12] focuses on conflicts between norms defined in different jurisdictions. The authors in [3] claim that a particular situation can be judged by different legal systems and the norms of those systems can conflict. The authors [11, 12] claim that acting under several jurisdictions at the same time is becoming the norm, so, it is important to have a mechanism to find conflicts between them. In this paper we focus on conflicts between norms defined in the same legal systems. In [8] the authors present a new logic to formalize different operations for solving conflicts but they do not concern about the relationships among the entities of the system when checking for conflicts.

7 Conclusion and Related Work

The paper addresses one of the main problems when dealing with the specification of norms: the checking of normative conflicts. The proposed mechanism uses the system specification that describes the relationships among the systems elements when checking the conflicts. In Sect. 5 we exemplify the need for considering the system specification by checking for conflicts between two norms that, apparently, were not in conflict. After the analysis, we could demonstrate that the norms that applied at different context to different entities and regulates different actions were in fact in conflict.

Before presenting the algorithm for the checking of conflicts, we have described a set of definitions and rules. Since norm is an important concept in this paper we have formally defined such concept and its related concept in Sect. 2. In the sequence, we have presented the characteristics of the system by describing the relationships we have predefined and the related rules. The rules state the consequence of applying a norm to an entity when such entity is related to others. When describing the relationships between actions (refinement and composition) and the consequence of defining a norm to an action that is related to another, it was important to carefully analyze the deontic concept. It is out of the scope of this paper to detail how a norm described in English is mapped to our specification and how it is created.

It is our intention to extend our approach in order to be able to indicate the cases of conflicts between norms. By using the rewritten norms, it is possible to observe where the conflicting cases occur. Such rewritten norms could be used are a feedback to the one using our conflict checker and also used when proposing solutions for the conflicts.