# Abstraction Refinement and Antichains for Trace Inclusion of Infinite State Systems

Radu Iosif, Adam Rogalewicz, Tomáš Vojnar

► To cite this version:

Radu Iosif, Adam Rogalewicz, Tomáš Vojnar. Abstraction Refinement and Antichains for Trace Inclusion of Infinite State Systems. 22nd International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), Apr 2016, Eindhoven, Netherlands. pp.71-89, 10.1007/978-3-662-49674-9_5 . hal-01418885

HAL Id: hal-01418885

https://hal.science/hal-01418885

Submitted on 17 Dec 2016

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# Abstraction Refinement and Antichains for Trace Inclusion of Infinite State Systems

Radu Iosif, Adam Rogalewicz, and Tomáš Vojnar

CNRS/Verimag, France and FIT BUT, Czech Republic

**Abstract.** A data automaton is a finite automaton equipped with variables (counters or registers) ranging over infinite data domains. A trace of a data automaton is an alternating sequence of alphabet symbols and values taken by the counters during an execution of the automaton. The problem addressed in this paper is the inclusion between the sets of traces (data languages) recognized by such automata. Since the problem is undecidable in general, we give a semi-algorithm based on abstraction refinement, which is proved to be sound and complete, but whose termination is not guaranteed. We have implemented our technique in a prototype tool and show promising results on several non-trivial examples.

## 1 Introduction

In this paper, we address a trace inclusion problem for infinite-state systems. Given (i) a network of data automata $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ that communicate via a set of shared variables $\mathbf{x}_{\mathcal{A}}$, ranging over an infinite data domain, and a set of input events $\Sigma_{\mathcal{A}}$, and (ii) a data automaton $B$ whose set of variables $\mathbf{x}_B$ is a subset of $\mathbf{x}_{\mathcal{A}}$, does the set of (finite) traces of $B$ contain the traces of $A$? Here, by a trace, we understand an alternating sequence of valuations of the variables from the set $\mathbf{x}_B$ and input events from the set $\Sigma_{\mathcal{A}} \cap \Sigma_B$, starting and ending with a valuation. Typically, the network of automata $\mathcal{A}$ is an implementation of a concurrent system and $B$ is a specification of the set of good behaviors of the system.

Consider, for instance, the network $\langle A_1, \dots, A_N \rangle$ of data automata equipped with the integer-valued variables $x$ and $v$ shown in Fig. 1–left. The automata synchronize on the **init** symbol and interleave their $a_{1,...,N}$ actions. Each automaton $A_i$ increases the shared variable $x$ and writes its identifier $i$ into the shared variable $v$ as long as the value of $x$ is in the interval $[(i-1)\Delta, i\Delta - 1]$, and it is inactive outside this interval, where $\Delta \ge 1$ is an unbounded parameter of the network. A possible specification for this network might require that each firing sequence is of the form **init** $\mathbf{a}^*_{1,...,N} \mathbf{a}_2 \mathbf{a}^*_{2,...,N} \dots \mathbf{a}_i \mathbf{a}^*_{i}$ for some $1 \le i \le N$, and that $v$ is increased only on the first occurrence of the events $\mathbf{a}_2, \dots, \mathbf{a}_i$, in this order. This condition is encoded by the automaton $B$ (Fig. 1–right). Observe that only the $v$ variable is shared between the network $\langle A_1, \dots, A_N \rangle$ and the specification automaton $B$—we say that $v$ is *observable* in this case. An example of a trace, for $\Delta = 2$ and $N \ge 3$, is: $(v=0) \ \mathbf{init} \ (v=1) \mathbf{a}_1 (v=1) \mathbf{a}_1 (v=1) \mathbf{a}_2 (v=2) \mathbf{a}_2 (v=2) \mathbf{a}_3 (v=3)$. Our problem is to check that this, and all other traces of the network, are included in the language of the specification automaton, called the *observer*. The trace inclusion problem has multiple applications, e.g.:
<figure><img src="image_1.png" /><figcaption>**Fig. 1.** An instance of the trace inclusion problem.</figcaption></figure>

- Decision procedures for logics describing array structures within imperative programs [16, 15] that use a translation of array formulae to integer counter automata which encode the set of array models of a formula. The expressiveness of such logics is currently limited by the decidability of the emptiness (reachability) problem for counter automata. If we give up on decidability, we can reduce an entailment between two array formulae to the trace inclusion of two integer counter automata, and use the method presented in this paper as a semi-decision procedure. To assess this claim, we have applied our trace inclusion method to several verification conditions for programs with unbounded arrays of integers [6].

- Timed automata and regular specifications of timed languages [2] can be both represented by finite automata extended with real-valued variables [13]. The verification problem boils down to the trace inclusion of two real-valued data automata. In this context, our method has been tested on several timed verification problems, including communication protocols and boolean circuits [27].

When developing a method for checking the inclusion between trace languages of automata extended with variables ranging over infinite data domains, the first problem is the lack of determinisation and/or complementation results. In fact, certain classes of infinite state systems, such as timed automata [2], cannot be determinized and are provably not closed under complement. This is the case due to the fact that the clock variables of a timed automaton are not observable in its timed language, which records only the time lapses between successive events. However, if we require that the values of all variables of a data automaton be part of its trace language, we obtain a determinisation result, which generalizes the classical subset construction by taking into account the data valuations. Building on this first result, we define the complement of a data language and reduce the trace inclusion problem to the emptiness of a product data automaton $\mathcal{L}(A \times \bar{B}) = \emptyset$. It is crucial, for this reduction, that the variables $x_B$ of the right-hand side data automaton $B$ (the one being determinized) are also controlled by the left-hand side automaton $A$, in other words, that $B$ has no hidden variables.

The language emptiness problem for data automata is, in general, undecidable [23]. Nevertheless, several semi-algorithms and tools for this problem (better known as the *reachability problem*) have been developed [3, 18, 21, 14]. Among those, the technique of *lazy predicate abstraction* [18] combined with *counterexample-driven refinement using interpolants* [21] has been shown to be particularly successful in proving emptiness of rather large infinite-state systems. Moreover, this technique shares similar aspects with the antichain-based algorithm for language inclusion in the case of a finite alpha-
bet [1]. An important similarity is that both techniques use a partial order on states, to
prune the state space during the search.

The main result of this paper is a semi-algorithm that combines the principle of the antichain-based language inclusion algorithm [1] with the interpolant-based abstraction refinement semi-algorithm [21], via a general notion of language-based subsumption relation. We have implemented our semi-algorithm in a prototype tool and carried out a number of experiments, involving hardware, real-time systems, and array logic problems. Since our procedure tests inclusion within a set of good traces, instead of empty intersection with a set of error traces, we can encode rather complex verification conditions concisely, using automata of relatively small size.

1.1 Overview

<figure><img src="image_2.png" /><figcaption>**Fig. 2.** Sample run of our semi-algorithm.</figcaption></figure>

We introduce the reader to our trace inclusion method by means of an example. Let us consider the network of data automata $\langle A_1, A_2 \rangle$ and the data automaton $B$ from Fig. 1. We prove that, for any value of $\Delta$, any trace of the network $\langle A_1, A_2 \rangle$, obtained as an interleaving of the actions of $A_1$ and $A_2$, is also a trace of the observer $B$. To this end, our procedure will fire increasingly longer sequences of input events, in search for a counterexample trace. We keep a set of predicates associated with each state $(\langle q_1, q_2 \rangle, P)$ of the product automaton where $q_i$ is a state of $A_i$ and $P$ is a set of states of $B$. These predicates are formulae that define over-approximations of the data values reached simultaneously by the network, when $A_i$ is the state $q_i$, and by the observer $B$, in every state from $P$.

The first input event is **init**, on which $A_1$ and $A_2$ synchronize, moving together from the initial state $\langle q_0^1, q_0^2 \rangle$ to $\langle q_1^1, q_1^2 \rangle$. In response, $B$ can choose to either(i) move from
`{p0}` to `{p1}`, matching the only transition rule from `p0`, or (ii) ignore the transition rule and move to the empty set. In the first case, the values of `v` match the relation of the rule `p0 <init,v'=1> p1`, while in the second case, these values match the negated relation `¬(v' = 1)`. The second case is impossible because the action of the network requires `x' = 0 ∧ v' = 1`. The only successor state is thus `⟨⟨q1, q1²⟩, {p1}⟩` in Fig. 2 (a). Since no predicates are initially available at this state, the best over-approximation of the set of reachable data valuations is the universal set (`⊤`).

The second input event is **a**₁, on which A₁ moves from q₁¹ back to itself, while A₂ makes an idle step because no transition with **a**₁ is enabled from q₁². Again, **B** has the choice between moving from `{p₁}` either to ∅ or `{p₁}`. Let us consider the first case, in which the successor state is `⟨⟨q₁, q₁²⟩, ∅, ⊤⟩`. Since q₁¹ and q₁² are final states of A₁ and A₂, respectively, and no final state of **B** is present in ∅, we say that the state is accepting. If the accepting state (in dashed boxes in Fig. 2) is reachable according to the transition constraints along the input sequence **init.a**₁, we have found a counterexample trace that is in the language of `⟨A₁, A₂⟩` but not in the language of **B**.

