Marius Bozga
email: marius.bozga@univ-grenoble-alpes.fr

Radu Iosif
email: radu.iosif@univ-grenoble-alpes.fr

Joseph Sifakis
email: joseph.sifakis@univ-grenoble-alpes.fr

Checking Deadlock-Freedom of Parametric Component-Based Systems

We propose an automated method for computing inductive invariants used to proving deadlock freedom of parametric component-based systems. The method generalizes the approach for computing structural trap invariants from bounded to parametric systems with general architectures. It symbolically extracts trap invariants from interaction formulae defining the system architecture. The paper presents the theoretical foundations of the method, including new results for the first order monadic logic and proves its soundness. It also reports on a preliminary experimental evaluation on several textbook examples.

Modern computing systems exhibit dynamic and reconfigurable behavior. To tackle the complexity of such systems, engineers extensively use architectures that enforce, by construction, essential properties, such as fault tolerance or mutual exclusion. Architectures can be viewed as parametric operators that take as arguments instances of components of given types and enforce a characteristic property. For instance, client-server architectures enforce atomicity and resilience of transactions, for any numbers of clients and servers. Similarly, token-ring architectures enforce mutual exclusion between any number of components in the ring.

Parametric verification is an extremely relevant and challenging problem in systems engineering. In contrast to the verification of bounded systems, consisting of a known set of components, there exist no general methods and tools succesfully applied to parametric systems. Verification problems for very simple parametric systems, even with finite-state components, are typically intractable [START_REF] German | Reasoning about systems with many processes[END_REF][START_REF] Bloem | Decidability of Parameterized Verification[END_REF]. Most work in this area puts emphasis on limitations determined mainly by three criteria [START_REF] Abdulla | Well (and better) quasi-ordered transition systems[END_REF] the topology of the architecture, (2) the coordination primitives, and (3) the properties to be verified.

The main decidability results reduce parametric verification to the verification of a bounded number of instances of finite state components. Several methods try to determine a cut-off size of the system, i.e. the minimal size for which if a property holds, then it holds for any size, e.g. Suzuki [START_REF] Suzuki | Proving properties of a ring of finite-state machines[END_REF], Emerson and Namjoshi [START_REF] Emerson | Reasoning about rings[END_REF]. Other methods identify systems with well-structured transition relations, for which symbolic enumeration of reachable states is feasible [START_REF] Abdulla | Well (and better) quasi-ordered transition systems[END_REF] or reduce to known decidable problems, such as reachability in vector addition systems [START_REF] German | Reasoning about systems with many processes[END_REF]. Typically, these methods apply to systems with global coordination. When theoretical decidability is not of concern, semi-algorithmic techniques such as regular model checking [START_REF] Kesten | Symbolic model checking with rich assertional languages[END_REF][START_REF] Abdulla | Regular model checking without transducers (on efficient verification of parameterized systems)[END_REF], SMT-based bounded model checking [START_REF] Alberti | A framework for the verification of parameterized infinite-state systems[END_REF][START_REF] Conchon | Cubicle: A parallel smt-based model checker for parameterized systems[END_REF], abstraction [START_REF] Baukus | Abstracting ws1s systems to verify parameterized networks[END_REF][START_REF] Bouajjani | Abstract regular model checking[END_REF] and automata learning [START_REF] Chen | Learning to prove safety over parameterised concurrent systems[END_REF] can be used to deal with more general classes of The interested reader can find a complete survey on parameterized model checking by Bloem et al. [9].

This paper takes a different angle of attack to the verification problem, seeking generality of the type of parametric systems and focusing on the verification of a particular but essential property: deadlock-freedom. The aim is to come up with effective methods for checking deadlock-freedom, by overcoming the complexity blowup stemming from the effective generation of reachability sets. We briefly describe our approach below.

A system is the composition of a finite number of component instances of given types, using interactions that follow the Behaviour-Interaction-Priorities (BIP) paradigm [START_REF] Basu | Rigorous component-based system design using the BIP framework[END_REF]. To simplify the technical part, we assume that components and interactions are finite abstractions of real-life systems. An instance is a finite-state transition system whose edges are labeled by ports. The instances communicate synchronously via a number of simultaneous interactions involving a set of ports each, such that no data is exchanged during interactions. If the number of instances in the system is fixed and known in advance, we say that the system is bounded, otherwise it is parametric.

a e r a f 1 b 1 f 1 b 1 b 2 f 2 b 2 f 2 e s u 1 u 2 w 1 w 2 Semaphore Task 1 Task 2 Γ = a ∧ b 1 ∨ a ∧ b 2 ∨ e ∧ f 1 ∨ e ∧ f 2 (a) Bounded System b (1) a e
... For instance, the bounded system in Figure 1a consist of component types Semaphore, with one instance, and Task, with two instances. A semaphore goes from the free state r to the taken state s by an acquire action a, and viceversa from s to r by a release action e. A task goes from waiting w to busy u by action b and viceversa, by action f . For the bounded system in Figure 1a, the interactions are {a, b 1 }, {a, b 2 }, {e, f 1 } and {e, f 2 }, depicted with dashed lines. Since the number of instances is known in advance, we can view an interaction as a minimal satisfying valuation of the boolean formula

f (i) b(i) b(1) f (1) u(i) u(1)
Γ = (a ∧ b 1 ) ∨ (a ∧ b 2 ) ∨ (e ∧ f 1 ) ∨ (e ∧ f 2 )
, where the port symbols are propositional variables. Because every instance has finitely many states, we can write a boolean formula

∆ = [¬r ∨ ¬(w 1 ∨ w 2 )] ∧ [¬s ∨ ¬(u 1 ∨ u 2 )
], this time over propositional state variables, which defines the configurations in which all interactions are disabled (deadlock). Proving that no deadlock configuration is reachable from the initial configuration r ∧w 1 ∧w 2 , requires finding an over-approximation (invariant) I of the reachable configurations, such that the conjunction I ∧ ∆ is not satisfiable.

The basic idea of our method, supported by the D-Finder deadlock detection tool [START_REF] Bensalem | D-finder: A tool for compositional deadlock detection and verification[END_REF] for bounded component-based systems, is to compute an invariant straight from the interaction formula, without going through costly abstract fixpoint iterations. The invariants we are looking for are in fact solutions of a system of boolean constraints Θ(Γ), of size linear in the size of Γ (written in DNF). In our example, Θ(Γ) = i=1,2 (r ∨ w i ) ↔ (s ∨ u i ). Finding the (minimal) solutions of this constraint can be done, as currently implemented in D-Finder, by exhaustive model enumeration using a SAT solver. Here we propose a more efficient solution, which consists in writing Θ(Γ) in DNF and remove the negative literals from each minterm. In our case, this gives the invariant

