Universal Invariant Checking of Parametric Systems with Quantiﬁer-Free SMT Reasoning

. The problem of invariant checking in parametric systems – which are required to operate correctly regardless of the number and connections of their components – is gaining increasing importance in various sectors, such as communication protocols and control software. Such systems are typically modeled using quantiﬁed formulae, describing the behaviour of an unbounded number of (identical) components, and their automatic veriﬁcation often relies on the use of decidable fragments of ﬁrst-order logic in order to eﬀectively deal with the challenges of quantiﬁed reasoning. In this paper, we propose a fully automatic technique for invariant checking of parametric systems which does not rely on quantiﬁed reasoning. Parametric systems are modeled with array-based transition systems, and our method iteratively constructs a quantiﬁer-free abstraction by analyzing, with SMT-based invariant checking algorithms for non-parametric systems, increasingly-larger ﬁnite instances of the parametric system. Depending on the veriﬁcation result in the concrete instance, the abstraction is automatically reﬁned by leveraging canditate lemmas from inductive invariants, or by discarding previously computed lemmas. We implemented the method using a quantiﬁer-free SMT-based IC3 as underlying veriﬁcation engine. Our experimental evaluation demonstrates that the approach is competitive with the state of the art, solving several benchmarks that are out of reach for other tools.


Introduction
Parametric systems consist of a finite but unbounded number of components. Examples include communication protocols (e.g. leader election), feature systems, or control algorithms in various application domains (e.g. railways interlocking logics). The key challenge is to prove the correctness of the parametric system for all possible configurations corresponding to instantiations of the parameters.
Parametric systems can be described as symbolic array-based transition systems [9], where the dependence on the configuration is expressed with first-order quantifiers in the initial condition and the transition relation of the model.
In this paper, we propose a fully automated approach for solving the universal invariant problem of array-based systems. The distinguishing feature is that the approach, grounded in SMT, does not require dealing with quantified theories, with obvious computational advantages. The algorithm implements an abstraction-refinement loop, where the abstract space is a quantifier-free transition system over some SMT theories. Our inspiration and starting point is the Parameter Abstraction of [3,14], which we extend in two directions. First, we modify the definition of the abstraction, by introducing a set of different environment variables, which intuitively overapproximate the behaviour of all the instances not precisely tracked by the abstraction, and by introducing a special stuttering transition in which the environment is allowed to change non-deterministically. Second, we combine the abstraction with a method for automatically inferring candidate universal lemmas, which are used to strengthen the abstraction in case of spurious counterexamples. The candidate lemmas are obtained by generalization from the spuriousness proof carried out in a finite-domain instantiation of the concrete system. However, we do not require quantified reasoning to prove that they universally hold; rather, the algorithm takes into account the fact that candidate lemmas may turn out not to be universally valid. In such cases, the method is able to automatically discover such bad lemmas and discard them, by examining increasingly-higher-dimension bounded instances of the parametric system.
We implemented the method in a tool called Lambda. At its core, Lambda leverages modern model checking approaches for quantifier-free infinite-state systems, i.e. the SMT-based approach of IC3 with implicit abstraction [4], in contrast to other approaches [18] where the abstract space is Boolean. In our experimental evaluation, we compared Lambda with the state-of-the-art tools MCMT [10] and Cubicle [6]. The results show the advantage of the approach, that is able to solve multiple benchmarks that are out of reach for its competitors.
The rest of the paper is structured as follows. In Section 2 we present some logical background, and in Section 3 we describe array-based systems. We give an informal overview of the algorithm in Section 4. In Section 5 we define the abstraction and state its formal properties. In Section 6 we discuss the approach to concretization and refinement, and we present the techniques for inferring candidate lemmas. We discuss the related work in Section 7, and we present our experimental evaluation in Section 8. Finally, in Section 9 we draw some conclusions and present directions for future work. For lack of space, the proofs of our theoretical results are reported in an Appendix.

