formal verification of alica multi-agent plans using model ... · formal verification of alica...

8
Formal Verification of ALICA Multi-agent Plans Using Model Checking Thao Nguyen Van Distributed Systems Group University of Kassel Kassel, Germany [email protected] Nugroho Fredivianus Distributed Systems Group University of Kassel Kassel, Germany [email protected] Huu Tam Tran Distributed Systems Group University of Kassel Kassel, Germany [email protected] Kurt Geihs Distributed Systems Group University of Kassel Kassel, Germany [email protected] Thi Thanh Binh Huynh Hanoi University of Science and Technology Hanoi, Vietnam [email protected] ABSTRACT In multi-agent systems (MAS), plans consisting of sequences of actions are used to accomplish the team task. A critical issue for this approach is avoiding problems such as deadlocks and safety vi- olations. Our recent work addresses that matter by verifying plans composed in a language called ALICA (A Language for Interactive Cooperative Agents) that controls the agents’ behavior. The inves- tigation is conducted by creating a translation tool that implements an algorithm for translating ALICA plans into the format used by the real-time model checker UPPAAL. We tested our concept using several cases, and the result is promising to get further insight on multi-agent model checking . CCS CONCEPTS General and reference Verification; KEYWORDS Verification, ALICA, model checking, multi-agent planning. ACM Reference Format: Thao Nguyen Van, Nugroho Fredivianus, Huu Tam Tran, Kurt Geihs, and Thi Thanh Binh Huynh. 2018. Formal Verification of ALICA Multi-agent Plans Using Model Checking. In The Ninth International Symposium on Information and Communication Technology (SoICT 2018), December 6–7, 2018, Danang City, Viet Nam. ACM, New York, NY, USA, 8 pages. https://doi.org/10.1145/ 3287921.3287947 1 INTRODUCTION ALICA (A Language For Interactive Cooperative Agents) is a be- havior specification language for teams of agents. Since 2009, it has Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. SoICT 2018, December 6–7, 2018, Danang City, Viet Nam © 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-6539-0/18/12. . . $15.00 https://doi.org/10.1145/3287921.3287947 been employed on our soccer robots and demonstrated its capa- bilities, e.g., our robot soccer team achieved the third place in the RoboCup MSL at the European Open in 2016. ALICA is also proven to be useful for various application domains, e.g., Robotic Space Missions and Autonomous Driving [17]. However, even the best laid plan must be verified [15], and this is also true for ALICA plans. Our aim is to ensure that no unexpected events will arise. Using formal methods, each plan will be checked to meet given properties and to minimize the likelihood of any dangerous or undesirable effects, particularly, when we apply agent systems to safety-critical applications such as autonomous vehicles or spacecraft control. A popular verification technique is model checking[5]. Model checking is a technique originally developed for verifying concur- rent systems. Although model checking has been widely used to verify hardware systems, it is also extensively applied to verify software systems, as well as protocols [2, 8]. In this work, we present a set of results obtained from a model checking technique for the verification of plans written in ALICA. The task is quite challenging due to a number of constraints. Firstly, the verifier must convert ALICA plans to a model that describes the plans in sufficient detail. And secondly, the model should be sufficiently simple to be verified by the model checker. Moreover, several states in ALICA plans may contain more than one behavior for multitasking purposes, making it more difficult to be examined. To solve this matter, we compose a translation algorithm and cre- ate a corresponding tool with the ability of performing a proper conversion process. For that task, the model checker UPPAAL is chosen due to its success in several verification cases for real-time systems [1, 10]. Therefore, we demonstrate our tool by presenting two main con- tributions. Firstly, we have constructed an algorithm called AL- ICA2UPPAAL for translating ALICA plans into the syntax used in UPPAAL. Secondly, we present our translation tool called A2U along with the technical description. The rest of the paper is organized as follows: in Section 2, re- lated works are presented. Section 3 briefly describes the general structure of an ALICA plan and the UPPAAL model checker. Then, we introduce our algorithm and the A2U tool in Section 4, followed

Upload: others

Post on 30-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

Formal Verification of ALICA Multi-agent Plans Using ModelChecking

Thao Nguyen VanDistributed Systems Group

University of KasselKassel, Germany