I = (r ∨ s) ∧ i=1,2 (w i ∨ u i ) ∧ (r ∨ u 1 ∨ u 2 ) ∧ (s ∨ w 1 ∨ w 2 ) and I ∧ ∆ is proved unsatisfiable using a SAT solver.
The main contribution of this paper is the generalization of this invariant generation method to the parametric case. To understand the problem, consider the parametric system from Figure 1, in which a Semaphore interacts with n Tasks, where n > 0 is not known in advance. The interactions are described by a fragment of first order logic, in which the ports are either propositional or monadic predicate symbols, in our case Γ = a∧∃i . b(i)∨e∧∃i . f (i). This logic, called Monadic Interaction Logic (MIL), is also used to express the constraints Θ(Γ) and compute their solutions. In our case, we obtain

I = (r ∨ s) ∧ [∀i . w(i) ∨ u(i)] ∧ [r ∨ ∃i . u(i)] ∧ [s ∨ ∃i . w(i)].
As in the bounded case, we can give a parametric description of deadlock configurations ∆ = [¬r ∨ ¬∃i . w(i)] ∧ [¬s ∨ ¬∃i . u(i)] and prove that I ∧ ∆ is unsatisfiable, using the decidability of MIL, based on an early small model property result due to Löwenheim [START_REF] Lowenheim | Über Möglichkeiten im Relativkalkül[END_REF]. In practice, we avoid the model enumeration suggested by this result and check the satisfiability of such queries using a decidable theory of sets with cardinality constraints [START_REF] Kuncak | Deciding boolean algebra with Presburger arithmetic[END_REF], available in the CVC4 SMT solver [START_REF] Bansal | A new decision procedure for finite sets and cardinality constraints in SMT[END_REF].

The paper is structured as follows: §1 presents existing results for checking deadlockfreedom of bounded systems using invariants, §2 formalizes the approach for computing invariants using MIL, §3 introduces cardinality constraints for invariant generation, §4 presents the integration of the above results within a verification technique for parametric systems and §5 reports on preliminary experiments carried out with a prototype tool. Finally, §6 presents concluding remarks and future work directions. For reasons of space, all proofs are given in [START_REF] Bozga | Checking Deadlock-Freedom of Parametric Component-Based Systems[END_REF].

Bounded Component-based Systems

A component is a tuple C = P, S, s 0 , ∆ , where P = {p, q, r, . . .} is a finite set of ports, S is a finite set of states, s 0 ∈ S is an initial state and ∆ ⊆ S × P × S is a set of transitions written s p -→ s . To simplify the technical details, we assume there are no two different transitions with the same port, i.e. if s

1 p 1 --→ s 1 , s 2 p 2 --→ s 2 ∈ ∆ and s 1 s 2 or s 1 s 2 then p 1 p 2 .
In general, this restriction can be lifted, at the cost of cluttering the presentation.

A bounded system S = C 1 , . . . , C n , Γ consists of a fixed number (n) of components C k = P k , S k , s 0 k , ∆ k and an interaction formula Γ, describing the allowed interactions. Since the number of components is known in advance, we write interaction formulae using boolean logic over the set of propositional variables BVar def = n k=1 (P k ∪ S k ). Here we intentionally use the names of states and ports as propositional variables.

A boolean interaction formula is either a ∈ BVar, f 1 ∧ f 2 or ¬ f 1 , where f i are formulae, for i = 1, 2, respectively. We define the usual shorthands

f 1 ∨ f 2 def = ¬(¬ f 1 ∧ ¬ f 2 ), f 1 → f 2 def = ¬ f 1 ∨ f 2 , f 1 ↔ f 2 def = ( f 1 → f 2 ) ∧ ( f 2 → f 1 )
. A literal is either a variable or its negation and a minterm is a conjunction of literals. A formula is in disjunctive normal form (DNF) if it is written as n i=1 m i j=1 i j , where i j is a literal. A formula is positive if and only if each variable occurs under an even number of negations, or, equivalently, its DNF forms contains no negative literals. We assume interaction formulae of bounded systems to be always positive.

A boolean valuation β : BVar → { , ⊥} maps each propositional variable to either true ( ) or false (⊥). We write β | = f if and only if f = , when replacing each boolean variable a with β(a) in f . We say that β is a model of f in this case and write f ≡ g for

[[ f ]] = [[g]], where [[ f ]] def = {β | β | = f }. Given two valuations β 1 and β 2 we write β 1 ⊆ β 2 if and only if β 1 (a) = implies β 2 (a) = , for each variable a ∈ BVar. We write f ≡ µ g for [[ f ]] µ = [[g]] µ , where [[ f ]] µ def = {β ∈ [[ f ]] | for all β : β ⊆ β and β β only if β [[ f ]]
} is the set of minimal models of f .

Execution Semantics of Bounded Systems

We use 1-safe marked Petri Nets to define the set of executions of a bounded system. A Petri Net (PN) is a tuple N = S , T, E , where S is a set of places, T is a set of transitions, S ∩ T = ∅, and E ⊆ S × T ∪ T × S is a set of edges. The elements of S ∪ T are called nodes. For a node n, let

• n def = {m ∈ S ∪ T | E(m, n) = 1}, n • def = {m ∈ S ∪ T | E(n, m) = 1}
and lift these definitions to sets of nodes, as usual.

Fig. 2: PN for Mutual Exclusion

A marking for a PN N = S , T, E is a function m : S → N. A marked Petri net is a pair N = (N, m 0 ), where m 0 is the initial marking of N = S , T, E . We consider that the reader is familiar with the standard execution semantics of a marked PN. A marking m is reachable in N if and only if there exists a sequence of transitions leading fom m 0 to m. We denote by R(N) the set of reachable markings of N. A set of markings M is an invariant of N = (N, m 0 ) if and only if m 0 ∈ M and M is closed under the transitions of N. A marked PN N is 1-safe if m(s) ≤ 1, for each s ∈ S and each m ∈ R(N). In the following, we consider only marked PNs that are 1-safe. In this case, any (necessarily finite) set of reachable markings can be defined by a boolean formula, which identifies markings with the induced boolean valuations. A marking m is a deadlock if for no transition is enaled in m and let D(N) be the set of deadlocks of

N. A marked PN N is deadlock-free if and only if R(N) ∩ D(N) = ∅. A sufficient condition for deadlock freedom is M ∩ D(N) = ∅, for some invariant M of N.
In the rest of this section, we fix a bounded system S = C 1 , . . . , C n , Γ , where