Preliminaries
Our setting is standard first order logic. A theory T in the SMT sense is a pair T = (Σ, C), where Σ is a first order signature and C is a class of models over Σ. A theory T is closed under substructure if its class C of structures is such that whenever M ∈ C and N is a substructure of M, then N ∈ C. We use the standard notions of Tarskian interpretation (assignment, model, satisfiability, validity, logical consequence). We refer to 0-arity predicates as Boolean variables, and to 0-arity uninterpreted functions as (theory) variables. A literal is an atom or its negation. A clause is a disjunction of literals. A formula is in conjunctive normal form (CNF) iff it is a conjuction of clauses. If x 1 , ..., x n are variables and φ is a formula, we might write φ(x 1 , ..., x n ) to indicate that all the variables occurring free in φ are in x 1 , ..., x n .
If φ is a formula, t is a term and v is a variable which occurs free in φ, we write φ[v/t] for the substitution of every occurrence of v with t. If t and v are vectors of the same length, we write φ[v/t] for the simultaneous substitution of each v i with the corresponding term t i . We use an if-then-else notation for formulae. We write if φ 1 then ψ 1 elif φ 2 then ψ 2 elif . . . ψ n−1 else ψ n to denote the formula ( Given a set of variables v, we denote with v the set {v |v ∈ v}. A symbolic transition system is a triple (v, I(v), T (v, v )), where v is a set of variables, and I(v), T (v, v ) are first order formulae over some signature. An assignment to the variables in v is a state. A state s is initial iff it is a model of I(v), i.e. s |= I(v). The states s, s denote a transition iff s ∪ s |= T (v, v ), also written T (s, s ). A path is a sequence of states s 0 , s 1 , . . . such that s 0 is initial and T (s i , s i+1 ) for all i. We denote paths with π, and with π[j] the j-th element of π. A state s is reachable iff there exists a path π such that π[i] = s for some i. A variable v is frozen iff for all π, i it holds that π[i](v) = π[0](v). In the following, when we define a frozen variable v, we assume that this is done by having a constraint v = v as a top-level conjunct of the transition formula. A formula φ(v) is an invariant of the transition system C = (v, I(v), T (v, v )) iff it holds in all the reachable states. Following the standard model checking notation, we denote this with C |= φ(v). 1

Modeling Parametric Systems as Array-based
Transition Systems

Array-based Transition Systems
In order to describe parametric systems, we adapt from [9] the notion of arraybased systems. In the following, we fix a theory of indexes T I = (Σ I , C I ) and a theory of elements T E = (Σ E , C E ). In order to model the parameters, we require that the class C I is closed under substructure. Then with A E I we denote the theory whose signature is Σ = Σ I ∪ Σ E ∪ {[ ]}, and a model for it is given by a set of total functions from a model of T I to a model of T E . In general, we can have several array theories with multiple sorts for indexes and elements. For simplicity, we fix only an index sort and an elem sort. In the following, an array-based transition system C = (a, ι(a), τ (a, a )) is a symbolic transition system, with the additional constraints that: a is a variable of sort index → elem. We use a single variable for the sake of simplicity: additional variables of arbitrary type (also of index or element type) can be added without loss of generality. ι(a) is a first-order formula of the form ∀i.φ(i, a[i]), where i is of index sort and φ is a quantifier-free formula. τ (a, a ) is a finite disjunction of formulae, ∨ n k=1 τ k , such that every τ k is a formula of the following type (with i, j of index sort): with ψ a quantifier-free formula.
This syntactic requirement subsumes the common guard and update formalism used for the description of parametric systems, used e.g in [9,11,14].
In the following, we shall refer to the disjuncts τ k of τ as transition rules (or simply rules when clear from the context).
An array-based transition system can be seen as a family of transition systems, one for each cardinality of the finite models M I of T I . In the following, given d an integer, we denote with C d the finite instance of C of size d obtained by instantiating the quantifiers of C over a set of fresh index variables of cardinality d (considered implicitly different from each other). Note that this C d is a symmetric presentation [14]: if c = {c 1 , . . . , c d } are the fresh index variables, and σ is a permutation of c, we have that, for every formula φ(c, a[c]), Example 1 (Mutex Protocol for Ring Topology). Here we describe a simple protocol for accessing a shared resource, with processes in a ring-shaped topology. As an index theory, we use the finite sets of integers. As an element theory, we use both the Booleans and an enumerated data type of two elements, namely {idle, critical}. The array variable t, with sort index → boolean, is true in an index variable x if x holds the token. The variable s, with sort index → {idle, critical} holds the current state of the process. In addition, we have an integer frozen variable length, which represents the length of the ring. The transition system is described by the following formulae: Initial states. Initially, only one process holds the token, and every process is idle. We model this initial process with an additional constant init token of sort index. Moreover, each index is bounded by the value of length. The initial formula is: Transition rule 1. A process which holds the token can enter the critical section: Transition rule 2. A process exits from the critical section and passes the token to the process at its right:

Universal invariant problem for array-based systems
In the following, given an array-based transition system C = (a, ι(a), τ (a, a )), the universal invariant problem is the problem of proving (or disproving) that a formula of the form Φ def = ∀i.φ(i, a[i]) is an invariant for C.
Guard Strengthening In order to prove that ∀i.φ(i, a[i]) is an invariant of a system C = (a, ι(a), τ (a, a )), we can first strengthen the rules of C by adding the candidate invariant in conjunction with the transition relation, and then prove that the formula is an invariant of the newly-restricted system. This induction principle is justified by the following proposition: Proposition 1 (Guard strenghtening [14]) Let C = (a, ι(a), τ (a, a )) be a transition system and let Φ be ∀i.
Prophecy variables The universal quantifiers in the candidate invariant can be replaced with fresh frozen variables, called prophecy variables, that intuitively contain the indexes of the processes witnessing the violation of the property.  . . ψn} is the set of candidate lemmas; CΦ∧Ψ is a quantified transition system resulting from the strengthening of C;CΦ∧Ψ is a quantifier-free transition system. Proposition 2 (Removing quantifiers [18]) Let C = (a, ι(a), τ (a, a )) be an array-based system. The formula ∀i.φ(i, a[i]) is an invariant for C iff the formula φ(p, a[p]) is an invariant for C +p = (a ∪ p, ι(a), τ (a, a )), where p is a set of fresh frozen variables of index sort.
For better readability, in the following we will omit the subscript +p. Moreover, we assume that the index variables universally quantified in the candidate invariant are considered to be different. This does not limit expressiveness, and simplifies our discourse. Therefore, the prophecy variables induced by a candidate invariant are considered to be implicitly different.

