Model Checking Strategies from Synthesis Over Finite Traces
Abstract
The innovations in reactive synthesis from Linear Temporal Logics over finite traces () will be amplified by the ability to verify the correctness of the strategies generated by synthesis tools. This motivates our work on model checking. model checking, however, is not straightforward. The strategies generated by synthesis may be represented using terminating transducers or non-terminating transducers where executions are of finite-but-unbounded length or infinite length, respectively. For synthesis, there is no evidence that one type of transducer is better than the other since they both demonstrate the same complexity and similar algorithms.
In this work, we show that for model checking, the two types of transducers are fundamentally different. Our central result is that model checking of non-terminating transducers is exponentially harder than that of terminating transducers. We show that the problems are EXPSPACE-complete and PSPACE-complete, respectively. Hence, considering the feasibility of verification, synthesis tools should synthesize terminating transducers. This is, to the best of our knowledge, the first evidence to use one transducer over the other in synthesis.
1 Introduction
Linear Temporal Logic over finite traces [13] () is the finite-horizon counterpart of the well-known Linear Temporal Logic () over infinite traces [23]. is rapidly gaining popularity among real-world applications where behaviors are better expressed over a finite but unbounded horizon [6, 10, 11, 18, 34].
Reactive synthesis from specifications, or synthesis [2, 7, 9, 12, 14, 17, 28, 36] has amassed so much interest that the 2023 Reactive Synthesis Competition (SYNTCOMP) will inaugrate an track111http://www.syntcomp.org/news/. Consequently, synthesis tools have been growing in complexity [2, 8, 17, 28, 36]. Their correctness, however, is rarely verified. To continue the innovations in synthesis and to successfully conduct large-scale competitions like SYNTCOMP there is, therefore, a need to verify the correctness of the synthesized strategies/transducers. Verifying the results as opposed to verifying the tools has been advocated in various contexts, including translation validation [26], program checking [5], and equivalence checking [21]. For synthesis, result checking is simply model checking. For synthesis, we need model checking. But this is a topic that has not been studied so far, hence this work.
We observe that model checking for synthesis tools is not as straightforward as one might have thought to be. The standard approach in the literature on synthesis generates non-terminating transducers. This includes the seminal work on synthesis [12] and the SYNTCOMP guidelines [19]. The executions of non-terminating transducers are of infinite length. Since formulas are defined on finite traces only, an execution of a non-terminating transducer is said to satisfy an formula if there exists a finite-length prefix that satisfies the formula [12]. Few works on synthesis do mention the possibility of terminating transducers as the output [2, 36]. Since their executions are of finite length, satisfaction is defined naturally on terminating transducers. When it comes to synthesis, there is no clear evidence that one type of transducer is better than the other, since the complexity and algorithms of synthesis are the same for both types. We believe this is why existing works on synthesis do not make a clear distinction between the two. For implementations, however, most works use non-terminating transducers as they directly correspond to standard Mealy/Moore machines (See state-of-the-art tools, e.g., Syft [36], Lisa [2], and Lydia [8]). This work shows, however, that from the model-checking perspective, the two types of transducers are fundamentally different and bear a significant impact on synthesis.
Our central result is that model checking of non-terminating transducers is exponentially harder than model checking of terminating transducers. We demonstrate that under specifications, model checking non-terminating transducers is EXPSPACE-complete, whereas model checking terminating transducers is PSPACE-complete. An immediate implication of this result is that for non-terminating transducers, model checking is exponentially harder than model checking, which is known to be PSPACE-complete [32]. This result is unexpected because a factor behind the increasing popularity of is the perception that problems using are at most as hard as those using , if not simpler (See Table 1). This is because formulas can be expressed by automata over finite words [13], which allow for practically scalable algorithms for automata constructions [29]. Conversely, formulas require automata over infinite words [35], for which the automata manipulation is harder in theory [16, 25, 30, 31] and in practice [15, 20]. It is no wonder that an exponential increase in the model-checking complexity seems surprising at first.
The exponential blow-up in model-checking of non-terminating transducers arises from subtlety in the problem definition. A transducer satisfies a formula if there are no counterexamples. In non-terminating transducers, an infinite execution is a counterexample if every finite prefix does not satisfy the formula. Formally, for an formula , let represent the language consisting of all infinite executions for which every prefix satisfies . Then, a non-terminating transducer satisfies an formula iff , where is the set of all executions of . This is where model checking fundamentally differs from model checking, as counterexamples in are obtained simply from an automaton for the negation of the formula [32]. W.l.o.g., we show that while is -regular for all formulas , the size of their non-deterministic Büchi automata (NBA) is doubly exponential in the size of the formula, i.e., and . Once again, this differs from model checking, where the size of the NBAs for counterexamples is singly exponential in the size of the formula. As a result, we show model checking of non-terminating transducers is in EXPSPACE using on-the-fly emptiness checking of . We establish EXPSPACE-hardness from first principles.
In contrast, we show that model checking of terminating transducers is PSPACE-complete. Due to their finite-length executions, counterexamples in terminating transducers are completely characterized by the negation of the formula, lending the same complexity as model checking.
Thus, our results offer a clear recommendation between the two types of transducers in synthesis. We argue that synthesis tools should account for the feasibility of the verification of the synthesized transducers. Consequently, we recommend that synthesis tools should generate terminating transducers rather than non-terminating transducers. We believe this is the first work to offer theoretical evidence to use one transducer over the other in synthesis. Furthermore, these results could be applied immediately to run the track in SYNTCOMP.
Non-deterministic Automata | (NBA) Exponential | (NFA) Exponential |
---|---|---|
Satisfiability | PSPACE-complete [27] | PSPACE-complete [13] |
Synthesis | 2EXPTIME-complete [24] | 2EXPTIME-complete [12] |
Model Checking (NT) | PSPACE-complete [32] | EXPSPACE-complete (New!) |
Model Checking (T) | Undefined | PSPACE-complete (New!) |
Outline.
2 Preliminaries and Notations
We use the standard notions of deterministic and non-deterministic finite automata (DFAs and NFAs, respectively) as well as deterministic and non-deterministic Büchi automata (DBAs and NBAs, respectively). For an automaton, we use the notation where is a finite set of symbols (called an alphabet), is a finite set of states, is the initial state, is the set of accepting states, and is the transition relation. We use standard semantics for all automata, hence defer details to the appendix.
2.1 Linear Temporal Logic over Finite Traces ()
[1, 13] extends propositional logic with finite-horizon temporal operators. In effect, is a variant of [23] that is interpreted over finite rather than infinite traces. The syntax of an formula over a finite set of propositions is identical to , and defined as
where X (Next) and U (Until), are temporal operators. We also include their dual operators, N (Weak Next) and R (Release), defined as and . We also use typical abbreviations such as , , , . We denote by the length/size of a formula , i.e., the number of operators in .
The semantics of is similar to but is interpreted over finite traces. A finite sequence over is said to satisfy an formula over , denoted by , if where for all positions , is defined inductively on as follows:
-
•
; ; iff
-
•
iff
-
•
iff and ;
-
•
iff and
-
•
iff there exists s.t. and , and for all , , we have
Observe that X requires that there exists a next position; In the context of finite traces, its negation also contains the situation that no next position exists, formulated as or equivalently Nfalse. This differs from where the Next operator is applied to all positions. Also, note that formulas are evaluated on traces of non-zero length.
The language of an formula over is the set of all finite sequences over such that . The language of an formula is regular. The NFA and DFA representing are of size singly exponential and doubly exponential, respectively, in the size of the formula [13]. We note that a letter of the NFA/DFA corresponds to a valuation over the set of propositions.
2.2 Synthesis and Transducers
Let formula be defined over propositional variables partitioned into and representing the input and output variables, respectively. Given such an formula , the problem of realizability is to determine whether there exists a strategy such that for all , there is an integer such that the finite trace satisfies . The synthesis problem is to generate such a function, if the given formula is realizable [12]. Intuitively, synthesis can be viewed as a game between two agents, an environment and a system, who continually take turns to assign values to the input and output variables, respectively, to generate a sequence of input and output variables. W.l.o.g., we assume the system plays first, followed by the environment, and so on. The goal of synthesis is to generate a strategy for the system agent so that all resulting plays with the environment satisfy the given specification. We note that our model-checking results also hold when the environment plays first, as we will model strategies as transition systems in model checking for generality (cf. Section 3).
2.2.1 Non-terminating transducers.
The standard in synthesis is to represent the strategy using (non-terminating) transducers [12, 19]. W.l.o.g., a transducer is a Moore machine where is a finite set of states, is the initial state, and and are finite sets of input and output variables, respectively. Functions and are the transition function and the output function, respectively. Given an input sequence , the output sequence is where is the initial state and for all .
Then, given an formula with variables partitioned into and the realizability and synthesis problem is to generate a Moore machine such that for all input sequences , there exists an integer such that satisfies . Intuitively, the system and environment play indefinitely, where the system plays as per the transducer. The play (an execution in the transducer) satisfies an formula if there exists a finite-length prefix that satisfies the formula.
2.2.2 Terminating transducers.
The strategy can also be represented using terminating transducers [2, 36]. W.l.o.g., a terminating transducer is a Terminating Moore machine where , , , , , and are as defined for Moore machines and are the terminal states. An input sequence generates an output sequence where is the initial state and for all .
Then, given an formula with variables partitioned into and , the realizability and synthesis problem is to generate a terminating Moore machine such that for all input sequence , there exists an integer such that with and satisfies . Intuitively, the synthesized terminating transducer is such that as soon as a play lands in a terminal state of the transducer, the system agent controlling the output variables wins the game and this play is over as it is guaranteed that the play seen so far satisfies the given formula. On the contrary, in non-terminating transducers, the system agent does not have the ability to terminate a game as it is never informed of whether it has seen a satisfying prefix.
3 Model Checking
In addition to being of independent interest, our motivation behind model checking is to support the ongoing development of synthesis tools. As synthesis tools continue to become more complex, it is imperative that we design automatic approaches to check their correctness. One way is to evaluate whether the result generated from these tools is correct. In the case of synthesis, result checking corresponds to model checking. Finally, an immediate application of model checking could be in running the inaugural track in the Reactive Synthesis Competition (SYNTCOMP) [19].
We begin by defining the model-checking problem. As described in Section 2.2, the result of synthesis could be a terminating or a non-terminating transducer. Since satisfaction on executions in the two types of transducers differ, we define model-checking on them separately. For the sake of generality, we define model-checking with respect to transition systems (TS) as opposed to transducers. Translations from transducers to transition systems are standard and polynomial [22]. Hence, the translation details have been omitted.
Non-Terminating Transition Systems
are those that run indefinitely, i.e., their executions are of infinite length (e.g. network servers). Formally, a non-terminating TS is a structure , where is a finite propositional alphabet, is a finite set of states, relation is the transition relation with no sink states, is the initial state, and is the labeling function. An execution in is an infinite sequence of consecutive states beginning with the initial state, i.e., and for all . The label sequence of is the sequence . The -length finite prefix of and its label sequence are given by and , respectively, for .
Since executions are of infinite-length and formulas are interpreted over finite-length sequences only, we say an execution in satisfies an formula , denoted by , as follows
i.e., there exists a finite-length prefix of the execution that satisfies the formula.
Terminating Transition Systems
are those that terminate after a finite but unbounded amount of steps (e.g. a terminating program). Formally, a terminating TS is given by a structure , where , , , , and are defined as for nonterminating transition systems and are the terminal states, which are the only states that are allowed to be sink states. An execution in is a finite sequence of consecutive states beginning with the initial state and ending in a terminal state, i.e., and for all , and . Its label sequence is the sequence .
An execution in satisfies an formula , denoted by ,
Model Checking.
We first define satisfaction and then model checking.
Definition 1 ()
Given a non-terminating (resp., terminating) transition system and an formula , we say TS satisfies , denoted by , if for all (resp., finite) executions of , we have that .
Definition 2 (Model Checking)
Given a non-terminating (resp. terminating) transition system and an formula , the problem of model checking of non-terminating (resp. terminating) models is to determine whether satisfies .
Note on abuse of notation.
The notation has been overloaded to express satisfaction at several occasions, namely, in semantics, in defining when executions of non-terminating and terminating systems satisfy a formula, and when a system satisfies a formula. We overload notation to avoid new symbols for each case, as the context is clear from the L.H.S.
4 Prefix Language of Formulas
This section builds the basic blocks for model checking of non-terminating systems. Recall from Section 3, an (infinite-length) execution in a non-terminating system violates an formula if all of its finite prefixes violate . So, the counterexamples are captured by the language that accepts an infinite word iff all of its finite prefixes violate (or satisfy ). We call this the prefix language of an formula . Then, clearly, iff the intersection of with the prefix language of is empty, making the prefix language a basic block to model-check non-terminating systems.
We first observe that the prefix languages for formulas are -regular. We then show that one can construct a DBA accepting the prefix language of an formula, which incurs a doubly exponential blow-up (Section 4.1). One may expect that the complexity of the construction can be improved if we target at NBAs. We show, however, that the doubly exponential blow-up is not due to a lack of better construction, but a fundamental trait of the problem itself (Theorem 4.2). This is in contrast to the construction of NBA/NFA for / , where only deterministic automata constructions incur doubly exponential blow-ups and nondeterministic automata constructions incur singly exponential blow-ups, hinting at the hardness of model checking. Finally, we identify a fragment of formulas for which a singly exponential construction of NBAs for their prefix languages can be obtained via a translation from to (Section 4.2).
4.1 Prefix Automata for
This section formally defines the prefix language/automata for formulas and proves that their automata constructions involve an unavoidable double-exponential blow-up. The upper and lower bounds are shown in Theorem 4.1 and Theorem 4.2, respectively.
Definition 3 (Prefix Language)
Given an formula , the prefix language of , denoted by , is such that an (infinite-length) word iff every finite prefix of satisfies , i.e., .
Recall that the semantics of requires traces of non-zero length only (see Section 2). So we only need , instead of , ignoring the empty word. By abuse of notation, we let denote both the prefix language and its corresponding automaton, called the prefix automaton.
We start by showing is -regular for formula :
Theorem 4.1 (Prefix automata: Upper bound)
For an formula , the language is -regular. The Büchi automaton recognizing has states.
Proof
Given formula , we construct a DBA for as follows:
-
1.
Construct a DFA for , i.e., .
We require to be complete in the sense that for every state and every alphabet , there exists a successor .
-
2.
Obtain a DBA by converting all accepting states of to accepting sink states in . For this, replace all outgoing transitions from all accepting states in with self loops on all letters.
Formally, replace every in DFA with in DBA , for all and . For all other states, let behaves identically to .
-
3.
Obtain the desired Büchi automaton by swapping accepting and non-accepting states of .
Since is a DBA with accepting sink states, is the complement of . Hence, it suffices to show that accepts iff there exists a finite prefix of that satisfies . Clearly, then must have a finite-prefix satisfying since the accepting states of and are identical. Conversely, we need to show that despite and being different, will accept all words that contain a finite prefix satisfying . For this, we show that for every such word, retains the transitions to accept the shortest prefix satisfying . Details can be found in the appendix. Finally, the number of states of are bounded by those of which is doubly exponential in [13]. ∎
Observe that the Büchi automaton constructed above is deterministic. One of our key discoveries is that the doubly exponential blow-up appears even in the construction of NBAs for , demonstrating that the blow-up is fundamentally unavoidable. Theorem 4.2 presents such an formula to demonstrate the blow-up. The rest of the section builds up to that construction.
We observe that the blow-up is caused by the combination of two aspects: First is the universal quantification on prefixes of words in ; Second is the ability of an formula to identify the -th last positions of finite words using the X (Next) modality. At first, we identify an -regular language, parameterized with , such that all NBAs accepting the language have at least states. Let and . Consider the language where
where , and . Intuitively, consists of infinite words that are (a) split into two parts by a special character “” and (b) all words of the form appearing after “” must have appeared before “”, for all -length words . Essentially, is a bit-level adaption of the language where if digits appearing in are a subset of digits appearing in , where and for . Obviously, the words and are good prefixes of a word when . There are also less obvious good prefixes, such as a permutation of followed by the letter . We need to recognize all good prefixes in order to accept the language . So, it is necessary to keep track of the digits (i.e., subsets of ) that the automaton has seen so far in an input word. Hence, the NBA of needs states. The same proof can be adapted to show that the NBA of consists of states. We defer a full proof to the supplemental material.
Next, we need to identify a regular language such that, by abuse of notation, corresponds to and can be represented by an formula of polynomial length in the parameter . A natural choice would be to let to be the finite-word version of . In other words, s.t. if appears in then must have appeared in for all and . The issue is that cannot be represented by a short formula for the same reason why cannot be expressed by a short formula.
We need to be a simpler language. The roadmap would be to leverage the universal quantification over all prefixes to generate . This is also where we leverage the ability of to refer to the last -th positions of a finite trace. Keeping these goalposts, we define regular language as
where and . Intuitively, by applying universal quantification on all finite-length prefixes, focusing on the last characters of words in is sufficient to ensure that every occurrence of the form after the symbol “” appears in the portion before the “”.
There is one last caveat. There are infinitely many prefixes of words in that may not contain the symbol . This issue can be easily remedied by including words without symbol to both languages. We overload the notation of to refer to the prefix language of a language over finite words . Then,
Lemma 1
Let and be as defined above. Then
Proof (Proof Sketch)
To see why , observe that the prefixes of a word either contain the symbol or they don’t. If the prefix falls under the latter, then the prefix is contained in . Otherwise, if the last characters are not in the form for then the prefix is contained in by definition of . If the last characters are in form for , then, by properties of words in , must have appeared before . Once again, the prefix is contained in . Thus, all prefixes of are contained in .
The converse, i.e., , can be proven by a similar case-by-case analysis. Details can be found in the appendix. ∎
The last piece is to show that the language can be expressed using an formula of length polynomial in , as shown below:
Theorem 4.2 (Prefix automata: Lower bound)
There exists an formula such that the number of states in all NBAs for is .
Proof
Let and . Let and be as defined above.
Since all NBAs of are of size and is disjoint from by containing the “&” symbol, it is easy to show that all NBAs of require states as well.
From Lemma 1, it is sufficient to show that can be represented by an formula of length . So, let us construct the desired formula . By abuse of notation, let the propositions be given by with the interpretation that the symbol holds when its proposition is true. Recall that a letter in the finite alphabet corresponds to a valuation over the atomic propositions . For instance, is interpreted as the valuation over . Then, the formula is a conjunction of the following three:
-
(R1).
At all times, only one proposition can be true.
-
(R2).
If “” holds at some place, it occurs exactly once.
-
(R3).
If “” holds at some place, then if the end of the word has the form , for , must have appeared before “”.
The formulation of (R1), denoted by , is quite straightforward and has been deferred to the supplementary material. The formulation of (R2) is , where expresses that occurs exactly once:
Intuitively, the symbol is not seen until it is seen somewhere, after which either the trace terminates (i.e., holds) or the trace does not see globally (i.e., holds). In fact, we also have .
To express (R3), we first introduce two formulas. The first is to express that the end of the word has the form . The second is to express that the word must appear before . So, (R3) is expressed by
For , we introduce shorthands, namely , and . Note that is true only at the -th last position of a trace and enforces that the current and next positions have the form for . Then,
Also,
Intuitively, when defining , we assume that we are standing at the first position of a word of the form that appears before . So, we require that holds and later holds. Next, we require the same word to appear at the end. So we require that if in the -th position, (resp. ) holds, at the -th position from where holds, (resp. ) must also hold. This is formulated as .
Finally, the whole formula is given as follows:
Clearly, when does not hold, all words satisfying would be in . If holds, then all words should meet (R2) and (R3). One can easily verify that specifies the language . Thus, .
Last but not the least, the length of is in since has length of . ∎
Note that the formulation makes heavy use of , which in turn uses the X modality. Essentially, serves as a unique identifier of a specific position at the end of all traces. This enables us to anchor at that location without any artificial constructs and to express the desiderata accordingly. This is a crucial difference between and .
4.2 Prefix automata for Fragment
In this section, we show that a singly exponential construction of NBAs is possible for a fragment of formulas. Through an exposition of the prefix language for fragments of , we highlight some of the peculiarities of the prefix language. Consider the fragment of , denoted as , which permits all but the R (Release) modality and allows and on literals only, as defined below:
where . We show that the prefix language of this fragment is equivalently represented by an formula of the same size, hence its NBA is singly exponential in the size of the formula. The said formula can be obtained using the translation described below (Since and share the same syntax, to avoid confusion, we add the subscript to temporal operators in , indicating that we have . For instance, Globally in becomes ):
-
•
,
-
•
,
-
•
-
•
-
•
-
•
The insight behind this translation is to identify that the criteria for a formula to hold on all finite-length prefixes simplifies to the formula holding on a prefix of length one. The proof is presented below:
Lemma 2
Let and let be as defined above. Then, and .
Proof
Trivially, holds. We prove that by structural induction on . In the interest of space, we skip the base cases ( and ). We also skip the and G modalities, as they are intuitive. We present the argument for X, N, F, and U. The full proof has been deferred to the appendix.
We set up notations: for , let denote subsequences of for . So, is the -length prefix of for . By inductive hypothesis (I.H.), we assume for .
- Case :
-
The critical observation is that for to hold on all finite prefixes, must hold on the prefix of length 1, which in turn is possible only if the first position of the word satisfies . Formally, first we show that . Let . Then, in particular . This is possible only if . Thus, for all , we get . So, . By I.H., . By translation, this means . Next, we show . Let . By translation, . By I.H., . Now, if holds, then also holds for all non-zero lengths. Hence, .
- Case :
-
As earlier, the critical observation is for to hold on a prefix of length one. For this, must hold. The proof is similar to the earlier case.
- Case :
-
The issue is that can never be true on a word of length one, since there does not exist a next position on length one words. Hence, .
- Case :
-
N (Weak Next) doesn’t have the issue faced by X. If a word is of length one, trivially holds. For words of all other lengths, it requires to hold. Formally, first we show that . Let . Then, by semantics of , it follows that the second position on must satisfy , i.e., . In particular, for all , . So, . By I.H., . Hence, . Conversely, let . By translation, . Hence, by I.H., we get for all , and since . In other words, .
∎
An immediate consequence of Lemma 2 is that the prefix automata for are singly exponential in the size of the formula [33]:
Corollary 1
Let . The NBA for contains states.
Note that, in all the cases above, every conjunct holds on all finite prefixes. This may not be true if (or) is permitted in the formula. For example, consider . Now, the word since the prefix of length one satisfies and all other prefixes satisfy . Hence, with disjunction, different prefixes can satisfy different disjuncts. In fact, the formula for is . However, such translations may increase the formula length because of duplicating the formula under modality. An open problem here is to identify the largest fragment for which the prefix automata have only singly exponential blow-up. This goes hand-in-hand with uncovering the core behind the doubly exponential blow-up for prefix automata.
5 Complexity of Model Checking
We present the complexity of model checking. Section 5.1 develops the lower bound for model checking non-terminating systems and Section 5.2 presents the completeness argument for both terminating and non-terminating systems.
5.1 EXPSPACE Lower Bound for Non-terminating Systems
We prove EXPSPACE-hardness of model checking of non-terminating systems by a polynomial-time reduction from the problem of whether an exponential-space Turing machine accepts an input word . The components of the Turing machine are defined as follows:
-
•
is the set of states and is the initial state.
-
•
is the tape alphabet, which is assumed to include the blank symbol .
-
•
is the transition function. means that if the machine is in state and the head reads symbol , it moves to state , writes symbol , and moves the head in direction .
-
•
is the set of accepting states. The machine accepts if it reaches a state in .
Since is an exponential-space Turing machine, we can assume that its tape has cells, where is the size of the input and is a constant.
5.1.1 High-Level Idea
Given a Turing machine and an input , our reduction will construct a non-terminating system and an formula s.t. accepts iff every execution of has a finite prefix that satisfies , i.e., .
In this reduction, we will encode runs of the Turing machine as label sequences of the system. A cell in the tape is encoded as a sequence of propositional assignments. The first assignment encodes the content of the cell, which can be either a symbol or a symbol along with a state , the latter indicating that the head is on that cell and is in state . The remaining assignments encode the position of the cell in the tape as a -bit number (since the tape has cells). The concatenation of cells encodes a configuration of the Turing machine. Therefore, each configuration is encoded by assignments in total. The concatenation of configurations encodes a run of the Turing machine. Note, however, that for such a run to be consistent with the run of on , certain consistency conditions must hold:
-
1.
For every configuration, the encoding of the position of the first cell must be , and the encoding must increase by for each successive cell.
-
2.
The first configuration must start with on the tape and the head on the first cell and in the initial state .
-
3.
Successive configurations must be consistent with the transition function .
One way is to enforce all consistency conditions through the system . However, since each configuration consists of cells, this would require the system to have an exponential number of states. Therefore, to allow for a polynomial reduction, we enforce the consistency conditions through the formula .
For this, we construct an formula . where expresses the the consistency conditions and expresses the property of reaching an accepting configuration. Therefore, every execution with a finite prefix that satisfies is either inconsistent or an accepting run of on . Since is deterministic, there is exactly one execution of that is consistent with . Every other execution will necessarily satisfy , and this execution will satisfy if and only if accepts . Therefore, if every execution of has a finite prefix that satisfies , then the run of on input is accepting, and vice-versa.
We now provide the details of the system and the formula .
5.1.2 Atomic Propositions
The propositions used by system are the following:
-
•
indicates that the current assignment represents the first part of the cell encoding, encoding the cell’s content.
-
•
, for , indicates that the current assignment represents the -th bit of the encoding of the cell’s position. Only one of is true at any given time.
-
•
, for , indicates that the content of the cell is (a tape symbol with or without the head). This proposition can only be true if is true.
-
•
gives the current bit of the cell’s position. This proposition can only be true if is false.
5.1.3 The Model
We define the transition system as follows:
-
•
-
•
-
•
-
•
if and only if one of the following is true (for some ):
-
–
and .
-
–
for , and .
-
–
and .
-
–
-
•
-
•
The propositional alphabet consists of the set of propositions described above. The states of the are either of the form , where is the content of a cell, or for , where is the current bit in the encoding of the cell’s position. The initial state is , indicating that a) this is the first part of the cell’s encoding, b) the head is on this cell, c) the machine is in the initial state , and d) the cell is blank (this should be the cell immediately to the left of the input word ).
The transition relation ensures only that the system progresses consistently from part 0 of the encoding to part 1, part 2, part 3, and so on until part , after which it resets back to part 0 (of the next cell). Note that the values of and are unconstrained, as these will be handled by the formula . Observe the three consistency conditions required for runs of are not wired into the model.
Finally, the labeling function simply converts the state into an appropriate propositional representation.
5.1.4 The Formula
We now construct the formula over the propositional alphabet . As mentioned before, we want to be such that, if an execution of the system has a prefix that satisfies , then either that execution violates a consistency condition or it is an accepting run. To achieve this, we construct . is defined as follows:
It is easy to see that an execution of has a prefix that satisfies iff that execution reaches a state where is an accepting state of .
Meanwhile, we define as a conjunction of formulas, such that if an execution has a prefix that violates one of these formulas then the execution is inconsistent, and every inconsistent execution has a prefix that violates one of these formulas. We classify these formulas into three groups, one for each of the three consistency conditions described above:
-
(C1).
Consistency within a configuration (the binary encoding of each cell’s position is correct)
-
(C2).
Consistency with the input word (the first configuration is correct)
-
(C3).
Consistency with the transition function (every configuration follows from the previous one)
The first two conditions (C1) and (C2) are relatively straightforward to encode as formulas of polynomial size. For details, refer to the appendix.
The third condition (C3) is where the biggest challenge lies. This condition requires reasoning about changes from one configuration to the next. The difficulty lies in accessing the segment that represents the same cell in the next configuration using a polynomial-sized formula. Recall that a cell is represented by assignments in the trace and each configuration is composed of cells. Since the size of each configuration is exponential, formulas may require exponential size. For instance, if the segment representing a cell begins at assignment in the trace, then the same cell in the next configuration will start at assignment . Referring to this assignment directly in the formula would require nested X operators. Alternatively, the cell in the next configuration can be identified by being the first cell where the binary encoding of its position on the tape is the same as the current cell. However, this may require enumeration on all possible assignments of the bits.
To circumvent this problem and compare corresponding cells in two different configurations using a formula of polynomial size, we take advantage of the fact that we are dealing with finite prefixes of the trace. The insight is that we can use the last position in the trace as an anchor, so that instead of having to find the cell in the next configuration with the same position encoding, we can instead look at the last cell in the trace and test if a) it is in the next configuration, and b) it has the same position encoding. Since the formula is checked for every prefix, eventually we will find a prefix where this holds. We can then check if the contents of the cells are consistent with the transition function.
We now go into details of the formula for (C3). Consistency condition (C3) says that every configuration follows from the previous one according to ’s transition function . As mentioned before, to ensure that we get a formula of polynomial size, the formula that we construct actually expresses the following condition: for all cells in the prefix, if the last cell of the prefix is in the same position as but in the next configuration, then follows from based on the transition function. Since the formula must hold for all prefixes, its satisfaction implies the original consistency condition.
We start by defining the useful shorthand , which denotes that holds positions before the end of the prefix (e.g. means that holds at the last position of the prefix). This is expressed by saying that at some point in the future holds, and positions after that is the last position of the prefix (by the semantics of , only holds at the last position). We then define the formula , which checks if the cell in the current position corresponds to the last cell of the prefix, as follows:
where denotes the start of a new configuration (a cell whose position in the tape is encoded as ). expresses that (a) we are at the start of a cell (); (b) the last positions of the prefix encode another cell (); (c) and are in the same tape position (); and (d) we start a new configuration exactly once between and (). In other words, and are the same cell in successive configurations. We can then encode the consistency condition by the formula
where each of , , , and expresses one way in which the contents of the cell can change (or not change) in the next configuration:
-
•
expresses that if the head is on (), then in the head must have moved to a different cell and written the appropriate symbol given by the transition relation ()
-
•
expresses that if the head is on the cell to the right of (), and the transition relation requires it to move left, then in the next configuration the head must have moved to ()
-
•
expresses that if the head is on the cell to the left of (), and the transition relation requires it to move right, then in the next configuration the head must have moved to ()
-
•
Finally, expresses that if the head is neither on nor on the cells adjacent to it (), then the contents of the cell don’t change ()
Note that in the latter two formulas is the cell to the right of the current cell () this is necessary so that and can refer to the cell to the left of . Formula for , , , and have been presented in the appendix. The size of each formula is polynomial in the size of the transition relation of the Turing Machine.
Theorem 5.1 ( Model Checking. Lower bound)
model checking of non-terminating systems is EXPSPACE-hard.
Proof
Let the non-terminating system and formula be as described above. We show that an exponential-space Turing machine accepts an input word iff every execution of has a finite prefix that satisfies , i.e., . Note that since is deterministic, its execution on the input word is unique. Therefore, there is exactly one trace of that simulates the execution of on . By construction, a trace has a finite prefix that satisfies iff that trace violates one of the consistency conditions. This holds for every trace of except . So, because no finite prefix of satisfies , model checks if and only if has a prefix that satisfies , which means that eventually reaches an accepting state. Since simulates on , this happens if and only if accepts . ∎
5.2 Final Complexity Results
Finally, we present the complexity of model-checking non-terminating systems:
Theorem 5.2 (MC. Non-terminating. Complexity)
model checking of non-terminating systems is EXPSPACE-complete.
Proof
Recall, a non-terminating system satisfies an formula iff . A naive algorithm would explicitly construct and require doubly exponential space in the size of . Instead, the approach is to construct on-the-fly in exponential space and simultaneously evaluate the emptiness of . Given all three steps in the construction of are amenable to on-the-fly constructions, this procedure follows standard on-the-fly procedures [32]. Thus, model checking of non-terminating models is in EXPSPACE. Theorem 5.1 establishes the matching lower bound. ∎
This result is unexpected as it implies that model checking is exponentially harder than model checking for non-terminating systems, contrary to the prior perception that problems in tend to be as hard if not easier than their counterparts in (See Table 1).
Next, we present the complexity of model-checking terminating systems:
Theorem 5.3 (MC. Terminating. Complexity)
model checking of terminating systems is PSPACE-complete.
Proof
Recall that a terminating system satisfies an formula if every execution of satisfies . So, iff where is the NFA for . Since the NFA is exponential in the size of the formula [13], an on-the-fly algorithm for non-emptiness checking of can be performed in PSPACE. PSPACE-hardness can be proven by a trivial reduction from satisfiability, which is PSPACE-complete [13]. ∎
For synthesis, these results imply that it is much harder to verify a non-terminating transducer than a terminating transducer. Hence, to test the correctness of an synthesis tool by verifying its output strategy, it would be better for synthesis tools to generate terminating transducers. This, to the best of our knowledge, is the first theoretically sound evidence to use one transducer over the other in synthesis.
6 Concluding Remarks
Motivated by the recent surge in synthesis tools that are rarely verified for result correctness, this work is the first to investigate the problem of model checking. Noting that synthesis can generate both terminating and non-terminating transducers, we examine model checking for both possibilities. Our central result is that model checking of non-terminating models is exponentially harder than terminating models. Their complexities are EXPSPACE-complete and PSPACE-complete, respectively. This is surprising at first as it implies that model checking is harder than model checking for non-terminating models, contrary to the expectation from prior comparisons between and (See Table 1). In addition to being of independent interest, our results immediately lend several broad impacts:
-
1.
They present the first theoretical evidence for the use of terminating transducers to represent the synthesized strategies in synthesis, as it would be easier to verify the correctness of the synthesized transducer.
-
2.
Implementations of our model checking algorithms could be deployed in large-scale competitions such as the track in SYNTCOMP 2023.
-
3.
They invite further exploration into vs , as it breaks the prior perception that problems in are as hard if not simpler than their counterparts.
These results inspire future work in the development of practical tools for model checking and synthesis as well as the development of model checking in more complex domains such as probabilistic models or under asynchrony [4, 3]. It would be interesting to see how the practical implementations compare for model checking under terminating and non-terminating semantics, even though terminating models are preferred in theory.
Acknowledgements
We thank the anonymous reviewers for their valuable feedback. This work has been supported by the Engineering and Physical Sciences Research Council [grant number EP/X021513/1], NASA 80NSSC17K0162, NSF grants IIS-1527668, CCF-1704883, IIS-1830549, CNS-2016656, DoD MURI grant N00014-20-1-2787, and an award from the Maryland Procurement Office.
References
- [1] Baier, J.A., McIlraith, S.: Planning with temporally extended goals using heuristic search. In: ICAPS. pp. 342–345. AAAI Press (2006)
- [2] Bansal, S., Li, Y., Tabajara, L., Vardi, M.: Hybrid compositional reasoning for reactive synthesis from finite-horizon specifications. In: AAAI. vol. 34, pp. 9766–9774 (2020)
- [3] Bansal, S., Namjoshi, K.S., Sa’ar, Y.: Synthesis of asynchronous reactive programs from temporal specifications. In: Computer Aided Verification: 30th International Conference, CAV 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 14-17, 2018, Proceedings, Part I 30 (2018)
- [4] Bansal, S., Namjoshi, K.S., Sa’ar, Y.: Synthesis of coordination programs from linear temporal specifications. Proceedings of the ACM on Programming Languages (POPL) (2019)
- [5] Blum, M., Kannan, S.: Designing programs that check their work. Journal of the ACM 42(1), 269–291 (1995)
- [6] Brafman, R.I., De Giacomo, G.: Planning for LTLf/LDLf goals in non-markovian fully observable nondeterministic domains. In: IJCAI. pp. 1602–1608 (2019)
- [7] Camacho, A., Icarte, R.T., Klassen, T.Q., Valenzano, R.A., McIlraith, S.A.: LTL and beyond: Formal languages for reward function specification in reinforcement learning. In: IJCAI. vol. 19, pp. 6065–6073 (2019)
- [8] De Giacomo, G., Favorito, M.: Compositional approach to translate LTLf/LDLf into deterministic finite automata. In: Proceedings of the International Conference on Automated Planning and Scheduling. vol. 31, pp. 122–130 (2021)
- [9] De Giacomo, G., Favorito, M., Li, J., Vardi, M.Y., Xiao, S., Zhu, S.: Ltlf synthesis as and-or graph search: Knowledge compilation at work. In: Proc. of IJCAI (2022)
- [10] De Giacomo, G., Iocchi, L., Favorito, M., Patrizi, F.: Foundations for restraining bolts: Reinforcement learning with LTLf/LDLf restraining specifications. In: ICAPS. vol. 29, pp. 128–136 (2019)
- [11] De Giacomo, G., Rubin, S.: Automata-theoretic foundations of fond planning for LTLf and LDLf goals. In: IJCAI. pp. 4729–4735 (2018)
- [12] De Giacomo, G., Vardi, M.: Synthesis for LTL and LDL on finite traces. In: IJCAI. pp. 1558–1564. AAAI Press (2015)
- [13] De Giacomo, G., Vardi, M.Y.: Linear temporal logic and linear dynamic logic on finite traces. In: IJCAI. pp. 854–860. AAAI Press (2013)
- [14] De Giacomo, G., Vardi, M.Y.: LTLf and LDLf synthesis under partial observability. In: IJCAI. vol. 2016, pp. 1044–1050 (2016)
- [15] Duret-Lutz, A., Renault, E., Colange, M., Renkin, F., Aisse, A.G., Schlehuber-Caissier, P., Medioni, T., Martin, A., Dubois, J., Gillard, C., Lauko, H.: From spot 2.0 to spot 2.10: What’s new? In: Shoham, S., Vizel, Y. (eds.) Computer Aided Verification - 34th International Conference, CAV 2022, Haifa, Israel, August 7-10, 2022, Proceedings, Part II. Lecture Notes in Computer Science, vol. 13372, pp. 174–187. Springer (2022)
- [16] Esparza, J., Křetínskỳ, J., Sickert, S.: A unified translation of linear temporal logic to -automata. Journal of the ACM (JACM) 67(6), 1–61 (2020)
- [17] Favorito, M.: Forward ltlf synthesis: Dpll at work. arXiv preprint arXiv:2302.13825 (2023)
- [18] He, K., Lahijanian, M., Kavraki, L.E., Vardi, M.Y.: Reactive synthesis for finite tasks under resource constraints. In: IROS. pp. 5326–5332. IEEE (2017)
- [19] Jacobs, S., Perez, G.A., Schlehuber-Caissier, P.: The temporal logic synthesis format TLSF v1.2 (2023)
- [20] Křetínskỳ, J., Meggendorfer, T., Sickert, S.: Owl: a library for omega-words, automata, and LTL. In: ATVA. pp. 543–550. Springer (2018)
- [21] Kuehlmann, A., van Eijk, C.A.: Combinational and sequential equivalence checking. Logic synthesis and Verification pp. 343–372 (2002)
- [22] Nicola, R.D., Vaandrager, F.W.: Action versus state based logics for transition systems. In: Guessarian, I. (ed.) Semantics of Systems of Concurrent Processes, LITP Spring School on Theoretical Computer Science, La Roche Posay, France, April 23-27, 1990, Proceedings. Lecture Notes in Computer Science, vol. 469, pp. 407–419. Springer (1990)
- [23] Pnueli, A.: The temporal logic of programs. In: FOCS. pp. 46–57. IEEE (1977)
- [24] Pnueli, A., Rosner, R.: On the synthesis of a reactive module. In: POPL. pp. 179–190 (1989)
- [25] Safra, S.: On the complexity of omega -automata. In: [FOCS. pp. 319–327 (1988)
- [26] Siegel, M., Pnueli, A., Singerman, E.: Translation validation. In: Proc. of TACAS. pp. 151–166 (1998)
- [27] Sistla, A.P., Clarke, E.M.: The complexity of propositional linear temporal logics. Journal of the ACM (JACM) 32(3), 733–749 (1985)
- [28] Tabajara, L.M., Vardi, M.Y.: Partitioning techniques in LTLf synthesis. In: IJCAI. pp. 5599–5606. AAAI Press (2019)
- [29] Tabakov, D., Rozier, K., Vardi, M.Y.: Optimized temporal monitors for SystemC. Formal Methods in System Design 41(3), 236–268 (2012)
- [30] Thomas, W., et al.: Automata, logics, and infinite games: a guide to current research, vol. 2500. Springer Science & Business Media (2002)
- [31] Vardi, M.Y.: The Büchi complementation saga. In: STACS. pp. 12–22. Springer (2007)
- [32] Vardi, M.Y., Wolper, P.: An automata-theoretic approach to automatic program verification. In: LICS. IEEE Computer Society (1986)
- [33] Vardi, M.Y., Wolper, P.: Reasoning about infinite computations. Inf. Comput. 115(1), 1–37 (1994)
- [34] Wells, A.M., Lahijanian, M., Kavraki, L.E., Vardi, M.Y.: LTLf synthesis on probabilistic systems. arXiv preprint arXiv:2009.10883 (2020)
- [35] Wolper, P., Vardi, M.Y., Sistla, A.P.: Reasoning about infinite computation paths. In: FOCS. pp. 185–194. IEEE (1983)
- [36] Zhu, S., Tabajara, L.M., Li, J., Pu, G., Vardi, M.Y.: Symbolic LTLf synthesis. In: IJCAI. pp. 1362–1369. AAAI Press (2017)
Appendix
6.1 Automata over Finite and Infinite words
A (nondeterministic) automaton is a tuple where is a finite set of symbols (called an alphabet), is a finite set of states, is the initial state, is the set of accepting states, and is the transition relation. An automaton on finite words is called a nondeterministic finite-state automaton (NFA), while an automaton over infinite words is called a nondeterministic Büchi automaton (NBA). An NFA is said to be deterministic (DFA) if for each state and letter , . Deterministic Büchi automata (DBAs) are defined analogously.
Let be an NFA. For a finite word , a run of over is a finite state sequence such that and for all , holds. A run is an accepting run if . A word is accepted by if has an accepting run over .
Let be an NBA. Similarly, a run of over an infinite word is an infinite sequence such that and for all , . Let denote the set of states that occur infinitely often in run . A run is an accepting run in if . An infinite word is accepted by if has an accepting run over .
We denote by (resp. ) the set of all words accepted by (resp. ). It is known that NFAs/DFAs recognize exactly regular languages while NBAs accept exactly -regular languages. In the remainder of the paper, we denote by the -th element in the sequence .
6.2 Semantics of and
We first give the semantics of formulas. A finite sequence over is said to satisfy an formula over , denoted by , if where for all positions , is defined inductively on as follows:
-
•
,
-
•
,
-
•
iff where is the -th element of for all ,
-
•
iff ,
-
•
iff and ,
-
•
iff or ,
-
•
iff and ,
-
•
iff there exists s.t. and , and for all , , we have ,
-
•
iff there exists s.t. and ,
-
•
iff for all s.t. , .
To obtain the semantics of formulas, must be an infinite sequence. Thus, the length of , denoted as , is . It actually means that we can just drop all restrictions that the integers need to be less than meant for semantics We use a subscript for all modalities to distinguish with their counterparts. For all positions , is defined inductively on as follows:
-
•
,
-
•
,
-
•
iff where is the -th element of for all ,
-
•
iff ,
-
•
iff and ,
-
•
iff or ,
-
•
iff ,
-
•
iff there exists s.t. and , and for all , , we have ,
-
•
iff there exists s.t. and ,
-
•
iff for all s.t. , .
6.3 Proof of Theorem 4.1
Theorem 4.1. For formula , let be as defined above. Then,
-
1.
is a safety language.
-
2.
is -regular. NBA representing consists of states.
Proof of Theorem 4.1- 1.
A language is a safety language if for every word there exists a finite-prefix of such for all the word . Such prefixes are referred to as bad prefix.
Consider such that . By definition of , there exists an s.t. the finite-prefix . Clearly, every infinite extensions of will also not be contained in , i.e. for all , . Hence, is a safety language.
Proof of Theorem 4.1- 2.
Given formula , the NBA for can be constructed as follows:
-
1.
Construct a DFA for , i.e., .
We require to be complete in the sense that for every state and every alphabet , there exists a successor .
-
2.
Obtain a DBA by converting all accepting states of to accepting sink states in . For this, replace all outgoing transitions from all accepting states in with self loops on all letters.
Formally, replace every in DFA with in DBA , for all and . For all other states, let behaves identically to .
-
3.
Obtain the desired NBA by swapping accepting and non-accepting states of .
Since is a DBA with all accepting states as sink states, swapping accepting and non-accepting states results in its complementation. Hence, it is sufficient to show that accepts the complement of . In other words, accepts iff there exists a finite-prefix of that satisfies . Clearly, then must have a finite-prefix satisfying since the accepting states of and are identical and all but outgoing transitions from accepting states are retained. Conversely, let such that it contains a finite prefix that satisfies . Despite and being different, we need to show that is accepted. Let be the shortest prefix of satisfying . Since is a DFA, has a unique run in . This run also appears in because all transitions appearing in this run in are retained in as none of them are outgoing transitions from accepting states (if it weren’t so, then would not have been the shortest prefix of that satisfies ). Further, since accepting states in are sink states, . Finally, the number of states of are bounded by those of which is doubly exponential in [13]. ∎
6.4 Proof of Lemma 1
Lemma 1 Let and be as defined above. Then
Proof
First, we show that . Trivially, all prefixes of words in are contained in since “” does not appear in any of them. It remains to show that . Let . We establish that all prefixes of are contained in . We perform case analysis of prefixes:
-
1.
When the prefix is a prefix of . These prefixes are contained in since “” does not appear in the prefix.
-
2.
When prefix of is of the form . Now, since it contains exactly one “” and the end of is not in the form for .
-
3.
When prefix is of the form but does not end in for . For the same reason as above, .
-
4.
When prefix is of the form and ends in for . Since , we know that every appearing in “” must have appeared in , for . Since is a prefix of and is at the end of , we get that must have also appeared in . Hence, .
Hence, .
Next, we prove . First, observe that for , can contain at most one occurrence of “”. By case analysis:
-
1.
If does not contain “”, then clearly, .
-
2.
Otherwise, the word is of the form where and . Either there are no occurrences of in , for . In this case, vacuously.
Otherwise, there are occurrences of in . Let be an arbitrary prefix of that ends in . Since , . Thus, must have appeared in as well. Finally, since there are only finitely many possibilities of words of the form , we conclude that every occurrence of in must have also appeared in . Hence, .
Hence, .
Therefore . ∎
6.5 Encoding of (R1) from Theorem 4.2
6.6 Proof of 2
2 Let and let be as defined above. Then, and .
Proof
Trivially, holds. We prove that by structural induction on . Let where is the -th letter in . Recall, denotes the subsequence of for . Then
-
•
(resp. ). By definition, . It is trivial that iff since either or .
-
•
. Then . Assume that . By LTL semantics, and . It follows that and , based on induction assumption. It means that for all , and . Thus, for all . We then have that .
Assume that . It follows that for all , , i.e., and . By induction assumption, we have that and . Consequently, , i.e., .
-
•
. Then . By induction assumption, we have that iff .
Assume that , i.e., . It follows that for every , . Obviously, for every , . Consequently, .
Assume that . Then for every , . By semantics of , , i.e., . It follows that for every , we also have that , indicating that . By induction assumption, . So we are done for this case.
-
•
. Then . The proof is quite similar to the one for . By induction assumption, we have that iff .
Assume that , i.e., . It follows that for every , . Obviously, for every , since . Consequently, .
Assume that . Then for every , . By semantics of , , i.e., . It follows that for every , we also have that , indicating that . By induction assumption, . So we are done for this case.
-
•
. Then, . By induction assumption, we have that we have that iff .
Assume that . By semantics of , for every . In other words, we have that for all . It follows that for all , according to definition of languages. Then we have that for all in semantics. Obviously, .
Assume that . By definition of languages, we have that for all . By semantics of , we have for all (The last position of the word needs to satisfy ); Also, for all . By definition of languages, we have that for all . Based on induction assumption, we have for all . It follows that . Thus, we have done for this case.
-
•
. Then . By induction assumption, iff .
Assume that . Then for all , including . By semantics, it follows that since is not the last position when . It follows that we have that for all . So, , i.e., based on induction assumption. Then we have , i.e., .
Assume that . Then . By induction assumption, we have . It follows that by definition of languages. Then . Clearly, we have for all , including when . Consequently, we have
-
•
. Then . It is impossible for a word to hold since as there is no next position at position . Therefore, since there are no words satisfying false.
∎
6.7 Missing details from Section 5.1
6.7.1 Consistency conditions (C1) and (C2)
We present the encoding of the first two consistency conditions (C1) and (C2). Recall, we require the following two:
-
(C1).
Consistency within a configuration (the binary encoding of each cell’s position is correct)
-
(C2).
Consistency with the input word (the first configuration is correct)
Condition (C1) only needs to reason about adjacent cells in the same configuration. If and are the binary encodings of the positions of two adjacent cells, and is a propositional formula capturing that encodes the successor (mod ) of (see below for details), then the formula
expresses that if we start at the beginning of the encoding of a cell () and the prefix is long enough to include the entirety of the successor cell (), then holds between the encodings of the two cells (note that is given by and is given by ). Similarly, the formula expresses that the encoding of the first cell’s position is .
Condition (C2) only requires looking at the cell contents that should contain the input word in the first configuration, plus ensuring that all other cells on the tape are blank. Checking the cells that should contain the input word can be expressed by the formula
meaning that if the prefix is long enough to cover all cells (), then the content of the -th cell is (), for all from to . Ensuring that all other cells are blank can likewise be expressed by a formula of polynomial size (see below for details).
Consistency within a configuration.
As explained above, the first consistency condition can be represented by a conjunction of the formula , which expresses that the encoding of the first cell’s position is , and the formula , which expresses that the encoded position of each successive cell is the successor of the previous one. The propositional formula can be defined as
which expresses the successor relation between two binary numbers and (note that we consider the least significant digit). The subformula expresses that the least significant digit is flipped, while (where is the exclusive-or operator) expresses that the -th digit is flipped if there is a carry (which only happens when the -th digit has flipped from to ).
Consistency with the input word.
The second consistency condition is composed of two formulas. As explained above, the formula expresses that the first cells of the first configuration contain the input word . The second formula ensures that all other cells are blank, and can be expressed by
meaning that if the prefix is long enough to reach the -th cell (), the contents of every cell from this point on must be blank () until we reach a new configuration, indicated by the encoding of the cell position resetting back to (). Note that the “zeroth” cell (the cell where the head starts, immediately before the input word) is also blank, but this is enforced by the transition relation of .
6.7.2 Missing formulas for (C3)
-
•
expresses that if the head is on (), then in the head must have moved to a different cell and written the appropriate symbol given by the transition relation ()
-
•
expresses that if the head is on the cell to the right of (), and the transition relation requires it to move left, then in the next configuration the head must have moved to ()
-
•
expresses that if the head is on the cell to the left of (), and the transition relation requires it to move right, then in the next configuration the head must have moved to ()
-
•
Finally, expresses that if the head is neither on nor on the cells adjacent to it (), then the contents of the cell don’t change ()
Note that in the latter two formulas is the cell to the right of the current cell () this is necessary so that and can refer to the cell to the left of .
6.8 NBA with at least states
Let and . Consider the language where
where , and . Essentially, is a bit-level adaption of the language where if digits appearing in are a subset of digits appearing in , where and for . We show that all NBA of consists of at least states. This proof can easily be adapted to show that all NBA of consists of states.
First, note that is a safety -regular language. Let be an (non-deterministic Büchi) automaton representing . Then, can be trimmed by removing all states that are unreachable from the initial state and at least one accepting state. Next, all states of the trimmed automaton can be converted to accepting states. Let us denote this automaton by . Clearly, and has fewer states than .
We claim that must have at least states. Suppose there are fewer than states. We will use the notation and to denote finite and infinite words over the digits s.t. and denote the set of digits appearing in and respectively. For a state in with outgoing transitions on , let be all the infinite words with paths starting in . Since all paths are accepting ( is a safety automaton), all finite words to must be of the form where and . Now, consider a word . We claim that all its accepting paths must pass through states of the form . Suppose has a path to a state with an outgoing transition on . Similar to for , let be defined for . We assume . Clearly, , since otherwise it would accept a word where . Furthermore, since otherwise will not have a path from . Hence, . Hence, for every , must have at least one unique state to accept words of the form . Thus, must have at least states. Subsequently, all automata of the language must contain at least states.