C k = P k , S k , s 0 k , ∆ k , for all k ∈ [1, n]
and Γ is a positive boolean formula, over propositional variables denoting ports. The set of executions of S is given by the 1-safe marked PN N S = (N, m 0 ), where

N = ( n i=1 S i , T, E), m 0 (s) = 1 if and only if s ∈ {s 0 i | i ∈ [1, n]} and
T , E are as follows. For each minimal model β ∈ [[Γ]] µ , we have a transition t β ∈ T and

edges (s i , t β ), (t β , s i ) ∈ E, for all i ∈ [1, n] such that s i p i -→ s i ∈ ∆ i and β(p i ) = . Moreover, nothing else is in T or E.
For example, the marked PN from Figure 2 describes the set of executions of the bounded system from Figure 1a. Note that each transition of the PN corresponds to a minimal model of the interaction formula

Γ = a ∧ b 1 ∨ a ∧ b 2 ∨ e ∧ f 1 ∨ e ∧ f 2 ,
or equivalently, to the set of (necessarily positive) literals of some minterm in the DNF of Γ.

Proving Deadlock Freedom of Bounded Systems

A bounded system S is deadlock-free if and only if its corresponding marked PN N S is deadlock-free. In the following, we prove deadlock-freedom of a bounded system, by defining a class of invariants that are particularly useful for excluding unreachable deadlock markings.

Given a Petri Net N = (S , T, E), a set of places W ⊆ S is called a trap if and only if

W • ⊆ • W. A trap W of N is a marked trap of the marked PN N = (N, m 0 ) if and only if m 0 (s) = for some s ∈ W.
A minimal marked trap is a marked trap such that none of its strict subsets is a marked trap. A marked trap defines an invariant of the PN because some place in the trap will always be marked, no matter which transition is fired. The trap invariant of N is the least set of markings that mark each trap of N. Clearly, the trap invariant of N subsumes the set of reachable markings of N, because the latter is the least invariant of N and invariants are closed under intersection1 .

Lemma 1. Given a bounded system S, the boolean formula:

Trap(N S ) def = { k i=1 s i | {s 1 , . . . , s k } is a marked trap of N S } defines an invariant of N S .
Next, we describe a method of computing trap invariants that does not explicitly enumerate all the marked traps of a marked PN. First, we consider a trap constraint Θ(Γ), derived from the interaction formula Γ, in linear time. By slight abuse of notation, we define, for a given port p ∈ P i of the component C i , for some i ∈ [1, n], the pre-and post-state of p in C i as • p def = s and p • def = s , where s p -→ s is the unique rule2 involving p in ∆ i , and 3 that any satisfying valuation of Θ(Γ) defines a trap of N S and, moreover, any such trap is defined in this way. We also consider the formula Init(S) def = n k=1 s 0 k defining the set of initially marked places of S, and prove the following:

• p = p • def = ⊥ if there is no such rule. Assuming that the interaction formula is written in DNF as Γ = N k=1 M k =1 p k , we define the trap constraint: Θ(Γ) def = N k=1 M k =1 • p k → M k =1 p k • It is not hard to show
Lemma 2.
Let S be a bounded system with interaction formula Γ and β be a boolean valuation. Then

β ∈ [[Θ(Γ) ∧ Init(S)]] iff {s | β(s) = } is a marked trap of N S . Moreover, β ∈ [[Θ(Γ) ∧ Init(S)]] µ iff {s | β(s) = } is a minimal marked trap of N S .
Because Θ(Γ) and Init(S) are boolean formulae, it is, in principle, possible to compute the trap invariant Trap(N S ) by enumerating the (minimal) models of Θ(Γ)∧Init(S) and applying the definition from Lemma 1. However, model enumeration is inefficient and, moreover, does not admit generalization for the parametric case, in which the size of the system is unknown. For these reasons, we prefer a computation of the trap invariant, based on two symbolic transformations of boolean formulae, described next.

For a formula f we denote by f + the positive formula obtained by deleting all negative literals from the DNF of f . We shall call this operation positivation. Second, for a positive boolean formula f , we define the dual formula ( f ) ∼ recursively on the structure of f , as follows: (

f 1 ∧ f 2 ) ∼ def = f 1 ∼ ∨ f 2 ∼ , ( f 1 ∨ f 2 ) ∼ def = f 1 ∼ ∧ f 2
∼ and a ∼ def = a, for any a ∈ BVar. Note that f ∼ is equivalent to the negation of the formula obtained from f by substituting each variable a with ¬a in f .

The following theorem gives the main result of this section, the symbolic computation of the trap invariant of a bounded system, directly from its interaction formula. Theorem 1. For any bounded system S, with interaction formula Γ, we have:

Trap(N S ) ≡ [Θ(Γ) ∧ Init(S)] + ∼
Intuitively, any satisfying valuation of Θ(Γ)∧Init(S) defines an initially marked trap of N S and a minimal such valuation defines a minimal such trap (Lemma 2). Instead of computing the minimal satisfying valuations by model enumeration, we directly cast the above formula in DNF and remove the negative literals. This is essentially because the negative literals do not occur in the propositional definition of a set of places 4 . Then the dualization of this positive formula yields the trap invariants in CNF, as a conjunction over disjunctions of propositional variables corresponding to the places inside a minimal initially marked trap.

Just as any invariants, trap invariants can be used to prove absence of deadlocks in a bounded system. Assuming, as before, that the interaction formula is given in DNF as Γ = N k=1 M k =1 p k , we define the set of deadlock markings of N S by the formula

∆(Γ) def = N k=1 M k =1 ¬( • p k ).
This is the set of configurations in which all interactions are disabled. With this definition, proving deadlock freedom amounts to proving unsatisfiability of a boolean formula.

Corollary 1. A bounded system S with interaction formula Γ is deadlock-free if the boolean formula [Θ(Γ) ∧ Init(S)] + ∼ ∧ ∆(Γ) is unsatisfiable.

Parametric Component-based Systems

From now on we shall focus on parametric systems, consisting of a fixed set of component types C 1 , . . . , C n , such that the number of instances of each type is not known in advance. These numbers are given by a function M : [1, n] → N, where M(k) denotes the number of components of type C k that are active in the system. To simplify the technical presentation of the results, we assume that all instances of a component type are created at once, before the system is started 5 . For the rest of this section, we fix a parametric system S = C 1 , . . . , C n , M, Γ , where each component type C k = P k , S k , s 0 k , ∆ k has the same definition as a component in a bounded system and Γ is an interaction formula, written in the fragment of first order logic, defined next.

Monadic Interaction Logic

