=Paper= {{Paper |id=None |storemode=property |title=Model Contextual Variability for Agents Using Goals and Commitments |pdfUrl=https://ceur-ws.org/Vol-978/paper_18.pdf |volume=Vol-978 |dblpUrl=https://dblp.org/rec/conf/istar/ChatzikonstantinouK13 }} ==Model Contextual Variability for Agents Using Goals and Commitments== https://ceur-ws.org/Vol-978/paper_18.pdf
      Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




 Model Contextual Variability for Agents Using
          Goals and Commitments

              George Chatzikonstantinou and Kostas Kontogiannis

                  School of Electrical and Computer Engineering
                  National Technical University of Athens,Greece
             gchatzik@cslab.ece.ntua.gr, kkontog@softlab.ntua.gr



      Abstract. Goal models have been extensively utilized in requirements
      engineering as they provide an expressive and qualitative way to repre-
      sent requirements, while recent extensions related to contextual variabil-
      ity have further increased the expressiveness of the models. In addition to
      their application in requirements engineering however, goal models have
      been also proposed in the literature as a formal way to define the internal
      design of agents in multi-agent systems. In this paper we adopt the idea
      of applying goal models with contextual elements, i.e. conditional goals,
      decompositions and contributions, as a mean to model the internal de-
      sign of agents. Furthermore, we express the way those agents can interact
      with each other in terms of commitments, a recently introduced modeling
      concept that can be used for the definition of communication protocols
      in multi-agent systems. In this context, we introduce a transformation
      process that maps all conditional elements to commitments and contri-
      butions, and hence, reasoning techniques that exist for commitments can
      be applied to contextual models with no further changes.

      Keywords: goal models, agent-oriented models, commitments


1   Introduction

Goal models, which have been extensively utilized in requirements engineering,
have been proposed in the literature as a formal way to define the internal de-
sign and objectives of agents in multi-agent systems. This idea has been also
adopted by Chopra et al. in [1], where they additionally introduce the notion of
commitment as a way to model the communication protocol, i.e. the way agents
can interact with each other, in multi-agent systems. More specifically, in [1], the
internal design of each agent, along with the goals it wants to achieve, are defined
in terms of AND/OR decompositions, and contributions. Given that an agent
has the capability to fulfil only a subset of its intended goals on its own, it can-
not help but depend on others for the fulfilment of the remaining ones. These
dependencies are expressed via roles the agents can adopt, and commitments
that exist between agents that play those roles. In a more detailed manner, a
commitment of the form Commitment(Debtor,Creditor, antecedent, consequent)
means that the Debtor is committed to the Creditor for the consequent if the




                                         103
             Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




2

                                                        C(Product paid,       a
                                                        Phone call confirmation)
                                                                                              C(Product paid, b
                                                                            C(Product paid, c e-mail confirmation)
                                            Alice
                                                                            Product shipped)
                                         {Customer}
                        Product                                             C(Product paid, d
                        bought                                              SMS confirmation)                            Tom
                                  AND                                                                                  {Merchant}
                                                    Product
        Product paid                                                                                 Product sold
                             Confirmation           shipped
                               received
                                                      Phone call                     Product paid         AND
                 e-mail                  OR
                                                     confirmation                                                   Product
              confirmation         SMS                                                          Phone call          shipped
                                                             {Ceu}
                               confirmation                                                    confirmation

    Legend

       goal      goal node        goal        agent capability         goal     conditional           C(antecedent,           Credit
                                                                                            Debtor
                                                                                 goal node             consequent )             or
                                                                          {c}


      Fig. 1: Two agents that participate in an online marketplace application.


antecedent holds, where both Debtor and Creditor are roles that an agent can
adopt. Once the goal model of each agent, as well as the sets of roles and com-
mitments have been specified, the authors provide the semantics of a reasoning
process that can be used to check whether the achievement of a specific agent’s
goal can be supported by the underlying protocol.
    As an example consider the case illustrated in Fig. 1, where two agents,
namely Alice and Tom, participate in an online marketplace application (ignore
the conditional goal node for the moment). In this example Alice, who adopts
role “Customer”, can satisfy her goal “Product paid” on her own as this is a
capability of hers. The satisfaction of her goal “Product shipped” however, can
be only supported by the commitment denoted as “c” in the figure. In a nutshell,
because of the existence of the commitment “c”, Tom, who participates in the
application as a “Merchant”, is committed to provide “Product shipped”, if Alice
(the “Customer”) fulfils “Product paid”.


2       Research Objectives

In this paper, we utilize the ideas of [2] and [3] related to contextual variability
of goal models, in order to capture the variability that may exist in the internal
design of an agent as a consequence of alterations in the context an agent acts in.
In this case however, the problem that needs to be solved is slightly different. We
are now interested in studying whether a specific agent’s goal can be supported
by the underlying protocol and within the given context. Hence, the reasoning
process described in [1] does not apply any more.
    To overcome this problem, and in an attempt to keep the reasoning mech-
anism unchanged, we propose the framework illustrated in Fig. 2. In a more
descriptive manner, we firstly extend the metamodel introduced in [4] so as to




                                                                 104
         Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




                                                                                                                                3

                                                                         Reasoning
       Multi-agent Application
      with Contextual Variability                           Multi-agent
             Metamodel                                      Application                Reasoning
              Section 3.1                                   Metamodel                  Semantics
                                                           Chopra et al. [4]         Chopra et al. [1]
                     conforms to                                  conforms to               uses
                                                                                                         Can Agents Support
             Model with             Transformation      Model with NO                  Reasoning
                                                                                                         their Goals within a
         Conditional Elements          Section 3.2    Conditional Elements           Implementation
                                                                                                           given Context ?


                                      Fig. 2: The proposed framework.


support contextual elements, i.e. goals, decompositions and contributions (see
section 3.1), and we then introduce a transformation process that will allow us
to express those context-related modeling elements in terms of commitments
and contributions (see section 3.2). Thus, by applying this transformation, we
can produce a model that captures the multiple variations that may exist in
the initial model, while at the same time we can reuse the reasoning semantics
proposed in [1]. It is important to note that the produced model is only intended
to be used for the generation of the rules required for the reasoning process.


3      Scientific Contribution
3.1      Agents with Context-dependent Goal Models
Using the conceptual model defined in [4] as a starting point, and taking into
consideration the way contextual variability is captured in goal models in [2]
and [3], we ended up with the metamodel depicted in Fig. 3. While the part
of the metamodel related to the definition of a service engagement in terms of
commitments and roles is identical to the one introduced in [4] (and thus not
included in the figure), the goal-oriented representation of agents is extended
with the addition of conditions. More specifically, the proposed metamodel allows
for goals, decompositions, and contributions to be defined as conditional, in the
sense that each one of those modeling elements can be related to one or more
conditions, the truth values of which dictate the existence of the corresponding
element in the goal model. Hence, a conditional element is included in the model
only if at least one of the attached conditions is true, otherwise it must be
removed. In this respect, the metamodel can capture the contextual variability
of the internal model of an agent, where a specific context is mirrored by the
assignment of truth values to all conditions in the model.
    For the example illustrated in Fig. 1, lets assume that the online marketplace
application serves only e-shops that are located in Europe, and that the goal node
“Phone call confirmation” is conditional and exist in the model only if Alice is
located in Europe when she interacts with the application (Ceu is true), and is
removed otherwise. Lets also assume that Alice happens to be in the USA (i.e.
condition Ceu is false), and hence she can only receive a confirmation via an
e-mail or an SMS. As Tom cannot provide neither of them to Alice, she will not
be able to achieve her goal as a consequence of the context she acts in.




                                                     105
                                DecompositionType             +MMS
                                +AND                          +PPD
                                +OR                           +MMD

        Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




4

                  0..*      -has               1
                                                       1     1
                                           Goal          -from           Contribution
                  Agent
                                                       1     1     -type : ContributionType
                                                          -to
                                                                                              «interface»       0..*      -isRelatedTo
                   -isCapableOf
                          0..*                                                                Conditional
                    1                                                                                       1          Condition
            -decomposedTo      HardGoal            SoftGoal       2..*

        1                                                                                1
                         2..*                                     -decomposedTo                                              1..*
                                                                                                                             1..*
                                                                                                                  1…*      -consistsOf
    HGDecomposition              0..*
                                    1     -hasDecomposition
                                                  1                    SGDecomposition
                                                                                                                       Context
-type : DecompositionType                                         -type : DecompositionType
                                 -hasDecomposition         0..*


       Fig. 3: The metamodel for the contextual variability of agents’ goals.


3.2     From Conditional Elements to Commitments

In this section we are going to define a transformation process for the mapping
of conditional elements to commitments. Initially, we define a dummy agent
called ContextAgent which has no goals to achieve, and always adopts the role
Reasoner. The purpose of this agent is to provide other agents with goals that
belong to the set of its capabilities (set GC ), something that can be done by
enriching the existing protocol with additional commitments. More than that,
for each condition in the model we create a corresponding role that can be
adopted by the agents that participate in the application.
      The mapping from conditional contributions to commitments for the four
possible types (++S/D and −−S/D) 1 , along with the corresponding transfor-
mation steps are summarized in Table 1. Because of space limitations we will
only discuss in detail the transformation process for the −−D conditional con-
tribution. We start by adding two new goal nodes to the model, namely gs0 and
gt0 , with the latter being a capability of the ContextAgent. Those two goal nodes
are then connected to the goal model via two unconditional contributions, one
of type −−D from gs to gs0 , and a second one of type ++S from gt0 to gt . Sub-
sequently, the commitment Commitment(Reasoner,rcond ,gs0 ,gt0 ) is inserted in the
protocol of the application. What remains to be proved is the soundness of the
mapping from the −−D conditional contribution, to the rules that use commit-
ments and unconditional contributions. In other words, we must show that when
condition Ccond is true, and gs is not satisfied, goal gt is fulfilled.
      Actually, if gs is denied, gs0 is satisfied because of the existence of the −−D
contribution from the former to the latter. This implies that if the agent adopts
the role rcond (this is the role that corresponds to Ccond ), and because of the
commitment previously specified, ContextAgent will provide it with gt0 which is
one of ContextAgent’s capabilities. Finally, the truth of gt0 has as a consequence
the satisfaction of gt goal node because of the ++S contribution introduced
earlier. Hence, if gs is denied and the agent adopts the role rcond , gt becomes
true, while if rcond is not adopted, gt can not be satisfied as a consequence of the
1
    In the context of this paper we adopt the semantics of [1] for contributions




                                                              106
      Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




                                                                                           5


         Table 1: Mapping conditional contributions to commitments.
    Conditional Contribution            Mapping to Commitments
                  ++S
              gs −−−−→ gt               Commitment(Reasoner,rcond ,gs ,gt0 )
                                                      ++S
                 {cond}
                                        gt0 ∈ GC , gt0 −−−→ gt
                  −−S
              gs −−−−→ gt               Commitment(Reasoner,rcond ,gs ,gt0 )
                                                      −−S
                 {cond}
                                        gt0 ∈ GC , gt0 −−−→ gt
                  −−D
              gs −−−−→ gt               Commitment(Reasoner,rcond ,gs0 ,gt0 ) , gt0 ∈ GC
                                            −−D             ++S
                 {cond}
                                        gs −−−→ gs0 , gt0 −−−→ gt
                  ++D
              gs −−−−→ gt               Commitment(Reasoner,rcond ,gs0 ,gt0 ) , gt0 ∈ GC
                                            −−D             −−S
                 {cond}
                                        gs −−−→ gs0 , gt0 −−−→ gt



denial of gs , as in this case the corresponding commitment cannot be applied.
This means that by substituting the initial −−D conditional contribution with
a commitment and an appropriate combination of unconditional contributions,
we end up with a model that does not contain the initial conditional element
but still has the same behavior as if it was part of the model.
     Finally, the remaining two conditional elements, i.e. decompositions and
goals, can be fully described by utilizing conditional contributions, and so, the
same transformation process can also apply in those cases. The way a conditional
decomposition, and an OR-child node are encoded as conditional contributions
is illustrated in Fig. 4a and 4b respectively, while because of the duality between
AND and OR-decomposition the former has been omitted.


4    Conclusion
In this paper we use goal models with conditional elements as a mean to capture
the contextual variability of agents that participate in a multi-agent application.
Consequently, we propose a set of rules for the transformation of those condi-
tional elements to commitments and contributions. This transformation allows
us to apply the same reasoning process introduced in [1] even in the presence of
conditional goals, decompositions and contributions. Hence, we have succeeded
in increasing the expressiveness of the metamodel introduced in [4], while at the
same time the proposed reasoning techniques can still apply without changes.


5    Ongoing and future work
The extended metamodel presented in this paper is intended to be used for
modeling policies that must apply in multi-layer systems at run-time. The for-
mal representation of those policies, along with a proper reasoning engine, and
in combination with advanced monitoring techniques, can then be utilized in
order to check whether the system complies with the required policies or not.




                                         107
      Proceedings of the 6th International i* Workshop (iStar 2013), CEUR Vol-978




6

                  {C1}                       {C2}
                                                                      ++S              G1             ++S
                  {C1}
                   G1                        {C2}
                                              G1                                               {C2}
                                                                      + + S{C1}        G1             ++S
                   G1                        G1                          A {C1}                {C2} B
                  AND                        OR           →             A                             B
                                                                                                      OR
                                                                       AND
            A1    AND    A2             B1   OR     B2    →      A1               A2           B1
                                                                                                      OR
                                                                                                            B2
                                                                       AND
            A1           A2             B1          B2           A2               A1           B2           B1
                                                           (a)
                              G1
                                                                             G1                 ++S
                              G1OR                        → ++S
                                                                             G1             {C1} + + S
                                   OR                     → ++S         ++S
                                               A3
             A1               A2                                 A1                         {C1} A3
                                               A3
                                                {C1}                    + + S A2
             A1               A2                                 A1                             A3
                                                {C1}                          A2

                                                           (b)

Fig. 4: Conditional a) decomposition (G1 is AND-decomposed if C1 holds, or
OR-decomposed if C2 holds) and b) goal encoded as conditional contributions.