Overview of the Method
In the following, let an array-based transition system C def = (a, ι(a), τ (a, a )), and a candidate universal invariant Φ def = ∀i.φ(i, a[i]) for C be given. We now summarize the algorithm that attempts to solve the universal invariant problem for C and Φ. The algorithm, depicted in Figure 4, iterates trying either to construct an abstraction sufficiently precise to prove the property (exit with Safe), or to find a finite instantiation of the problem exhibiting a concrete counterexample (exit with Unsafe). The abstract space is quantifier-free, and obtained by instantiating the universally quantified formulae over two sets of index variables: the prophecy variables, which arise from the candidate invariant (as explained in Proposition 2), and are denoted with p; and the environmental variables, denoted with x, which arise from the transition formula and are intended to represent the environment surrounding the p indexes, interacting with them in the behaviour leading to the violation. While prophecy variables are frozen, thus representing the same indexes for the whole run, environmental variables are free to change at each time step, hence producing possibly spurious behaviours. The algorithm maintains a set of candidate lemmas Ψ def = {Ψ i } i , composed of universally quantified formulae, that are used to strengthen the property and to tighten the abstraction. Initially, Ψ is empty. In the following, if C d is a finite instance of C and Φ is a candidate universal invariant, with Φ d we denote the formula obtained from Φ by instantiating the quantifiers in variables used for the domain of cardinality d.
At each iteration, we carry out the following high-level steps (described in detail in the next sections): the property Φ to be proved is conjoined with the candidate lemmas in Ψ , and its quantifiers are moved in prenex form; 2 we construct the guard-strengthening C Φ∧Ψ (cfr. Proposition 1), conjoining Φ ∧ Ψ to the transition rules of C; we compute our modified Parameter Abstraction of C Φ∧Ψ (defined in §5.1).
First, we define the necessary prophecy variables p and environmental variables x. Then, we instantiate the quantifiers obtaining the quantifier-free array transition systemC Φ∧Ψ . we (try to) solve the invariant checking problemC Φ∧Ψ |=Φ ∧Ψ by calling a model checker for quantifier-free transition systems.Φ ∧Ψ is obtained from Φ ∧ Ψ by removing quantifiers with prophecy variables, as in Proposition 2 if the model checker concludes that there is no violation, then Φ holds in C (for the properties of the Parameter Abstraction), and we exit with Safe. otherwise, we try to check whether the property violation in the abstract space corresponds to a real counterexample. We do so by checking whether then the abstraction must be tightened. When the verification of the finite instance succeeds, an inductive invariant I d is produced, which is used to compute (candidate) lemmas by generalization from d to the universal case.
If so, we exit with Unsafe, and we produce a concrete counterexample to the original problem, finitely witnessed in C d .
-However, it is also possible that C d does not violate Φ d , but it falsifies some lemmas. In fact, the candidate lemmas obtained at previous iterations, by generalization on C d − with d − = d, may not hold universally in C. In that case, the bad lemmas must be fixed, and the iteration is restarted.
When the algorithm terminates with Unsafe, we are able to exhibit a finite counterexample trace in a finite instance of C violating the property. When the algorithm terminates with safe, then the property holds in C. The result is obtained by the following chain of implications: from Theorem 3, stated in the next section, we have thatC Φ∧Ψ |=Φ ∧Ψ implies C Φ∧Ψ |=Φ ∧Ψ . From Proposition 2, we have that C Φ∧Ψ |= Φ ∧ Ψ . Therefore, from Proposition 1, we have C |= Φ ∧ Ψ . In particular, we have C |= Φ.