For each component type C k , where k ∈ [1, n], we assume a set of index variables Var k and a set of predicate symbols Pred k def = P k ∪ S k . Similar to the bounded case, we use state and ports names as monadic (unary) predicate symbols. We also define the sets

Var def = n k=1
Var k and Pred def = n k=1 Pred k . Moreover, we consider that Var k ∩ Var = ∅ and Pred k ∩ Pred = ∅, for all 1 ≤ k < ≤ n. For simplicity's sake, we assume that all predicate symbols in Pred are of arity one. For component types C k , such that M(k) = 1 and predicate symbols pr ∈ Pred k , we shall write pr instead of pr(1), as in the interaction formula of the system from Figure 1b. The syntax of the monadic interaction logic (MIL) is given below: i, j ∈ Var index variables

φ := i = j | pr(i) | φ 1 ∧ φ 2 | ¬φ 1 | ∃i . φ 1
where, for each predicate atom pr(i), if pr ∈ Pred k and i ∈ Var then k = . We use the shorthands ∀i . φ 1 def = ¬(∃i . ¬φ 1 ) and distinct(i 1 , . . . , i m ) def = 1≤ j< ≤m ¬i j = i6 . A sentence is a formula in which all variables are in the scope of a quantifier. A formula is positive if each predicate symbol occurs under an even number of negations. The semantics of MIL is given in terms of structures I = (U, ν, ι), where:

-U def = [1, max n k=1 M(k)]
is the universe of instances, over which variables range, -ν : Var → U is a valuation mapping variables to elements of the universe, -ι : Pred → 2 U is an interpretation of predicates as subsets of the universe. For a structure I = (U, ν, ι) and a formula φ, the satisfaction relation I | = φ is defined as:

I | = ⊥ ⇔ never I | = i = j ⇔ ν(i) = ν( j) I | = p(i) ⇔ ν(i) ∈ ι(p) I | = ∃i . φ 1 ⇔ (U, ν[i ← m], ι) | = φ 1 for some m ∈ [1, M(k)]
provided that i ∈ Var k where ν[i ← m] is the valuation that acts as ν, except for i, which is assigned to m. Whenever I | = φ, we say that I is a model of φ. It is known that, if a MIL formula has a model, then it has a model with universe of cardinality at most exponential in the size (number of symbols) of the formula [START_REF] Lowenheim | Über Möglichkeiten im Relativkalkül[END_REF]. This result, due to Löwenheim, is among the first decidability results for a fragment of first order logic.

Structures are partially ordered by pointwise inclusion, i.e. for

I i = (U, ν i , ι i ), for i = 1, 2, we write I 1 ⊆ I 2 iff ι 1 (p) ⊆ ι 2 (p),
φ 1 ≡ φ 2 for [[φ 1 ]] = [[φ 2 ]] and φ 1 ≡ µ φ 2 for [[φ 1 ]] µ = [[φ 2 ]] µ .

Execution Semantics of Parametric Systems

We consider the interaction formulae of parametric systems to be finite disjunctions of formulae of the form below: ∃i 1 . . . ∃i ∧ ϕ ∧ j=1 p j (i j ) ∧ +m j= +1 ∀i j . ψ j → p j (i j )

(1) where ϕ, ψ +1 , . . . , ψ +m are conjunctions of equalities and disequalities involving index variables. Intuitively, the formulae (1) state that there are at most component instances that engage in a multiparty rendez-vous interaction on ports p 1 (i 1 ), . . . , p (i ), together with a broadcast to the ports p +1 (i +1 ), . . . , p +m (i +m ) of the instances that fulfill the constraints ψ +1 , . . . , ψ +m . Observe that, if m = 0, the above formula corresponds to a multiparty (generalized) rendez-vous interaction ∃i 1 . . . ∃i ∧ ϕ ∧ j=1 p j (i j ). An example of peer-to-peer rendez-vous is the parametric system from Figure 1. Another example of broadcast is given below.

Example 1. Consider the parametric system obtained from an arbitrary number of Worker components (Figure 3), where C 1 = Worker, Var 1 = {i, i 1 , i 2 , j} and Pred 1 = {a, b, f, u, w}. Any pair of instances can jointly execute the b (begin) action provided all others are taking the a (await) action. Any instance can also execute alone the f (finish) action.

u(i 2 ) f (i 1 ) Worker(i 1 ) f (i 2 ) Worker(i 2 ) f ( j) Worker( j) a( j) b( j) ... ... ... ... b(i 1 ) a(i 1 ) a(i 2 ) b(i 2 ) b(i 1 ) f (i 2 ) f ( j) a(i 1 ) a(i 2 ) a( j) b(i 2 ) b( j) f (i 1 )
w(i 1 ) w(i 2 ) w( j)

u(i 1 ) u( j) Γ = [∃i 1 ∃i 2 . i 1 i 2 ∧ b(i 1 ) ∧ b(i 2 ) ∧ ∀ j . j i 1 ∧ j i 2 → a( j)] ∨ ∃i. f (i) Fig. 3: Parametric System with Broadcast
The execution semantics of a parametric system S is the marked PN N S = (N, m 0 ), where

N = ( n k=1 S k × [1, M(k)], T, E), m 0 ((s 0 k , i)) = 1, for all k ∈ [1, n] and i ∈ [1, M(k)],
and the sets of transitions T and edges E are defined next. For each minimal model

I = (U, ν, ι) ∈ [[Γ]] µ , we have a transition t I ∈ T and the edges ((s i , k), t I ), (t I , (s i , k)) ∈ E for all i ∈ [1, n] such that s i p i -→ s i ∈ ∆ i and k ∈ ι(p i ).
Moreover, nothing else is in T or E. As a remark, unlike in the case of bounded systems, the size of the marked PN N S , that describes the execution semantics of a parametric system S, depends on the maximum number of instances of each component type. The definition of the trap invariant Trap(N S ) is the same as in the bounded case, except that, in this case, the size of the boolean formula depends on the (unbounded) number of instances in the system. The challenge, addressed in the following, is to define trap invariants using MIL formulae of a fixed size.

Computing Parametric Trap Invariants

To start with, we define the trap constraint of an interaction formula Γ consisting of a finite disjunction of (1) formulae, as a finite conjunction of formulae of the form below:

∀i 1 . . . ∀i . ϕ ∧ j=1 • p j (i j ) ∨ +m j= +1 ∃i j . ψ j ∧ • p j (i j ) → j=1 p j • (i j ) ∨ +m j= +1 ∃i j . ψ j ∧ p j • (i j )
where, for a port p ∈ P k of some component type C k , • p(i) and p(i) • denote the unique predicate atoms s(i) and s (i), such that s p -→ s ∈ ∆ k is the (unique) transition involving p in T k , or ⊥ if there is no such rule. Example 2. For example, the trap constraint for the parametric (rendez-vous) system in Figure 1b