In our work we mainly focus on the former two parts, namely policy modeling,
and reasoning, and we examine the applicability of probabilistic and fuzzy logic
reasoners to the problem of policy validation.
    An application of the proposed modeling is presented in [5]. The problem we
are trying to solve in this paper is quite different, as we are interested in predict-
ing the satisfaction of goals related to software project development. However,
we show how a goal model with conditional modeling elements can be trans-
formed to a first order logic knowledge base, which can then be used to perform
probabilistic reasoning.
Acknowledgment This research is co-funded by the European Union (Euro-
pean Social Fund ESF) and Greek National funds through the Operational
Program ”Education and Lifelong Learning” of the National Strategic Refer-
ence Framework (NSRF) - Research Funding Program: Heracleitus II. Investing
in knowledge society through the European Social Fund.


References
1. Chopra, A.K., Dalpiaz, F., Giorgini, P., Mylopoulos, J.: Reasoning about agents
   and protocols via goals and commitments. In: AAMAS. (2010) 457–464
2. Ali, R., Dalpiaz, F., Giorgini, P.: A goal-based framework for contextual require-
   ments modeling and analysis. Requir. Eng. 15(4) (2010) 439–458
3. Lapouchnian, A., Mylopoulos, J.: Capturing contextual variability in i* models. In:
   iStar. (2011) 96–101
4. Chopra, A.K., Dalpiaz, F., Giorgini, P., Mylopoulos, J.: Modeling and reasoning
   about service-oriented applications via goals and commitments. In: CAiSE. (2010)
5. Chatzikonstantinou, G., Kontogiannis, K.: A goal driven framework for software
   project data analytics. In: CAiSE. (2013) To appear.




                                                         108