Regular Model Checking for Systems with Effectively Regular Reachability Relation
Abstract
Regular model checking is a well-established technique for the verification of regular transition systems (RTS): transition systems whose initial configurations and transition relation can be effectively encoded as regular languages. In 2008, To and Libkin studied RTSs in which the reachability relation (the reflexive and transitive closure of the transition relation) is also effectively regular, and showed that the recurrent reachability problem (whether a regular set of configurations is reached infinitely often) is polynomial in the size of RTS and the transducer for the reachability relation. We extend the work of To and Libkin by studying the decidability and complexity of verifying almost-sure reachability and recurrent reachability – that is, whether is reachable or recurrently reachable with probability 1. We then apply our results to the more common case in which only a regular overapproximation of the reachability relation is available. In particular, we extend recent complexity results on verifying safety using regular abstraction frameworks – a technique recently introduced by Czerner, the authors, and Welzel-Mohr – to liveness and almost-sure properties.
Keywords and phrases:
Regular model checking, abstraction, inductive invariantsCopyright and License:
2012 ACM Subject Classification:
Theory of computation Regular languages ; Theory of computation Problems, reductions and completeness ; Theory of computation Verification by model checkingAcknowledgements:
We thank Anthony Widjaja Lin and Pascal Bergsträßer for very insightful discussions, and the anonymous reviewers for helpful comments.Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Regular model checking is a well-established technique for the verification of infinite-state systems whose configurations can be represented as finite words over a suitable alphabet. It applies to regular transition systems (RTS): systems whose set of initial configurations and transition relation are both regular, and presented as a finite automaton and a finite-state transducer, respectively [14, 8, 9, 1, 2]. The main application of regular model checking is the verification of parameterized systems in which an arbitrarily long array or ring of finite-state processes interact [10]. Examples of these systems include mutual exclusion algorithms, cache coherence protocols, communication protocols, consensus algorithms, and others.
RTSs are very general; in particular, it is easy to encode Turing machines as regular transition systems, which makes all interesting analysis problems for RTSs undecidable. In [43, 44], To and Libkin observed that in some classes of RTSs, like pushdown systems and ground-term-rewriting systems, the reachability relation (i.e., the reflexive and transitive closure of the transition relation) is regular and one can effectively compute a transducer recognizing it. They showed that in this case, the reachability and recurrent reachability problems become decidable and solvable in polynomial time in the size of the transducer for the reachability relation. These problems ask, given a RTS and a regular set of configurations, whether some run of – that is, some run starting at some initial configuration of – visits at least once (reachability) or infinitely often (recurrent reachability). In the notation of CTL∗, they correspond to deciding the formulas EF and EGF , respectively. Many other problems can be reduced to reachability or recurrent reachability
In this paper we extend the work of To and Libkin in two different directions. Both of them are motivated by our interest in applying regular model checking to the verification of liveness properties of randomized distributed systems with an arbitrary number of processes, like many algorithms for distributed consensus or self-stabilization.
Verification of almost-sure properties.
Proving liveness properties for randomized distributed systems amounts to showing that, under a class of adversarial stochastic schedulers selecting the process making the next move, something happens almost surely (a.s.), or, in other words, that for every scheduler in the class and every initial configuration, the runs of the system starting at that configuration and satisfying a given property have probability one [38, 40]. This raises the question whether a.s. reachability and a.s. recurrent reachability are decidable when the reachability relation is effectively regular assuming, as in [44], that a transducer for the reachability relation is part of the input. We also study whether reachability and recurrent reachability holds for all possible schedulers, that is, whether is visited at least once or infinitely often by every run starting at any initial configuration. These properties – which we call sure reachability and sure recurrent reachability and are expressed by the formulas AF and AGF in CTL∗ – hold for a fair number of probabilistic systems, as observed in [40]. We also study the complexity of some related properties, like a.s. termination or deadlock-freedom, which are important in applications.
Most algorithms for distributed consensus or self-stabilization are designed to work for an arbitrary but fixed number of processes, without dynamic process creation or deletion. In these systems the successors of a configuration with processes also have processes, and so both the configuration and its successor are encoded by words of length . For this reason, on top of the complexity for general transducers we also investigate the complexity for the length-preserving case.
A summary of our results is shown in Tables 1 and 2 (recall that are the co-recursively enumerable languages and the corresponding level of the analytic hierarchy [42]). In all cases, the problem consists of deciding, given an RTS, a nondeterministic transducer recognizing the reachability relation, and an NFA recognizing the set of configurations, whether the corresponding property holds. Our main results are:
-
There is a big gap in the complexities of EF and AF (the first can be solved in polynomial time, while the second is undecidable) even in the length-preserving case.
-
A.s. recurrent reachability is easier to check than sure reachability in the length-preserving case. This is surprising, because, as mentioned above, sure reachability is often used as an easier-to-check approximation to a.s. recurrent reachability.
-
For sure properties, the general case is harder than the length-preserving case. Indeed, since they are - and -complete, respectively, there is no recursive reduction from the first to the second. This is contrary to the case of reachability and recurrent reachability, where the general case can be reduced to the length-preserving case.
Regular overapproximations of the reachability relation.
The reachability relation is regular for some classes of RTSs, but not for many others. In particular, this is not the case for most models of concurrent and distributed computing, like Vector Addition Systems (VAS, aka Petri nets) and many of their extensions [41, 13], lossy channel systems [7, 37], broadcast protocols [22, 27] or population protocols [11]. However, several techniques exist for computing a regular overapproximation of the reachability relation [6, 35, 19]. In this paper, we are interested in the regular abstraction frameworks of [19]. In this approach, transducers are used not only to model the transition relation of the system, but also, in the terminology of abstract interpretation, to model abstract domains [18]. After the user fixes an abstract domain by choosing a transducer, the system automatically computes another transducer recognizing the potential reachability relation, the best overapproximation in the abstract domain of the reachability relation – in a certain technical sense111The precise notion of best approximation is not the same as in standard abstract interpretation.. It is shown in [19] that, while the safety problem (whether, given an RTS and a regular set of unsafe configurations, some reachable configuration is unsafe) is undecidable, the abstract safety problem (whether, given additionally a transducer for an abstract domain, some potentially reachable configuration is unsafe) is -complete.
We study whether the decision algorithms for sure and almost-sure properties become semi-decision algorithms when one uses a regular abstraction, i.e., whether they become algorithms that always terminate and answer “yes” or “don’t know” (or “no” and “don’t know”). We first show that this is the case for recurrent reachability and prove that deciding whether some potential run of the RTS visits infinitely often, is also -complete. We then study almost-sure recurrent reachability. It is easy to see that in general one does not obtain a semi-decision algorithm. However, our last result shows that one does for systems in which the set of predecessors of the set of goal configurations is effectively computable, a condition satisfied by all well-structured transition systems [4, 31] under weak conditions satisfied all the models of [41, 13, 7, 37, 22, 27, 11]. In particular, we prove that the abstract version of a.s. recurrent reachability is -complete for population protocols, whereas the problem itself is equivalent to the reachability problem for Petri nets under elementary reductions [28], and therefore Ackermann-complete [20, 21, 39].
2 Preliminaries
Relations.
Let be a relation. The complement of is the relation . The inverse of is the relation . The projections of onto its first and second components are the sets and . The join of two relations and is the relation . The post-image of a set under a relation , denoted or , is the set ; the pre-image, denoted or , is defined analogously. Throughout this paper, we only consider relations where and for some alphabets , . We just call them relations. A relation is length-preserving if implies .
Automata.
Let be an alphabet. A nondeterministic finite automaton (NFA) over is a tuple where is a finite set of states, is the transition function, is the set of initial states, and is the set of final states. A run of on a word is a sequence of states where and . A run on is accepting if , and accepts if there exists an accepting run of on . The language recognised by , denoted , is the set of words accepted by . If and for every , then is a deterministic finite automaton (DFA).
Convolutions and transducers.
Let , be alphabets, let be a padding symbol, and let and . The convolution of two words and , denoted , is the word over the alphabet defined as follows. Intuitively, is the result of putting on top of , aligned left, and padding the shorter of and with . Formally, if , then , and otherwise .
A transducer over is an NFA over . The binary relation recognised by a transducer over , denoted , is the set of pairs such that accepts . A transducer is deterministic if it is a DFA. A relation is regular if it is recognised by some transducer. A transducer is length-preserving if it recognises a length-preserving relation.
Complexity of operations on automata and transducers.
Given NFAs , over with and states, DFAs , over with and states, and transducers over and over with and states, the following facts are well known (see e.g. chapters 3 and 5 of [25]):
-
there exist NFAs for , , and with at most , , and states, respectively;
-
there exist DFAs for , , and with at most , , and states, respectively;
-
there exist NFAs for and and a transducer for with at most states;
-
there exists a transducer for with at most states; and
-
there exist NFAs for and with at most and states, respectively.
Turing machines.
We fix the definition of Turing machine used in the paper.
A Turing machine (TM) is a tuple where is the set of states, is the input alphabet, is the tape alphabet, is the blank symbol, is the initial state, is the (only) final state, and is the transition function. A nondeterministic Turing machine is defined the same way as a Turing machine, with the difference that is now a function from to . A configuration of a (nondeterministic) TM is a triple where is the tape to the left of the head of , is the current state of , and is the tape to the right of the head of ; the first symbol of is the symbol currently being read. The successor(s) of a configuration are defined as usual. A configuration is accepting if . A run of a (nondeterministic) TM on an input is either a sequence of configurations of where and is a successor of , or a tuple where , is a successor of , and is accepting. In the latter case, the run is called accepting. accepts the input if there exists an accepting run of on .
Remark 2.1.
Note that Turing machines are (unless specified otherwise) deterministic, have no rejecting state, and the transition function is total, i.e. every non-accepting configuration has a successor. In particular, a Turing machine halts iff it accepts.
The arithmetical and analytical hierarchies.
We briefly recall the definition of the first levels of the arithmetical and analytical hierarchies (see e.g. [42], part IV). is the set of all semi-decidable problems. is the set of sets of the form where the range over functions from to and is an arithmetic formula with arbitrary quantification over natural numbers. and are the sets of problems whose complement is in and , respectively. -hard and -hard problems are sometimes called highly undecidable.
2.1 Regular transition systems
We recall standard notions about regular transition systems and fix some notations. Then we recall how to use regular transition systems to simulate Turing machines.
A transition system is a pair where is the set of all possible configurations of the system, and is a transition relation. The reachability relation Reach is the reflexive and transitive closure of . Observe that, by our definition of post-set, and are the sets of configurations reachable in one step and in arbitrarily many steps from , respectively.
Regular transition systems are transition systems where configurations are represented by words and the transition relation is regular. We also define regular transition systems to contain a set of initial configurations which all runs start from.
Definition 2.2.
A regular transition system (RTS) over an alphabet is a pair where is an alphabet, the set of configurations is , is a regular set of initial configurations and is a regular transition relation. is called length-preserving if is length-preserving. A configuration is called terminating if it has no successor, i.e. if . We denote the set of terminating configurations by . A run of is either a sequence where and or a tuple where , and . In the latter case, the run is called terminating.
Example 2.3.
We give two small examples of RTSs loosely inspired by Herman’s randomized protocol for self-stabilization. We model an array of cells, each of which either holds a token () or not (). The alphabet is and the initial configurations are , where and mark the two ends of the array. A transition moves a token to a neighbour cell, “swallowing” its token if the cell is not empty. The language of the transducer is
where is an abbreviation for . The RTS is length-preserving. Intuitively, it satisfies that the set of configurations with exactly one token is almost surely reachable and also almost surely recurrently reachable, for any probability distribution assigning non-zero probability to each transition.
Consider now another RTS in which the array can additionally grow or shrink on the right end. We can model this by adding to the language of the transducer the transitions
.
The new RTS is no longer length-preserving, and the property above no longer holds for every probability distribution.
Simulation of Turing machines by regular transition systems.
In our undecidability proofs we make use of the fact that RTSs can simulate Turing machines. More precisely, a configuration of a TM can be encoded as a word . The transition function of can then be simulated by as only the letters at positions next to the head can change. If the RTS is length-preserving, one can set where is the input to and terminate if the head of gets to the last position of the configuration of the RTS; in this case, accepts iff there exists a run of the RTS (starting in a configuration of a high enough length) which reaches a configuration containing .
3 Decision problems
It was proved in [43] that the problem whether an RTS with a regular reachability relation has a run visiting a set of configurations given by an NFA infinitely often is in for both length-preserving and general transition relations. Extending this result, we analyse the complexities of infinite reachability problems in an RTS with a regular reachability relation.
We start with a lemma showing that a basic problem about RTSs is -complete in the general case and -complete in the length-preserving case. The proof of the length-preserving case is very simple, while the general case requires to use a clever result by Harel, Pnueli, and Stavi [33].
Lemma 3.1.
Deciding whether an RTS has an infinite run is -complete. If is length-preserving, the problem is -complete.
Proof.
In the length-preserving case, only finitely many configurations are reachable from any configuration; hence, if there exists an infinite run, there exists a path from some to some which visits twice. This path is a checkable certificate, proving membership in . For hardness, we reduce from the problem whether a Turing machine accepts the empty input. First, we construct a TM which behaves like , but swaps acceptance and looping: simulates while writing down all visited configurations; if detects that visits a configuration for the second time, accepts; if detects that accepts, goes in an infinite loop. We then simulate by ; has an infinite run iff goes in an infinite loop iff accepts the empty input.
We now show that the problem is -complete in the general case by reducing from and to the following problem: Given a nondeterministic Turing machine , does have an infinite run on the empty input which visits its initial state infinitely often? This problem is known to be -complete [33, Proposition 5.1].
Given , simulates a run of by nondeterministically writing down an initial configuration, repeatedly guessing transitions in the transducer for before nondeterministically stopping in a final state of the transducer, writing down the successor, and repeating the process. never visits during the guessing process (otherwise might never stop guessing an infinitely long successor) and every time a successor is guessed, visits .
For the other direction, can simulate with a counter which indicates when the next time visits will be. Every time visits , nondeterministically sets the counter to a number , and every time does a transition without visiting , is decreased by 1. If reaches 0, terminates. (Note that can be set arbitrarily high with only one transition.)
In the following problems, we assume that the input consists of an NFA for , a transducer for , and, where applicable, a transducer for Reach and an NFA for .
Theorem 3.2.
Sure reachability and sure recurrent reachability are -complete. If is length-preserving, then they are -complete.
Proof.
We prove that the complements of both problems are equivalent to the problem whether an RTS has an infinite run, both in the length-preserving and in the general case. We do that by reducing these four problems to each other in a cycle:
-
(a)
Given , , and Reach, does there exist a run which only visits finitely often?
-
(b)
Given , , and Reach, does there exist a run which never visits ?
-
(c)
Given , does there exist an infinite run?
-
(d)
Given where all configurations are initial, does there exist an infinite run?
Here, (a) is the complement of the sure recurrent reachability problem, (b) is the complement of the sure reachability problem, and (c) is the problem from Lemma 3.1.
(a) (b): A run visits finitely often if and only if it visits a configuration from which it never visits again. Hence the reduction just changes the initial configurations to while leaving everything else the same.
(b) (c): Given and , define and add self-loops to all terminating configurations.
(c) (d): Given , we construct an RTS which has an infinite run starting from any configuration iff has an infinite run. The idea is that checks an infinite run of for correctness. The configurations of are of the form where are configurations of .
In the length-preserving case, checks (using multiple transitions) that , that for all , and that there exists an such that . can do that by e.g. working like a Turing machine and marking the already checked letters. If any checks fail, terminates; if all checks succeed, unmarks all letters and repeats the process. has an infinite run iff has a run which loops, i.e. visits the same configuration twice, and can check that run forever, which also results in an infinite run. For the converse, note that can only have an infinite run if all checks succeed.
The non-length-preserving case is similar. Instead of checking for a cycle, checks that the current prefix of a run of is valid, and after all checks succeed, nondeterministically adds a configuration and restarts the process. It is clear that has an infinite run iff does.
(d) (a): Given with , we construct an RTS and an NFA for such that has a run which only visits finitely often iff has an infinite run. We let behave the same way as , but add a special configuration (in the length-preserving case, we add infinitely many such configurations, one for each length), set and add the transitions and for all to . Then the reachability relation of is regular as all configurations (or all configurations of the same length) can reach each other. If has an infinite run, then has the same infinite run which does not visit ; if does not have an infinite run, then every run of must visit again and again.
Remark 3.3.
The undecidability of the sure reachability problem for arbitrary transducers can be immediately deduced from well-known results. Theorem 3.3 of [23] proves that the reachability relation of Basic Parallel Processes (BPPs) [17, 16] is expressible in Presburger arithmetic, and so regular under standard encodings of tuples of natural numbers as words [32, 26]. So BPPs are a special case of RTSs in which Reach can be encoded as a transducer. Further, it was shown in [29, 24] that sure reachability for BPPs is undecidable. The novelty of Theorem 3.2 is to show that the problem remains undecidable in the length-preserving case (and to give a simpler proof for arbitrary transducers). Observe that the length-preserving case requires a novel argument: indeed, since sure reachability is -complete in the general case, it cannot be recursively reduced to sure reachability for length-preserving transducers, which is only -complete.
Theorem 3.4.
Deadlock-freedom is -complete.
Proof.
The set of terminating configurations is , and thus there exists a terminating run iff . This is decidable in nondeterministic polynomial space by e.g. guessing a configuration letter by letter and checking on the fly that and ; indeed, this only requires enough memory to store a state of the NFA for and a set of states of the NFA for . For hardness, we can reduce from the universality problem: Given an NFA , setting and makes the problem equivalent to deciding whether is universal.
4 Almost sure properties
In this section we present our results on the decidability and complexity of almost sure properties. We see the RTS as a Markov chain, i.e. we have a probability measure which assigns a positive probability to every transition and satisfies . This induces as usual a probability space for every configuration , where is the set of runs starting at , is the -field generated by all basic cylinders where is a finite path starting at , and is the unique probability function such that where .
In the length-preserving case, a.s. reachability, recurrent reachability and termination only depend on the topology of the Markov chain , and not on the numerical values of the probabilities of its transitions. This fact is well-known for finite Markov chains. To show that it also holds for , which can be infinite, observe that, since the number of configurations of a given length is finite, every configuration can only reach finitely many configurations, and so is the disjoint union of a finite or countably infinite family of finite Markov chains. It follows that our almost-sure properties hold iff they hold for every Markov chain in the family, and therefore do not depend on the numerical values either.
In the general case, the property depends on the numerical values. For example, consider a random walk on with transitions and assume that is the same for all . The probability that a run starting at eventually reaches is 1 if and only if .
Again, we assume that the input consists of an NFA for , a transducer for , and, where applicable, a transducer for Reach and an NFA for .
4.1 The length-preserving case
We make use of the fact that a run of almost surely eventually visits a bottom strongly connected component (bSCC) of . Further, once in a bSCC, the run either terminates (if the bSCC is trivial, i.e. consists of a single terminating configuration) or stays in that bSCC forever, visiting each configuration of the bSCC infinitely often almost surely.
Proposition 4.1.
Almost sure reachability is -complete for length-preserving RTSs.
Proof.
If there exists an initial configuration from which reaching has probability less than 1, then there exists a bSCC reachable from such that neither the bSCC nor the path from to the bSCC intersects . In other words, there exists a path such that , for all , and is in a bSCC which does not intersect , i.e. and . Given such a path, these conditions can be checked, proving semi-decidability of the complement and thus proving that almost sure reachability is in .
For hardness, we reduce from the non-emptiness problem for Turing machines. Given a TM , we define to be the set of input configurations of with any number of blank symbols, that is, the set of all words where is the encoding of an input configuration of , and is a word of blanks. Further, we let simulate the transitions of . Moreover, for every length, we add two special configurations to the RTS and add the following transitions to : and for every configuration of , for every accepting configuration of , and . Then where is the set of configurations of , so Reach is regular. Let (of all lengths). If has an input which it accepts, then there exists a run of starting from (with enough blank symbols) which reaches an accepting configuration of and then goes to , never visiting . This run has positive probability as the number of steps until is reached is finite, and thus the probability of visiting is not 1. Conversely, if does not have an input which it accepts, then no run can reach without visiting first, and a transition to will occur eventually almost surely, i.e. the probability of visiting is 1.
For almost sure recurrent reachability, we introduce the following characterisation, which will also be useful in later sections.
Lemma 4.2.
reaches infinitely often almost surely iff .
Proof.
Every run of eventually visits a bSCC almost surely, and thus every infinite run visits infinitely often iff every reachable bSCC is non-trivial and contains a configuration in . This is the case iff no terminating configuration is reachable and can be reached from every reachable configuration, or formally, .
Proposition 4.3.
Almost sure recurrent reachability is -complete for length-preserving RTSs.
Proof.
By Lemma 4.2, it suffices to show that deciding whether is -complete. One can decide this in nondeterministic polynomial space by e.g. guessing a configuration letter by letter and checking on the fly that , , and . For that, one can run on the corresponding NFAs by memorizing the current set of states after each letter of , and checking whether that set contains a final state of the NFA at the end. Since all involved NFAs have polynomial size (note that ), this algorithm takes polynomial space, and membership in follows from .
For hardness, we can reduce from the NFA subset problem, i.e., whether for given NFAs : By setting , , and , almost sure recurrent reachability holds iff .
We now consider almost sure termination, the property for which the proof is most involved. Again, we first prove a characterisation. We say that terminates almost surely if for every initial configuration , the set of runs starting at that end in a terminating configuration has probability 1.
Lemma 4.4.
terminates almost surely iff .
Proof.
is the set of all reachable configurations such that no terminating configuration can be reached from . If such a exists, then reaching it has a positive probability, and since the run cannot terminate from , terminates with probability less than 1. For the converse, if terminating configurations can be reached from any reachable configuration, then no reachable non-trivial bSCCs exist, i.e. every reachable bSCC is a terminating configuration. Since a run of eventually reaches a bSCC almost surely, it follows that terminates almost surely.
Proposition 4.5.
Almost sure termination is -complete for length-preserving RTSs. If an NFA for the set of terminating configurations is provided in the input, almost sure termination becomes -complete.
Proof.
From the characterisation of Lemma 4.4, it is easy to show that the problem is -complete in the case where an NFA for is given in the input, one can e.g. reduce from and to the NFA subset problem. For membership in , observe that has an NFA of exponential size in the input. One can thus build a polynomial NFA for and an exponential NFA for , guess a configuration letter by letter and check that and . This is a nondeterministic algorithm using exponential space, and membership follows from .
For -hardness, we reduce from the problem whether an exponentially space-bounded Turing machine accepts the empty input. The configurations of our RTS are going to be encodings of runs of , and a run of cannot terminate if and only if it starts with the encoding of the accepting run of on the empty input. We encode a run of as a word consisting of encodings of configurations of separated by .
Let and let , …, be the first prime numbers. Then is polynomial in by the prime number theorem while is exponential in ; we can thus assume that the run of on the empty input uses only the first tape cells. An NFA recognizing the language of words not divisible by only needs states. Thus, by putting NFAs side by side, each of which only accepts words of length not divisible by , one can construct an NFA of polynomial size in which only accepts words of length not divisible by . This fact will be used in our reduction.
Let and . We call symbols in unmarked and symbols in marked. We denote the symbol in position of a configuration of by . Let , and , i.e. the first configuration of in an initial configuration of is the empty input to , and the last symbol is the accepting state of . has three types of transitions: , which marks some symbols, and , which unmarks all symbols, and , which is used to terminate certain runs. Specifically, nondeterministically chooses a position and a distance and marks the symbols at positions , , , , and . For this transition to be executed, three conditions are required:
-
No symbol is marked.
-
There is exactly one in the subword .
-
If is part of a configuration of , then is not the symbol appearing in place of in the next configuration of . In particular, if , then .
The last point can be intuitively described as the encoding of the run having a “mistake” at position . This description only fits if chooses the correct distance; for other distances, even the correct run has a mistake. It will be relevant, however, that the encoding of the correct run does not have a mistake if distance is chosen.
takes as input a configuration with exactly five marked symbols, checks that the distance between the second and the fifth is not a multiple of , and unmarks all symbols. If the distance is a multiple of , the transition cannot occur. As explained above, this can be done with a transducer of polynomial size in .
takes as input a configuration where the distance between any two s is not a multiple of , and replaces all symbols by , after which the run terminates.
Observe that transitions only mark and unmark symbols and never change them. Thus every reachable configuration can be reached in at most two steps, and is regular and has a transducer of polynomial size in . Furthermore, a run of can only terminate if either the initial configuration has s at a distance not divisible by , or the run reaches a configuration where the distance between the marked symbols and chosen by is a multiple of , i.e. finds a mistake at a distance divisible by .
If accepts the empty input, a run of can start with the encoding of the accepting run of . Since the run only uses the first tape cells, there exists such an encoding where the distance between two consecutive is always ; therefore, the run of can never terminate with . Moreover, can only choose distances as otherwise there will be two between position and . If , then will unmark the positions in the next transition; and cannot be chosen because the correct run has no “mistakes” for to find. Hence such a run cannot terminate.
If does not accept the empty input, then there exists no run of starting with the empty input and ending with an accepting configuration. That is, every encoding of such a run in must have a mistake, i.e. there must exist symbols , , , , where does not result from , where s.t. is the distance between two consecutive . Such a mistake will almost surely be eventually “found” by , and the run will terminate. If the distance between two consecutive is not a multiple of , then the run can terminate with . In both cases, the run will almost surely eventually terminate.
4.2 The general case
In the general case, not every run ends up in a bSCC almost surely; bSCCs do not even necessarily exist. Furthermore, the probabilities of the transitions can affect the answer, which introduces the question of how is provided in the input, and how to deal with configurations with infinitely many successors. We show that the problems are undecidable even in the special case where every configuration has finitely many successors and is the uniform probability measure, i.e. .
We prove undecidability of the almost sure termination problem; the other problems can be easily reduced to it. For that, we reduce from the problem whether a deterministic Turing machine loops on the empty input, i.e. reaches the same configuration twice. A run of our RTS will simulate the run of on the empty input with high probability and have a low probability (the longer the configuration of , the lower) to jump to a special configuration . From , the run can terminate, restart the simulation of the run of on the empty input, or, with low probability, jump to any configuration of (this is done to ensure that Reach is regular). If halts or the head goes too far to the right, restarts the simulation of on the empty input while increasing the length by 1. This way, if loops on the empty input, the run will eventually jump to and have a chance to terminate. If does not loop on the empty input, but instead halts or the head goes arbitrarily far, then, with high probability, the configuration of will become longer and longer, and the probability of reaching will decrease, leading to termination with probability . For the full proof, see the full version [30].
Proposition 4.6.
Almost sure termination is undecidable.
Corollary 4.7.
Almost sure reachability and almost sure recurrent reachability are undecidable.
Proof.
One can reduce from almost sure termination by adding a new configuration , setting , and adding transitions and for every .
5 Sure and almost-sure properties in regular abstraction frameworks
As mentioned in the introduction, while some formalisms that can be modeled as RTSs have an effectively computable regular reachability relation, many others do not, including lossy channel systems, Vector Addition Systems and their many extensions, broadcast protocols, and population protocols. On the other hand, there exist different techniques to effectively compute a regular overapproximation of Reach, which in this section we generically call potential reachability and denote PReach. We consider the particular case of regular abstraction frameworks, a recent technique for the computation of PReach [19] introduced by the authors and colleagues. The technique automatically computes an overapproximation PReach for any regular abstraction representable – in a certain technical sense – by a transducer, and the computational complexity of the automatic procedure is precisely known (see Section 5.1 below).
The section is structured as follows. Section 5.1 recalls the main notions and results of [19]. Sections 5.2 and 5.3 study sure and almost-sure properties, respectively.
5.1 Regular abstraction frameworks
We briefly recall the main idea behind regular abstraction frameworks. Recall that the configurations of an RTS are finite words over an alphabet . A regular abstraction framework introduces a second alphabet and a deterministic transducer over , called an interpretation. Words over are called constraints. Intuitively, words over are “identifiers” for sets of configurations, and “interprets” an identifier as the set of configurations . A configuration satisfies a constraint if .
A constraint is inductive if . Given an inductive constraint , we have , i.e., is closed under the reachability relation. An inductive constraint separates two configurations if and . Observe that if separates , then is not reachable from . This leads to the definition of the potential reachability relation induced by , denoted PReach, as the set of all pairs that are not separated by any inductive constraint. Formally:
The following theorem was shown in [19] and holds for length-preserving as well as general RTSs.
Theorem 5.1.
Let be an RTS and let be an interpretation.
-
1.
PReach is reflexive, transitive, and regular. Further, one can compute in exponential time a transducer recognizing with at most states.
-
2.
Given an NFA for , deciding whether some configuration in is potentially reachable from some initial configuration (formally: whether holds) is -complete.
Proposition 5.2.
Abstract deadlock-freedom is -complete.
Proof.
Abstract deadlock-freedom is the problem whether . A nondeterministic algorithm can guess a configuration and check that and . Since one can construct an exponential-sized NFA for and a polynomial-sized NFA for , this algorithm needs exponential space.
For hardness, we reduce from Abstract Safety. Given an RTS and a set of unsafe configurations, we construct by adding a new configuration (in the length-preserving case, adding such a configuration for each length), adding self-loops to all configurations except , adding transitions for every , and adding to all constraints (i.e. for every constraint , we have ). This makes the only terminating configuration while not affecting the inductivity of any constraints. It is easy to see that abstract safety holds for iff abstract deadlock-freedom holds for .
5.2 Sure properties
We define Abstract Liveness, obtained by substituting “recurrent reachability” for “reachability” in Abstract Safety.
Definition 5.3.
Let be an RTS and let be an interpretation. A potential run of is a run of the RTS with . The abstract liveness problem is defined as follows:
Abstract Liveness
Given: RTS , interpretation , NFA for .
Decide: Does some potential run of visit infinitely often?
Lemma 5.4.
The reflexive transitive closure of is PReach. The transitive closure of is .
Proof.
See the full version [30].
The first statement of Lemma 5.4 shows that our definition of a potential run coincides with the definition of abstract safety in [19]: Abstract safety holds iff no potential run reaches . The second statement will be used to characterise abstract liveness.
In the rest of the section, we show that Abstract Liveness and abstract sure termination, which can be seen as a special case of Abstract Liveness, are -complete. We start with a lemma, similar to the starting point of To and Libkin in [43].
Lemma 5.5.
Let , , be an instance of Abstract Liveness. Let be as in Definition 5.3. There exists a potential run of that visits infinitely often if and only if one of these conditions hold:
-
(a)
There exist configurations , such that , , , and .
-
(b)
There exists a sequence of pairwise distinct configurations such that , , and .
Proof.
We use Lemma 5.4. If (a) holds, then the infinite sequence is a potential run. If (b) holds, then is a potential run. For the converse, let be a potential run that visits infinitely often. If for some , then , and since , (a) holds. Otherwise, removing all configurations not in from the sequence yields a sequence of pairwise distinct configurations in , and (b) holds.
The sequence in condition (b) is called an infinite directed clique, see [12]. Note that (b) never holds for length-preserving RTSs. We prove that both (a) and (b) can be decided in .
Lemma 5.6.
Deciding (a) is in .
Proof.
One can guess a configuration letter by letter and check that , and . is equivalent to there existing a such that and . Since an NFA for can be built using exponential space (see Theorem 5.1), the algorithm amounts to guessing letter by letter (in parallel) and running words on NFAs of at most exponential size. To do this, one can memorize the current set of states after each letter and check whether that set contains a final state of the NFA at the end. Since all involved NFAs are at most exponential, this algorithm takes exponential space, and the result follows from .
For (b), we first need the following lemma, based on Lemma 4 from [43].
Lemma 5.7.
Condition (b) holds if and only if there exist sequences and in such that
-
1.
and for every ;
-
2.
for every ;
-
3.
there exists an infinite run of on such that, for every , is accepted from the state reached by on the prefix ,
-
4.
there exists an infinite run of the transducer for PReach on such that is accepted from the state reached by on the prefix .
Proof.
One direction is easy: if the four conditions hold, the sequence with satisfies (b). For the other direction, we make use of the transitivity of PReach, see the proof of Lemma 4 in [43].
Lemma 5.8.
Deciding (b) is in .
Proof.
See the full version [30].
Theorem 5.9.
Abstract Liveness is -complete both for length-preserving and for general RTSs.
Proof.
Membership in follows from Lemmas 5.5, 5.6, and 5.8. -hardness follows from an easy reduction from the abstract safety problem: One can add self-loops to all configurations in to make sure that (a) holds iff . Since self-loops do not affect whether constraints are inductive, PReach does not change. Note that for length-preserving RTSs, abstract infinite reachability is equivalent to (a).
Theorem 5.10.
Abstract sure termination is -complete both for length-preserving and for general RTSs.
Proof.
Abstract sure termination is the special case of abstract liveness where and therefore also in . The hardness proof is more involved, see the full version [30].
5.3 Almost-sure properties
Unlike recurrent reachability, almost-sure recurrent reachability cannot be semi-decided using only an overapproximation of the reachability relation, not even in the length-preserving case. To see why, recall that a run of a length-preserving RTS visits a regular set of configurations infinitely often with probability 1 iff (Lemma 4.2). Unfortunately, given an overapproximation , this condition neither implies nor is implied by . This situation changes when is an effectively computable regular set of configurations. Indeed, in this case is decidable, and implies . We show that this leads to positive results for
Abstract A.S. Liveness
Given: RTS , interpretation , NFA for .
Decide: Does a potential run of visit infinitely often almost surely?
More precisely, in the rest of the section we recall well-structured RTSs [31] and prove a) that Abstract A.S. Liveness is decidable for well-structured RTSs and so-called upward-closed sets of configurations, and b) that several well-known classes of parameterized stochastic systems can be modeled as well-structured RTSs for which Reach is not effectively regular.
Well-structured RTSs.
The scattered subword order on configurations is defined by: for every , we have if and for some words . A set of configurations is upward-closed if and implies . It follows from Higman’s lemma that every upward-closed set of configurations is regular [34]. An RTS is well-structured if for every and every there exists a configuration such that .
Theorem 5.11 ([31]).
Let be a well-structured RTS and let be an NFA recognizing an upward-closed set of configurations . Then is regular and effectively computable.
The algorithm to compute is very simple: iterate the operation until a fixpoint is reached. Theorem 5.11 immediately yields:
Theorem 5.12.
Abstract A.S. Liveness is decidable for well-structured RTS and upward-closed sets of configurations.
Proof.
One needs to decide whether , i.e. whether is universal. An NFA for can be computed (see Theorem 5.1), and the statement follows.
Models with non-regular/non-computable reachability relation.
Broadcast protocols [22, 27] and population protocols [11] are two models in which an arbitrarily large number of identical finite-state processes interact by broadcast or rendez-vous, respectively. In both models, configurations with processes can be modeled as words of length over the alphabet of process states, and the transition function is captured by a length-preserving RTS.
In lossy channel systems (LCS) a fixed set of finite-state processes communicate through unreliable FIFO channels that can lose messages [7]. LCS are made probabilistic by attaching probabilities to message losses [37, 3]. Channels have unbounded capacity, and so they cannot be modeled by length-preserving RTSs. So we consider parameterized lossy channel systems (PLCS), a variant in which channels have bounded capacity, but the capacity is a parameter. In other words, a PLCS is an infinite collection of LCS that only differ in the capacity of their channels (1,2, …).
In any of these models, Reach is not always effectively regular. (For PLCS see [5], for population protocols it follows from the fact that Reach is not always semilinear [36], and for broadcast protocols from the undecidability of recurrent reachability [27].) These negative results justify the interest of Theorem 5.12. Moreover, for population protocols Abstract A.S. Liveness is even in , and so not worse than AbstractSafety:
Proof.
6 Conclusions
We have extended the work of To and Libkin on recurrent reachability of RTSs [43, 44] to the verification of sure and almost-sure properties, and applied our results to the setting of regular abstraction frameworks [19]. In particular, we have shown that Abstract Liveness has the same complexity as Abstract Safety, and that Abstract A.S. Liveness is decidable for some important models of distributed systems.
References
- [1] Parosh Aziz Abdulla. Regular model checking. Int. J. Softw. Tools Technol. Transf., 14(2):109–118, 2012. doi:10.1007/S10009-011-0216-8.
- [2] Parosh Aziz Abdulla. Regular model checking: Evolution and perspectives. In Model Checking, Synthesis, and Learning, volume 13030 of Lecture Notes in Computer Science, pages 78–96. Springer, 2021. doi:10.1007/978-3-030-91384-7_5.
- [3] Parosh Aziz Abdulla, Christel Baier, S. Purushothaman Iyer, and Bengt Jonsson. Reasoning about probabilistic lossy channel systems. In CONCUR, volume 1877 of Lecture Notes in Computer Science, pages 320–333. Springer, 2000. doi:10.1007/3-540-44618-4_24.
- [4] Parosh Aziz Abdulla, Karlis Cerans, Bengt Jonsson, and Yih-Kuen Tsay. General decidability theorems for infinite-state systems. In LICS, pages 313–321. IEEE Computer Society, 1996. doi:10.1109/LICS.1996.561359.
- [5] Parosh Aziz Abdulla, Aurore Collomb-Annichini, Ahmed Bouajjani, and Bengt Jonsson. Using forward reachability analysis for verification of lossy channel systems. Formal Methods Syst. Des., 25(1):39–65, 2004. doi:10.1023/B:FORM.0000033962.51898.1A.
- [6] Parosh Aziz Abdulla, Frédéric Haziza, and Lukás Holík. Parameterized verification through view abstraction. Int. J. Softw. Tools Technol. Transf., 18(5):495–516, 2016. doi:10.1007/S10009-015-0406-X.
- [7] Parosh Aziz Abdulla and Bengt Jonsson. Verifying programs with unreliable channels. In LICS, pages 160–170. IEEE Computer Society, 1993. doi:10.1109/LICS.1993.287591.
- [8] Parosh Aziz Abdulla, Bengt Jonsson, Marcus Nilsson, and Julien d’Orso. Regular model checking made simple and efficient. In CONCUR, volume 2421 of Lecture Notes in Computer Science, pages 116–130. Springer, 2002. doi:10.1007/3-540-45694-5_9.
- [9] Parosh Aziz Abdulla, Bengt Jonsson, Marcus Nilsson, and Mayank Saksena. A survey of regular model checking. In CONCUR, volume 3170 of Lecture Notes in Computer Science, pages 35–48. Springer, 2004. doi:10.1007/978-3-540-28644-8_3.
- [10] Parosh Aziz Abdulla, A. Prasad Sistla, and Muralidhar Talupur. Model checking parameterized systems. In Handbook of Model Checking, pages 685–725. Springer, 2018. doi:10.1007/978-3-319-10575-8_21.
- [11] Dana Angluin, James Aspnes, Zoë Diamadi, Michael J. Fischer, and René Peralta. Computation in networks of passively mobile finite-state sensors. Distributed Comput., 18(4):235–253, 2006. doi:10.1007/S00446-005-0138-3.
- [12] Pascal Bergsträßer, Moses Ganardi, Anthony W. Lin, and Georg Zetzsche. Ramsey quantifiers over automatic structures: Complexity and applications to verification. In Christel Baier and Dana Fisman, editors, LICS, pages 28:1–28:14. ACM, 2022. doi:10.1145/3531130.3533346.
- [13] Michael Blondin and Mikhail A. Raskin. The complexity of reachability in affine vector addition systems with states. Log. Methods Comput. Sci., 17(3), 2021. doi:10.46298/LMCS-17(3:3)2021.
- [14] Ahmed Bouajjani, Bengt Jonsson, Marcus Nilsson, and Tayssir Touili. Regular model checking. In CAV, volume 1855 of Lecture Notes in Computer Science, pages 403–418. Springer, 2000. doi:10.1007/10722167_31.
- [15] Laura Bozzelli and Pierre Ganty. Complexity analysis of the backward coverability algorithm for VASS. In RP, volume 6945 of Lecture Notes in Computer Science, pages 96–109. Springer, 2011. doi:10.1007/978-3-642-24288-5_10.
- [16] Søren Christensen, Yoram Hirshfeld, and Faron Moller. Bisimulation equivalence is decidable for basic parallel processes. In CONCUR, volume 715 of Lecture Notes in Computer Science, pages 143–157. Springer, 1993. doi:10.1007/3-540-57208-2_11.
- [17] Søren Christensen, Yoram Hirshfeld, and Faron Moller. Decomposability, decidability and axiomatisability for bisimulation equivalence on basic parallel processes. In LICS, pages 386–396. IEEE Computer Society, 1993. doi:10.1109/LICS.1993.287569.
- [18] Patrick Cousot. Principles of abstract interpretation. MIT Press, 2021.
- [19] Philipp Czerner, Javier Esparza, Valentin Krasotin, and Christoph Welzel-Mohr. Computing inductive invariants of regular abstraction frameworks. In CONCUR, volume 311 of LIPIcs, pages 19:1–19:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.CONCUR.2024.19.
- [20] Wojciech Czerwinski, Slawomir Lasota, Ranko Lazic, Jérôme Leroux, and Filip Mazowiecki. The reachability problem for petri nets is not elementary. J. ACM, 68(1):7:1–7:28, 2021. doi:10.1145/3422822.
- [21] Wojciech Czerwinski and Lukasz Orlikowski. Reachability in vector addition systems is ackermann-complete. In FOCS, pages 1229–1240. IEEE, 2021. doi:10.1109/FOCS52979.2021.00120.
- [22] E. Allen Emerson and Kedar S. Namjoshi. Automatic verification of parameterized synchronous systems (extended abstract). In CAV, volume 1102 of Lecture Notes in Computer Science, pages 87–98. Springer, 1996. doi:10.1007/3-540-61474-5_60.
- [23] Javier Esparza. Petri nets, commutative context-free grammars, and basic parallel processes. In FCT, volume 965 of Lecture Notes in Computer Science, pages 221–232. Springer, 1995. doi:10.1007/3-540-60249-6_54.
- [24] Javier Esparza. Decidability of model checking for infinite-state concurrent systems. Acta Informatica, 34(2):85–107, 1997. doi:10.1007/S002360050074.
- [25] Javier Esparza and Michael Blondin. Automata Theory – An Algorithmic Approach. MIT Press, 2023.
- [26] Javier Esparza and Michael Blondin. Automata theory: An algorithmic approach. MIT Press, 2023.
- [27] Javier Esparza, Alain Finkel, and Richard Mayr. On the verification of broadcast protocols. In LICS, pages 352–359. IEEE Computer Society, 1999. doi:10.1109/LICS.1999.782630.
- [28] Javier Esparza, Pierre Ganty, Jérôme Leroux, and Rupak Majumdar. Model checking population protocols. In FSTTCS, volume 65 of LIPIcs, pages 27:1–27:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2016. doi:10.4230/LIPICS.FSTTCS.2016.27.
- [29] Javier Esparza and Astrid Kiehn. On the model checking problem for branching time logics and basic parallel processes. In CAV, volume 939 of Lecture Notes in Computer Science, pages 353–366. Springer, 1995. doi:10.1007/3-540-60045-0_62.
- [30] Javier Esparza and Valentin Krasotin. Regular model checking for systems with effectively regular reachability relation, 2025. arXiv:2506.18833.
- [31] Alain Finkel and Philippe Schnoebelen. Well-structured transition systems everywhere! Theor. Comput. Sci., 256(1-2):63–92, 2001. doi:10.1016/S0304-3975(00)00102-X.
- [32] Christoph Haase. A survival guide to presburger arithmetic. ACM SIGLOG News, 5(3):67–82, 2018. doi:10.1145/3242953.3242964.
- [33] David Harel, Amir Pnueli, and Jonathan Stavi. Propositional dynamic logic of nonregular programs. J. Comput. Syst. Sci., 26(2):222–243, 1983. doi:10.1016/0022-0000(83)90014-4.
- [34] Graham Higman. Ordering by divisibility in abstract algebras. Proceedings of the London Mathematical Society, 3(1):326–336, 1952.
- [35] Chih-Duo Hong and Anthony W. Lin. Regular abstractions for array systems. Proc. ACM Program. Lang., 8(POPL):638–666, 2024. doi:10.1145/3632864.
- [36] John E. Hopcroft and Jean-Jacques Pansiot. On the reachability problem for 5-dimensional vector addition systems. Theor. Comput. Sci., 8:135–159, 1979. doi:10.1016/0304-3975(79)90041-0.
- [37] S. Purushothaman Iyer and Murali Narasimha. Probabilistic lossy channel systems. In TAPSOFT, volume 1214 of Lecture Notes in Computer Science, pages 667–681. Springer, 1997. doi:10.1007/BFB0030633.
- [38] Ondrej Lengál, Anthony Widjaja Lin, Rupak Majumdar, and Philipp Rümmer. Fair termination for parameterized probabilistic concurrent systems. In TACAS (1), volume 10205 of Lecture Notes in Computer Science, pages 499–517, 2017. doi:10.1007/978-3-662-54577-5_29.
- [39] Jérôme Leroux. The reachability problem for petri nets is not primitive recursive. In FOCS, pages 1241–1252. IEEE, 2021. doi:10.1109/FOCS52979.2021.00121.
- [40] Anthony W. Lin and Philipp Rümmer. Liveness of randomised parameterised systems under arbitrary schedulers. In CAV (2), volume 9780 of Lecture Notes in Computer Science, pages 112–133. Springer, 2016. doi:10.1007/978-3-319-41540-6_7.
- [41] Tadao Murata. Petri nets: Properties, analysis and applications. Proceedings of the IEEE, 77(4):541–580, 1989. doi:10.1109/5.24143.
- [42] Piergiorgio Odifreddi. Classical recursion theory: The theory of functions and sets of natural numbers, volume 125. Elsevier, 1992.
- [43] Anthony Widjaja To and Leonid Libkin. Recurrent reachability analysis in regular model checking. In LPAR, volume 5330 of Lecture Notes in Computer Science, pages 198–213. Springer, 2008. doi:10.1007/978-3-540-89439-1_15.
- [44] Anthony Widjaja To and Leonid Libkin. Algorithmic metatheorems for decidable LTL model checking over infinite systems. In FoSSaCS, volume 6014 of Lecture Notes in Computer Science, pages 221–236. Springer, 2010. doi:10.1007/978-3-642-12032-9_16.