is ∀i.[r ∨ w(i)] → [s ∨ u(i)] ∧ ∀i.[s ∨ u(i)] → [r ∨ u(i)].
Analogously, the trap constraint for the parametric (broadcast) system in Figure 3 is:

∀i 1 .∀i 2 . [i 1 i 2 ∧ (w(i 1 ) ∨ w(i 2 ) ∨ ∃ j.( j i 1 ∧ j i 2 ∧ w( j)))] → [i 1 i 2 ∧ (u(i 1 ) ∨ u(i 2 ) ∨ ∃ j.( j i 1 ∧ j i 2 ∧ w( j)))] ∧ ∀i. u(i) → w(i)
We define a translation of MIL formulae into boolean formulae of unbounded size. Given a function M : [1, n] → N, the unfolding of a MIL sentence φ is the boolean formula B M (φ) obtained by replacing each existential [universal]

quantifier ∃i . ψ(i) [∀i . ψ(i)], for i ∈ Var k , by a finite disjunction [conjunction] M(k) =1 ψ[ /i] [ M(k) =1 ψ[ /i]],
where the substitution of the constant ∈ M(k) for the variable i is defined recursively as usual, except for pr(i)[ /i] def = (pr, ), which is a propositional variable. Further, we relate structures to boolean valuations of unbounded sizes. For a structure I = (U, ν, ι) we define the boolean valuation β I ((pr, )) = if and only if ∈ ι(pr), for each predicate symbol pr and each integer constant . Conversely, for each valuation β of the propositional variables (pr, ), there exists a structure I β = (U, ν, ι) such that ι(pr)

I β ∈ [[φ]]. 2. for each structure I ∈ [[φ]] µ , we have β I ∈ [[B M (φ) ]] µ and conversely, for each valuation β ∈ [[B M (φ) ]] µ , we have I β ∈ [[φ]] µ .
Considering the MIL formula Init(S)

def = n k=1 ∃i k . s 0 k (i k )
, that defines the set of initial configurations of a parametric system S, the following lemma formalizes the intuition behind the definition of parametric trap constraints: Lemma 4. Let S be a parametric system with interaction formula Γ and I be a structure. Then

I | = Θ(Γ) ∧ Init(S) iff {(s, k) | k ∈ ι(s)} is a marked trap of N S . Moreover, I ∈ [[Θ(Γ) ∧ Init(S)]] µ iff {(s, k) | k ∈ ι(s)} is a minimal marked trap of N S .
We are currently left with the task of computing a MIL formula which defines the trap invariant Trap(N S ) of a parametric component-based system S = C 1 , . . . , C n , M, Γ . The difficulty lies in the fact that the size of N S and thus, that of the boolean formula Trap(N S ) depends on the number M(k) of instances of each component type k ∈ [1, n].

As we aim at computing an invariant able to prove safety properties, such as deadlock freedom, independently of how many components are present in the system, we must define the trap invariant using a formula depending exclusively on Γ, i.e. not on M.

Observe first that Trap(N S ) can be equivalently defined using only the minimal marked traps of N S , which, by Lemma 4, are exactly the sets {(s, k) | k ∈ ι(s)}, defined by some structure (U, ν, ι) ∈ [[Θ(Γ) ∧ Init(S)]] µ . Assuming that the set of structures [[Θ(Γ) ∧ Init(S)]] µ , or an over-approximation of it, can be defined by a positive MIL formula, the trap invariant is defined using a generalization of boolean dualisation to predicate logic, defined recursively, as follows:

(i = j) ∼ def = ¬i = j (φ 1 ∨ φ 2 ) ∼ def = φ 1 ∼ ∧ φ 2 ∼ (∃i . φ 1 ) ∼ def = ∀i . φ 1 ∼ p(i) ∼ def = p(i) (¬i = j) ∼ def = i = j (φ 1 ∧ φ 2 ) ∼ def = φ 1 ∼ ∨ φ 2 ∼ (∀i . φ 1 ) ∼ def = ∃i . φ 1 ∼
The crux of the method is the ability of defining, given an arbitrary MIL formula φ, a positive MIL formula φ ⊕ that preserve its minimal models, formally φ ≡ µ φ ⊕ . Because of quantification over unbounded domains, a MIL formula φ does not have a disjunctive normal form and thus one cannot define φ ⊕ by simply deleting the negative literals in DNF, as was done for the definition of the positivation operation (.) + , in the propositional case. For now we assume that the transformation (.) ⊕ of monadic predicate formulae into positive formulae preserving minimal models is defined (a detailed presentation of this step is given next in §3) and close this section with a parametric counterpart of Theorem 1.

Theorem 2. For any parametric system S = C 1 , . . . , C n , M, Γ , we have Trap(N S ) ≡ B M (Θ(Γ) ∧ Init(S)) ⊕ ∼

Cardinality Constraints

This section is concerned with the definition of a positivation operator (.) ⊕ for MIL sentences, whose only requirements are that φ ⊕ is positive and φ ≡ µ φ ⊕ . For this purpose, we use a logic of quantifier-free boolean cardinality constraints [START_REF] Kuncak | Deciding boolean algebra with Presburger arithmetic[END_REF][START_REF] Bansal | A new decision procedure for finite sets and cardinality constraints in SMT[END_REF] as an intermediate language, on which the positive formulae are defined. The translation of MIL into cardinality constraints is done by an equivalence-preserving quantifier elimination procedure, described in §3.1. As a byproduct, since the satisfiability of quantifier-free cardinality constraints is NP-complete [START_REF] Kuncak | Deciding boolean algebra with Presburger arithmetic[END_REF] and integrated with SMT [START_REF] Bansal | A new decision procedure for finite sets and cardinality constraints in SMT[END_REF], we obtain a practical decision procedure for MIL that does not use model enumeration, as suggested by the small model property [START_REF] Lowenheim | Über Möglichkeiten im Relativkalkül[END_REF]. Finally, the definition of a positive MIL formula from a boolean combination of quantifier-free cardinality constraints is given in §3.2.

We start by giving the definition of cardinality constraints. Given the set of monadic predicate symbols Pred, a boolean term is generated by the syntax:

t := pr ∈ Pred | ¬t 1 | t 1 ∧ t 2 | t 1 ∨ t 2
When there is no risk of confusion, we borrow the terminology of propositional logic and say that a term is in DNF if it is a disjunction of conjunctions (minterms). We also write t 1 → t 2 if and only if the implication is valid when t 1 and t 2 are interpreted as boolean formulae, with each predicate symbol viewed as a propositional variable. Two boolean terms t 1 and t 2 are said to be compatible if and only if t 1 ∧ t 2 is satisfiable, when viewed as a boolean formula.

For a boolean term t and a first-order variable i ∈ Var, we define the shorthand t(i) recursively, as (¬t 1 )(i)

def = ¬t 1 (i), (t 1 ∧ t 2 )(i) def = t 1 (i) ∧ t 2 (i) and (t 1 ∨ t 2 )(i) def = t 1 (i) ∨ t 2 (i).
Given a positive integer n ∈ N and t a boolean term, we define the following cardinality constraints, by MIL formulae:

|t| ≥ n def = ∃i 1 . . . ∃i n . distinct(i 1 , . . . , i n ) ∧ n j=1 t(i j ) |t| ≤ n def = ¬(|t| ≥ n + 1)
We shall further use cardinality constraints with n = ∞, by defining |t| ≥ ∞ def = ⊥ and |t| ≤ ∞ def = . The intuitive semantics of cardinality constraints is formally defined in terms of structures I = (U, ν, ι) by the semantics of monadic predicate logic, given in the previous. For instance, |p ∧ q| ≥ 1 means that the intersection of the sets p and q is not empty, whereas |¬p| ≤ 0 means that p contains all elements from the universe.

Quantifier Elimination

Given a sentence φ, written in MIL, we build an equivalent boolean combination of cardinality constraints qe(φ), using quantifier elimination. We describe the elimination of a single existential quantifier and the generalization to several existential or universal quantifiers is immediate. Assume that φ = ∃i 1 . k∈K ψ k (i 1 , . . . , i m ), where K is a finite set of indices and, for each k ∈ K, ψ k is a quantifier-free conjunction of atomic propositions of the form i j = i , pr(i j ) and their negations, for some j, ∈ [1, m]. We write, equivalently, φ ≡ k∈K ϕ k ∧ ∃i 1 . θ k (i 1 , . . . , i m ), where ϕ k does not contain occurrences of i 1 and θ k is a conjunction of literals of the form pr(i 1 ), ¬pr(i 1 ), i 1 = i j and ¬i 1 = i j , for some j ∈ [2, m]. For each k ∈ K, we distinguish the following cases:

1

. if i 1 = i j is a consequence of θ k , for some j > 1, let qe(∃i 1 . θ k ) def = θ k [i j /i 1 ]. 2. else, θ k = j∈J k ¬i 1 = i j ∧ t k (i 1 ) for some J k ⊆ [2,
m] and boolean term t k , and let:

qe(∃i 1 . θ k ) def = J⊆J k distinct {i j } j∈J ∧ j∈J t k (i j ) → |t k | ≥ ||J|| + 1 qe(φ) def = k∈K ϕ k ∧ qe(∃i 1 . θ k )
Universal quantification is dealt with using the duality qe(∀i 1 . ψ) def = ¬qe(∃i 1 . ¬ψ). For a prenex formula φ = Q n i n . . . Q 1 i 1 . ψ, where Q 1 , . . . , Q n ∈ {∃, ∀} and ψ is quantifierfree, we define, recursively qe(φ)

def = qe(Q n i n . qe(Q n-1 i n-1 . . . Q 1 i 1 . ψ)).
It is easy to see that, if φ is a sentence, qe(φ) is a boolean combination of cardinality constraints. The correctness of the construction is a consequence of the following lemma:

Lemma 5. Given a MIL formula φ = Q n i n . . . Q i i 1 . ψ, where Q 1 , . . . , Q n ∈ {∀, ∃}
and ψ is a quantifier-free conjunction of equality and predicate atoms, we have φ ≡ qe(φ).

Example 3. (contd. from Example 2) Below we show the results of quantifier elimination applied to the conjunction Θ(Γ) ∧ Init(S) for the system in Figure 1b: (¬r

∧ ¬s ∧ |w ∧ ¬u| ≤ 0 ∧ |u ∧ ¬w| ≤ 0 ∧ 1 ≤ |w|) ∨ (¬r ∧ |w ∧ ¬u| ≤ 0 ∧ |¬w| ≤ 0 ∧ 1 ≤ |w|) ∨ (s ∧ r) ∨ (s ∧ |¬w| ≤ 0 ∧ 1 ≤ |w|) ∨ (¬s ∧ |¬u| ≤ 0 ∧ |u ∧ ¬w| ≤ 0 ∧ 1 ≤ |w|) ∨ (|¬u| ≤ 0 ∧ |¬w| ≤ 0 ∧ 1 ≤ |w|) .
Similarly, for the system in Figure 3, we obtain the following cardinality constraints:

(3 ≤ |w| ∧ |u ∧ ¬w| ≤ 0) ∨ (2 ≤ |w| ∧ |w ∧ ¬u| ≤ 1 ∧ |u ∧ ¬w| ≤ 0) ∨ (|¬u| ≤ 1 ∧ |¬u ∧ ¬w| ≤ 0 ∧ |u ∧ ¬w| ≤ 0 ∧ 1 ≤ |w|) ∨ (|w ∧ ¬u| ≤ 0 ∧ |u ∧ ¬w| ≤ 0 ∧ 1 ≤ |w|) .

Building Positive Formulae that Preserve Minimal Models

Let φ be a MIL formula, not necessarily positive. We shall build a positive formula φ ⊕ , such that φ ≡ µ φ ⊕ . By the result of the last section, φ is equivalent to a boolean combination of cardinality constraints qe(φ), obtained by quantifier elimination. Thus we assume w.l.o.g. that the DNF of φ is a disjunction of conjunctions of the form i∈L |t i | ≥ i ∧ j∈U t j ≤ u j , for some sets of indices L, U and some positive integers { i } i∈L and {u j } j∈U .

For a boolean combination of cardinality constraints ψ, we denote by P(ψ) the set of predicate symbols that occur in a boolean term of ψ and by P + (ψ) (P -(ψ)) the set of predicate symbols that occur under an even (odd) number of negations in ψ. The following proposition allows to restrict the form of φ even further, without losing generality: Proposition 1. Given MIL formulae φ 1 and φ 2 , for any positivation operator (.) ⊕ , the following hold:

1.