Modified Parameter Abstraction
We describe here our Parameter Abstraction. The first version of this approach was introduced in [3], and later formalized in [14]. In the following, we describe a novel version of the abstraction, and how it can be applied to array-based transition systems. The main novelty is that, instead of using a special abstract index " * " that overapproximates the behaviour of the system in the array locations that are not explicitly tracked, we use n environmental (index) variables which are not abstracted, but are allowed to change nondeterministically in some transitions. This can be achieved by the usage of an additional stuttering transition: this rule allows the environmental variables to change value arbitrarily, while not changing the values of the array in the prophecies.

Abstraction Computation
Let an array-based transition system C and a universal invariant Φ be given 3 . By conjoining Φ to the transition rules in C, we obtain C Φ , the guard strengthening of C with respect to Φ. Then, we define two sets of variables: the prophecy variables p, in number determined by Proposition 2, and the environmental variables x, in number determined by the greatest existential quantification depth in the transition rules of C Φ . While the prophecies are frozen variables, the interpretation of the environmental variables is not fixed. Moreover, we assume that the values taken by p and x are different. We now defineC, the parameter abstraction of C.
) quantifier-free. The initial formula of the abstract system is a quantifier-free first order formula, denotedι(p, a[p]) obtained by instantiating all the universal quantifiers in ι over the set of prophecy variables p.
Transition formula The transition formula of C Φ is still represented by a disjuction of formulae of the form 4 For simplicity, we can assume that we have only one rule τ (a, a ). First, we compute the set of all substitutions of the i over p ∪ x, and we consider the set of formulae {τ j (p, x, a, a )}, where j ranges over the substitutions, andτ j is the result of applying the substitution to τ .
Then, for each formula in the set {τ j }, we instantiate the universal quantifiers over the set p ∪ x, obtaining a quantifier-free formula over prophecy and environmental variables.
Moreover, we consider an additional transition formula, called the stuttering transition, defined by:τ The disjunction of all the abstracted transition formulae is the transition formulaτ . So, we can now define the transition system Example 3. We apply the abstraction procedure to the transition rule 2 of the token in the ring protocol of Example 1. Since the invariant is the formula ∀i, j.¬(s[i] = critical ∧ s[j] = critical) it follows that we have two prophecy variables p 1 , p 2 . Recall that the invariant itself is added to the transition as an additional conjunct. Since the existential quantification depth is one, we have only one environment variable x 1 . In the abstraction system we obtain three transition formulae from the original transition; we report the one indexed by the substitution mapping i into x 1 ; such a formula is equivalent to the following:

Stuttering Simulation
We define here the stuttering simulation induced by our version of the Parameter Abstraction. The proof of the main theorem can be found in the appendix. The stuttering is induced byτ S : this is a weaker version than the simulation induced by [14], yet it is sufficient for preserving invariants.
Definition 1 (Stuttering Simulation) Given two symbolic transition systems , with sets of states S 1 and S 2 , a stuttering simulation S is a relation S ⊂ S 1 × S 2 , such that: for every s 1 ∈ S 1 such that s 1 |= ι 1 , there exists some s 2 ∈ S 2 such that (s 1 , s 2 ) ∈ S and s 2 |= ι 2 ; for every (s 1 , s 2 ) ∈ S, and for every s 1 ∈ S 1 such that s 1 ∪ s 1 |= τ 1 , there exists either some s 2 ∈ S 2 such that (s 1 , s 2 ) ∈ S and s 2 ∪ s 2 |= τ 2 , or some If such a relation exists, we say that C 2 stutter simulates C 1 .
We write S(s 1 ) for {s 2 |(s 1 , s 2 )} ∈ S. We recall that stutter simulation preserves reachability, i.e. if C 2 stutter simulates C 1 , then if s 1 is reachable in C 1 then the set S(s 1 ) is reachable in C 2 . Formally, the stuttering simulation induced by the Parameter Abstraction is defined as follows.
Definition 2 (Simulation) Let C be the original transition system and letC be its Parameter Abstraction. Let s ands denote states of C andC, respectively. We define S as follows: Intuitively, we require that in the concrete state s and the abstract states, the array is interpreted in the same way for all the locations referred by the prophecy variables. We then have the following: Theorem 3. The relation S is a stuttering simulation between C andC. Moreover, ifC |= Φ(p, a[p]), then C |= Φ(p, a[p]).

Concretization
If Φ(p, a[p]) does not hold inC, in general we cannot conclude anything, since the abstraction could be too coarse. So, if an abstract counterexample is encountered, we try to explore a small instance of the system to see if this counterexample occurs in it. To choose the appropriate size, our algorithm keeps a counter d, whose value is equal to the size to explore. Initially, d is equal to the number of (universally-quantified) index variables in the property Φ. 5 When an abstract counterexample is encountered, we check whether C d |= (Φ ∧ Ψ ) d . For this check, we use a model checker able to return, in case of success, an inductive invariant I d . From the inductive invariant we compute some first order formulae J which will be a new set of candidate lemmas. We will see later how to obtain this generalization. After computing the new lemmas, we set d = d + 1. If a concrete counterexample is found, then there are two cases: (i) the counterexample falsifies the original property, and we exit from the algorithm with a concrete counterexample; (ii) the counterexample falsifies some lemmas; in this case we remove the lemma and restart the loop (without changing d).

From Invariants to Universal Lemmas
Definition 3 Let d be an integer, and let I d be a set of clauses containing d variables. A generalization of I d is a first-order formula J such that, when evaluating the quantifiers in J in a domain with precisely d elements, we obtain a formula equivalent to I d .
We use the following technique for generalization. Suppose that I d is in CNF, and that we used c 1 , . . . , c d as variables for an instance with d elements. Then, I d = C 1 ∧ · · · ∧ C n is a conjunction of clauses. From each of those clauses we will obtain a new candidate lemma. Let AllDiff (i) be the formula which states that all variables in i are different from each other. Since every C d is given by a symmetric presentation [14], we have that, for every i ∈ {1, . . . , n}, C d |= ∀i 1 , . . . , i h .AllDiff Example 4. LetC be the result of the abstraction procedure of the ring protocol of Example 1. An abstract counterexample for the property is given by a trace where the environmental variable takes the token twice (with stuttering transitions), and then it passes it to both prophecy variables, which can then enter the critical section. Therefore, we compute C 2 , the finite instance with exactly two indexes, and we check if the property holds in it. The property does hold, and we obtain an inductive invariant: where the dots denote some other clauses which are equal up to a symmetry to c 1 or c 2 . If we generalize the first two clauses, we have the two formulae: such that ψ 2 1 ∧ ψ 2 2 is equivalent to I 2 . After the guard strengthening process, the new lemmas are enough to block all the spurious counterexamples, and the property is proved.
Fixing Unsound Lemmas Unfortunately, we know a priori that a lemma holds only for the instance from which it was generalized. In general, its universal generalization obtained as outlined above might not hold in the system.
Suppose that the formula ψ 1 is a candidate lemma, obtained by generalization after the successful verification of an instance of size d. Suppose that later, a counterexample for ψ 1 is found by exploring a different instance C d (with d > d). This means that the lemma ψ 1 does not hold universally, but only for some finite instances of the system (including C d ), and not in general. In this case, we simply remove ψ 1 from the set of candidate lemmas Ψ , thus effectively weakening our working property (from Φ ∧ Ψ to Φ ∧ (Ψ \ {ψ 1 })). While this may cause a particular (abstract) counterexample to be encountered more than once during the main loop of the algorithm, since the finite instances are explored monotonically and their size d is increased after every successful verification of a bounded instance, the overall procedure still makes progress by exploring increasingly-large instances of the system. The hope is that eventually the algorithm will discover enough good lemmas that block the abstract counterexample. This notion of (weak) progress is justified by the following: Proposition 4 Letπ be an abstract counterexample, Ψ be the current set of universally quantified lemmas, and d be the size of the bounded instance to explore. During every execution of the algorithm, the same triple (π, Ψ, d) never occurs twice.