To verify the reachability of the accepting state, we check the satisfiability of the path formula corresponding to the composition of the transition constraints `x' = 0 ∧ v' = 1` (**init**) and `0 ≤ x < Δ ∧ x' = x + 1 ∧ v' = 1 ∧ ¬(v' = v)** (**a**₁) in Fig. 2 (a). This formula is unsatisfiable, and the proof of infeasibility provides the interpolant `⟨v = 1⟩`. This formula is an explanation for the infeasibility of the path because it is implied by the first constraint and it is unsatisfiable in conjunction with the second constraint. By associating the new predicate `v = 1` with the state `⟨⟨q₁, q₁²⟩, {p₁}⟩`, we ensure that the same spurious path will never be explored again.

We delete the spurious counterexample and recompute the states along the input sequence **init.a**₁ with the new predicate. In this case, `⟨⟨q₁, q₁²⟩, ∅⟩` is unreachable, and the outcome is `⟨⟨q₁, q₁²⟩, {p₁}, v = 1⟩`. However, this state was first encountered after the sequence **init**, so there is no need to store a second occurrence of this state in the tree. We say that the node **init.a**₁ is subsumed by **init**, and indicate this by a dashed arrow in Fig. 2 (b).

We continue with **a**₂ from the state `⟨⟨q₁, q₁²⟩, {p₁}, v = 1⟩`. In this case, A₁ makes an idle step and A₂ moves from q₁² to itself. In response, **B** has the choice between moving from `{p₁}` to either(i) `{p₁}` with the constraint `v' = v`, (ii) `{p₂}` with the constraint `v' = v + 1`, (iii) `{p₁, p₂}` with the constraint `v' = v ∧ v' = v + 1 → ⊥` (this possibility is discarded), (iv) ∅ for data values that satisfy `¬(v' = v) ∧ ¬(v' = v + 1)`. The last case is also discarded because the value of `v` after **init** constrained to 1 and the A₂ imposes further the constraint `v' = 2` and `v = 1 ∧ v' = 2 ∧ ¬(v' = v) ∧ ¬(v' = v + 1) → ⊥`. Hence, the only **a**₂-successor of `⟨⟨q₁, q₁²⟩, {p₁}, v = 1⟩` is `⟨⟨q₁, q₁²⟩, {p₂}, ⊤⟩`, in Fig. 2 (b).

By firing the event **a**₁ from this state, we reach `⟨⟨q₁, q₁²⟩, ∅, v = 1⟩`, which is, again, accepting. We check whether the path **init.a**₂.**a**₁ is feasible, which turns out not to be the case. For efficiency reasons, we find the shortest suffix of this path that can be proved infeasible. It turns out that the sequence **a**₂.**a**₁ is infeasible starting from the state `⟨⟨q₁, q₁²⟩, {p₁}, v = 1⟩`, which is called the *pivot*. This proof of infeasibility yields the interpolant `⟨v = 1, Δ < x⟩`, and a new predicate Δ < x is associated with `⟨⟨q₁, q₁²⟩, {p₂}⟩`. The refinement phase rebuilds only the subtree rooted at the pivot state, in Fig. 2 (b).

The procedure then builds the tree on Fig. 2 (c) starting from the pivot node and finds the accepting state `⟨⟨q₁, q₁²⟩, ∅, Δ < x⟩` as the result of firing the sequence **init.a**₂.**a**₂.
This path is spurious, and the new predicate $v = 2$ is associated with the location $(\langle q_1^1, q_1^2 \rangle, \{p_2\})$. The pivot node is the same as in Fig. 2 (b), and, by recomputing the subtree rooted at this node with the new predicates, we obtain the tree in Fig. 2 (d), in which all frontier nodes are subsumed by their predecessors. Thus, no new event needs to be fired, and the procedure can stop reporting that the trace inclusion holds.

## 1.2 Related Work

The trace inclusion problem has been previously addressed in the context of timed automata [25]. Although the problem is undecidable in general, decidability is recovered when the left-hand side automaton has at most one clock, or the only constant appearing in the clock constraints is zero. These are essentially the only known decidable cases of language inclusion for timed automata.

The study of data automata [5, 11] usually deals with the complexity of decision problems in logics describing data languages for simple theories, typically infinite data domains with equality. Here we provide a semi-decision procedure for the language inclusion between data automata controlled by generic first-order theories, whose language-theoretic problems are undecidable.

Data words are also studied in the context of symbolic visibly pushdown automata (SVPA) [10]. Language inclusion is decidable for SVPAs with transition guards from a decidable theory because SVPAs are closed under complement and the emptiness can be reduced to a finite number of queries expressible in the underlying theory of guards. Decidability comes here at the cost of reducing the expressivity and forbidding comparisons between adjacent positions in the input (only comparisons between matching call/return positions of the input nested words are allowed).

Finally, several works on model checking infinite-state systems against CTL [4] and CTL* [8] specifications are related to our problem as they check inclusion between the set of computation trees of an infinite-state system and the set of trees defined by a branching temporal logic specification. The verification of existential CTL formulae [4] is reduced to solvingforall-exists quantified Horn clauses by applying counterexample guided refinement to discover witnesses for existentially quantified variables. The work [8] on CTL* verification of infinite systems is based on partial symbolic determination, using prophecy variables to summarize the future program execution. For finite-state systems, automata are a strictly more expressive formalism than temporal logics<fnref n="1" />. Such a comparison is, however, non-trivial for infinite-state systems. Nevertheless, we found the data automata considered in this paper to be a natural tool for specifying verification conditions of array programs [16, 15, 6] and regular properties of timed languages [2].

# 2 Preliminary Definitions

Let $\mathbb{N}$ denote the set of non-negative integers including zero. For any $k, \ell \in \mathbb{N}$, $k \le \ell$, we write $[k, \ell]$ for the set $\{k, k+1, \dots, \ell\}$. We write $\perp$ and $\top$ for the boolean constants

<footnote n="1">¹ For (in)finite words, the class of LTL-definable languages coincides with the star-free languages, which are a strict subclass of (ω-)regular languages.</footnote>
false and true, respectively. Given a possibly infinite data domain $\mathcal{D}$, we denote by $\text{Th}(\mathcal{D}) = \langle \mathcal{D}, f_1, \dots, f_m \rangle$ the set of syntactically correct first-order formulae with function symbols $f_1, \dots, f_m$. A variable $x$ is said to be free in a formula $\phi$, denoted as $\phi(x)$, iff it does not occur under the scope of a quantifier.

Let $\mathbf{x} = \{x_1, \dots, x_n\}$ be a finite set of variables. A valuation $v : \mathbf{x} \to \mathcal{D}$ is an assignment of the variables in $\mathbf{x}$ with values from $\mathcal{D}$. We denote by $\mathcal{D}^x$ the set of such valuations. For a formula $\phi(\mathbf{x})$, we denote by $v \models_{\text{Th}(\mathcal{D})} \phi$ the fact that substituting each variable $x \in \mathbf{x}$ by $v(x)$ yields a valid formula in the theory $\text{Th}(\mathcal{D})$. In this case, $v$ is said to be a model of $\phi$. A formula is said to be satisfiable iff it has a model. For a formula $\phi(\mathbf{x}, \mathbf{x}')$ where $\mathbf{x}' = \{x' | x \in \mathbf{x}\}$ and two valuations $v, v' \in \mathcal{D}^x$, we denote by $(v, v') \models_{\text{Th}(\mathcal{D})} \phi$ the fact that the formula obtained from $\phi$ by substituting each $x$ with $v(x)$ and each $x'$ with $v'(x')$ is valid in $\text{Th}(\mathcal{D})$.

**Data Automata.** *Data Automata* (DA) are extensions of non-deterministic finite automata with variables ranging over an infinite data domain $\mathcal{D}$, equipped with a first order theory $\text{Th}(\mathcal{D})$. Formally, a DA is a tuple $A = \langle \mathcal{D}, \Sigma, \mathbf{x}, Q, \mathbf{t}, F, \Delta \rangle$, where:

- $\Sigma$ is a finite alphabet of input events and $\diamond \in \Sigma$ is a special padding symbol,

- $\mathbf{x} = \{x_1, \dots, x_n\}$ is a set of variables,

- $Q$ is a finite set of states, $\mathbf{t} \in Q$ is an initial state, $F \subseteq Q$ are final states, and

- $\Delta$ is a set of rules of the form $q \xrightarrow{\sigma, \phi(\mathbf{x}^{\prime})} q'$ where $\sigma \in \Sigma$ is an alphabet symbol and $\phi(\mathbf{x}, \mathbf{x}')$ is a formula in $\text{Th}(\mathcal{D})$.

A configuration of $A$ is a pair $(q, v) \in Q \times \mathcal{D}^x$. We say that a configuration $(q', v')$ is a successor of $(q, v)$ if and only if there exists a rule $q \xrightarrow{\sigma, \phi} q' \in \Delta$ and $(v, v') \models_{\text{Th}(\mathcal{D})} \phi$. We denote the successor relation by $(q, v) \xrightarrow{\sigma, \phi} A(q', v')$, and we omit writing $\phi$ and $A$ when no confusion may arise. We denote by $\text{succ}_A(q, v) = \{(q', v') | (q, v) \to_A (q', v')\}$ the set of successors of a configuration $(q, v)$.

A trace is a finite sequence $w = (v_0, \sigma_0), \dots, (v_{n-1}, \sigma_{n-1}), (v_n, \diamond)$ of pairs $(v_i, \sigma_i)$ taken from the infinite alphabet $\mathcal{D}^x \times \Sigma$. A run of $A$ over the trace $w$ is a sequence of configurations $\pi : (q_0, v_0) \xrightarrow{\sigma_0} (q_1, v_1) \xrightarrow{\sigma_1} \dots \xrightarrow{\sigma_{n-1}} (q_n, v_n)$. We say that the run $\pi$ is accepting if and only if $q_n \in F$, in which case $A$ accepts $w$. The language of $A$, denoted $\mathcal{L}(A)$, is the set of traces accepted by $A$.

**Data Automata Networks.** A data automata network (DAN) is a non-empty tuple $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ of data automata $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, \mathbf{t}_i, F_i, \Delta_i \rangle$, $i \in [1, N]$ whose sets of states are pairwise disjoint. A DAN is a succint representation of an exponentially larger DA $\mathcal{A}^e = \langle \mathcal{D}, \Sigma_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}}, Q_{\mathcal{A}}, \mathbf{t}_{\mathcal{A}}, F_{\mathcal{A}}, \Delta_{\mathcal{A}} \rangle$, called the expansion of $\mathcal{A}$, where:

- $\Sigma_{\mathcal{A}} = \Sigma_1 \cup \dots \cup \Sigma_N$ and $\mathbf{x}_{\mathcal{A}} = \mathbf{x}_1 \cup \dots \cup \mathbf{x}_N$,

- $Q_{\mathcal{A}} = Q_1 \times \dots \times Q_N$, $\mathbf{t}_{\mathcal{A}} = \langle \mathbf{t}_1, \dots, \mathbf{t}_N \rangle$ and $F_{\mathcal{A}} = F_1 \times \dots \times F_N$,

- $\langle q_1, \dots, q_N \rangle \xrightarrow{\sigma, \phi} \langle q'_1, \dots, q'_N \rangle$ if and only if (i) for all $i \in I$, $q_i \xrightarrow{\sigma, \phi_i} q'_i$, (ii) for all $i \notin I$, $q_i = q'_i$, and (iii) $\phi = \bigwedge_{i \in I} \phi_i \wedge \bigwedge_{j \notin I} \tau_j$, where $I = \{i \in [1, N] \mid q_i \xrightarrow{\sigma, \phi_i} q'_i \in \Delta_i\}$ is the set of DA that can move from $q_i$ to $q'_i$ while reading the input symbol $\sigma$, and $\tau_j \equiv \bigwedge_{x \in \mathbf{x}_j \setminus (\cup_{i \in I} \mathbf{x}_i)} x'$ propagates the values of the local variables in $A_j$ that are not updated by $\{A_i\}_{i \in I}$.
Intuitively, all automata that can read an input symbol synchronize their actions on that
symbol whereas the rest of the automata make an idle step and copy the values of their
local variables which are not updated by the active automata. The language of the DAN
$\mathcal{A}$ is defined as the language of its expansion DA, i.e. $\mathcal{L}(\mathcal{A}) = \mathcal{L}(\mathcal{A}^e)$.

**Trace Inclusion.** Let $\mathcal{A}$ be a DAN and $\mathcal{A}^e = \langle \mathcal{D}, \Sigma, \mathbf{x}_{\mathcal{A}}, \mathcal{Q}_{\mathcal{A}}, \mathbf{1}_{\mathcal{A}}, F_{\mathcal{A}}, \Delta_{\mathcal{A}} \rangle$ be its expansion. For a set of variables $\mathbf{y} \subseteq \mathbf{x}_{\mathcal{A}}$, we denote by $v_{\downarrow \mathbf{y}}$ the restriction of a valuation $v \in \mathcal{D}^{\mathbf{x}_{\mathcal{A}}}$ to the variables in $\mathbf{y}$. For a trace $w = (v_0, \sigma_0), \dots, (v_n, \diamond) \in (\mathcal{D}^{\mathbf{x}_{\mathcal{A}}} \times \Sigma_{\mathcal{A}})^*$, we denote by $w_{\downarrow \mathbf{y}}$ the trace $(v_0 \downarrow_{\mathbf{y}}, \sigma_0), \dots, (v_{n-1} \downarrow_{\mathbf{y}}, \sigma_{n-1}), (v_n \downarrow_{\mathbf{y}}, \diamond) \in (\mathcal{D}^{\mathbf{y}} \times \Sigma)^*$. We lift this notion to sets of words in the natural way, by defining $\mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{y}} = \{w_{\downarrow \mathbf{y}} | w \in \mathcal{L}(\mathcal{A})\}$.

We are now ready to define the trace inclusion problem on which we focus in this
paper. Given a DAN $\mathcal{A}$ as before and a DA $B = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, \mathcal{Q}_B, \mathbf{1}_B, F_B, \Delta_B \rangle$ such that $\mathbf{x}_B \subseteq \mathbf{x}_{\mathcal{A}}$, the trace inclusion problem asks whether $\mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \subseteq \mathcal{L}(B)$? The right-hand side DA $B$ is called observer, and the variables in $\mathbf{x}_B$ are called observable variables.

3 Boolean Closure Properties of Data Automata

We show first that data automata are closed under the boolean operations of union,
intersection and complement and that they are amenable to determinisation. Clearly,
the emptiness problem is, in general, undecidable, due to the result of Minsky on 2-
counter machines with integer variables, increment, decrement and zero test [23].

Let $A = (\mathcal{D}, \Sigma, \mathbf{x}, \mathcal{Q}, \mathbf{1}, F, \Delta)$ be a DA for the rest of this section. $A$ is said to be *deterministic* if and only if, for each trace $w \in \mathcal{L}(A)$, $A$ has at most one run over $w$. The first result of this section is that, interestingly, any DA can be determinized while preserving its language. The determinisation procedure is a generalization of the classical subset construction for Rabin-Scott word automata on finite alphabets. The reason why determinisation is possible for automata over an infinite data alphabet $\mathcal{D}^x \times \Sigma$ is that the successive values taken by *each variable* $x \in \mathbf{x}$ are tracked by the language $\mathcal{L}(A) \subseteq (\mathcal{D}^x \times \Sigma)^*$. This assumption is crucial: a typical example of automata over an infinite alphabet, that cannot be determinized, are timed automata [2], where only the elapsed time is reflected in the language, and not the values of the variables (clocks).

Formally, the deterministic DA accepting the language $\mathcal{L}(A)$ is defined as $A^d = \langle \mathcal{D}, \Sigma, \mathbf{x}, Q^d, \mathbf{1}^d, F^d, \Delta^d \rangle$, where $Q^d = 2^Q, \mathbf{1}^d = \{1\}, F^d = \{P \subseteq Q \mid P \cap F \neq \emptyset\}$ and $\Delta^d$ is the set of rules $P \xrightarrow{\sigma, \theta} P'$ such that:

- for all $p' \in P'$ there exists $p \in P$ and a rule $p \xrightarrow{\sigma, \psi} p' \in \Delta$,

- $\theta(\mathbf{x}, \mathbf{x}') \equiv \bigwedge_{p' \in P'} \bigvee_{p \in P} \xrightarrow{\sigma, \psi} p' \in \Delta \wedge \psi \wedge \bigwedge_{p' \in Q \setminus P'} \bigwedge_{p \in P} \xrightarrow{\sigma, \phi} p' \in \Delta \quad \neg \phi$.

The main difference with the classical subset construction for Rabin-Scott automata is
that here we consider all sets $P'$ of states that have a predecessor in $P$, not just the max-
imal such set. This refined subset construction takes into account not just the alphabet
symbols in $\Sigma$, but also the valuations of the variables in $\mathbf{x}$. Observe, moreover, that $A^d$
can be built for any theory $\text{Th}(\mathcal{D})$ that is closed under conjunction and negation. The
following lemma states the main properties of $A^d$.
**Lemma 1.** Given a DA $A = (\mathcal{D}, \Sigma, \mathbf{x}, \mathcal{Q}, \mathfrak{I}, F, \Delta)$, (1) for any $w \in (\mathcal{D}^x \times \Sigma)^*$ and $P \in \mathcal{Q}^d$, $A^d$ has exactly one run on $w$ that starts in $P$, and (2) $\mathcal{L}(A) = \mathcal{L}(A^d)$.

*Proof.* (1) Let $w = (v_0, \sigma_0), \dots, (v_{n-1}, \sigma_{n-1}), (v_n, \diamond)$ be an arbitrary trace and $P \subseteq Q$ be a state of $A^d$. We first build a run $\pi = (P_0, v_0) \xrightarrow{\sigma_0, \theta_0} (P_1, v_1) \dots \xrightarrow{\sigma_{n-1}, \theta_{n-1}} (P_n, v_n)$ of $A^d$ such that $P_0 = P$, by induction on $n \ge 0$. If $n = 0$, then $w = (v_0, \diamond)$ and $\pi = (P_0, v_0)$ is trivially a run of $A^d$ over $w$. For the induction step, let $n > 0$ and suppose that $A^d$ has a run $(P_0, v_0) \xrightarrow{\sigma_0, \theta_0} \dots (P_{n-1}, v_{n-1})$ such that $P_0 = P$. We extend this run to a run over $w$, by considering:

$$ P_n = \left\{ \begin{array}{l} p \in Q \mid \exists q \in P_{n-1} \cdot q \xrightarrow{\sigma_{n-1}, \phi} p \in \Delta \text{ and } (v_{n-1}, v_n) \models_{\mathfrak{m}(\mathcal{D})} \phi \\ \theta_n \equiv \bigwedge_{p' \in P_n} \bigvee_{\substack{p \xrightarrow{\sigma, \psi} p' \in \Delta \\ p \in P_{n-1}}} \psi \wedge \bigwedge_{p' \in Q \setminus P_n} \bigwedge_{\substack{p \xrightarrow{\sigma, \phi} p' \in \Delta \\ p \in P_{n-1}}} \neg \phi \end{array} \right\} $$

It is not hard to see that $(v_{n-1}, v_n) \models \theta_n$, thus $(P_0, v_0) \xrightarrow{\sigma_0, \theta_0} \dots \xrightarrow{\sigma_{n-1}, \theta_{n-1}} (P_n, v_n)$ is indeed a run of $A^d$ over $w$. To show that $\pi$ is unique, suppose, by contradiction, that there exists a different run $\pi' = (R_0, v_0) \xrightarrow{\sigma_0, \omega_0} (R_1, v_1) \dots \xrightarrow{\sigma_{n-1}, \omega_{n-1}} (R_n, v_n)$ such that $P_0 = R_0 = P$. Notice that the relation labeling any transition rule $P_i \xrightarrow{\sigma_i, \theta_i} P_{i+1}$ is entirely determined by the sets $P_i$ and $P_{i+1}$, so two runs are different iff they differ in at least one state, i.e. and $P_j \neq R_j$, for some $j \in [1, n]$. Let $i$ denote the smallest such $j$ and suppose that there exists $p \in P_i$ such that $p \notin R_i$ (the symmetrical case $p \in R_i$ and $p \notin P_i$ is left to the reader). By the definition of $\Delta^d$, there exists $q \in P_{i-1} = R_{i-1}$ such that $q \xrightarrow{\sigma_{i-1}, \psi} p \in \Delta$. Since $(v_{i-1}, v_i) \models \theta_{i-1} \wedge \omega_{i-1}$, we obtain that $(v_{i-1}, v_i) \models \{\psi \mid q \xrightarrow{\sigma_{i-1}, \psi} p \in \Delta, q \in P_{i-1}\}$ and $(v_{i-1}, v_i) \models \neg \psi \mid q \xrightarrow{\sigma_{i-1}, \psi} p \in \Delta, q \in P_{i-1}\}$, contradiction. Thus $\pi$ is the only run of $A^d$ over $w$, starting in $P$.

(2) Let $w = (v_0, \sigma_0), \dots, (v_{n-1}, \sigma_{n-1}), (v_n, \diamond)$ be a trace. "$\subseteq$" If $w \in \mathcal{L}(A)$, then $A$ has a run $(q_0, v_0) \xrightarrow{\sigma_0, \phi_0} \dots \xrightarrow{\sigma_{n-1}, \phi_{n-1}} (q_n, v_n)$ such that $q_0 = \mathfrak{I}$ and $q_n \in F$. By point (1), $A^d$ has a unique run $(P_0, v_0) \xrightarrow{\sigma_0, \theta_0} \dots \xrightarrow{\sigma_{n-1}, \theta_{n-1}} (P_n, v_n)$ over $w$. We prove that $q_i \in P_i$, by induction on $i \in [0, n]$. For $i = 0$, we have $P_0 = \{\mathfrak{I}\}$, by the definition of $A^d$. For the induction step, suppose that $i \in [1, n]$ and $q_{i-1} \in P_{i-1}$. By contradiction, assume that $q_i \notin P_i$. Since $(v_{i-1}, v_i) \models_{\mathfrak{m}(\mathcal{D})} \theta_{i-1}$, we obtain $(v_{i-1}, v_i) \models_{\mathfrak{m}(\mathcal{D})} \neg \phi_{i-1}$, contradiction. Thus $q_i \in P_i$ for all $i \in [0, n]$, and $q_n \in P_n$, hence $P_n \cap F \neq \emptyset$. Then $P_n \in F^d$, and $w \in \mathcal{L}(A^d)$. "$\supseteq$" If $w \in \mathcal{L}(A^d)$, then $A^d$ has a (unique) run $(P_0, v_0) \xrightarrow{\sigma_0, \theta_0} (P_1, v_1) \dots \xrightarrow{\sigma_{n-1}, \theta_{n-1}} (P_n, v_n)$ over $w$, such that $P_0 = \{\mathfrak{I}\}$ and $P_n \cap F \neq \emptyset$. Then there exists $p_n \in P_n \cap F$ and, by the definition of $A^d$, there exists $p_{n-1} \in P_{n-1}$ such that $p_{n-1} \xrightarrow{\sigma_{n-1}, \psi_{n-1}} p_n \in \Delta$ and $(v_{n-1}, v_n) \models_{\mathfrak{m}(\mathcal{D})} \psi_{n-1}$. Continuing this argument backwards, we can find a run $(q_0, v_0) \xrightarrow{\sigma_0, \psi_0} \dots \xrightarrow{\sigma_{n-1}, \psi_{n-1}} (q_n, v_n)$ of $A$ over $w$, such that $q_i \in P_i$, for all $i \in [0, n]$. Since $P_0 = \{\mathfrak{I}\}$ and $q_n \in F$, we obtain that $w \in \mathcal{L}(A)$. $\square$

The construction of a deterministic DA recognizing the language of $A$ is key to defining a DA that recognizes the complement of $A$. Let $\bar{A} = (\bar{\mathcal{D}}, \bar{\Sigma}, \bar{\mathbf{x}}, \bar{\mathcal{Q}}^d, \bar{\mathfrak{I}}^d, \bar{\mathcal{F}}^d, \bar{\Delta}^d)$. In other words, $\bar{A}$ has the same structure as $A^d$, and the set of final states consists of those subsets that contain no final state, i.e. $\{P \subseteq Q \mid P \cap F = \emptyset\}$. Using Lemma 1, it is not difficult to show that $\mathcal{L}(\bar{A}) = (\mathcal{D}^x \times \Sigma)^* \setminus \mathcal{L}(A)$.
Next, we show closure of DA under intersection. Let $B = \langle \mathcal{D}, \Sigma, \mathbf{x}, Q', t', F', \Delta' \rangle$ be a DA and define $A \times B = \langle \mathcal{D}, \Sigma, \mathbf{x}, Q \times Q', (t, t'), F \times F', \Delta^\times \rangle$, where $(q, q') \xrightarrow{\sigma, \phi} (p, p') \in \Delta^\times$ if and only if $q \xrightarrow{\sigma, \phi} p \in \Delta$, $q' \xrightarrow{\sigma, \psi} p' \in \Delta'$ and $\phi \equiv \phi \wedge \psi$. It is easy to show that $\mathcal{L}(A \times B) = \mathcal{L}(A) \cap \mathcal{L}(B)$. DA are also closed under union, since $\mathcal{L}(A) \cup \mathcal{L}(B) = \mathcal{L}(\bar{A} \times \bar{B})$.

Let us turn now to the trace inclusion problem. The following lemma shows that this problem can be effectively reduced to an equivalent language emptiness problem. However, note that this reduction does not work when the trace inclusion problem is generalized by removing the condition $\mathbf{x}_B \subseteq \mathbf{x}_A$. In other words, if the observer uses local variables not shared with the network<fnref n="2" />, i.e. $\mathbf{x}_B \setminus \mathbf{x}_A \neq \emptyset$, the generalized trace inclusion problem $\mathcal{L}(A) \downarrow_{\mathbf{x}_A \cap \mathbf{x}_B} \subseteq \mathcal{L}(B) \downarrow_{\mathbf{x}_A \cap \mathbf{x}_B}$ has a negative answer iff there exists a trace $w = (v_0, \sigma_0), \dots, (v_n, \diamond) \in \mathcal{L}(A)$ such that, for all valuations $\mu_0, \dots, \mu_n \in \mathcal{D}^{\mathbf{x}_B \setminus \mathbf{x}_A}$, we have $w' = (v_0 \downarrow_{\mathbf{x}_A \cap \mathbf{x}_B} \cup \mu_0, \sigma_0), \dots, (v_n \downarrow_{\mathbf{x}_A \cap \mathbf{x}_B} \cup \mu_n, \diamond) \notin \mathcal{L}(B)$. This kind of quantifier alternation cannot be easily accommodated within the framework of language emptiness, in which only one type of (existential) quantifier occurs.

**Lemma 2.** Given DA $A = (\mathcal{D}, \Sigma, \mathbf{x}_A, Q_A, t_A, F_A, \Delta_A)$ and $B = (\mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, t_B, F_B, \Delta_B)$ such that $\mathbf{x}_B \subseteq \mathbf{x}_A$. Then $\mathcal{L}(A) \downarrow_{\mathbf{x}_B} \subseteq \mathcal{L}(B)$ if and only if $\mathcal{L}(A \times \bar{B}) = \emptyset$.

*Proof.* We have $\mathcal{L}(A) \downarrow_{\mathbf{x}_B} \subseteq \mathcal{L}(B)$ iff $\mathcal{L}(A) \downarrow_{\mathbf{x}_B} \cap \mathcal{L}(\bar{B}) = \mathcal{L}(A \times \bar{B}) \downarrow_{\mathbf{x}_B} = \emptyset$ iff $\mathcal{L}(A \times \bar{B}) = \emptyset$. $\square$

The trace inclusion problem is undecidable, which can be shown by reduction from the language emptiness problem for DA (take $B$ such that $\mathcal{L}(B) = \emptyset$). However the above lemma shows that any semi-decision procedure for the language emptiness problem can also be used to deal with the trace inclusion problem.

# 4 Abstract, Check, and Refine for Trace Inclusion

This section describes our semi-algorithm for checking the trace inclusion between a given network $\mathcal{A}$ and an observer $B$. Let $\mathcal{A}^e$ denote the expansion of $\mathcal{A}$, defined in the previous. In the light of Lemma 2, the trace inclusion problem $\mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \subseteq \mathcal{L}(B)$, where the set of observable variables $\mathbf{x}_B$ is included in the set of network variables, can be reduced to the language emptiness problem $\mathcal{L}(\mathcal{A}^e \times \bar{B}) = \emptyset$.

Although language emptiness is undecidable for data automata [23], several cost-effective semi-algorithms and tools [17, 21, 14, 3] have been developed, showing that it is possible, in many practical cases, to provide a yes/no answer to this problem. However, to apply one of the existing off-the-shelf tools to our problem, one needs to build the product automaton $\mathcal{A}^e \times \bar{B}$ prior to the analysis. Due to the inherent state explosion caused by the interleaving semantics of the network as well as by the complementation of the observer, such a solution would not be efficient in practice.

To avoid building the product automaton, our procedure builds on-the-fly an over-approximation of the (possibly infinite) set of reachable configurations of $\mathcal{A}^e \times \bar{B}$. This over-approximation is defined using the approach of *lazy predicate abstraction* [17],

<footnote n="2">² For timed automata, this is the case since the only shared variable is the time, and the observer may have local clocks.</footnote>
combined with *counterexample-driven abstraction refinement* using interpolants [21]. We store the explored abstract states in a structure called an *antichain tree*. In general, antichain-based algorithms [28] store only states which are incomparable w.r.t. a partial order called *subsumption*. Our method can be thus seen as an extension of the antichain-based language inclusion algorithm [1] to infinite state systems by means of predicate abstraction and interpolation-based refinement. Since the trace inclusion problem is undecidable in general, termination of our procedure is not guaranteed; in the following, we shall, however, call our procedure an algorithm for the sake of brevity.

## 4.1 Antichain Trees

In this section, we define antichain trees, which are the main data structure of the trace inclusion (semi-)algorithm. Let $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ be a network of automata where $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, \mathbf{v}_i, F_i, \Delta_i \rangle$, for all $i \in [1, N]$, and let $B = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, \mathbf{v}_B, F_B, \Delta_B \rangle$ be an observer such that $\mathbf{x}_B \subseteq \bigcup_{i=1}^N \mathbf{x}_i$. We also denote by $\mathcal{A}^e = \langle \mathcal{D}, \Sigma_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}}, Q_{\mathcal{A}}, \mathbf{v}_{\mathcal{A}}, F_{\mathcal{A}}, \Delta_{\mathcal{A}} \rangle$ the expansion of the network $\mathcal{A}$ and by $\mathcal{A}^e \times \bar{B} = \langle \mathcal{D}, \Sigma_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}}, Q^p, \mathbf{v}^p, F^p, \Delta^p \rangle$ the product automaton used for checking language inclusion.

An *antichain tree* for the network $\mathcal{A}$ and the observer $B$ is a tree whose nodes are labeled by *product states* (see Fig. 2 for examples). Intuitively, a product state is an over-approximation of the set of configurations of the product automaton $\mathcal{A}^e \times \bar{B}$ that share the same control state. Formally, a *product state for A and B* is a tuple $s = (\mathbf{q}, P, \Phi)$ where(i) $(\mathbf{q}, P)$ is a state of $\mathcal{A}^e \times \bar{B}$ with $\mathbf{q} = \langle q_1, \dots, q_N \rangle$ being a state of the network expansion $\mathcal{A}^e$ and $P$ being a set of states of the observer $B$, and (ii) $\Phi(\mathbf{x}_{\mathcal{A}}) \in \text{Th}(\mathcal{D})$ is a formula which defines an over-approximation of the set of valuations of the variables $\mathbf{x}_{\mathcal{A}}$ that reach the state $(\mathbf{q}, P)$ in $\mathcal{A}^e \times \bar{B}$. A product state $s = (\mathbf{q}, P, \Phi)$ is a finite representation of a possibly infinite set of configurations of $\mathcal{A}^e \times \bar{B}$, denoted as $[[s]] = \{(\mathbf{q}, P, v) \mid v \models_{\text{Th}(\mathcal{D})} \Phi\}$.

To build an over-approximation of the set of reachable states of the product automaton, we need to compute, for a product state $s$, an over-approximation of the set of configurations that can be reached in one step from $s$. To this end, we define first a finite abstract domain of product states, based on the notion of *predicate map*. A predicate map is a partial function that associates sets of facts about the values of the variables used in the product automaton, called *predicates*, with components of a product state, called *substates*. The reason behind the distribution of predicates over substates is two-fold. First, we would like the abstraction to be *local*, i.e. the predicates needed to define a certain subtree in the antichain must be associated with the labels of that subtree only. Second, once a predicate appears in the context of a substate, it should be subsequently reused whenever that same substate occurs as part of another product state.

Formally, a *substate* of a state $(\langle q_1, \dots, q_N \rangle, P) \in Q^p$ of the product automaton $\mathcal{A}^e \times \bar{B}$ is a pair $(\langle q_{i_1}, \dots, q_{i_k} \rangle, S)$ such that (i) $(\langle q_{i_1}, \dots, q_{i_k} \rangle)$ is a subsequence of $(\langle q_1, \dots, q_N \rangle)$, and (ii) $S \neq \emptyset$ only if $S \cap P \neq \emptyset$. We denote the substate relation by $(\langle q_{i_1}, \dots, q_{i_k} \rangle, S) \lhd (\langle q_1, \dots, q_N \rangle, P)$. The substate relation requires the automata $A_{i_1}, \dots, A_{i_k}$ of the network $\mathcal{A}$ to be in the control states $q_{i_1}, \dots, q_{i_k}$ simultaneously, and the observer $B$ to be in at least some state of $S$ provided $S \neq \emptyset$ (if $S = \emptyset$, the state of $B$ is considered to be irrelevant). Let $S_{\langle \mathcal{A}, B \rangle} = \{r \mid \exists q \in Q^p . r \lhd q\}$ be the set of substates of a state of $\mathcal{A}^e \times \bar{B}$.
A predicate map $\Pi: S_{\langle\mathcal{A}, B\rangle} \to 2^{\mathfrak{m}(\mathcal{D})}$ associates each substate $(\mathbf{r}, S) \in Q_{i_1} \times \dots \times Q_{i_k} \times 2^{Q_B}$ with a set of formulae $\pi(\mathbf{x})$ where (i) $\mathbf{x} = \mathbf{x}_{i_1} \cup \dots \cup \mathbf{x}_{i_k} \cup \mathbf{x}_B$ if $S \neq \emptyset$, and (ii) $\mathbf{x} = \mathbf{x}_{i_1} \cup \dots \cup \mathbf{x}_{i_k}$ if $S = \emptyset$. Notice that a predicate associated with a substate refers only to the local variables of those network components $A_{i_1}, \dots, A_{i_k}$ and of the observer $B$ that occur in the particular substate.

**Example 1.** The antichain in Fig. 2 (d) uses the predicate map $(\langle q_1^1, q_1^2 \rangle, \{p_1\}) \mapsto \{v = 1\}$, $(\langle q_1^1, q_1^2 \rangle, \{p_2\}) \mapsto \{\Delta < x, v = 2\}$. ■

We are now ready to define the abstract semantics of the product automaton $\mathcal{A}^e \times \bar{B}$, induced by a given predicate map. For convenience, we define first a set $Post(s)$ of concrete successors of a product state $s = (\mathbf{q}, P, \Phi)$ such that $(\mathbf{r}, S, \Psi) \in Post(s)$ if and only if (i) the product automaton $\mathcal{A}^e \times \bar{B}$ has a rule $(\mathbf{q}, P) \xrightarrow{\sigma, \theta} (\mathbf{r}, S) \in \Delta^p$ and $\Psi(\mathbf{x}_{\mathcal{A}}) \equiv \exists \mathbf{x}'_{\mathcal{A}} \cdot \Phi(\mathbf{x}'_{\mathcal{A}}) \wedge \theta(\mathbf{x}'_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}}) \to \bot$. The set of concrete successors does not contain states with empty set of valuations because these states are unreachable in $\mathcal{A}^e \times \bar{B}$.

Given a predicate map $\Pi$, the set $Post_{\Pi}(s)$ of abstract successors of a product state $s$ is defined as follows: $(\mathbf{r}, S, \Psi_{\Pi}^{\sharp}) \in Post_{\Pi}(s)$ if and only if (i) there exists a product state $(\mathbf{r}, S, \Psi) \in Post(s)$ and (ii) $\Psi_{\Pi}^{\sharp}(\mathbf{x}_{\mathcal{A}}) \equiv \bigwedge_{r \prec (\mathbf{r}, S)} \bigwedge \{\pi \in \Pi(r) \mid \Psi \to \pi\}$. In other words, the set of data valuations that are reachable by an abstract successor is the tightest over-approximation of the concrete set of reachable valuations, obtained as the conjunction of the available predicates from the predicate map that over-approximate this set.

**Example 2.** (contd. from Ex. 1) Consider the antichain from Fig. 2 (d). The concrete successors of $s = (\langle q_1^1, q_1^2 \rangle, \{p_1\}, v = 1)$ are $(\langle q_1^1, q_1^2 \rangle, \{p_1\}, \Psi_1)$ and $(\langle q_1^1, q_1^2 \rangle, \{p_2\}, \Psi_2)$:

$$ \Psi_1 \equiv \exists v', x', \Delta' \cdot v' = 1 \wedge x = x' + 1 \wedge v = 1 \wedge \Delta = \Delta' \wedge 0 \le x' < \Delta \wedge v = v' $$

$$ \Psi_2 \equiv \exists v', x', \Delta' \cdot v' = 1 \wedge x = x' + 1 \wedge v = 2 \wedge \Delta = \Delta' \wedge \Delta \le x' < 2\Delta \wedge v = v' + 1 $$

With predicate map $\Pi$ from Ex. 1, $Post_{\Pi}(s) = \{(\langle q_1^1, q_1^2 \rangle, \{p_1\}, \Psi_1^{\sharp}), (\langle q_1^1, q_1^2 \rangle, \{p_2\}, \Psi_2^{\sharp})\}$:

$$ \Psi_1 \to v = 1 \qquad \Rightarrow \Psi_1^{\sharp} \equiv v = 1 $$

$$ \Psi_2 \to v = 2 \text{ and } \Psi_2 \to \Delta < x \Rightarrow \Psi_2^{\sharp} \equiv v = 2 \wedge \Delta < x. \blacksquare $$

Finally, an antichain tree (or, simply antichain) $\mathcal{T}$ for $\mathcal{A}$ and $B$ is a tree whose nodes are labeled with product states and whose edges are labeled by input symbols and concrete transition relations. Let $\mathbb{N}^*$ be the set of finite sequences of natural numbers that denote the positions in the tree. For a tree position $p \in \mathbb{N}^*$ and $i \in \mathbb{N}$, the position $p.i$ is a child of $p$. A set $S \subseteq \mathbb{N}^*$ is said to be prefix-closed if and only if, for each $p \in S$ and each prefix $q$ of $p$, we have $q \in S$ as well. The root of the tree is denoted by the empty sequence $\varepsilon$.

Formally, an antichain $\mathcal{T}$ is a set of pairs $\langle s, p \rangle$, where $s$ is a product state and $p \in \mathbb{N}^*$ is a tree position, such that (1) for each position $p \in \mathbb{N}^*$ there exists at most one product state $s$ such that $\langle s, p \rangle \in \mathcal{T}$, (2) the set $\{p \mid \langle s, p \rangle \in \mathcal{T}\}$ is prefix-closed, (3) $(\mathrm{root}_{\langle\mathcal{A}, B\rangle}, \varepsilon) \in \mathcal{T}$ where $\mathrm{root}_{\langle\mathcal{A}, B\rangle} = (\langle l_1, \dots, l_N \rangle, \{l_B\}, \top)$ is the label of the root, and (4) for each edge $(\langle s, p \rangle, \langle t, p.i \rangle)$ in $\mathcal{T}$, there exists a predicate map $\Pi$ such that $t \in Post_{\Pi}(s)$. For the latter condition, if $s = (\mathbf{q}, P, \Phi)$ and $t = (\mathbf{r}, S, \Psi)$, there exists a unique rule $(\mathbf{q}, P) \xrightarrow{\sigma, \theta} (\mathbf{r}, S) \in \Delta^p$, and we shall sometimes denote the edge as $s \xrightarrow{\sigma, \theta} t$ or simply $s \xrightarrow{\theta} t$ when the tree positions are not important.
Each antichain node $n = (s, d_1...d_k) \in \mathcal{T}$ is naturally associated with a path from the root to itself $\rho: n_0 \xrightarrow{\sigma_1, \theta_1} n_1 \xrightarrow{\sigma_2, \theta_2} ... \xrightarrow{\sigma_k, \theta_k} n_k$. We denote by $\rho_i$ the node $n_i$ for each $i \in [0, k]$, and by $|\rho| = k$ the length of the path. The *path formula* associated with $\rho$ is $\Theta(\rho) = \bigwedge_{i=1}^k \theta(\mathbf{x}_A^{i-1}, \mathbf{x}_A^i)$ where $\mathbf{x}_A^i = \{x^i | x \in \mathbf{x}_A\}$ is a set of indexed variables for each $i \in [0, k]$.

**Example 3.** Consider the path $\rho: (\langle q_0^1, q_0^2 \rangle, \{p_0\}, \top) \xrightarrow{\text{init}} (\langle q_1^1, q_1^2 \rangle, \{p_1\}, \nu = 1) \xrightarrow{a_2} (\langle q_1^1, q_1^2 \rangle, \{p_2\}, \Delta < x) \xrightarrow{a_2} (\langle q_1^1, q_1^2 \rangle, \emptyset, \Delta < x)$ in the antichain from Fig. 2 (c). The path formula of $\rho$ is $\Theta(\rho) = \theta_1 \wedge \theta_2 \wedge \theta_3$ where:

$$ 
\begin{align*}
\theta_1 &\equiv v_1 = 1 \wedge x_1 = 0 \wedge 0 < \Delta_1 \\
\theta_2 &\equiv v_2 = v_1 + 1 \wedge \Delta_2 = \Delta_1 \wedge v_2 = 2 \wedge x_2 = x_1 + 1 \wedge \Delta_1 \le x_1 < 2\Delta_1 \wedge \neg(v_2 = v_1) \\
\theta_3 &\equiv v_3 = 2 \wedge \Delta_3 = \Delta_2 \wedge x_3 = x_2 + 1 \wedge \Delta_2 \le x_2 < 2\Delta_2 \wedge \neg(v_3 = v_2) . \blacksquare
\end{align*}
$$

## 4.2 Counterexample-driven Abstraction Refinement

A *counterexample* is a path from the root of the antichain to a node which is labeled by an *accepting* product state. A product state $(\mathbf{q}, P, \Phi)$ is said to be *accepting* iff $(\mathbf{q}, P)$ is an accepting state of the product automaton $\mathcal{A}^e \times \bar{B}$, i.e. $\mathbf{q} \in F_{\mathcal{A}}$ and $P \cap F_B = \emptyset$. A counterexample is said to be *spurious* if its path formula is unsatisfiable, i.e. the path does not correspond to a concrete execution of $\mathcal{A}^e \times \bar{B}$. In this case, we need to (i) remove the path $\rho$ from the current antichain and (ii) refine the abstract domain in order to exclude the occurrence of $\rho$ from future state space exploration.

Let $\rho: \text{root}_{\langle \mathcal{A}, B \rangle} = (\mathbf{q}_0, P_0, \Phi_0) \xrightarrow{\theta_1} (\mathbf{q}_1, P_1, \Phi_1) \xrightarrow{\theta_2} \dots \xrightarrow{\theta_k} (\mathbf{q}_k, P_k, \Phi_k)$ be a spurious counterexample in the following. For efficiency reasons, we would like to save as much work as possible and remove only the smallest suffix of $\rho$ which caused the spuriousness. For some $j \in [0, k]$, let $\Theta^j(\rho) = \Phi_j(\mathbf{x}_A^0) \wedge \bigwedge_{i=j}^k \theta_i(\mathbf{x}_A^{i-j}, \mathbf{x}_A^{i-j+1})$ be the formula defining all sequences of data valuations that start in the set $\Phi_j$ and proceed along the suffix $(\mathbf{q}_j, P_j, \Phi_j) \to \dots \to (\mathbf{q}_k, P_k, \Phi_k)$ of $\rho$. The *pivot* of a path $\rho$ is the maximal position $j \in [0, k]$ such that $\Theta^j(\rho) = \perp$, and $-1$ if $\rho$ is not spurious.

**Example 4.** (contd. from Ex. 3) The path formula $\Theta(\rho) = \theta_1 \wedge \theta_2 \wedge \theta_3$ from Ex. 3 is unsatisfiable, thus $\rho$ is a spurious counterexample. Moreover, we have $\Theta^1(\rho) = \top \wedge \theta_2 \wedge \theta_3 \to \perp$ because of the unsatisfiable subformula $v_2 = 2 \wedge v_3 = 2 \wedge \neg(v_3 = v_2)$. Since $\Theta^2(\rho)$ is satisfiable, the pivot of $\rho$ is 1. ■

Finally, we describe the refinement of the predicate map, which ensures that a given spurious counterexample will never be found in a future iteration of the abstract state space exploration. The refinement is based on the notion of *interpolant* [21].

**Definition 1.** Given a formula $\Phi(\mathbf{x})$ and a sequence $\langle \theta_1(\mathbf{x}, \mathbf{x}'), \dots, \theta_k(\mathbf{x}, \mathbf{x}') \rangle$ of formulae, an interpolant is a sequence of formulae $\mathbf{I} = \langle I_0(\mathbf{x}), \dots, I_k(\mathbf{x}) \rangle$ where: (1) $\Phi \to I_0$, (2) $I_k \to \perp$, and (3) $I_{i-1}(\mathbf{x}) \wedge \theta_i(\mathbf{x}, \mathbf{x}') \to I_i(\mathbf{x}')$ for all $i \in [1, k]$.

Any given interpolant is a witness for the unsatisfiability of a (suffix) path formula $\Theta^j(\rho)$. Dually, if *Craig's Interpolation Lemma* [9] holds for the considered first-order data theory $\text{Th}(\mathcal{D})$, any infeasible path formula is guaranteed to have an interpolant.
**Example 5.** (contd. from Ex. 4) The path formula $\Theta^1(\rho)$ in Ex. 4 has the interpolant
$I = \langle \top, v = 2, \perp \rangle$. ■

Given a spurious counterexample $\rho$ with pivot $j \ge 0$, an interpolant $\mathbf{I} = \langle I_0, \dots, I_{k-j} \rangle$ for the infeasible path formula $\Theta^j(\rho)$ can be used to refine the abstract domain by augmenting the predicate map $\Pi$. As an effect of this refinement, the antichain construction algorithm will avoid every path with the suffix $(\mathbf{q}_j, P_j, \Phi_j) \to \dots \to (\mathbf{q}_k, P_k, \Phi_k)$ in a future iteration. If $I_i \Leftrightarrow C_i^l(\mathbf{y}_1) \wedge \dots \wedge C_i^{m_i}(\mathbf{y}_{m_i})$ is a conjunctive normal form (CNF) of the $i$-th component of the interpolant, we consider the substate $(\mathbf{r}_i^\ell, S_i^\ell)$ for each $C_i^\ell(\mathbf{y}_\ell)$ where $l \in [1, m_i]$:

- $\mathbf{r}_i^\ell = \langle q_{i_1}, \dots, q_{i_h} \rangle$ where $1 \le i_1 < \dots < i_h \le N$ is the largest sequence of indices such that $\mathbf{x}_{i_g} \cap \mathbf{y}_\ell \ne \emptyset$ for each $g \in [1, h]$ and the set $\mathbf{x}_{i_g}$ of variables of the network component DA $A_{i_g}$,

- $S_i^\ell = P_j$ if $\mathbf{x}_B \cap \mathbf{y}_\ell \ne \emptyset$, and $S_i^\ell = \emptyset$, otherwise.

A predicate map $\Pi$ is said to be *compatible* with a spurious path $\rho : s_0 \xrightarrow{\theta_1} \dots \xrightarrow{\theta_k} s_k$ with pivot $j \ge 0$ if $s_j = (\mathbf{q}_j, P_j, \Phi_j)$ and there is an interpolant $\mathbf{I} = \langle I_0, \dots, I_{k-j} \rangle$ of the suffix $\langle \theta_1, \dots, \theta_k \rangle$ wrt. $\Phi_j$ such that, for each clause $C$ of some equivalent CNF of $I_i$, $i \in [0, k-j]$, it holds that $C \in \Pi(r)$ for some substate $r \leftarrow s_{i+j}$. The following lemma proves that, under a predicate map compatible with a spurious path $\rho$, the antichain construction will exclude further paths that share the suffix of $\rho$ starting with its pivot.

**Lemma 3.** Let $\rho : (\mathbf{q}_0, P_0, \Phi_0) \xrightarrow{\theta_0} (\mathbf{q}_1, P_1, \Phi_1) \xrightarrow{\theta_1} \dots \xrightarrow{\theta_{k-1}} (\mathbf{q}_k, P_k, \Phi_k)$ be a spurious counterexample and $\Pi$ be a predicate map compatible with $\rho$. Then, there is no sequence of product states $(\mathbf{q}_j, P_j, \Psi_0), \dots, (\mathbf{q}_k, P_k, \Psi_{k-j})$ such that: (1) $\Psi_0 \to \Phi_j$ and (2) $(\mathbf{q}_{i+1}, P_{i+1}, \Psi_{i-j+1}) \in \text{Post}_{\Pi}((\mathbf{q}_i, P_i, \Psi_{i-j}))$ for all $i \in [j, k-1]$.

*Proof.* Let $j \in [0, k]$ be the pivot of $\rho$. Since $\rho$ is spurious, there exists an interpolant $\mathbf{I} = \langle I_0, \dots, I_{k-j} \rangle$ for $\Phi_j$ and $\langle \theta_j, \dots, \theta_k \rangle$. It is sufficient to prove that $\Psi_i \to I_i$ for all $i \in [0, k-j]$. Since $I_{k-j} = \perp$, we obtain $\Psi_{k-j} = \perp$, and consequently $(\mathbf{q}_{k-j}, P_{k-j}, \perp) \in \text{Post}_{\Pi}((\mathbf{q}_{k-j-1}, P_{k-j-1}, \Psi_{k-j-1}))$. By the definition of $\text{Post}_{\Pi}$, we have $(\mathbf{q}_{k-j}, P_{k-j}, \perp) \in \text{Post}((\mathbf{q}_{k-j-1}, P_{k-j-1}, \Psi_{k-j-1}))$, which contradicts with the definition of $\text{Post}$. We show that $\Psi_i \to I_i$ for all $i \in [0, k-j]$, by induction on $k-j$. For the base case $k-j=0$, we have $\Psi_0 \to \Phi_j \to I_0$. For the induction step, we assume $\Psi_i \to I_i$ for all $i \in [0, k-j-1]$ and prove $\Psi_{k-j} \to I_{k-j}$. By the induction hypothesis, we have:

$$ \begin{aligned} \Psi_{k-j-1}(\mathbf{x}_{\mathcal{A}}) &\to I_{k-j-1}(\mathbf{x}_{\mathcal{A}}) \\ \Psi_{k-j-1}(\mathbf{x}_{\mathcal{A}}) \wedge \theta_{k-j-1}(\mathbf{x}_{\mathcal{A}}, \mathbf{x}'_{\mathcal{A}}) &\to I_{k-j-1}(\mathbf{x}_{\mathcal{A}}) \wedge \theta_{k-j-1}(\mathbf{x}_{\mathcal{A}}, \mathbf{x}'_{\mathcal{A}}) \to I_{k-j}(\mathbf{x}'_{\mathcal{A}}). \end{aligned} $$

Let $C_1 \wedge \dots \wedge C_\ell$ be the CNF of $I_{k-j}$. Since $\Pi$ is compatible with $\rho$, for each clause $C_i$, there exists a substate $r \leftarrow (\mathbf{q}_k, P_k)$ such that $C_i \in \Pi(r)$. By the definition of $\text{Post}_{\Pi}$, we obtain that $\Psi_{k-j} \to C_i$ for each $i \in [1, \ell]$, hence $\Psi_{k-j} \to I_{k-j}$. $\square$

Observe that the refinement induced by interpolation is *local* since $\Pi$ associates sets of predicates with substates of the states in $\mathcal{A}^e \times \bar{B}$, and the update impacts only the states occurring within the suffix of that particular spurious counterexample.
## 4.3 Subsumption

The main optimization of antichain-based algorithms [1] for checking language inclusion of automata over finite alphabets is that product states that are subsets of already visited states are never stored in the antichain. On the other hand, language emptiness semi-algorithms, based on *predicate abstraction* [21] use a similar notion to cover newly generated abstract successor states by those that were visited sooner and that represent larger sets of configurations. In this case, state coverage does not only increase efficiency but also ensures termination of the semi-algorithm in many practical cases.

In this section, we generalize the subset relation used in classical antichain algorithms with the notion of coverage from predicate abstraction, and we define a more general notion of *subsumption* for data automata. Given a state $(\mathbf{q}, P)$ of the product automaton $\mathcal{A}^e \times \bar{B}$ and a valuation $v \in \mathcal{D}^{\mathcal{A}}$, the *residual language* $\mathcal{L}_{(\mathbf{q},P,v)}(\mathcal{A}^e \times \bar{B})$ is the set of traces $w$ accepted by $\mathcal{A}^e \times \bar{B}$ from the state $(\mathbf{q}, P)$ such that $v$ is the first valuation which occurs on $w$. This notion is then lifted to product states as follows: $\mathcal{L}_s(\mathcal{A}^e \times \bar{B}) = \bigcup_{(\mathbf{q},P,v) \in [[s]]} \mathcal{L}_{(\mathbf{q},P,v)}(\mathcal{A}^e \times \bar{B})$ where $[[s]]$ is the set of configurations of the product automaton $\mathcal{A}^e \times \bar{B}$ represented by the given product state $s$.

**Definition 2.** Given a DAN $\mathcal{A}$ and a DA $\bar{B}$, a partial order $\sqsubseteq$ is a subsumption provided that, for any two product states $s$ and $t$, we have $s \sqsubseteq t$ only if $\mathcal{L}_s(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$.

A procedure for checking the emptiness of $\mathcal{A}^e \times \bar{B}$ needs not continue the search from a product state $s$ if it has already visited a product state $t$ that subsumes $s$. The intuition is that any counterexample discovered from $s$ can also be discovered from $t$. The trace inclusion semi-algorithm described below in Section 4.4 works, in principle, with any given subsumption relation. In practice, our implementation uses the subsumption relation defined by the lemma below:

**Lemma 4.** The relation defined s.t. $(\mathbf{q}, P, \Phi) \subseteq_{img} (\mathbf{r}, S, \Psi) \Leftrightarrow \mathbf{q} = \mathbf{r}, P \supseteq S$, and $\Phi \to \Psi$ is a subsumption.

*Proof.* For any valuation $v \in \mathcal{D}^{\mathcal{A}}$, we have $\mathcal{L}_{(\mathbf{q},P,v)}(\mathcal{A}^e \times \bar{B}) = \mathcal{L}_{(\mathbf{q},v)}(\mathcal{A}^e) \cap \mathcal{L}_{(P,v)}(\bar{B})$. Since $P \supseteq S$, we have $\mathcal{L}_{(P,v)}(\bar{B}) \supseteq \mathcal{L}_{(S,v)}(\bar{B})$, thus $\mathcal{L}_{(P,v)}(\bar{B}) \subseteq \mathcal{L}_{(S,v)}(\bar{B})$. We obtain that $\mathcal{L}_{(\mathbf{q},P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{(\mathbf{r},v)}(\mathcal{A}^e) \cap \mathcal{L}_{(S,v)}(\bar{B}) = \mathcal{L}_{(\mathbf{r},S,v)}(\mathcal{A}^e \times \bar{B})$. Since moreover $\Phi \to \Psi$, we have that $\mathcal{L}_{(\mathbf{q},P,\Phi)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{(\mathbf{r},S,\Phi)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{(\mathbf{r},S,\Psi)}(\mathcal{A}^e \times \bar{B})$. $\square$

**Example 6.** In the antichain from Fig. 2 (d), $\langle q_1^1, q_1^2 \rangle$, $\{p_1\}$, $v=1$) $\subseteq_{img} \langle q_1^1, q_1^2 \rangle$, $\{p_1\}$, $v=1$) because $\langle q_1^1, q_1^2 \rangle = \langle q_1^1, q_1^2 \rangle$, $\{p_1\} \supseteq \{p_1\}$, and $v=1 \to v=1$. $\blacksquare$

As a remark, the language inclusion algorithm for non-deterministic automata on finite alphabets [1] uses also a more sophisticated subsumption relation based on a pre-computed simulation [22] between the states of the automata. We have defined a similar notion of simulation for data automata and an algorithm for computing such simulations [20]. The integration of data simulations within the framework of antichain-based abstraction refinement and its practical assessment are considered as future work.
<caption>**Algorithm 1 Trace Inclusion Semi-algorithm**</caption>

**input:**
1. a DAN $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ such that $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, \mathbf{t}_i, F_i, \Delta_i \rangle$ for all $i \in [1, N]$,
2. a DA $\mathcal{B} = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, \mathbf{t}_B, F_B, \Delta_B \rangle$ such that $\mathbf{x}_B \subseteq \bigcup_{i=1}^N \mathbf{x}_i$.

**output:** true if $\mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \subseteq \mathcal{L}(\mathcal{B})$, otherwise a trace $\tau \in \mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \setminus \mathcal{L}(\mathcal{B})$.

1: $\Pi \leftarrow \emptyset$. Visited $\leftarrow \emptyset$. Next $\leftarrow \langle \text{root}_{\langle \mathcal{A}, \mathcal{B} \rangle}, \epsilon \rangle$. Subsume $\leftarrow \emptyset$
2: **while** Next $\neq \emptyset$ **do**
3:     **chose** curr $\in$ Next and move curr from Next to Visited
4:     **match** curr with $\langle s, p \rangle$
5:     **if** s is an accepting product state **then**
6:         let $\rho$ be the path from the root to curr and k be the pivot of $\rho$
7:         **if** k $\ge$ 0 **then**
8:             $\Pi \leftarrow$ REFINEPREDICATEMAPBYINTERPOLATION($\Pi, \rho, k$)
9:             **rem** $\leftarrow$ SUBTREE($\rho_k$)
10:            **for** (n, m) $\in$ Subsume such that m $\in$ rem **do**
11:             **move** n from Visited to Next
12:             **remove** rem from (Visited, Next, Subsume)
13:             **add** $\rho_k$ to Next
14:         **else**
15:             **return** EXTRACTCOUNTEREXAMPLE($\rho$)
16:         **else**
17:             $i \leftarrow 0$
18:         **for** t $\in$ Post$_\Pi$(s) **do**
19:             **if** there exists m = $\langle t', p' \rangle$ $\in$ Visited such that t $\sqsubseteq$ t' **then**
20:                 **add** (curr, m) to Subsume
21:             **else**
22:                 **rem** $\leftarrow$ $\{n \in Next | n = \langle t', p' \rangle$ and t' $\sqsubseteq$ t\}
23:                 **succ** $\leftarrow$ $\langle t, p, t \rangle$
24:                 $i \leftarrow i + 1$
25:             **for** n $\in$ Visited such that n has a successor m $\in$ rem **do**
26:                 **add** (n, succ) to Subsume
27:             **for** (n, m) $\in$ Subsume such that m $\in$ rem **do**
28:                 **add** (n, succ) to Subsume
29:             **remove** rem from (Visited, Next, Subsume)
30:             **add** succ to Next

## 4.4 The Trace Inclusion Semi-algorithm

With the previous definitions, Algorithm 1 describes the procedure for checking trace inclusion. It uses a classical worklist iteration loop (lines 2-30) that builds an antichain tree by simultaneously unfolding the expansion $\mathcal{A}^e$ of the network $\mathcal{A}$ and the complement $\bar{\mathcal{B}}$ of the tree the observer $\mathcal{B}$, while searching for a counterexample trace $w \in \mathcal{L}(\mathcal{A}^e \times \bar{\mathcal{B}})$. Both $\mathcal{A}^e$ and $\bar{\mathcal{B}}$ are built on-the-fly, during the abstract state space exploration.

The processed antichain nodes are kept in the set Visited, and their abstract successors, not yet processed, are kept in the set Next. Initially, Visited = $\emptyset$ and Next = $\{\text{root}_{\mathcal{A},\mathcal{B}}\}$. The algorithm uses a predicate map $\Pi$, which is initially empty (line 1).

We keep a set of subsumption edges Subsume $\subseteq$ Visited $\times$ (Visited $\cup$ Next) with the following meaning: $\langle\langle s, p \rangle\rangle, \langle t, q \rangle\rangle \in$ Subsume for two antichain nodes, where s,t are product states and p,q $\in$ $\mathbb{N}^*$ are tree positions, if and only if there exists an abstract successor $s' \in$ Post$_\Pi$(s) such that $s' \sqsubseteq t$ (Definition 2). Observe that we do not explicitly store a subsumed successor of a product state s from the antichain; instead, we add a subsumption edge between the node labeled with s and the node that subsumes that particular successor. The algorithm terminates when each abstract successors of a node from Next is subsumed by some node from Visited.
An iteration of Algorithm 1 starts by choosing a current antichain node curr = ⟨s, p⟩ from Next and moving it to Visited (line 3). If the product state s is accepting (line 5) we check the counterexample path ρ, from the root of the antichain to curr, for spuriousness, by computing its pivot k. If k ≥ 0, then ρ is a spurious counterexample (line 7), and the path formula of the suffix of ρ, which starts with position k, is infeasible. In this case, we compute an interpolant for the suffix and refine the current predicate map Π by adding the predicates from the interpolant to the corresponding substates of the product states from the suffix (line 8).

The computation of the interpolant and the update of the predicate map are done
by the **REFINE PREDICATE MAP BY INTERPOLATION** function using the approach de-
scribed in Section 4.2. Subsequently, we remove (line 12) from the current antichain the
subtree rooted at the pivot node ρ<sub>k</sub>, i.e. the k-th node on the path ρ (line 9), and add ρ<sub>k</sub>
to Next in order to trigger a recomputation of this subtree with the new predicate map.
Moreover, all nodes with a successor previously subsumed by a node in the removed
subtree are moved from Visited back to Next in order to reprocess them (line 11).

On the other hand, if the counterexample ρ is found to be real (k = -1), any valuation v ∈ ⋃ |ρ| i =0 𝒳<sup>t<sub>i</sub></sup> that satisfies the path formula Θ(ρ) yields a counterexample trace w ∈ L(Α) ↓<sub>xB</sub> \ L(B), obtained by ignoring all variables from x<sub>A</sub> \ x<sub>B</sub> (line 15).

If the current node is not accepting, we generate its abstract successors (line 18). In
order to keep in the antichain only nodes that are incomparable w.r.t. the subsumption
relation ⊑<sub>⊑</sub>, we add a successor *t* of *s* to *Next* (lines 23 and 30) only if it is not subsumed
by another product state from a node *m* ∈ *Visited*. Otherwise, we add a subsumption
edge (*curr*, *m*) to the set *Subsume* (line 20). Furthermore, if *t* is not subsumed by
another state in *Visited*, we remove from *Next* all nodes ⟨*t*′, *p*′⟩ such that *t* strictly
subsumes *t*′ (lines 22 and 29) and add subsumption edges to the node storing *t* from all
nodes with a removed successor (line 26) or a removed subsumption edge (line 28).

The following theorem states the soundness of our trace inclusion semi-algorithm.
The theorem is proved in the appendix together with the other results presented above.

**Theorem 1.** Let $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ be a DAN such that $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, v_i, F_i, \Delta_i \rangle$ for all $i \in [1, N]$, and let $B = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, v_B, F_B, \Delta_B \rangle$ be a DA such that $\mathbf{x}_B \subseteq \bigcup_{i=1}^N \mathbf{x}_i$. If Algorithm 1 terminates and returns true on input $\mathcal{A}$ and $B$, then $\mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \mathcal{L}(B)$.

The dual question “if there exists a counterexample trace $w \in \mathcal{L}(\mathcal{A}) \downarrow_{\mathbf{x}_B} \mathcal{L}(B)$, will Algorithm 1 discover it?” can also be answered positively, using an implementation that enumerates the abstract paths in a systematic way, e.g. by using a breadth-first path exploration. This can be done using a queue to implement the Next set in Algorithm 1.

**4.5 Proof of Theorem 1**

Given a network $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ where $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, v_i, F_i, \Delta_i \rangle$ for all $i \in [1, N]$ and an observer $B = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, v_B, F_B, \Delta_B \rangle$, we recall that a configuration of the product automaton $\mathcal{A}^e \times \bar{B}$ is a tuple $\langle \langle q_1, \dots, q_N \rangle, P, v \rangle \in Q_1 \times \dots \times Q_N \times 2^{Q_B} \times \mathcal{D}^{\mathbf{x}_{\mathcal{A}}}$, and a node of the antichain $\mathcal{T}$ is a pair $\langle s, p \rangle$ where $s$ is a product state for $\mathcal{A}$ and $B$ and $p \in \mathbb{N}^*$ is a tree position. Moreover, $\text{root}_{\langle \mathcal{A}, B \rangle} = (\langle t_1, \dots, t_N \rangle, \{t_B\}, \top)$ is the product state that labels the root of $\mathcal{T}$. In the following, let $\Gamma = (\Pi, \text{Visited}, \text{Next}, \text{Subsume})$
be an *antichain state* where $\Pi$ is the predicate map, and *Visited*, *Next*, and *Subsume* are the sets of antichain nodes handled by Algorithm 1.

We say that $\Gamma$ is a closed antichain state if and only if, for all nodes $\langle s, p \rangle \in \text{Visited}$ and every successor $(\mathbf{q}, P, v) \in \text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!]$) of a configuration of the product automaton $\mathcal{A}^e \times \bar{B}$ represented by the product state $s$, there exists a node $\langle t, r \rangle \in \text{Visited} \cup \text{Next}$ such that $L_{(\mathbf{q},P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq L_t(\mathcal{A}^e \times \bar{B})$ and one of the following holds:

- $r = p.i$ for some $i \in \mathbb{N}$, i.e. $\langle t, r \rangle$ is a child of $\langle s, p \rangle$ in the antichain $\mathcal{T} = \text{Visited} \cup \text{Next}$, or

- $(\langle s, p \rangle, \langle t, r \rangle) \in \text{Subsume}$.

In other words, the current antichain $\mathcal{T}$, defined as the union of the sets *Visited* and *Next*, is in a closed state, if the residual language of every successor of a configuration of the product automaton $\mathcal{A}^e \times \bar{B}$ that is covered by a visited product state must be included in the residual language of a product state stored in the antichain, either as a direct successor in the tree or via a subsumption edge.

For a product state $s$, we define $\text{Dist}(s) = \min \{|w| \mid w \in L_s(\mathcal{A}^e \times \bar{B})\}$, and $\text{Dist}(s) = \infty$ if and only if $L_s(\mathcal{A}^e \times \bar{B}) = \emptyset$. For a finite non-empty set of antichain nodes $S$, we define $\text{Dist}(S) = \min \{\text{Dist}(s) \mid \langle s, p \rangle \in S\}$ with $\text{Dist}(\emptyset) = \infty$.

**Lemma 5.** Given a network $\mathcal{A}$ and an observer $\mathcal{B}$, for any product state $s$ of $\mathcal{A}$ and $\mathcal{B}$, we have $\text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!] = \bigcup_{t \in \text{Post}(s)} [\![t]\!]\!]$.

*Proof.* Let $s = (\mathbf{q}, P, \Phi)$. “$\subseteq$” Let $(\mathbf{r}, S, \mu) \in \text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!]$) be a configuration of $\mathcal{A}^e \times \bar{B}$ for which there exists $(\mathbf{q}, P, v) \in [\![s]\!]\!]$ such that $(\mathbf{q}, P, v) \xrightarrow{\sigma, \theta} (\mathbf{r}, S, \mu)$. Then there exists a unique rule $(\mathbf{q}, P) \xrightarrow{\sigma, \theta} (\mathbf{r}, S) \in \Delta^p$ such that $(v, \mu) \models_{\text{Th}(\mathcal{D})} \theta$. Moreover, if $(\mathbf{q}, P, v) \in [\![s]\!]\!]$, we have $v \models_{\text{Th}(\mathcal{D})} \Phi$. Let $t = (\mathbf{r}, S, \Psi) \in \text{Post}(s)$ where $\Psi(\mathbf{x}_{\mathcal{A}}) \equiv \exists \mathbf{x}'_{\mathcal{A}} \cdot \Phi(\mathbf{x}'_{\mathcal{A}}) \wedge \theta(\mathbf{x}'_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}})$. We have $\mu \models_{\text{Th}(\mathcal{D})} \Psi$, hence $(\mathbf{r}, S, \mu) \in [\![t]\!]\!]$. “$\supset$” Let $(\mathbf{r}, S, \mu) \in [\![t]\!]\!]$ for some $t \in \text{Post}(s)$. Then we have $t = (\mathbf{r}, S, \Psi)$ where $\Psi(\mathbf{x}_{\mathcal{A}}) \equiv \exists \mathbf{x}'_{\mathcal{A}} \cdot \Phi(\mathbf{x}'_{\mathcal{A}}) \wedge \theta(\mathbf{x}'_{\mathcal{A}}, \mathbf{x}_{\mathcal{A}})$. Since $\mu \models_{\text{Th}(\mathcal{D})} \Psi$, there exists $v \models_{\text{Th}(\mathcal{D})} \Phi$ such that $(\mathbf{q}, P, v) \xrightarrow{\sigma, \theta} (\mathbf{r}, S, \mu)$. Hence $(\mathbf{q}, P, v) \in [\![s]\!]\!]$, thus $(\mathbf{r}, S, \mu) \in \text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!])$. $\square$

**Lemma 6.** Given a network $\mathcal{A}$, an observer $\mathcal{B}$, and a predicate map $\Pi$, for any product state $s$ of $\mathcal{A}^e \times \bar{B}$ and any product state $t \in \text{Post}(s)$ there exists $t' \in \text{Post}_{\Pi}(s)$ such that $[\![t]\!]\!] \subseteq [\![t']\!]\!]$.

*Proof.* Let $t = (\mathbf{r}, S, \Psi) \in \text{Post}(s)$. By the definition of $\text{Post}_{\Pi}$, we have $t' = (\mathbf{r}, S, \Psi^{\#}) \in \text{Post}_{\Pi}(s)$, where $\Psi \to \Psi^{\#}$, thus $[\![t]\!]\!] \subseteq [\![t']\!]\!]$. $\square$

**Lemma 7.** Given a network $\mathcal{A}$, an observer $\mathcal{B}$, and a predicate map $\Pi$, for each product state $s$ and each configuration $(\mathbf{q}, P, v) \in \text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!]\!]$) there exists a product state $t \in \text{Post}_{\Pi}(s)$ such that $(\mathbf{q}, P, v) \in [\![t]\!]\!]\!]$.

*Proof.* We use the fact that $\text{succ}_{\mathcal{A}^e \times \bar{B}}([\![s]\!]\!]\!] = \bigcup_{t \in \text{Post}(s)} [\![t]\!]\!]\!]$ (Lemma 5) and that for each $t \in \text{Post}(s)$ there exists $t' \in \text{Post}_{\Pi}(s)$ such that $[\![t]\!]\!] \subseteq [\![t']\!]\!]\!]$ (Lemma 6). $\square$

The proof of soundness of Algorithm 1 relies on the inductive invariants $(\mathit{Inv}_1)$ and $(\mathit{Inv}_2)$ from the following lemma.
**Lemma 8.** The following invariants hold each time line 2 is reached in Algorithm 1:

- (Inv1) $\Gamma = (\Pi, Visited, Next, Subsume)$ is closed,

- (Inv2) $Dist(\text{root}_{\mathcal{A},\mathcal{B}}) < \infty \Rightarrow Dist(\text{Visited}) > Dist(\text{Next})$.

*Proof.* Initially, when coming to line 2 for the first time, we have Visited = $\emptyset$, thus Dist(Visited) = $\infty$, and both invariants hold trivially. For the case when coming to line 2 after executing the loop body, we denote by:

$$ 
\begin{aligned}
\Gamma_{old} &= (\Pi_{old}, Visited_{old}, Next_{old}, Subsume_{old}) \\
\Gamma_{new} &= (\Pi_{new}, Visited_{new}, Next_{new}, Subsume_{new})
\end{aligned}
$$

the antichain states before and after the execution of the main loop. We assume that both invariants hold for $\Gamma_{old}$.

(Inv1) Let $\langle s, p \rangle \in Visited_{new}$ and $(q, P, v) \in succ_{\mathcal{A}^e \times \bar{B}}([|s|])$. We distinguish two cases according to the control path taken inside the main loop:

(1) If the test on line 5 is positive, the predicate map is augmented, i.e. $\Pi_{new} \supseteq \Pi_{old}$ (line 8). Let $\Gamma' = (\Pi_{new}, Visited_{old}, Next_{old}, Subsume_{old})$ be the next antichain state. Clearly $\Gamma'$ is closed provided that $\Gamma_{old}$ is. Next, let $n_{pivot} \in Visited_{old}$ be the pivot of the path to the current node (line 6) and define the following sets of nodes:

$$ 
\begin{aligned}
T &= \text{SUBTREE}(n_{pivot}) \\
S &= \{n \in Visited_{old} \mid \exists m \in T. (n, m) \in Subsume_{old}\}
\end{aligned}
$$

Then we obtain (lines 10–13):

$$ 
\begin{aligned}
\text{Visited}_{new} &= \text{Visited}_{old} \setminus (S \cup T) \\
\text{Next}_{new} &= ((\text{Next}_{old} \cup S) \setminus T) \cup \{n_{pivot}\} \\
\text{Visited}_{new} \cup \text{Next}_{new} &= ((\text{Visited}_{old} \cup \text{Next}_{old}) \setminus T) \cup \{n_{pivot}\}
\end{aligned}
$$

Since $\Gamma'$ is closed, there exists a node $\langle t, r \rangle \in Visited_{old} \cup Next_{old}$ such that $\mathcal{L}_{(q,P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$ and either $r = p.i$ for some $i \in \mathbb{N}$ or $(\langle s, p \rangle, \langle t, r \rangle) \in Subsume_{old}$. We distinguish two cases:

(a) $\langle t, r \rangle \notin T$. Then $\langle t, r \rangle \in Visited_{new} \cup Next_{new}$ and, because $Subsume_{new} = Subsume_{old} \cap (Visited_{new} \times (Visited_{new} \cup Next_{new}))$, we obtain that $\Gamma_{new}$ is closed as well.

(b) $\langle t, r \rangle \in T$. Then we distinguish two further cases:

(i) If $r = p.i$ for some $i \in \mathbb{N}$, since we have assumed that $\langle s, p \rangle \in Visited_{new}$, we have $\langle s, p \rangle \notin T$. The only possibility is then $\langle t, r \rangle = n_{pivot}$ and $\langle s, p \rangle$ is the parent of $n_{pivot}$. In this case, we have $\langle t, r \rangle \in Next_{new}$.

(ii) If $(\langle s, p \rangle, \langle t, r \rangle) \in Subsume_{old}$, then $\langle s, p \rangle \in S$, which contradicts the assumption $\langle s, p \rangle \in Visited_{new}$.

(2) Otherwise, the test on line 5 is negative, in which case we have $\Pi_{new} = \Pi_{old}$ and $Visited_{new} = Visited_{old} \cup \{curr\}$. For each $(q, P, v) \in succ_{\mathcal{A}^e \times \bar{B}}([|s|])$ there exists $t \in Post_{\Pi}(s)$ such that $\mathcal{L}_{(q,P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$ (by Lemma 7). We distinguish two cases:

(a) $\langle s, p \rangle = curr$. In this case, either(i) there is $\langle t', p' \rangle \in Visited_{old}$ such that $t' \sqsubseteq t$, and then we also have $\mathcal{L}_{(q,P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{t'}(\mathcal{A}^e \times \bar{B})$ (Definition 2) and
($\langle s, p \rangle, \langle t', p' \rangle$) $\in$ Subsume$_{new}$ (added on line 20), or (ii) $(t, p.i) \in$ Next$_{new}$ for some $i \in \mathbb{N}$ (added on lines 23 and 30).

(b) Otherwise $\langle s, p \rangle \in$ Visited$_{old}$. As $\Gamma'$ is closed, there is $\langle u, r \rangle \in$ Visited$_{old} \cup$ Next$_{old}$ such that $\mathcal{L}_{(q,P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$ and either $r = p.i$ for some $i \in \mathbb{N}$ or $(\langle s, p \rangle, \langle u, r \rangle) \in$ Subsume$_{old}$. We distinguish two sub-cases:

(i) $\langle u, r \rangle \in$ rem (line 22). Then $\mathcal{L}_t(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$ (Definition 2), hence $\mathcal{L}_{(q,P,v)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$. If $r = p.i$, then $(\langle s, p \rangle, \langle t, r' \rangle) \in$ Subsume$_{new}$ for some $r' \in \mathbb{N}^*$ (added on line 26). Else, if $(\langle s, p \rangle, \langle u, r \rangle) \in$ Subsume$_{old}$, we have $(\langle s, p \rangle, \langle t, r' \rangle) \in$ Subsume$_{new}$ for some $r' \in \mathbb{N}^*$ (added on line 28). In both cases, we obtain that $\Gamma_{new}$ is closed.

(ii) $\langle u, r \rangle \notin$ rem. Then $\langle u, r \rangle \in$ Visited$_{new} \cup$ Next$_{new}$. Since Subsume$_{new} = $ Subsume$_{old} \cap$ (Visited$_{new} \times$ (Visited$_{new} \cup$ Next$_{new}$)), we obtain that $\Gamma_{new}$ is closed.

(Inv2) We distinguish two cases:

1. If $Dist(Visited_{new}) = \infty$, it is sufficient to show that $Dist(Next_{new}) < \infty$. Suppose, by contradiction, that $Dist(Next_{new}) = \infty$, hence $Dist(Visited_{new} \cup Next_{new}) = \infty$, and since $root_{\langle \mathcal{A}, B \rangle} \in$ Visited$_{new} \cup Next_{new}$, we obtain $Dist(root_{\langle \mathcal{A}, B \rangle}) = \infty$, contradiction.

2. Otherwise, $Dist(Visited_{new}) < \infty$ and there exists a node $\langle s, p \rangle \in$ Visited$_{new}$ such that $Dist(Visited_{new}) = Dist(s) < \infty$. Let $w = (v_0, \sigma_0), (v_1, \sigma_1), \dots, (v_n, \diamond) \in \mathcal{L}_s(\mathcal{A}^e \times \bar{B})$ be a trace such that $Dist(Visited_{new}) = n$. Then there exists a run $(q_0, P_0, v_0) \xrightarrow{\sigma_0} (q_1, P_1, v_1) \xrightarrow{\sigma_1} \dots \xrightarrow{\sigma_{n-1}} (q_n, P_n, v_n)$ of $\mathcal{A}^e \times \bar{B}$ over $w$ such that $(q_0, P_0, v_0) \in$ $[[s]]$ and $(q_n, P_n)$ a final state of $\mathcal{A}^e \times \bar{B}$. Since $\Gamma_{new}$ is closed due to $(Inv_1)$ and $(q_1, P_1, v_1) \in$ $succ_{\mathcal{A}^e \times \bar{B}}$($[[s]]$), there exists a node $\langle s_1, p_1 \rangle \in$ Visited$_{new} \cup$ Next$_{new}$ such that $\mathcal{L}_{(q_1, P_1, v_1)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{s_1}(\mathcal{A}^e \times \bar{B})$. If $\langle s_1, p_1 \rangle \in$ Next$_{new}$, we obtain that $Dist(Next_{new}) \le n-1$, and we are done. Otherwise, $\langle s_1, p_1 \rangle \in$ Visited$_{new}$, and we can repeat the same argument inductively, to discover a sequence of nodes $\langle s_1, p_1 \rangle, \dots, \langle s_n, p_n \rangle \in$ Visited$_{new}$ such that $\mathcal{L}_{(q_i, P_i, v_i)}(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_{s_n}(\mathcal{A}^e \times \bar{B})$ for all $i \in [1, n]$. Since $(q_n, P_n)$ is a final state of $\mathcal{A}^e \times \bar{B}$, we have $(v_n, \diamond) \in \mathcal{L}_{(q_i, P_i, v_i)}(\mathcal{A}^e \times \bar{B})$, thus $(v_n, \diamond) \in \mathcal{L}_{s_n}(\mathcal{A}^e \times \bar{B})$, and $s_n$ is an accepting product state. But this contradicts with the fact that accepting product states are never stored in the antichain. □

Back to the proof of Theorem 1:

*Proof.* If Algorithm 1 terminates and reports true, this is because $Next = \emptyset$, hence $Dist(Next) = \infty$. By Lemma 8 (Inv2), we obtain that $Dist(root_{\langle \mathcal{A}, B \rangle}) = \infty$. Suppose, by contradiction, that $\mathcal{L}(\mathcal{A}) \downarrow_{x_B} \notin \mathcal{L}(B)$. By Lemma 2, there exists a trace

$$w = (v_0, \sigma_0)(v_1, \sigma_1)\dots(v_n, \diamond) \in \mathcal{L}(\mathcal{A}^e \times \bar{B}).$$

Thus we have a run of $\mathcal{A}^e \times \bar{B}$ over $w$:

$$(q_0, P_0, v_0) \xrightarrow{\sigma_0} (q_1, P_1, v_1) \xrightarrow{\sigma_1} \dots \xrightarrow{\sigma_{n-1}} (q_n, P_n, v_n)$$
where $\mathbf{q}_0 = \langle t_1, \dots, t_N \rangle$, $P_0 = \{t_B\}$, $\mathbf{q}_n$ is final in $\mathcal{A}^e$, $P_n \cap F_B = \emptyset$. But, since $(\mathbf{q}_0, P_0, v_0) \in [[\mathrm{root}_{\langle \mathcal{A}, B \rangle}]]$, we have $w \in \mathcal{L}_{\mathrm{root}_{\langle \mathcal{A}, B \rangle}}(\mathcal{A}^e \times \bar{B})$. Hence, $\mathrm{Dist}(\mathrm{root}_{\langle \mathcal{A}, B \rangle}) \le n$, which is in contradiction with the fact that $\mathrm{Dist}(\mathrm{root}_{\langle \mathcal{A}, B \rangle}) = \infty$. Consequently, it must be the case that $\mathcal{L}(\mathcal{A}) \downarrow_{x_B} \subseteq \mathcal{L}(B)$. $\square$

# 5 Computing Simulations of Data Automata

In the case of classical Rabin-Scott finite automata over finite alphabets, a simulation [22] is a relation on the states of an automaton, which is invariant with respect to the transition relation of the automaton. The simulation-based approach for checking language inclusion between two automata A and B first computes a simulation relation on the union of the states of A and B, then checks whether the pair of initial states is a member of the simulation relation. This method is not complete because there exist automata, such that $\mathcal{L}(A) \subseteq \mathcal{L}(B)$, but the initial state of A is not simulated by the initial state of B. A pre-computed simulation relation can be used however to speed up the convergence of the antichain-based method, by weakening the subsumption relation used by the antichain construction algorithm [1].

In this section, we define a notion of simulation between data automata and give an algorithm that computes useful under-approximations of the weakest simulation on a data automaton. The simulation relation can be used to enhance the convergence of Algorithm 1, similar to the way in which classical simulations are integrated with the antichain-based language inclusion algorithm for automata over finite alphabets [1].

**Definition 3.** A relation $R \subseteq Q \times \mathcal{D}^x \times Q$ is a data simulation for a DA $A = (\Sigma, \mathcal{D}, \mathbf{x}, Q, \mathbf{v}, F, \Delta)$ if and only if, for all $(q, \mathbf{v}, q') \in R$ the following hold:

1. $q \in F$ only if $q' \in F$, and

2. for all $\sigma \in \Sigma$ and all $(r, \mathbf{v}') \in Q \times \mathcal{D}^x$ such that $(q, \mathbf{v}) \xrightarrow{\sigma} A (r, \mathbf{v}')$ there exists $r' \in Q$ such that $(q', \mathbf{v}) \xrightarrow{\sigma} A (r', \mathbf{v}')$ and $(r, \mathbf{v}', r') \in R$.

Observe that, while a classical simulation is a binary relation on states, a data simulation is a ternary relation involving also a valuation of the variables. The following lemma shows that a data simulation preserves residual languages.

**Lemma 9.** Given a DA $A = (\Sigma, \mathcal{D}, \mathbf{x}, Q, \mathbf{v}, F, \Delta)$ and $R \subseteq Q \times \mathcal{D}^x \times Q$ a data simulation for A, for any tuple $(q, \mathbf{v}, q') \in R$ we have $\mathcal{L}_{(q, \mathbf{v})}(A) \subseteq \mathcal{L}_{(q', \mathbf{v})}(A)$.

*Proof.* Let $(q, \mathbf{v}) = (q_0, v_0) \xrightarrow{\sigma_0} \dots \xrightarrow{\sigma_{n-1}} (q_n, v_n)$ be a run of A such that $q_n \in F$. By induction on $n \ge 0$ we find a run $(q', \mathbf{v}) = (q'_0, v_0) \xrightarrow{\sigma_0} \dots \xrightarrow{\sigma_{n-1}} (q'_n, v_n)$ of A, such that $(q_i, v_i, q'_i) \in R$, for all $i \in [0, n]$. Moreover, since $q_n \in F$, we also obtain $q'_n$. $\square$

Let $A = (\Sigma, \mathcal{D}, \mathbf{x}, Q, \mathbf{v}, F, \Delta)$, where $Q = \{q_1, \dots, q_k\}$, for some $k > 0$, be a DA for the rest of this section. The data simulation algorithm (Algorithm 2) given in this section manipulates sets of valuations from $\mathcal{D}^x$ that are definable by first-order formulae in $\mathrm{Th}(\mathcal{D})$. A relation $R \subseteq Q \times \mathcal{D}^x \times Q$ is said to be *definable* if and only if there exists a matrix $\Phi = [\phi_{ij}]_{i,j=1}^k$ of formulae $\phi_{ij}(\mathbf{x}) \in \mathrm{Th}(\mathcal{D})$ such that $(q_i, \mathbf{v}, q_j) \in R \Leftrightarrow \mathbf{v} \models \phi_{ij}$. For $\ell \in [1, k]$, we denote by $\Phi_\ell$ the $\ell$-th row of the matrix $\Phi$.
Algorithm 2 is a refinement algorithm which handles two matrices of formulae that define the relations *Sim*, *PrevSim* ⊆ *Q* × *D*<sup>*x*</sup> × *Q*. In the following we shall use the same names to denote the relations and their matrix representations. Intuitively, *PrevSim* is the previous candidate for simulation, whereas *Sim* is an entry-wise stronger relation, that refines *PrevSim*. The refinement step is performed backwards, with respect to each transition rule $q_i \xrightarrow{\sigma, \phi} q_\ell$ of the automaton. Namely, for each pair of valuations such that $(v, v') \models_{\mathrm{th}(\mathcal{D})} \phi$ and $(q_\ell, v', q_m) \in \mathrm{PrevSim}$ for some state $q_m$, we add the tuple $(q_i, v, q_j) \in \mathrm{Sim}$ for all predecessors $q_j$ of $q_m$, such that $q_j \xrightarrow{\sigma, \psi} q_m$ and $(v, v') \models_{\mathrm{th}(\mathcal{D})} \psi$. This update guarantees that, for every transition $(q_i, v) \xrightarrow{\sigma} A(q_\ell, v')$, where $(q_i, v, q_j) \in \mathrm{Sim}$ there exists a state $q_m$ such that $(q_j, v) \xrightarrow{\sigma} A(q_m, v')$ and $(q_\ell, v', q_m) \in \mathrm{PrevSim}$. The algorithm stops when *Sim* and *PrevSim* define the same relation, which is, moreover, a simulation.

To define the update, we use the following function:

$$ \mathrm{PreSim}_{\sigma}(i, j, \ell, R) \equiv \forall \mathbf{x}' . \phi(\mathbf{x}, \mathbf{x}') \rightarrow \bigvee_{q_j \xrightarrow{\sigma, \psi} q_m} \psi(\mathbf{x}, \mathbf{x}') \wedge R_{\ell m}(\mathbf{x}'), \text{ where } q \xrightarrow{\sigma, \phi} q' \in \Delta . $$

We define also the sets $\mathrm{post}_{\sigma}(q) = \{q' | q \xrightarrow{\sigma, \phi} q' \in \Delta\}$ and $\mathrm{pre}_{\sigma}(q) = \{q' | q' \xrightarrow{\sigma, \phi} q \in \Delta\}$. With this notation, Algorithm 2 describes the procedure that computes a data simulation for a given data automaton.

Initially, the matrix *PrevSim* is true everywhere (line 3). The current simulation candidate *Sim* is initialized to false for all *i*, *j* ∈ [1, *k*) such that *q*ᵢ ∈ *F* and *q*ⱼ ∉ *F* (line 7). Observe that, in this case *q*ⱼ cannot simulate *q*ᵢ, by Definition 3 (1). Otherwise, we initialize *Sim*ᵢⱼ to the strongest pre-simulation with respect to *PrevSim* (line 9). In the iterative loop (lines 10–20) the algorithm chooses a state *q*<sub>ℓ</sub> for which the current simulation candidate *Sim*<sub>ℓ</sub> is not equivalent to the previous one *PrevSim*<sub>ℓ</sub> (line 10) and sharpens the set *Sim*ᵢⱼ, with respect to the transition rule *q*ᵢ <sup>*σ*,*φ*</sup> *q*<sub>ℓ</sub>, for all input symbols *σ* ∈ Σ and all peer states *q*ⱼ, *j* ∈ [1, *k*) (line 14). The following invariants are key to proving the correctness of Algorithm 2.

**Lemma 10.** *The following invariants hold each time Algorithm 2 reaches line 10:*

$$ -(\mathrm{SimInv}_1) \forall i, j \in [1, k] : \mathrm{Sim}_{ij} \rightarrow \mathrm{PrevSim}_{ij} . $$

$$ -(\mathrm{SimInv}_2) \forall \sigma \in \Sigma \forall i, j, \ell \in [1, k] \forall v, v' \in \mathcal{D}^x : v \models_{\mathrm{th}(\mathcal{D})} \mathrm{Sim}_{ij} \text{ and } (q_i, v) \xrightarrow{\sigma} (q_\ell, v') \Rightarrow \exists m \in [1, k] : (q_j, v) \xrightarrow{\sigma} (q_m, v') \text{ and } v' \models_{\mathrm{th}(\mathcal{D})} \mathrm{PrevSim}_{lm} . $$

*Proof.* Let *Sim'* and *PrevSim'* denote the global matrices after one iteration of the loop on lines 10–20.

(*SimInv*₁) When line 10 is reached for the first time, *PrevSim*<sub>*ij*</sub> = ⊤, for all *i*, *j* ∈ [1, *k*], thus *SimInv*₁ holds initially. Since *Sim* is modified only at lines 14 or 17, we have *Sim*<sub>*ij*</sub> → *Sim'*<sub>*ij*</sub>, for all *i*, *j* ∈ [1, *k*]. Moreover, either *PrevSim'*<sub>*ij*</sub> = *Sim*<sub>*ij*</sub>, or *PrevSim'*<sub>*ij*</sub> = *PrevSim*<sub>*ij*</sub>, for all *i*, *j* ∈ [1, *k*] (line 20). Thus *PrevSim'*<sub>*ij*</sub> → *Sim*<sub>*ij*</sub> → *Sim'*<sub>*ij*</sub>, for all *i*, *j* ∈ [1, *k*], by an application of the induction hypothesis.

(*SimInv*₂) We show that this invariant holds the first time the control reaches line 10. Let *σ* ∈ Σ, *i*, *j*, *ℓ* ∈ [1, *k*] and *v*, *v'* ∈ *D*<sup>*x*</sup> such that *v*models<sub>*th*(*D*)</sub> *Sim*<sub>*ij*</sub> and (*q*<sub>*i*</sub>, *v*) models<sub>*v*</sub> (*q*<sub>*ℓ*</sub>, *v*'). Since
**Algorithm 2 Data Simulation Algorithm**

input: a data automaton $A = (\Sigma, \mathcal{D}, \mathbf{x}, Q, \mathbf{1}, F, \Delta)$, where $Q = \{q_1, \dots, q_k\}$ and a constant $K > 0$
output: a data simulation $R \subseteq Q \times \mathcal{D}^x \times Q$ for $A$
global vars $[Sim_{ij}]_{i,j=1}^k$, $[PrevSim_{ij}]_{i,j=1}^k$, $[Cnt_{ij}]_{i,j=1}^k$
1: **for** $i = 1, \dots, k$ **do**
2: &nbsp;&nbsp;&nbsp;&nbsp;**for** $j = 1, \dots, k$ **do**
3: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrevSim_{ij} \leftarrow \top
4: &nbsp;&nbsp;&nbsp;&nbsp;Cnt_{ij} \leftarrow K
5: &nbsp;&nbsp;&nbsp;&nbsp;**for** $j = 1, \dots, k$ **do**
6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if $q_i \in F$ and $q_j \notin F$ **then**
7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sim_{ij} \leftarrow \bot
8: &nbsp;&nbsp;&nbsp;&nbsp;**else**
9: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sim_{ij} \leftarrow \bigwedge_{\sigma \in \Sigma} \bigwedge_{q_l \in \text{post}_{\sigma}(q_i)} \text{PreSim}_{\sigma}(i, j, \ell, \text{PrevSim})
10: &nbsp;&nbsp;&nbsp;&nbsp;**for** all $\ell \in [1, k]$ such that $Sim_{\ell} \Leftrightarrow \text{PrevSim}_{\ell}$ **do**
11: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**for** $\sigma \in \Sigma$ **do**
12: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**for** $q_i \in \text{pre}_{\sigma}(q_{\ell})$ **do**
13: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**for** $j = 1, \dots, k$ **do**
14: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sim_{ij} \leftarrow Sim_{ij} \wedge \text{PreSim}_{\sigma}(i, j, \ell, \text{Sim})
15: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**for** all $j = 1, \dots, k$ such that $Sim_{\ell j} \Leftrightarrow \text{PrevSim}_{\ell j}$ **do**
16: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if $Cnt_{\ell j} = 0$ **then**
17: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sim_{\ell j} \leftarrow \bot
18: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**else**
19: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cnt_{\ell j} \leftarrow Cnt_{\ell j} - 1
20: &nbsp;&nbsp;&nbsp;&nbsp;**for** $Sim_{\ell} \leftarrow Sim_{\ell}$
21: **return** Sim

$v \models_{\mathfrak{m}(\mathcal{D})} Sim_{ij}$ (thus $Sim_{ij} \neq \bot$) and $q_\ell \in \text{post}_\sigma(q_i)$ we have that $v \models_{\mathfrak{m}(\mathcal{D})} \text{PreSim}_\sigma(i, j, \ell, \text{PrevSim})$, where $q_i \xrightarrow{\sigma, \phi} q_\ell \in \Delta$. Since $(q_i, v) \xrightarrow{\sigma} (q_\ell, v')$ we obtain that $(v, v') \models_{\mathfrak{m}(\mathcal{D})} \phi(\mathbf{x}, \mathbf{x}')$, and consequently $(v, v') \models_{\mathfrak{m}(\mathcal{D})} \psi(\mathbf{x}, \mathbf{x}') \wedge \text{PrevSim}_{\ell m}(\mathbf{x}')$, for some $m \in [1, k]$, such that $q_j \xrightarrow{\sigma, \psi} q_m \in \Delta$. Hence $\text{SimInv}_2$ holds when the control first reaches line 10.

For the induction step, let us assume that $SimInv_2$ holds at line 10 and we prove that it holds also after executing line 20. Let $\sigma \in \Sigma$, $i, j, \ell \in [1, k]$ and $v, v' \in \mathcal{D}^x$ such that $v \models_{\mathfrak{m}(\mathcal{D})} Sim'_{ij}$ and $(q_i, v) \xrightarrow{\sigma} (q_\ell, v')$. We distinguish two cases:

1. if $Sim_\ell \Leftrightarrow \text{PrevSim}_\ell$ on line 10, since $q_i \in \text{pre}_\sigma(q_\ell)$, then $Sim'_i$ was updated at line 14. Since $v \models_{\mathfrak{m}(\mathcal{D})} Sim'_{ij}$, we obtain $v \models_{\mathfrak{m}(\mathcal{D})} \text{PreSim}_\sigma(q_i, q_j, q_\ell, \text{Sim})$. Moreover, $\text{PrevSim}'_\ell$ is updated to $Sim'_\ell$ at line 20, hence $v \models_{\mathfrak{m}(\mathcal{D})} \text{PreSim}_\sigma(q_i, q_j, q_\ell, \text{PrevSim}')$ as well. Since $(q_i, v) \xrightarrow{\sigma} (q_\ell, v')$, we obtain that $(v, v') \models_{\mathfrak{m}(\mathcal{D})} \psi(\mathbf{x}, \mathbf{x}') \wedge \text{PrevSim}'_{\ell m}(\mathbf{x}')$, for some $m \in [1, k]$ such that $q_j \xrightarrow{\sigma, \psi} q_m \in \Delta$, thus $(v, v') \models_{\mathfrak{m}(\mathcal{D})} \psi(\mathbf{x}, \mathbf{x}')$ and $v' \models_{\mathfrak{m}(\mathcal{D})} \text{PrevSim}'_{\ell m}$. Thus $\text{SimInv}_2$ holds for $Sim'$ and $\text{PrevSim}'$.

2. else $Sim_\ell \Leftrightarrow \text{PrevSim}_\ell$ on line 10, $\text{PrevSim}'_\ell \Leftrightarrow \text{PrevSim}_\ell$ because the update on line 20 is skipped, and for all $q_i \in \text{pre}_\sigma(q_\ell)$ and all $j \in [1, k]$, we have $Sim'_j \Leftrightarrow Sim_{ij}$. Then $\text{SimInv}_2$ holds for $Sim'$ and $\text{PrevSim}'$ because it holds for $Sim$ and $\text{PrevSim}$, by the induction hypothesis. □
The algorithm iterates the loop on lines (10–20) until *Sim* and *PrevSim* define the same relation. Since, in general the data constraints *Sim*<sub>*ij*</sub>, at each iteration step, might form an infinitely decreasing sequence, we use the matrix *Cnt* of integer counters, initially set to some input value *K* > 0 (line 4). Observe that each entry *Cnt*<sub>*ij*</sub> decreases every time *Sim*<sub>*ij*</sub> ⇌ *PrevSim*<sub>*ij*</sub> (line 19). When the counter *Cnt*<sub>*ij*</sub> reaches zero, we set *Sim*<sub>*ij*</sub> to false (line 17), which guarantees that *Sim*<sub>*ij*</sub> ⇌ *PrevSim*<sub>*ij*</sub> always in the future. Since the number of entries in the counter matrix is finite, the algorithm is guaranteed to terminate. The following theorem summarizes the main result of this section.

**Theorem 2.** Let $A = \langle \Sigma, \mathcal{D}, \mathbf{x}, Q, \mathbf{1}, F, \Delta \rangle$ be a DA. Then Algorithm 2 terminates on input $A$ and the output is a data simulation $R \subseteq Q \times \mathcal{D}^{\mathbf{x}} \times Q$ for $A$.

*Proof.* Let $Sim^n$ and $PrevSim^n$ denote the matrices $Sim$ and $PrevSim$ at the n-th iteration of the loop on lines 10–20, for $n \ge 0$. Algorithm 2 terminates whenever $Sim_{ij}^n \Leftrightarrow PrevSim_{ij}^n$, for all $i, j \in [1, k]$ (line 10). Suppose, by contradiction, that this never happens, thus there exist $i, j \in [1, k]$ such that $Sim_{ij}^n \Leftrightarrow PrevSim_{ij}^n$, for all $n \ge 0$. Then $Cnt_{ij}^K = 0$ (line 19) and $Sim_{ij}^{K+1} = PrevSim_{ij}^{K+2} = \perp$ (lines 17 and 20). Since $Sim_{ij}^n \to PrevSim_{ij}^n$, by Lemma 10 (*SimInv1*), we obtain that $Sim_{ij}^{K+2} = PrevSim_{ij}^{K+2}$, contradiction.

To prove that the output of Algorithm 2 is a data simulation for $A$, we use Lemma 10 (*SimInv2*) and the fact that, upon termination, we have $Sim_{ij} \Leftrightarrow PrevSim_{ij}$, for all $i, j \in [1, k]$. $\square$

**5.1 Simulation and Subsumption**

Finally, we explain how a data simulation relation computed by Algorithm 2 can be used to optimize the trace inclusion semi-algorithm. Let $\mathcal{A} = \langle A_1, \dots, A_N \rangle$ be DAN, where $A_i = \langle \mathcal{D}, \Sigma_i, \mathbf{x}_i, Q_i, \mathbf{1}_i, F_i, \Delta_i \rangle$, for all $i \in [1, N]$, and $B = \langle \mathcal{D}, \Sigma, \mathbf{x}_B, Q_B, \mathbf{1}_B, F_B, \Delta_B \rangle$ be an observer DA such that $\mathbf{x}_B \subseteq \bigcup_{i=1}^N \mathbf{x}_i$.

The main problem in using data simulation to enhance the convergence of our trace inclusion semi-algorithm is related to the fact that simulation relations are, in general, not compositional w.r.t. the interleaving semantics of the network. In other words, if we have *N* data simulations $R_i \subseteq Q_i \times \mathcal{D}^{\mathbf{x}_i} \times Q_i$, then their cross-product $R \subseteq \mathcal{Q}_A \times \mathcal{D}^{\mathcal{A}} \times \mathcal{Q}_A$ defined as:

$$ \forall q_1, r_1 \in Q_1 \dots \forall q_N, r_N \in Q_N \forall v \in \mathcal{D}^{\mathcal{A}} : (\langle q_1, \dots, q_N \rangle, v, \langle r_1, \dots, r_N \rangle) \in R \Leftrightarrow (q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i $$

is not necessarily a simulation on the network expansion $\mathcal{A}^e$. The reason for this can be seen for $N=2$. Let $\sigma_1, \sigma_2 \in \Sigma_{\mathcal{A}}$, such that $\sigma_1 \notin \Sigma_2$ and $\sigma_2 \notin \Sigma_1$. The execution of $\mathcal{A}^e$ on the sequence of input symbols $\sigma_1\sigma_2$ is $(\langle q_1, q_2 \rangle, v) \xrightarrow{\sigma_1} (\langle q'_1, q_2 \rangle, v') \xrightarrow{\sigma_2} (\langle q'_1, q'_2 \rangle, v'')$. Suppose that $(q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i, i = 1, 2$. Then there exists $r'_1 \in Q_1$ such that $(\langle r_1, r_2 \rangle, v) \xrightarrow{\sigma_1} (\langle r'_1, r_2 \rangle, v')$ and $(q'_1, v' \downarrow_{\mathbf{x}_1}, r'_1) \in R_1$. In order to use the simulation and build the continuation $(\langle r'_1, r_2 \rangle, v') \xrightarrow{\sigma_2} (\langle r'_1, r'_2 \rangle, v'')$, we would need that $(q_2, v' \downarrow_{\mathbf{x}_2}, r_2) \in R_2$, which is not necessarily ensured by the hypothesis $(q_2, v \downarrow_{\mathbf{x}_2}, r_2) \in R_2$.

We propose a partial solution to this problem, based on a restriction concerning the distribution of the network variables $\mathbf{x}_{\mathcal{A}} = \bigcup_{i=1}^N \mathbf{x}_i$ over the components $A_1, \dots, A_N$: for each $i \in [1, N]$, we have $\mathbf{x}_i = \mathbf{x}^g \cup \mathbf{x}_i^f$, where $\mathbf{x}^g$ is a set of global variables, and $\mathbf{x}_i^f$ are
the local variables of $A_i$. In other words, the only variables shared between more than one component are $\mathbf{x}^g$, which, moreover, are visible to all components.

Then the problem can be bypassed if none of the simulation relations $R_i \subseteq Q_i \times \mathcal{D}^{\mathbf{x}_i} \times Q_i$ may constrain the global variables:

**Assumption 3.** For each $i \in [1, N]$ and each $(q_i, v, r_i) \in R_i$ we also have $(q_i, v', r_i) \in R_i$ for each $v' \in \mathcal{D}^{\mathbf{x}_i}$ such that $v \downarrow_{\mathbf{x}_i^f} = v' \downarrow_{\mathbf{x}_i^f}$.

Under this assumption, we use pre-computed data simulations $R_i \subseteq Q_i \times \mathcal{D}^{\mathbf{x}_i^g} \times Q_i$ and $R_B \subseteq Q_B \times \mathcal{D}^{\mathbf{x}_B} \times Q_B$ to generalize the basic subsumption relation between product states (defined by Lemma 4) thus speeding up the convergence of Algorithm 1.

**Lemma 11.** Under assumption 3, the relation defined as:

$$ (\langle q_1, \dots, q_N \rangle, P, \Phi) \stackrel{\text{sim}}{=} (\langle r_1, \dots, r_N \rangle, S, \Psi) \iff $$

$$ \forall i \in [1, N] \quad \forall v \in \mathcal{D}^{\mathbf{x}_A} : v \models \Phi \Rightarrow v \models \Psi \quad \text{and} \quad \left\{ \begin{array}{l} (q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i \\ \forall p \in S \exists q \in P . \ (p, v \downarrow_{\mathbf{x}_B}, q) \in R_B \end{array} \right. $$

is a subsumption relation.

*Proof.* Let $s = (\langle q_1, \dots, q_N \rangle, P, \Phi)$ and $t = (\langle r_1, \dots, r_N \rangle, S, \Psi)$ be two product states, such that $s \subseteq_{\text{sim}} t$. According to Definition 2, we need to prove that $\mathcal{L}_s(\mathcal{A}^e \times \bar{B}) \subseteq \mathcal{L}_t(\mathcal{A}^e \times \bar{B})$. To this end, it is sufficient to prove that for each $v \in \mathcal{D}^{\mathbf{x}_A}$ such that $v \models \Phi$:

1. $\mathcal{L}(\langle q_1, \dots, q_N \rangle, v)(\mathcal{A}^e) \subseteq \mathcal{L}(\langle r_1, \dots, r_N \rangle, v)(\mathcal{A}^e)$, and

2. for all $p \in S$ there exists $q \in P$ such that $\mathcal{L}(p, v \downarrow_{\mathbf{x}_B})(B) \subseteq \mathcal{L}(q, v \downarrow_{\mathbf{x}_B})(B)$. Assuming that the above statements hold, we have:

$$ \begin{aligned} \mathcal{L}_s(\mathcal{A}^e \times \bar{B}) &= \bigcup_{v \models \Phi} \left( \mathcal{L}(\langle q_1, \dots, q_N \rangle, v)(\mathcal{A}^e) \cap \bigcap_{q \in P} \mathcal{L}(q, v \downarrow_{\mathbf{x}_B})(\bar{B}) \right) \\ &\subseteq \bigcup_{v \models \Phi} \left( \mathcal{L}(\langle r_1, \dots, r_N \rangle, v)(\mathcal{A}^e) \cap \bigcap_{p \in S} \mathcal{L}(p, v \downarrow_{\mathbf{x}_B})(\bar{B}) \right) \\ &\subseteq \bigcup_{v \models \Psi} \left( \mathcal{L}(\langle r_1, \dots, r_N \rangle, v)(\mathcal{A}^e) \cap \bigcap_{p \in S} \mathcal{L}(p, v \downarrow_{\mathbf{x}_B})(\bar{B}) \right) \\ &= \mathcal{L}_t(\mathcal{A}^e \times \bar{B}) \end{aligned} $$

and we are done. Moreover, the second point above is a direct consequence of the second point of the definition of $\subseteq_{\text{sim}}$ and Definition 2. We are left with proving the first point. Let $(\langle q_1, \dots, q_N \rangle, v) \xrightarrow{\sigma} (\langle q'_1, \dots, q'_N \rangle, v')$ be a transition of $\mathcal{A}^e$ and let $(\langle r_1, \dots, r_N \rangle, v)$ be a configuration of $\mathcal{A}^e$ such that $(q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i$, for each $i \in [1, N]$. Let $i \in [1, N]$ be an arbitrary component, and distinguish two cases:

- if $q_i \xrightarrow{\sigma, \phi_i} q'_i \in \Delta_i$ and $(v \downarrow_{\mathbf{x}_i}, v' \downarrow_{\mathbf{x}_i}) \models_{\text{th}(\mathcal{D})} \phi_i$, i.e. $(q_i, v \downarrow_{\mathbf{x}_i}) \xrightarrow{\sigma} (q'_i, v' \downarrow_{\mathbf{x}_i})$, then, since $(q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i$ there exists $r'_i \in Q_i$ s.t. $(r_i, v \downarrow_{\mathbf{x}_i}) \xrightarrow{\sigma} (r'_i, v \downarrow_{\mathbf{x}_i})$ and $(q'_i, v \downarrow_{\mathbf{x}_i}, r'_i) \in R_i$.

- otherwise, $q_i = q'_i$ and $v \downarrow_{\mathbf{x}_i^f} = v' \downarrow_{\mathbf{x}_i^f}$. By Assumption 3, we obtain $(q_i, v' \downarrow_{\mathbf{x}_i}, r_i) \in R_i$. By choosing $r'_i = r_i$, we obtain $(q'_i, v' \downarrow_{\mathbf{x}_i}, r'_i) \in R_i$.

Hence $(q'_i, v' \downarrow_{\mathbf{x}_i}, r'_i) \in R_i$, for all $i \in [1, N]$. Thus, the relation defined as:

$$ (\langle q_1, \dots, q_N \rangle, v, \langle r_1, \dots, r_N \rangle) \in R \iff \forall i \in [1, N]: (q_i, v \downarrow_{\mathbf{x}_i}, r_i) \in R_i $$

is a data simulation (Definition 3), thus, by Lemma 9, we obtain that $\mathcal{L}(\langle q_1, \dots, q_N \rangle, v)(\mathcal{A}^e) \subseteq \mathcal{L}(\langle r_1, \dots, r_N \rangle, v)(\mathcal{A}^e)$, for all $v \in \mathcal{D}^{\mathbf{x}_A}$, such that $v \models_{\text{th}(\mathcal{D})} \Phi$, and the first point above holds. $\square$
# 6 Experimental Results

We have implemented Algorithm 1 in a prototype tool<fnref n="3" /> using the MATHSAT SMT solver [7] for answering the satisfiability queries and computing the interpolants. The results of the experiments are given in Tables 1 and 2. The results were obtained on an Intel i7-4770 CPU @ 3.40GHz machine with 32GB RAM.

<table><caption>**Table 1.** Experiments with single-component networks.</caption><thead><tr><th>Example</th><th>A (|Q|/|Δ|)</th><th>B (|Q|/|Δ|)</th><th>Vars.</th><th>Res.</th><th>Time</th></tr></thead><tbody><tr><td>Arrays shift</td><td>3/3</td><td>3/4</td><td>5</td><td>ok</td><td>&lt; 0.1s</td></tr><tr><td>Array rotation 1</td><td>4/5</td><td>4/5</td><td>7</td><td>ok</td><td>0.1s</td></tr><tr><td>Array rotation 2</td><td>8/21</td><td>6/24</td><td>11</td><td>ok</td><td>34s</td></tr><tr><td>Array split</td><td>20/103</td><td>6/26</td><td>14</td><td>ok</td><td>4m32s</td></tr><tr><td>HW counter 1</td><td>2/3</td><td>1/2</td><td>2</td><td>ok</td><td>0.2s</td></tr><tr><td>HW counter 2</td><td>6/12</td><td>1/2</td><td>2</td><td>ok</td><td>0.4s</td></tr><tr><td>Synchr. LIFO</td><td>4/34</td><td>2/15</td><td>4</td><td>ok</td><td>2.5s</td></tr><tr><td>ABP-error</td><td>14/20</td><td>2/6</td><td>14</td><td>cex</td><td>2s</td></tr><tr><td>ABP-correct</td><td>14/20</td><td>2/6</td><td>14</td><td>ok</td><td>3s</td></tr></tbody></table>

Table 1 contains experiments where the network $\mathcal{A}$ consists of a single component. We applied the tool on several verification conditions generated from imperative programs with arrays [6] (Array shift, Array rotation 1+2, Array split) available online [24]. Then, we applied it on models of hardware circuits (HW Counter 1+2, Synchronous LIFO) [26]. Finally, we checked two versions (correct and faulty) of the timed Alternating Bit Protocol [29].

Table 2 provides a list of experiments where the network $\mathcal{A}$ has $N > 1$ components. First, we have the example of Fig. 1 (Running). Next, we have several examples of real-time verification problems [27]: a controller of a railroad crossing [19] (Train) with T trains, the Fischer Mutual Exclusion protocol with deadlines $\Delta$ and $\Gamma$ (Fischer), and a hardware communication circuit with K stages, composed of timed NOR gates (Stari). Third, we have modelled a Producer-Consumer example [12] with a fixed buffer size B. Fourth, we have experimented with several models of parallel programs that manipulate arrays (Array init, Array copy, Array join) with window size $\Delta$.

For the time being, our implementation is a proof-of-concept prototype that leaves plenty of room for optimization (e.g. caching intermediate computation results) likely to improve the performance on more complicated examples. Despite that, we found the results from Tables 1 and 2 rather encouraging.

# 7 Conclusions

We have presented an interpolation-based abstraction refinement method for trace inclusion between a network of data automata and an observer where the variables used

<footnote n="3">³ http://www.fit.vutbr.cz/research/groups/verifit/tools/includer/</footnote>
<table><caption>**Table 2.** Experiments with multiple-component networks (e.g., 2 × 2/2 + 2 × 3/3 in column A means that A is a network with 4 components, of which 2 DA with 2 states and 2 rules, and 2 DA with 3 states and 3 rules).</caption><thead><tr><th>Example</th><th>N</th><th>A (|Q|/|Δ|)</th><th>B (|Q|/|Δ|)</th><th>Vars.</th><th>Res.</th><th>Time</th></tr></thead><tbody><tr><td>Running</td><td>2</td><td>2×2/2</td><td>3/4</td><td>3</td><td>ok</td><td>0.2s</td></tr><tr><td>Running</td><td>10</td><td>10×2/2</td><td>11/20</td><td>3</td><td>ok</td><td>25s</td></tr><tr><td>Train (T = 5)</td><td>7</td><td>5×3/3 + 4/4 + 4/4</td><td>2/38</td><td>1</td><td>ok</td><td>4s</td></tr><tr><td>Train (T = 20)</td><td>22</td><td>20×3/3 + 4/4 + 4/4</td><td>2/128</td><td>1</td><td>ok</td><td>6m26s</td></tr><tr><td>Fischer (Δ = 1, Γ = 2)</td><td>2</td><td>2×5/6</td><td>1/10</td><td>4</td><td>ok</td><td>8s</td></tr><tr><td>Fischer (Δ = 1, Γ = 2)</td><td>3</td><td>3×5/6</td><td>1/15</td><td>4</td><td>ok</td><td>2m48s</td></tr><tr><td>Fischer (Δ = 2, Γ = 1)</td><td>2</td><td>2×5/6</td><td>1/10</td><td>4</td><td>cex</td><td>3s</td></tr><tr><td>Fischer (Δ = 2, Γ = 1)</td><td>3</td><td>3×5/6</td><td>1/15</td><td>4</td><td>cex</td><td>32s</td></tr><tr><td>Stari (K = 1)</td><td>5</td><td>4/5 + 2/4 + 5/7 + 5/7 + 5/7</td><td>3/6</td><td>3</td><td>ok</td><td>0.5s</td></tr><tr><td>Stari (K = 2)</td><td>8</td><td>4/5 + 2/4 + 2×5/7 + 2×5/7 + 2×5/7</td><td>3/6</td><td>3</td><td>ok</td><td>0.5s</td></tr><tr><td>Prod-Cons (B = 3)</td><td>2</td><td>4/4 + 4/4</td><td>2/7</td><td>2</td><td>ok</td><td>10s</td></tr><tr><td>Prod-Cons (B = 6)</td><td>2</td><td>4/4 + 4/4</td><td>2/7</td><td>2</td><td>ok</td><td>2m32s</td></tr><tr><td>Array init (Δ = 2)</td><td>5</td><td>5×2/2</td><td>2/6</td><td>2</td><td>ok</td><td>3s</td></tr><tr><td>Array init (Δ = 2)</td><td>15</td><td>15×2/2</td><td>2/16</td><td>2</td><td>ok</td><td>3m15s</td></tr><tr><td>Array copy (Δ = 20)</td><td>20</td><td>20×2/2</td><td>2/21</td><td>3</td><td>ok</td><td>0.3s</td></tr><tr><td>Array copy (Δ = 20)</td><td>150</td><td>150×2/2</td><td>2/151</td><td>3</td><td>ok</td><td>43s</td></tr><tr><td>Array join (Δ = 10)</td><td>4</td><td>2×2/2 + 2×3/3</td><td>2/3</td><td>2</td><td>ok</td><td>6s</td></tr><tr><td>Array join (Δ = 20)</td><td>6</td><td>3×2/2 + 3×3/3</td><td>2/4</td><td>2</td><td>ok</td><td>1m9s</td></tr></tbody></table>

by the observer are a subset of those used by the network. The procedure builds on a new determinization result for DAs and combines in a novel way predicate abstraction and interpolation with antichain-based inclusion checking. The procedure has been successfully applied to several examples, including verification problems for array programs, real-time systems, and hardware designs. Future work includes an extension of the method to data tree automata and its application to logics for heaps with data. Also, we foresee an extension of the method to handle infinite traces.

*Acknowledgement.* This work was supported by the Czech Science Foundation project 14-11384S, the BUT FIT project FIT-S-14-2486, and the French ANR-14-CE28-0018 project Vecolib.

## References

1. Abdulla, P., Chen, Y.F., Holik, L., Mayr, R., Vojnar, T.: When simulation meets antichains. In: Proc. of TACAS’10, LNCS, vol. 6015, pp. 158–174. Springer (2010)

2. Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126(2), 183–235 (1994)

3. Bardin, S., Finkel, A., Leroux, J., Petrucci, L.: Fast: Fast acceleration of symbolic transition systems. In: Proc. of CAV’03. LNCS, vol. 2725. Springer (2003)

4. Beyene, T.A., Popeea, C., Rybalchenko, A.: Solving existentially quantified horn clauses. In: Proc. of CAV’13. LNCS, vol. 8044. Springer (2013)

5. Bojańczyk, M., David, C., Muscholl, A., Schwentick, T., Segoufin, L.: Two-variable logic on data words. ACM Trans. Comput. Logic 12(4), 27:1–27:26 (2011)

6. Bozga, M., Habermehl, P., Iosif, R., Konecný, F., Vojnar, T.: Automatic verification of integer array programs. In: Proc. of CAV’09. LNCS, vol. 5643, pp. 157–172 (2009)

7. Cimatti, A., Griggio, A., Schaafsma, B., Sebastiani, R.: The MathSAT5 SMT Solver. In: Proc. of TACAS. LNCS, vol. 7795 (2013)
8. Cook, B., Khlaaf, H., Piterman, N.: On automation ofctl* verification for infinite-state sys-
tems. In: Proc. of CAV'15. LNCS, vol. 9206. Springer (2015)

9. Craig, W.: Three uses of the herbrand-gentzen theorem in relating model theory and proof theory. J. Symb. Log. 22(3), 269–285 (1957)

10. D'Antoni, L., Alur, R.: Symbolic visibly pushdown automata. In: Proc. of CAV'14. LNCS, vol. 8559. Springer (2014)

11. Decker, N., Habermehl, P., Leucker, M., Thoma, D.: Ordered navigation on multi-attributed data words. In: Proc. of CONCUR'14. LNCS, vol. 8704, pp. 497–511 (2014)

12. Dhar, A.: Algorithms For Model-Checking Flat Counter Systems. Ph.D. thesis, Univ. Paris 7 (2014)

13. Fribourg, L.: A closed-form evaluation for extended timed automata. Tech. rep., CNRS et Ecole Normale Supérieure de Cachan (1998)

14. Grebenshchikov, S., Lopes, N.P., Popeea, C., Rybalchenko, A.: Synthesizing software veri-fiers from proof rules. In: ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '12, Beijing, China - June 11 - 16, 2012. pp. 405–416 (2012)

15. Habermehl, P., Iosif, R., Vojnar, T.: A logic of singly indexed arrays. In: Proc. of LPAR'08. LNCS, vol. 5330, pp. 558–573 (2008)

16. Habermehl, P., Iosif, R., Vojnar, T.: What else is decidable about integer arrays? In: Proc. of FOSSACS'08. LNCS, vol. 4962, pp. 474–489 (2008)

17. Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Lazy abstraction. In: Proc. of POPL'02. ACM (2002)

18. Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Software Verification with Blast. In: Proc. of 10th SPIN Workshop. LNCS, vol. 2648 (2003)

19. Henzinger, T.A., Nicollin, X., Sifakis, J., Yovine, S.: Symbolic model checking for real-time systems. Information and Computation 111, 394–406 (1992)

20. Iosif, R., Rogalewicz, A., Vojnar, T.: Abstraction refinement for trace inclusion of data au-
tomata. CoRR abs/1410.5056 (2014), http://arxiv.org/abs/1410.5056

21. McMillan, K.L.: Lazy abstraction with interpolants. In: Proc. of CAV'06. LNCS, vol. 4144. Springer (2006)

22. Milner, R.: An algebraic definition of simulation between programs. In: Proc. of IJCAI'71. Morgan Kaufmann Publishers Inc. (1971)

23. Minsky, M.: Computation: Finite and Infinite Machines. Prentice-Hall (1967)

24. Numerical Transition Systems Repository. http://http://nts.imag.fr/index.php/Flata (2012)

25. Ouaknine, J., Worrell, J.: On the language inclusion problem for timed automata: Closing a decidability gap. In: Proc of LICS'04. IEEE Computer Society (2004)

26. Smrcka, A., Vojnar, T.: Verifying parametrised hardware designs via counter automata. In: HVC'07. pp. 51–68 (2007)

27. Tripakis, S.: The analysis of timed systems in practice. Ph.D. thesis, Univ. Joseph Fourier, Grenoble (December 1998)

28. Wulf, M.D., Doyen, L., Henzinger, T.A., Raskin, J.: Antichains: A new algorithm for check-
ing universality of finite automata. In: Proc. of CAV'06. LNCS, vol. 4144. Springer (2006)

29. Zbrzezny, A., Polrola, A.: Sat-based reachability checking for timed automata with discrete data. Fundamenta Informaticae 79, 1–15 (2007)