(φ 1 ∨ φ 2 ) ⊕ ≡ µ φ 1 ⊕ ∨ φ 2 ⊕ , 2. (φ 1 ∧ φ 2 ) ⊕ ≡ µ φ 1 ⊕ ∧ φ 2 ⊕ , provided that P(φ 1 ) ∩ P(φ 2 ) = ∅.
From now on, we assume that φ is a conjunction of cardinality constraints that cannot be split as φ = φ 1 ∧ φ 2 , such that P(φ 1 ) ∩ P(φ 2 ) = ∅.

Let us consider a cardinality constraint |t| ≥ that occurs in φ. Given a set P of predicate symbols, for a set of predicates S ⊆ P, the complete boolean minterm corresponding to S with respect to P is t P S def = p∈S p ∧ p∈P\S ¬p. Moreover, let S t def = {S ⊆ P(φ) | t S → t} be the set of sets S of predicate symbols for which the complete minterm t S implies t. Finally, each cardinality constraint |t| ≥ is replaced by the equivalent disjunction 7 , in which each boolean term is complete with respect to P(φ): Notice that, restricting the sets of predicates in S t to subsets of P(φ), instead of the entire set of predicates, allows to apply Proposition 1 and reduce the number of complete minterm to be considered. That is, whenever possible, we write each minterm i∈L |t i | ≥ i ∧ j∈U t j ≤ u j in the DNF of φ as ψ 1 ∧ . . . ∧ ψ k , such that P(ψ i ) ∩ P(ψ j ) = ∅ for all 1 ≤ i < j ≤ k. In practice, this optimisation turns out to be quite effective, as shown by the small execution times of our test cases, reported in §5.

The second step is building, for each conjunction C = { S ≤ t P(φ) S ∧ t P(φ)

S

≤ u S | S ⊆ P(φ)} 8 , as above, a positive formula C ⊕ , that preserves its set of minimal models [[C]] µ . The generalization to arbitrary boolean combinations of cardinality constraints is a direct consequence of Proposition 1. Let L + (φ) (resp. L -(φ)) be the set of positive boolean combinations of predicate symbols p ∈ P + (φ) (resp. ¬p, where p ∈ P -(φ)). Further, for a complete minterm t P S , we write t P S + (t P S -) for the conjunction of the positive (negative) literals in t P S . Then, we define:

C ⊕ def = |τ| ≥ t P(φ) S + →τ S | τ ∈ L + (φ) ∧ |τ| ≤ t P(φ) S - →τ u S | τ ∈ L -(φ)} It is not hard to see that C ⊕ is a positive MIL formula, because: -for each τ ∈ L + (φ), we have |τ| ≥ k ≡ ∃i 1 . . . ∃i k . distinct(i 1 , . . . , i k ) ∧ k j=1 τ( j) and -for each τ ∈ L -(φ), we have |τ| ≤ k ≡ ∀i 1 . . . ∀i k+1 . distinct(i 1 , . . . , i k+1 ) → k+1
j=1 ¬τ(i j ). The following lemma proves that the above definition meets the second requirement of positivation operators, concerning the preservation of minimal models. Similarly, the result of positivation applied to the second conjunct of the DNF cardinality constraint corresponding to the system in Figure 3 is given below:

2 ≤ |w| ∧ |w ∧ ¬u| ≤ 1 ∧ |u ∧ ¬w| ≤ 0 ⊕ = 2 ≤ |w| ∧ 1 ≤ |u ∧ w|
Here, the number of elements in w is at least 2 and, in any structure I = (U, ν, ι), we must have ι(u) ⊆ ι(w) and at most one element in ι(w) \ ι(u). Consequently, the intersection of the sets ι(u) and ι(w) must contain at least one element, i.e. |u ∧ w| ≥ 1.

Proving Deadlock Freedom of Parametric Systems

We have gathered all the ingredients necessary for checking deadlock freedom of parametric systems, using our method based on trap invariant generation (Figure 4). In particular, we derive a trap constraint Θ(Γ) directly from the interaction formula Γ, both of which are written in MIL. Second, we compute a positive formula that preserves the set of minimal models of Θ(Γ) ∧ Init(S), by first converting the MIL formula into a quantifier-free cardinality constraint, using quantifier elimination, and deriving a positive MIL formula from the latter.

The conjunction between the dual of this positive formula and the formula ∆(Γ) that defines the deadlock states is then checked for satisfiability. Formally, given a parametric system S, with an interaction formula Γ written in the form (1), the MIL formula

∆(Γ) def = ∀i 1 . . . ∀i . ϕ → j=1 ¬ • p j (i j ) ∨ +m j= +1 ∃i j . ψ j ∧ ¬ • p j (i j )
We state a sufficient verification condition for deadlock freedom in the parametric case:

Corollary 2. A parametric system S = C 1 , . . . , C n , M, Γ is deadlock-free if (Θ(Γ) ∧ Init(S)) ⊕ ∼ ∧ ∆(Γ) → ⊥
The satisfiability check is carried out using the conversion to cardinality constraints via quantifier elimination §3.1 and an effective set theory solver for cardinality constraints, implemented in the CVC4 SMT solver [START_REF] Barrett | CVC4[END_REF].

Experimental Results

To assess our method for proving deadlock freedom of parametric component-based system, we ran a number of experiments on systems with a small numbers of rather simple component types, but with nontrivial interaction patterns, given by MIL formulae. The task-sem i/n examples, i = 1, 2, 3, are generalizations of the parametric Task-Semaphore example depicted in Figure 1b, in which n Tasks synchronize using n Semaphores, such that i Tasks interact with a single Semaphore at once, in a multiparty rendez-vous. In a similar vein, the broadcast i/n examples, i = 2, 3 are generalizations of the system in Figure 3, in which i out of n Workers engage in rendez-vous on the b port, whereas all the other stay idle -here idling is modeled as a broadcast on the a ports. Finally, in the sync i/n examples, i = 1, 2, 3, we consider systems composed of n Workers (Figure 1b) such that either i out of n instances simultaneously interact on the b ports, or all interact on the f ports. Notice that, for i = 2, 3, these systems have a deadlock if and only if n 0 mod i. This is because, if n = m mod i, for some 0 < m < i, there will be be m instances that cannot synchronize on their b port, in order to move from w to u, in order to engage in the f broadcast.