Related Work
Parametric verification is a challenging problem, and there is a large body of work in the literature devoted to this problem. Here, we (necessarily) focus on the approaches that are most related to ours.
Several methods are based on quantifier elimination using decidable fragments of first order logic, with notable examples in [6,9,21]. These methods guarantee a high degree of automation, but typically impose strong syntactic requirements in the input problem, and may suffer from scalability issues. A second popular approach is based on abstraction and abstraction refinement. Within this family of abstractions, earlier versions of the Paramater Abstraction [3,14] have been used successfully also for industrial protocols [23]. The main drawback is that the degree of automation is limited, and substantial expertise is required to obtain the desired results. The first steps of our abstraction algorithm are inspired by the ones in [18] and [14]. The key difference from [18] is that in that work the abstract transition systemC is given by an eager propositional abstraction, with the axioms of the background theories recovered by the usage of some schemata. Here we retain the theory of arrays in the abstract spaceC. Moreover, differently from both [14] and [18], our procedure includes an automatic refinement of the abstraction in a counterexample-driven manner.
Ivy [19,21] implements both semi-automatic invariant checking with decidable logics (namely, Effectively Propositional Logic -EPR) and compositional abstraction with eager axioms [18]. MyPyvy [12,13] is a model checker inspired by the language of Ivy. It implements a version of IC3 capable of dealing with universal formulas [12]; the algorithm is completely automatic, but it is still based on quantifier elimination via reduction to decidable logics. In a more recent work, MyPyvy has gained the capability of inferring invariants with quantifier alternations, using a procedure that combines separators and first-order logic [13]. At the moment, our framework is capable of handling only universally quantified invariants. On the other hand, our approach is not limited to EPR, but it can in principle handle formulae with arbitrary SMT theories.
Exploring small instances of a parameterized system for candidate lemmas is a popular approach for parametric verification. In [7], this idea is used to over-approximate backward reachable states inside an algorithm which combines backward search and quantifier elimination. In [15], a finite-instance exploration is used together with a theorem prover to check the validity of candidate lemmas. In [16], candidate invariants are obtained from the set of reachable states of small instances. Similarly to our approach, these lemmas are used to strengthen an earlier version of the parameter abstraction. However, human intervention is still needed for the refinement.
A similar approach is presented in [22], where lemmas are obtained from a generalization of the proof of the property in a small instance of the protocol. The main difference with our technique, besides the methods used to extract such invariants, is the following: in [22], the authors show that to prove that a property (conjoined with lemmas) is inductive for all N , it is enough to prove that it is inductive for a particular N 0 , which is computable from the number of variables in the description of the system. This result is obtained from the imposed syntactic structure of the system. On the other hand, we impose less structure, and we rely on proving the property in an abstract version (and not a concrete instance) of the system. Moreover, our approach is integrated in an abstraction/refinement loop, which is missing from [22].
Another SMT-based approach for parametric verification is in [11]. The method is based on a reduction of invariant checking to the satisfiability of non-linear Constrained Horn Clauses (CHCs). Besides differing substantially in the overall approach, the method is more restrictive in the input language, and handles invariants only with a specific syntactic structure.
The use of prophecy variables for inferring universally quantified invariants has been explored also in non-parametric contexts, such as [17]. The main difference with our work is that [17] focuses on finding quantified invariants for quantifier-free transition systems with arrays, rather than array-based systems with quantifiers. The overall abstraction-refinement approach is also substantially different.