[email protected]

Nugroho FredivianusDistributed Systems Group

University of KasselKassel, Germany

[email protected]

Huu Tam TranDistributed Systems Group

University of KasselKassel, Germany

[email protected]

Kurt GeihsDistributed Systems Group

University of KasselKassel, Germany

[email protected]

Thi Thanh Binh HuynhHanoi University of Science

and TechnologyHanoi, Vietnam

[email protected]

ABSTRACTIn multi-agent systems (MAS), plans consisting of sequences ofactions are used to accomplish the team task. A critical issue forthis approach is avoiding problems such as deadlocks and safety vi-olations. Our recent work addresses that matter by verifying planscomposed in a language called ALICA (A Language for InteractiveCooperative Agents) that controls the agents’ behavior. The inves-tigation is conducted by creating a translation tool that implementsan algorithm for translating ALICA plans into the format used bythe real-time model checker UPPAAL. We tested our concept usingseveral cases, and the result is promising to get further insight onmulti-agent model checking .

CCS CONCEPTS• General and reference→ Verification;

KEYWORDSVerification, ALICA, model checking, multi-agent planning.

ACM Reference Format:ThaoNguyen Van, Nugroho Fredivianus, Huu TamTran, Kurt Geihs, and ThiThanh Binh Huynh. 2018. Formal Verification of ALICA Multi-agent PlansUsingModel Checking. In The Ninth International Symposium on Informationand Communication Technology (SoICT 2018), December 6–7, 2018, DanangCity, Viet Nam. ACM, New York, NY, USA, 8 pages. https://doi.org/10.1145/3287921.3287947

1 INTRODUCTIONALICA (A Language For Interactive Cooperative Agents) is a be-havior specification language for teams of agents. Since 2009, it has

Permission to make digital or hard copies of all or part of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. Copyrights for components of this work owned by others than theauthor(s) must be honored. Abstracting with credit is permitted. To copy otherwise, orrepublish, to post on servers or to redistribute to lists, requires prior specific permissionand/or a fee. Request permissions from [email protected] 2018, December 6–7, 2018, Danang City, Viet Nam© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.ACM ISBN 978-1-4503-6539-0/18/12. . . $15.00https://doi.org/10.1145/3287921.3287947

been employed on our soccer robots and demonstrated its capa-bilities, e.g., our robot soccer team achieved the third place in theRoboCup MSL at the European Open in 2016. ALICA is also provento be useful for various application domains, e.g., Robotic SpaceMissions and Autonomous Driving [17]. However, even the bestlaid plan must be verified [15], and this is also true for ALICA plans.Our aim is to ensure that no unexpected events will arise. Usingformal methods, each plan will be checked to meet given propertiesand to minimize the likelihood of any dangerous or undesirableeffects, particularly, when we apply agent systems to safety-criticalapplications such as autonomous vehicles or spacecraft control.

A popular verification technique is model checking[5]. Modelchecking is a technique originally developed for verifying concur-rent systems. Although model checking has been widely used toverify hardware systems, it is also extensively applied to verifysoftware systems, as well as protocols [2, 8].

In this work, we present a set of results obtained from a modelchecking technique for the verification of plans written in ALICA.The task is quite challenging due to a number of constraints. Firstly,the verifier must convert ALICA plans to a model that describesthe plans in sufficient detail. And secondly, the model should besufficiently simple to be verified by the model checker. Moreover,several states in ALICA plans may contain more than one behaviorfor multitasking purposes, making it more difficult to be examined.To solve this matter, we compose a translation algorithm and cre-ate a corresponding tool with the ability of performing a properconversion process.

For that task, the model checker UPPAAL is chosen due to itssuccess in several verification cases for real-time systems [1, 10].Therefore, we demonstrate our tool by presenting two main con-tributions. Firstly, we have constructed an algorithm called AL-ICA2UPPAAL for translating ALICA plans into the syntax usedin UPPAAL. Secondly, we present our translation tool called A2Ualong with the technical description.

The rest of the paper is organized as follows: in Section 2, re-lated works are presented. Section 3 briefly describes the generalstructure of an ALICA plan and the UPPAAL model checker. Then,we introduce our algorithm and the A2U tool in Section 4, followed