All experiments were carried out on a Intel(R) Xeon(R) CPU @ 2.00GHz virtual machine with 4GB of RAM. Table 1 shows separately the times needed to generate example interaction formula t-gen t-smt result task-sem 1/n ∃i∃ j 1 . a(i) ∧ b( j 1 ) ∃i∃ j 1 . e(i) ∧ f ( j 1 ) 22 ms 20 ms unsat task-sem 2/n ∃i∃ j 1 ∃ j 2 . j 1 j 2 ∧ a(i) ∧ b( j 1 ) ∧ b( j 2 ) ∃i∃ j 1 ∃ j 2 . j 1 j 2 ∧ e(i) ∧ f ( j 1 ) ∧ f ( j 2 ) 34 ms 40 ms unsat task-sem 3/n ∃i∃ j 1 ∃ j 2 ∃ j 3 . distinct( j 1 , j 2 , j 3 ) ∧ a(i) ∧ b( j 1 ) ∧ b( j 2 ) ∧ b( j 3 ) ∃i∃ j 1 ∃ j 2 ∃ j 3 . distinct( j 1 , j 2 , j 3 ) ∧ e(i) ∧ f ( j 1 ) ∧ f ( j 2 ) ∧ f ( j 3 ) 73 ms 40 ms unsat broadcast 2/n ∃i 1 ∃i 2 .i 1 i 2 ∧ b(i 1 ) ∧ b(i 2 ) ∧ ∀ j. j i 1 ∧ j i 2 → a( j) ∃i. f (i) 14 ms 20 ms unsat broadcast 3/n ∃i 1 ∃i 2 ∃i 3 .distinct(i 1 , i 2 , i 3 ) ∧ b(i 1 ) ∧ b(i 2 ) ∧ b(i 3 ) ∧ ∀ j. j i 1 ∧ j i 2 ∧ j i

Conclusions

This work is part of a lasting research program on BIP linking two work directions:

(1) recent work on modeling architectures using interaction logics, and (2) older work on verification by using invariants. Its rationale is to overcome as much as possible complexity and undecidability issues by proposing methods which are adequate for the verification of essential system properties.

The presented results are applicable to a large class of architectures characterized by the MIL. A key technical result is the translation of MIL formulas into cardinality constraints. This allows on the one hand the computation of the MIL formula characterizing the minimal trap invariant. On the other hand, it provides a decision procedure for MIL, that leverages from recent advances in SMT, implemented in the CVC4 solver [START_REF] Barrett | CVC4[END_REF].

ΓFig. 1 :

 1 Fig. 1: Mutual Exclusion Example

  for all p ∈ Pred and I 1 ⊂ I 2 iff I 1 ⊆ I 2 and I 1 I 2 . As before, we define the sets [[φ]] = {I | I | = φ} and [[φ]] µ = {I ∈ [[φ]] | ∀I . I ⊂ I → I [[φ]]} of models and minimal models of a MIL formula, respectively. Given formulae φ 1 and φ 2 , we write

def=Lemma 3 .

 3 { | β((pr, )) = }, for each pr ∈ Pred. The following lemma relates the semantics of MIL formulae with that of their boolean unfoldings: Given a MIL sentence φ and a function M : [1, n] → N, the following hold: 1. for each structure I ∈ [[φ]], we have β I ∈ [[B M (φ) ]] and conversely, for each valuation β ∈ [[B M (φ) ]], we have

≥

  S | for some constants { S ∈ N} S ∈S t such that S ∈S t S = Note that because any two complete minterms t S and t T , for S T , are incompatible, then necessarily |t S ∨ t T | = |t S | + |t T |. Thus |t S ∨ t T | ≥ if and only if there exist 1 , 2 ∈ N such that 1 + 2 = and |t S | ≥ 1 , |t T | ≥ 2 , respectively.

Lemma 6 .

 6 Given P a finite set of monadic predicate symbols, { S ∈ N} S ⊆P and {u S ∈ N ∪ {∞}} S ⊆P sets of constants, for any conjunction C = { S ≤ t P S ∧ t P S ≤ u S | S ⊆ P}, we have C ≡ µ C ⊕ . Example 4. (contd. from Example 3) Consider the first minterm of the DNF of the cardinality constraint obtained by quantifier elimination in Example 3, from the system in Figure 1b. The result of positivation for this minterm is given below: ¬r ∧ ¬s ∧ |w ∧ ¬u| ≤ 0 ∧ |u ∧ ¬w| ≤ 0 ∧ 1 ≤ |w| ⊕ = 1 ≤ |u ∧ w| Intuitively, the negative literals ¬r and ¬s may safely disapear, because no minimal model will assign r or s to true. Further, the constraints |w ∧ ¬u| ≤ 0 and |u ∧ ¬w| ≤ 0 are equivalent to the fact that, in any structure I = (U, ν, ι), we must have ι(u) = ι(w). Finally, because |w| ≥ 1, then necessarily |u ∧ w| ≥ 1.

Fig. 4 :

 4 Fig. 4: Verification of Parametric Component-based Systems

Table 1 :

 1 ∃i 1 ∃i 2 . i 1 i 2 ∧ b(i 1 ) ∧ b(i 2 ) ∀i. f (i) 7 ms 50 ms sat sync 3/n ∃i 1 ∃i 2 ∃i 3 .distinct(i 1 , i 2 , i 3 ) ∧ b(i 1 ) ∧ b(i 2 ) ∧ b(i 3 ) ∀i. f (i)11 ms 40 ms sat Benchmarks the proof obligations (trap invariants and deadlock states) from the interaction formulae and the times needed by CVC4 1.7 to show unsatisfiabilty or come up with a model. All systems considered, for which deadlock freedom could not be shown using our method, have a real deadlock scenario that manifests only under certain modulo constraints on the number n of instances. These constraints cannot be captured by MIL formulae, or, equivalently by cardinality constraints, and would require cardinality constraints of the form |t| = n mod m, for some constants n, m ∈ N.

	3 → a( j)	∃i. f (i)	409 ms 20 ms unsat

The intersection of two or more invariants is again an invariant.

We have assumed that each port is associated a unique transition rule.

See [?] for a proof.

If the DNF is (p ∧ q) ∨ (p ∧ ¬r), the dualization would give (p ∨ q) ∧ (p ∨ ¬r). The first clause corresponds to the trap {p, q} (either p or q is marked), but the second does not directly define a trap. However, by first removing the negative literals, we obtain the traps {p, q} and {r}.

This is not a limitation, since dynamic instance creation can be simulated by considering that all instances are initially in a waiting state, which is left as result of an interaction involving a designated "spawn" port.

Throughout this paper, we consider that i∈I φ i = if I = ∅.

The constraints |t| ≤ u are dealt with as ¬(|t| ≥ u + 1).

Missing lower bounds S are replaced with 0 and missing upper bounds u S with ∞.

The research leading to these results has received funding from the European Union Horizon 2020 research and innovation programme under grant agreement no. 700665 CITADEL (Critical Infrastructure Protection using Adaptive MILS) and no. 730086 ERGO (European Robotic Goal-Oriented Autonomous Controller).