Experimental Evaluation
We have implemented our algorithm in a tool called Lambda (for Learning Abstractions froM BoundeD Analysis). Lambda is written in Python, and uses the SMT-based IC3 with implicit predicate abstraction of [4] as underlying quantifier-free verification engine. 6 Lambda accepts as input array-based systems specified either in the language of MCMT [10] or in VMT format (a light-weight extension of SMT-LIB to model transition systems [24]). In case of successful termination, Lambda generates either a counterexample trace (for violated properties) in a concrete instance of the parametric system, or a quantified inductive invariant that proves the property for any instance of the system. In the latter case, Lambda can also generate proof obligations that can be independently checked with an SMT solver supporting quantifiers, such as Z3 [20] or CVC4 [2]. More specifically, the quantified inductive invariant can be generated by Lambda by simply universally quantifying all the (index) variables in the inductive invariant generated forC, and conjoining it with the lemmas Ψ discovered during the main loop iterations. Computing such an invariant is immediate after the termination of the algorithm, and does not require additional reasoning.
In order to evaluate the effectiveness of our method, we have compared Lambda with two state-of-the-art tools for the verification of array-based systems, namely Cubicle [6] and MCMT. We could not include MyPyvy in the comparison, due to the many differences in input languages and modeling formalisms, which make an automatic translation of the benchmarks very difficult. We would also have liked to compare with the technique of [11], however the prototype tool mentioned in the paper doesn't seem to be available.
For our evaluation, we have collected a total of 116 benchmarks, divided in three different groups: Protocols consists of 42 instances taken from the MCMT or the Cubicle distributions, and used in previous works on verifcation of array-based systems. We have used all the instances which were available in both input formats, and we have split benchmarks containing multiple properties into different files. DynArch consists of 57 instances of verification problems of dynamic architectures, taken from [5]. These benchmarks make use of arithmetic constraints on index terms, which are not supported by Cubicle. Therefore, we could only compare Lambda with MCMT on them. Trains consists of 17 instances derived by (a simplified version of) verification problems on railway interlocking logics [1]. These benchmarks make use of several features that are not fully supported by Cubicle and MCMT (such as non-functional updates in the transition relation, transition rules with more than one universally-quantified variable, real-valued variables). None of such restrictions applies to Lambda, which in general accepts models with significatly fewer syntactic constraints than Cubicle and MCMT. Since these instances are inspired by relevant real-world verification problems, we believe that it is interesting to include them in the evaluation even though we could only run Lambda on them.
Our implementation, all the benchmarks, and the scripts for reproducing the results are available at http://es-static.fbk.eu/people/griggio/papers/cade21-lambda. tar.gz. We have run our experiments on a cluster of machines with a 2.90GHz Intel Xeon Gold 6226R CPU running Ubuntu Linux 20.04.1, using a time limit of 1 hour and a memory limit of 4GB for each instance. We have used the default settings for MCMT, whereas for Cubicle we have also enabled the BRAB algorithm. 7 A summary of the results of our evaluation are presented in Table 2. More details are provided in Appendix A.2.
Overall, Lambda is very competitive with the state of the art, and in fact it solves the largest number of instances (even when disregarding the Trains group, which cannot be handled by the other tools).When considering the Protocols group, Cubicle is often significantly faster than Lambda (see also Table 2 in Appendix A.2), especially on easier problems, thanks to its explicit-state exploration component (part of the BRAB algorithm). However, the symbolic techniques used by Lambda allow it to generally scale better to larger, more challenging problems: in the end, Lambda solves 4 more instances than Cubicle, and 10 more than MCMT. The situation is different for the DynArch group, in which Lambda and MCMT solve the same number of instances. However, it is interesting to observe that both tools can solve 5 instances that the other tool cannot solve; more in general, it seems that the two approaches have somewhat complementary strengths (this can be seen clearly from Table 3 in Appendix A.2). Moreover, as already stated above, the fact that Lambda imposes significantly less syntactic restrictions than the other two tools considered allowed it to handle all the instances of the Trains group, which cannot be easily modeled in the languages of MCMT or Cubicle.
Finally, we wish to remark that we have generated SMT proof obligations for checking the correctness of all the (universally quantified) inductive invariants produced by Lambda, and checked them with both CVC4 and Z3. None of the solvers reported any error, and overall the combination of the two solvers was able to successfully verify all the proof obligations for 65 of the 67 instances reported as safe. 8 We believe that the fact that we can easily produce proof obligations that can be independently checked is another strength of our approach. This is in contrast to the approach of Cubicle, where generating proof obligations is nontrivial [8].