Page 2: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

SoICT 2018, December 6–7, 2018, Danang City, Viet Nam N. Thao et al.

by the discussion regarding the experimental results from our im-plementation in Section 5. Finally, Section 6 concludes the paperand points to the future work.

2 RELATEDWORKVarious model checking techniques have been used in MAS toverify plans based on several formalisms. The work in [9] presentsUPPAAL for HSTS, a planner and scheduler of the remote agentautonomous control system that is deployed in deep space. Then, Xuet al. [18] introduce an approach for modeling and verifying multi-agent behaviors using Predicate/Transition Nets. In [6], a method isproposed to verify non-deterministic execution plans forMAS usingHierarchical Colored Petri Nets, based on guidelines for modelingand verification activities. Barringer et al. [3] propose an approachapplied in a NASA mission to verify command sequences createdon the ground, against a set of flight rules, before sending them toa satellite. Such a command sequence has the same characteristicsas a plan: it is a sequence of actions (commands) to be executed onboard the satellite. Also, they have to satisfy the properties used inthe flight rules, formulated as monitors in the TraceContract tool.

Vandi Verma et al. [16] present The Plan Execution InterchangeLanguage (PLEXIL), a language for describing the behavior of anautonomous agent. It is used in the area of robotics, unmannedvehicles, automation in industrial operations, and software agents.PLEXIL also provides the combination with many high-level plan-ners and supports the integration of domain descriptions as wellas high-level decision making. To some extent, the expressivenessof the language is similar to ALICA. PLEXIL can express planswith loops, conditions and further control structures. Moreover,the formal semantics of PLEXIL enables a validation of plans andprovides a framework for formal analysis [7]. However, PLEXILwas designed to express the behavior of a single agent system,which is different from ALICA that supports multi-agent conceptslike synchronizations and task cardinalities. Hence, the verificationprocess for ALICA plans is more difficult and complicated.

An earlier attempt to verify ALICA multi-agent plans was con-ducted in [11], where Answer Set Programming (ASP) is used toverify a number of plans during the modeling process. That workcan help the designers who are unfamiliar with the concepts ofmulti-agent plans in avoiding errors when modeling an ALICAprogram. However, since the verification does not consider the cor-rectness properties, the chance of creating unsafe plans still exists.The approach proposed in this paper can exhaustively explore a setof reachable states (i.e., the state space). Therefore, the designersare able to know that the properties may or may not hold for anycreated plans, before applying them in real agents.

3 BACKGROUNDSo far, ALICA has been used as a language to implement variousscenarios in a number of our works, e.g., soccer robots, explorationagents, and other mobile entities. The result is satisfying, indicatedby the functioning system. However, some erroneous occurrencesstill appear now and then. For instance, a robot that should per-form a free kick in the soccer game keeps waiting for any visibleteammate until the time expires. Such a situation may appear whenthe opponent team implements a strategy to cover the teammate’s

visibility. This is an example where the necessity of having theplans checked before being implemented to the robots arises, andUPPAAL is chosen for checking the plans beforehand, due to itsversatility of performing the required examinations, as describedin the following subsections.

3.1 ALICA PlanEach ALICA plan consists of finite state machines, the lowest levelof the structure that describes sequences of actions performed bythe agents. A plan has one initial state and a number of regular ones.Every state can contain a set of behaviors and states are connectedto each other through transitions. An agent that occupies such astate obligates to execute all behaviors in this state. ALICA considersa behavior as an atomic activity. For instance, in the area of mobilerobots, typical behaviors are Drive andWait. More details regardingALICA can be found in [12–14].

Figure 1a illustrates a scenario where a team of mobile robotsis assigned to collect samples of objects (e.g., rocks) by pickingand bringing them to the base. Each agent is given the freedom ofperforming these activities:

(1) Drive: going out of the base and search for an object(2) PickUp: attempting to pick up an object, in case of failure, it

will attempt to redo the action(3) CheckStatus: checking the feedback from a sensor that in-

forms the agent, whether the pickup process was successfulor not.