Conclusions
In this paper we tackled the problem of universal invariant checking for parametric systems. We proposed a fully-automated abstraction-refinement approach, based on quantifier-free reasoning. The abstract model, that stutter simulates the concrete model, is a quantifier-free symbolic transition system refined by (the instantiation of) candidate universal lemmas. These are obtained by analyzing the proofs of validity of the property in a finite instance of the parametric system. We experimentally evaluated an implementation on standard benchmarks from the literature. The results show the effectiveness of the method, also in comparison with state-of-the-art tools (Cubicle, MCMT). We are able to prove, in a fully automated manner and without manual intervention, several benchmarks that are considered challenging. In the future, we plan to work on generalization, to improve the ability of inferring the right lemmas from a small instance, and to find more effective ways to filter out bad candidates. On the theoretical side, we will investigate the relation between the termination of the algorithm and decidable classes of parametric systems (e.g. those that enjoy a cut-off property). Finally, we will work on the verification of temporally extended properties which are also preserved by stuttering simulations (such as fragments of Linear Temporal Logic).

A Appendix
A.1 Proofs of section 5 We report here the technical results for the proof of Theorem 3. Note that a states ofC consists of both an assignment of the array variable a and of the index variables p ∪ x. With a small abuse of notation we do not distinguish the two cases.
Remark 1 In the following, since we assumed that the values taken by p are different, we also assume that the cardinialities of all index models M I are equal or greater than the length of p. This requirement is not a real limitation: initially, this can be assumed since the property vacuously holds in models with cardinality less than p. Moreover, the size of p can increase only if the property has been proved in all the finite models with lesser size.
First, we need the following key proposition.
Proposition 5 Lets be a state ofC. Let µ be an interpretation of p such that µ(p) =s(p). Let φ(p, a[p]) be a quantifier free formula which contains only prophecies as index variables. Then, for any state s of C such that S(s,s), where N is obtained from M by restricting all the interpretation of the index variables to the substructure of M I generated by the elements in µ(p) (note that N is still a model for A E I since T I is closed under substructure). Similarly, for where N defined similarly as above. Since µ(p) =s(p), we have N = N . Moreover, from the definition of S, s ands assign a to the same function, so (1) and (2) are equivalent. In general, suppose p = (p 1 , . . . , p n ). By hypothesis Since the the length of x is the maximum length of the existentially quantified index variables in the rules of C, we can assume without loss of generality that i = (i 1 , . . . , i m ) and x = (x 1 , . . . , x m ). By hypothesis there exists an interpretation µ of i such that Let's also fix a states ofC, such that S(s,s). There are again three cases; we omits the details since they are a generalization of the previous ones.
We can defines to be the restriction of s over p and we have agains ∪s |= τ σ:i →p Theorem 6. The relation S is a stuttering simulation between C andC.
Proof. Follows directly from Lemmas 1 and 2.
Theorem 7. Let C be an array-based transition system,C its parameter abstraction defined in §5. Let ∀i.Φ(i, a[i]) a candidate invariant, and p a set of frozen variables with same length as i.
Proof. The statement immediately follows from the fact that stutter simulations preserve reachability, and from Proposition 5.

A.2 Detailed Experimental Results
We report here detailed results of our experimental evaluation. The results for each group of benchmarks are presented in Tables 2-4. Besides the execution time, the table reports also some statistics on the size of the benchmarks (in number of state variables V and transition rules T) and on the execution of Lambda (number of iterations of the main loop I, number of lemmas added L and removed R, and maximum size of the concrete instances explored C).