We created an ALICA plan shown in Figure 1b for each robotto perform those activities. In this case, the typical behaviors areshown using instances like Drive and Pickup. A transition thatconnects a state to the other can "fire" if, and only if, all the corre-sponding conditions are satisfied. As illustrated in the figure, anagent (represented by a red circle) inhabits the state MetObj whileexecuting a behavior to pick up the objects, before entering the stateGetObj. In ALICA, a plantype (denoted by a purple icon) containsa number of plans that should be executed by the agent. For thisexample, we use the plantype CheckStatus for simulating a sensorand signal transmission between it and the agent. The plantypescan be inserted into states of the finite state machines. ALICA plansmay contain several plantypes without any limitation. However, inFigure 1b, the CheckStatus is a given plantype that contains onlyone plan (see Figure 2).

An ALICA plan typically contains more than one finite statemachine, where each of them is marked with a task and is limitedby a minimum and maximum cardinality. The minimum cardinalityis the minimum number of agents that are required for executingthe plans and the maximum cardinality is the maximum numberof agents, which are allowed to execute the plans. To provide aclear example, in robotic soccer only one agent is allowed to do afree kick, making the maximum cardinality equal to one. In othersituations like defending an open play, we can have all agentsperform as a defender. In the example illustrated here, the minimumand maximum cardinalities are equal to one. Hence, in Figure 1b,which illustrates a finite state machine marked with the SA FindAnd Pick task ("SA" stands for a single agent), only one agent isallowed to execute this plan at the same time.

Page 3: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City, Viet Nam

AtB

(a) Illustration.

(b) ALICA plan for a single mobile agent.

Figure 1: The agents collecting objects.

Figure 2: ALICA plan for plantype of single agent.

3.2 UPPAALUPPAAL is a toolbox for simulation, modeling, and verification ofreal time systems developed by Uppsala University in Sweden andAalborg University in Denmark [4]. It uses an extended version ofthe timed automata formalism. Here, a model may include severalautomata that run concurrently with the capability of communicat-ing via a number of channels, e.g., bounded integers.

Plans used in ALICA will be checked using UPPAAL, wherethree main components play their role in the process: a description

language, a simulator and a verifier. The description language isa non-deterministic guarded command language with data types(e.g., channels and arrays). The simulator permits step by step sim-ulation of the model displaying possible transitions and the currentstate. Finally, the verifier allows the specification and verification ofproperties as well as configuring the model checking engine. Also,if the verification attempt fails, a diagnostic trace may be loadedinto the simulation component to investigate the issues.

4 MAPPING ALGORITHM AND A2U TOOLTRANSLATOR

In this section we describe the algorithm ALICA2UPPAAL, andbased on it, an A2U tool translator is created to perform automatictranslation of ALICA plans into UPPAAL. Initially, an overview of amapping process is explained, followed by an explanation of stepsconducted in the algorithm ALICA2UPPAAL.

Figure 3 shows an overview of the mapping process from AL-ICA plans to the UPPAAL model checker. The tool comprises thefollowing functions:

(1) Input: retrieving ALICA plan design in PML1 file formatwhich contains the abstract syntax tree to store the dataelements and transition relations in a plan.

(2) Parse: the core component of the mapping process that mapselements of an ALICA plan to be used in UPPAAL. The dataelements in the PML file are read and analyzed iteratively.Then, the C++ Parser creates three tables, where two ofthem have a fixed number of columns (i.e., locations andtransitions). The last one is a dynamic table called a system.

(3) Output: UPPAAL supports three file formats: XML, XTA, andTA. The XML is the newest format, supporting all featuresof UPPAAL e.g., anonymous locations are supported andgraphical information (coordinates) about the objects arestored in XML file (in XTA format, graphical information(coordinates) are stored in a separate UGI file ) and the PMLand XML file have many similar properties. By these reasons,we choose XML format to be our output file.

The core contribution of this work is the Parse function. Thisprocess is divided into two steps: in the first step shown in Figure4, it checks whether an ALICA plan can be converted to UPPAALformalism. If it is not possible to do that, the process will stop.Otherwise, the Parse function whose flowchart depicted in Figure5 will be executed. Here, the algorithm for mapping ALICA plansto UPPAAL, namely ALICA2UPPAAL is run through the followingstages:

(1) ALICA transitions are mapped into UPPAAL transitions. Theproperty InState of an ALICA transition is converted to acorresponding transition Source (see Table 1). Similarly, theproperty OutState is converted to transition Target in UP-PAAL model checker. Moreover, signal transmissions amongagents or between the agent and its devices in ALICA areperformed through communication channels inserted intoUPPAAL transitions.

(2) The Parse function converts ALICA states to UPPAAL lo-cations. Because of the similarity of the structure, several

1The file format used to store ALICA plans

Page 4: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

SoICT 2018, December 6–7, 2018, Danang City, Viet Nam N. Thao et al.

Table 1: The properties of states and transitions of ALICAafter translating to UPPAAL formalism.

ALICA UPPAALStates LocationsStates.Id Locations.IdStates.Names Locations.NamesStates.EntryPoint(if a state is an initial state)

Locations.Init(Initial location)

States.Coordinate Locations.CoordinatePlanType TemplateStates.InTransition -States.OutTransition -Transitions TransitionsTransition.InState Transitions.SourceTransition.OutState Transitions.Target

properties owned by the ALICA state can be easily trans-lated into UPPAAL location, e.g., the state id is converted toa loc_id (location id) and names of location are copied fromnames of states. The Parse function will check that the stateis a committed, initial or regular state. If it is a committedstate, a translation will map it into a committed location l_c.In UPPAAL, committed locations are used when the userswould like to create a sequence of actionwithout interleaving(except in case: several processes are in a committed locationat the same time). Then, the initial and regular state will bemapped into the initial and normal location, respectively.

(3) The Parse function checks whether the states contain a be-havior or plantype. If they contain a plantype, this functionwill be executed to convert a plan (a member of the plantype)into a new template used in UPPAAL. On the other hand,it will set the minimum time t_min for executing behaviorsinto guard of a corresponding location’s outgoing transi-tion. Equivalently, the maximum time t_max is mapped intoinvariant of this location.

The purposes of ALICA plans can be mapped into propertiesin UPPAAL. Figure 7 shows the UPPAAL properties and diagnosistrace, which correspond to the ALICA plan in Figure 1b. Obviously,the plans should be verified before applying them to real agents.Regarding the run time for the translation process, it is highly de-pending on the complexity of the plans. Therefore, we have built theA2U translator written in C++ to implement our algorithm, whichcan automatically translate ALICA plans into UPPAAL model.

5 EXPERIMENTAL RESULTSWe tested our ALICA2UPPAAL using the example provided inFigure 1b and showed the result in Figure 6, which is automaticallycreated from the ALICA plan using A2U.

Our scenario uses the assumption that the agent will leave thebase within zero to 10 time units. Then, whenever it identifies anobject, it executes the PickUp behavior for 11 to 20 time units. Thefeedback obtained from the sensor owned by the agent regardingthe success of the picking, requires from zero to nine time units.If the object is picked successfully, the agent carries it to the base.

Read input file:ALICA plan

START

Unparsed lineexists?

END

Y

N

Parse i

Get unparsed item i

File formatsuitable?

N

Y

Figure 4: The main function of ALICA2UPPAAL algorithm.

Otherwise, it performs another attempt to pick the object. Whethereach agent picks up successfully or not, each one needs at leastthree time units for moving to a next state.

We take state GetObj as an example for our mapping process.Here, the time limit for each agent to wait for the result from itssensor is represented using c4a ≤ 9 as an invariant. Then, the limitfor moving to the next state is expressed by c4a ≥ 3 as a guardof the outgoing transition. In this context, guard means the con-dition for "firing" the transitions in UPPAAL program. Since thestate GetObj contains a plantype, the incoming transition picked isrepresented by the one with the channel ChannelCheckStatus!. Thischannel will send a message to the initial location of the templateCheckStatus converted from a plan that is a member of the plantypeCheckStatus. Finally, the branch transitions placed and dropped areexpressed via labels "Ok?" and "NotOk?" on their branching outgo-ing transition, respectively. These transitions receive the signalsfrom PickUpSuc and PickUpUnSuc location to an initial locationCheckStatus, respectively. After translating the ALICA plan intoUPPAAL model structure, the verification process can begin. Oncewe have configured our scenario in UPPAAL we can formally verifythe plan with the following properties:

Property 1: The model is deadlock free.This property confirms that no deadlocks will occur in our model

for all possible paths (the definition of deadlock is taken from UP-PAAL [4]):

A[] not deadlockProperty 2: The agents can successfully pick up the objects.E<> CheckStatus.PickUpSucThe results and diagnostic traces given by UPPAAL are presented

in Figure 7.We intentionally created an error in the ALICA plan by switch-

ing the placed for dropped transitions, after re-translating the plan

Page 5: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City, Viet Nam

C++Parser

locations

loc_idinitial state

... ...

coordinate

...

coordinate

...

name

...

name

...

UPPAALTimed

Automata XML

UPPAALTimed

Automata XML

Mapping rules

plan

...

plantype

plan

...

plantype

name

transitions

trans.Source trans.Target

... ... ...

name

transitions

InState OutState

... ... ...

name

transitions

InState OutState

... ... ...

ALICA plan PML

ALICA plan PML

template

...

system

template

...

system

OutputInput

states

#id entryPoint

... ...

coordinate

...

coordinate

...

name

...

name

...

Figure 3: Overview of the mapping process from ALICA plan to UPPAAL model checker.

j is atransisiton?

Yj → tu

Set executingtime guard

j containsplantype?

j containsa behavior?

N

j is acommitted state?

Yj → lc

N

YParse j

Parse (item j)

j is aninitial state?

Nj → l0

Y

N

j → lu

END

Y

N

First stage

Second stage

Third stage

Figure 5: The parse function of ALICA2UPPAAL algorithm.

by A2U we get the UPPAAL model presented in Figure 8. We veri-fied the receptive UPPAAL model with the Property 1 to check the

(a) Main

(b) CheckStatus

Figure 6: The UPPAALmodel of modifiedmulti-agents aftertranslating.

absence of deadlock in the system. The verification result said thatthere is a deadlock in the given model. From the diagnostic tracegiven by UPPAAL, we found out that the deadlock occurred when

Page 6: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

SoICT 2018, December 6–7, 2018, Danang City, Viet Nam N. Thao et al.

Figure 7: The results of verification for a single agent in UP-PAAL.

Figure 8: UPPAAL model of modified a single agent plan.

the agent reached to state GetObj, it cannot receive the correspond-ing signal from its sensor in order to move to the next state. Theinitial test shows that UPPAAL is able to verify the given properties,indicating its usability for ensuring correctness by detecting incon-sistencies and flaws in ALICA plans. In the provided case, UPPAALis able to detect a reachability property and the absence of dead-locks, which are useful for recognizing an incomplete specificationof compatibilities in ALICA plans. Moreover, from checking thereachability of states and deadlock freedom, livelock properties inALICA plans can also be detected.

To get a deeper impression on the results, we translate a secondscenario in which the agents can collaborate if necessary. This planis designed for multi-agents. Hence, the task must have an associ-ated cardinality of 2..∞. However, in this example, the maximumcardinality is five, as seen in Figure 9, because so far when we tryto verify with five agents, some of properties would highly increasethe verification time. This problem will be discussed at the endof this chapter. For this example, the mobile agents can performfollowing activities:

(1) Drive: going out of the base and searching the selected ob-jects.

(2) PickUp: picking up the objects, if the agent has failed to pickthem up, it sends a message to other agents and changes toWait state.

Figure 9: The ALICA plan for multi-agents.

(3) CheckStatus: checking the feedback from a sensor that willinform the agent whether the pickup process is successfulor not.

(4) PickUpTogether : collaboratively by picking up the intendedobject (in the experiments a success rate at 100% is used).

After applying the A2U to the ALICA plans, we receive theUPPAAL model. Similar to the first scenario, we use the Property 1to check the absence of deadlock in the system.

There is a deadlock in the given model, as shown by a red circleand the corresponding diagnostic traces given by UPPAAL in Figure10. Note thatMultiagent_Error and CheckStatusMA refer to UPPAALtemplates, followed by a number in a pair of parentheses that refersto the identity of the agents and their respective sensor. Fromthe diagnostic trace, we can observe that the deadlock occurredwhen two agents failed to pick up the objects, and both sent amessage to the other agents and waited. To overcome this issue, wearrange a solution by adding one transition to the ALICA plan (fromWaitOtherAgent to Committed state, see Figure 11). This transitionallows the agents to come to help another one when all of themfailed to pick up the objects. From the modified ALICA plan, were-translate it into UPPAAL,as shown in Figure 12. After applyingthose changes, the plan is verified with the following properties(Property 1 and 2 are similar to the first scenario):

Property 3: The agents can collaborate to pick up the objects. Assumethat we have released only two agents to work.

E<>(MultiAgent(0).PickUpTogether + Multi-Agent(1).PickUpTogether)==2)

Property 4: The propagation of a message from the agent to thesensor and vice versa happens in a bounded amount of time.

A[] (MultiAgent(0).GetObj imply Check-StatusMA(0).c4S <=9)

Property 5: the agent will eventually come to pick with anotherone, if one of them fails to pick up the objects.

A<>(forall (i:id_t) Status[i]==0) imply(forall (k:id_t) MultiAgent(k).PickUpTogether)

The verification results are shown in Figure 13. In our exper-iment, we recognize that in order to be verified, the propertiesrequire a substantial amount of processing time, particularly, whenwe increase the number of agents. For example, when there areonly four agents working, the verification process for Property 4takes around 45s to 47s seconds. However, when five agents are

Page 7: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City, Viet Nam

Table 2: The verification time of UPPAAL with the different number of agents.

Property#Agents 1 2 3 4 5

1 0.001s 0.073s 0.554s 20.155s *2 0.001s 0.001s 0.003s 0.09s 0.027s3 - 0.008s 0.01s 0.612s 3.143s4 - 0.062s 1.2s 45.79s *5 - 0.001s 0.001s 0.001s 0.001s

- The time in the table is "elapsed time" given by UPPAAL model checker.- Denote "*" to indicate that the verification did not terminate within a few hours and run out of memory.- Denote "-" to indicate that those properties are not verified.

Figure 10: The verification result and diagnostic traces ofmulti-agents.

Figure 11: The ALICA plan of multi-agents after fixing.

involved, the process runs out of memory after running for a few

(a) Main

(b) Checkstatus

Figure 12: The UPPAAL model of modified multi-agents af-ter translating.

hours. Table 2 shows the amount of time required for verifying theproperties.

6 CONCLUSIONThis paper focuses on introducing the use of model checking forverifying ALICA plans. We presented an algorithm namely AL-ICA2UPPAAL that maps our ALICA plans into timed UPPAALautomata. Then, the technique is implemented using the A2U tool,which translates the plans automatically into UPPAAL syntax. Each

Page 8: Formal Verification of ALICA Multi-agent Plans Using Model ... · Formal Verification of ALICA Multi-agent Plans Using Model Checking SoICT 2018, December 6–7, 2018, Danang City,

SoICT 2018, December 6–7, 2018, Danang City, Viet Nam N. Thao et al.

Figure 13: The result of verifications for modified multi-agents plan.

property will be examined in order to detect any inconsistencies andincompleteness within the model. Our proposed solution workswell in translating a number of models having limited size andcomplexity, as demonstrated using two example scenarios.

We are currently working on several extensions for A2U, addingthe capability to handle plans with higher size and complexity thatare implemented in our soccer robots and other agents using theALICA language. Furthermore, we are composing a database thatwill play the role as a “dictionary” which will make A2U convertALICA plans into UPPAAL formalism quicker and more reliable.Last but not least, the A2U will be presented as an add-on to thegraphical ALICA Plan Designer, so the user can easily check thecurrent model in the middle of the building process.

ACKNOWLEDGMENTSThis work has been supported by a collaboration project fundedby DFG/Germany under grant number GE776/20-1 and NAFOS-TED/Vietnam under grant number DFG 102.01-2016.03.

REFERENCES[1] Flora Amato, Nicola Mazzocca, Francesco Moscato, and Fatos Xhafa. 2018. Multi-

agent Collaborative Planning in Smart Environments. In Advances in IntelligentNetworking and Collaborative Systems, Leonard Barolli, Isaac Woungang, andOmar Khadeer Hussain (Eds.). Springer International Publishing, Cham, 250–261.

[2] Mathilde Arnaud, Veronique Cortier, and Stephanie Delaune. 2014. Modelingand verifying ad hoc routing protocols. Information and Computation 238 (2014),30 – 67. https://doi.org/10.1016/j.ic.2014.07.004 Special Issue on Security andRewriting Techniques.

[3] Howard Barringer, Klaus Havelund, and Robert A Morris. 2011. Checking FlightRules with TraceContract Application of a Scala DSL for Trace Analysis. (2011).

[4] Gerd Behrmann, Alexandre David, and Kim G Larsen. 2004. A tutorial on uppaal.In Formal methods for the design of real-time systems. Springer, 200–236.

[5] Edmund M Clarke, Orna Grumberg, and Doron Peled. 1999. Model checking. MITpress.

[6] Hyggo Oliveira de Almeida, Leandro Dias da Silva, Angelo Perkusich, and Evan-dro de Barros Costa. 2004. A formal approach for the modelling and verificationof multiagent plans based on model checking and Petri nets. In InternationalWorkshop on Software Engineering for Large-Scale Multi-agent Systems. Springer,162–179.

[7] Gilles Dowek, César Munoz, and Corina Pasareanu. 2007. A formal analysisframework for PLEXIL. In Proceedings of 3rd Workshop on Planning and PlanExecution for Real-World Systems. Citeseer, 45–51.

[8] Xiang Gan, Jori Dubrovin, and Keijo Heljanko. 2014. A symbolic model checkingapproach to verifying satellite onboard software. Science of Computer Program-ming 82 (2014), 44 – 55. https://doi.org/10.1016/j.scico.2013.03.005 Special Issueon Automated Verification of Critical Systems (AVoCS11).

[9] Lina Khatib, Nicola Muscettola, and Klaus Havelund. 2000. Verification of planmodels using UPPAAL. In International Workshop on Formal Approaches to Agent-Based Systems. Springer, 114–122.

[10] H. Bel Mokadem, B. Berard, V. Gourcuff, O. De Smet, and J. M. Roussel. 2010.Verification of a Timed Multitask System With Uppaal. IEEE Transactions onAutomation Science and Engineering 7, 4 (Oct 2010), 921–932. https://doi.org/10.1109/TASE.2010.2050199

[11] Stephan Opfer, Stefan Niemczyk, and Kurt Geihs. 2016. Multi-Agent Plan Veri-fication with Answer Set Programming. In Proceedings of the 3rd Workshop onModel-Driven Robot Software Engineering. ACM, 32–39.

[12] Hendrik Skubch. 2012. Modelling and controlling of behaviour for autonomousmobile robots. Springer Science & Business Media.

[13] Hendrik Skubch, Michael Wagner, Roland Reichle, and Kurt Geihs. 2011. A mod-elling language for cooperative plans in highly dynamic domains. Mechatronics21, 2 (2011), 423–433.

[14] Hendrik Skubch, Michael Wagner, Roland Reichle, Stefan Triller, and Kurt Geihs.2010. Towards a Comprehensive Teamwork Model for Highly Dynamic Domains..In ICAART (2). 121–127.

[15] Margaret H Smith, Gerard J Holzmann, Gordon C Cucullu, and BD Smith. 2005.Model Checking Autonomous Planners: Even the Best Laid PlansMust be Verified.In Aerospace Conference, 2005 IEEE. IEEE, 1–11.

[16] Vandi Verma, Tara Estlin, Ari Jónsson, Corina Pasareanu, Reid Simmons, and KamTso. 2005. Plan execution interchange language (PLEXIL) for executable plansand command sequences. In International symposium on artificial intelligence,robotics and automation in space (iSAIRAS).

[17] A. Witsch, S. Opfer, and K. Geihs. 2014. A formal multi-agent language forcooperative autonomous driving scenarios. In 2014 International Conference onConnected Vehicles and Expo (ICCVE). 546–551. https://doi.org/10.1109/ICCVE.2014.7297608

[18] Dianxiang Xu, Richard Volz, Thomas Ioerger, and John Yen. 2002. Modelingand verifying multi-agent behaviors using predicate/transition nets. In Proceed-ings of the 14th international conference on software engineering and knowledgeengineering. ACM, 193–200.