Abstract 1 Introduction 2 Preliminaries 3 NP-Hardness of Prime-DFA 4 Discussion References

Deciding DFA-Primality Is NP-Hard

Daniel Alexander Spenner ORCID Technische Universität Dortmund, Germany
Abstract

A DFA 𝒜 is composite if there exist DFAs 𝒜1,,𝒜t with (𝒜)=i=1t(𝒜i) such that each 𝒜i has strictly less states than the minimal DFA deciding (𝒜). Otherwise, it is prime.

Prime-DFA is the problem of deciding primality for a given DFA. It was defined by Kupferman and Mosheiff in 2015 and it was shown to be NL-hard and in ExpSpace.

This paper proves the NP-hardness of Prime-DFA, thereby making the first progress in closing this doubly-exponential gap. It proves the NP-hardness by a reduction from the propositional logic satisfiability problem. The correctness of the reduction relies on an involved characterization of primality for a class of DFAs which contains those that can occur in the reduction.

Keywords and phrases:
Deterministic finite automaton (DFA), Regular languages, Finite languages, Decomposition, Primality, NP-Hardness
Category:
Track B: Automata, Logic, Semantics, and Theory of Programming
Copyright and License:
[Uncaptioned image] © Daniel Alexander Spenner; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Regular languages
; Theory of computation Problems, reductions and completeness
Related Version:
Full Version: https://doi.org/10.48550/arXiv.2605.07031 [11]
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

We consider the primality of deterministic finite automata (DFA). Intuitively, the basic question is: Given a DFA 𝒜, are there a number of DFAs strictly smaller than 𝒜 itself that combined decide the same language as 𝒜? More formally, a DFA 𝒜 is composite if there exist DFAs 𝒜1,,𝒜t with (𝒜)=i=1t(𝒜i) such that the size of every 𝒜i is strictly smaller than the index of 𝒜. Otherwise, 𝒜 is prime. Here, the size of 𝒜 is the number of its states, while the index of 𝒜 is the size of the minimal DFA deciding (𝒜). Prime-DFA denotes the problem of deciding primality for a given DFA.

The notion of compositionality of finite automata was introduced in [8], although a similar but more restricted notion was already studied in [4]. With [8, Theorems 2.4 and 2.5], Prime-DFA is NL-hard and in ExpSpace. Up to now, progress in closing this surprisingly large doubly-exponential gap has proven elusive. In this paper, we improve the lower complexity bound of Prime-DFA.

Compositionality in general is an important notion in both practical and theoretical computer science [3, 12]. Regular languages and DFAs are key concepts of theoretical computer science and the question whether a DFA can be decomposed in this fashion seems natural and worth studying. Furthermore, the general idea of automaton decomposition can be motivated by LTL model checking, while a question related to automaton decomposition arises in the field of automaton identification. Both will be briefly discussed below.

Contributions.

We prove the NP-hardness of Prime-DFA by reducing the propositional logic satisfiability problem to Prime-DFA.

Given a formula Φ, the reduction yields a DFA 𝒜Φ so that every assignment for Φ can be associated with a word of a specific form which is accepted by 𝒜Φ if and only if the underlying assignment satisfies Φ. The proof that this is actually a reduction to Prime-DFA relies on an involved characterization of the compositionality of a class of DFAs which contains all DFAs of the form 𝒜Φ. Namely, we characterize the compositionality of “almost-acyclic” linear safety DFAs (essentially, DFAs whose states are linearly ordered, whose only rejecting state is a rejecting sink, who possess an accepting sink, and whose only cycles are its sinks). This characterization then shows that 𝒜Φ accepts a word of this specific form if and only if it is prime. This proves the correctness of the reduction.

Thus, the NP-hardness proof entails the construction of 𝒜Φ, the characterization of the compositionality of the mentioned DFA class, and the use of this characterization to link the satisfiability of Φ and the compositionality of 𝒜Φ. Additionally, we further exploit the characterization of the compositionality of “almost-acyclic” linear safety DFAs to prove that the restriction of Prime-DFA to such DFAs is NP-complete, meaning that the established lower bound is tight for this specific class of DFAs.

We attempt to give comprehensive proof sketches for these results in Section 3. The full version of this paper contains an additional section in its appendix [11, Appendix A]. There, we present the full argument with complete formal proofs.

Related Work.

As already mentioned, the notion of compositionality was introduced in [8], where the mentioned complexity bounds for Prime-DFA were established. This initial work was followed up by [6, 7, 10]. These works focused on restricted classes of DFAs, namely, unary DFAs, permutation DFAs, and acyclic DFAs and thereby finite languages, respectively. However, the initial complexity bounds for Prime-DFA remained unaltered.

The general idea of decomposing finite automata can be motivated by LTL model checking, where the validity of a specification, given as an LTL-formula, is checked for a system. The automata-based approach entails translating the specification into a finite automaton [13]. Since the LTL model checking problem is PSpace-complete in the size of the LTL-formula [1, Theorem 5.48], it is desirable to decompose the formula into a conjunction of subformulas. This can also be understood as decomposing the finite automaton corresponding to the formula.

A question related to the decomposition of automata arises in the field of automaton identification. The basic task here is, given a set of labeled words, to construct an automaton conforming to this set [5]. An interesting approach is to construct multiple automata instead of one, which can lead to smaller and more intuitive solutions [9].

However, the results obtained in this paper use decompositions with DFAs that are only slightly smaller than the given DFA (most often by just one state). For practical applications, decompositions into much smaller components might be more relevant.

2 Preliminaries

A deterministic finite automaton (DFA) is a 5-tuple 𝒜=(Q,Σ,qI,δ,F) where Q is a finite set of states, Σ is a finite non-empty alphabet, qIQ is an initial state, δ:Q×ΣQ is a transition function, and FQ is a set of accepting states. As usual, we extend δ to words: δ:Q×ΣQ with δ(q,ε)=q and δ(q,σ1σn)=δ(δ(q,σ1σn1),σn).

​​The run of 𝒜 on a word w=σ1σn starting in state q is the sequence q0,σ1,q1,,σn,qn with q0=q and qi=δ(qi1,σi) for each i{1,,n}. The initial run of 𝒜 on w is the run of 𝒜 on w starting in qI. The run of 𝒜 on w starting in q is accepting if qnF. Otherwise, it is rejecting. The DFA 𝒜 accepts w if the initial run of 𝒜 on w is accepting. Otherwise, it rejects w. The language (𝒜) of 𝒜 is the set of words accepted by 𝒜. We say that 𝒜 decides (𝒜). A language is regular if there exists a DFA deciding it. Since we only consider regular languages, we use the terms language and regular language interchangeably.

The size |𝒜| of 𝒜 is the number of states in Q. A DFA 𝒜 is minimal if (𝒜)() holds for every DFA with ||<|𝒜|. It is well known that, for every regular language L, there exists a canonical minimal DFA deciding L. The index ind(L) of L is the size of this canonical minimal DFA. The index of 𝒜 is the index of the language decided by 𝒜, thus ind(𝒜)=ind((𝒜)). Note that 𝒜 is minimal if and only if |𝒜|=ind(𝒜).

We borrow a few terms from graph theory. Let q0,σ1,q1,,σn,qn be the run of 𝒜 on w=σ1σn starting in q0. Then q0,,qn is a path in 𝒜 from q0 to qn. Thus, for two states q,q, there exists a path from q to q in 𝒜 if and only if there exists a wΣ with δ(q,w)=q. State q is reachable from q if there exists a path from q to q. Otherwise, q is unreachable from q. We say that q is reachable if it is reachable from qI. Otherwise, it is unreachable. A cycle in 𝒜 is a path q0,,qn in 𝒜 where q0=qn and n1. We call a state q a sink if δ(q,σ)=q for all σ, that is, if all out-q-transitions are self-loops.

We introduce the notions of compositionality and primality of DFAs and languages, following the definitions in [8]:

Definition 2.1.

For k1, a DFA 𝒜 is k-decomposable if there exist DFAs 𝒜1,,𝒜t with (𝒜)=i=1t(𝒜i) and |𝒜i|k for each i{1,,t}, where t1. We call such DFAs 𝒜1,,𝒜t a k-decomposition of 𝒜. We call 𝒜 composite if 𝒜 is k-decomposable for a k<ind(𝒜), that is, if it is (ind(𝒜)1)-decomposable. Otherwise, we call 𝒜 prime.  

When analyzing the compositionality of a given DFA 𝒜, it is sufficient to consider minimal DFAs strictly smaller than the minimal DFA of 𝒜 with (𝒜)(). Thus, we define α(𝒜)={ is a minimal DFA with ind()<ind(𝒜) and (𝒜)()}. Obviously, the DFA 𝒜 is composite if and only if (𝒜)=α(𝒜)(). We call a word w(α(𝒜)())(𝒜) a primality witness of 𝒜. Clearly, a DFA 𝒜 is composite if and only if it has no primality witness.

We say that a regular language is prime (composite) if its minimal automaton is prime (composite).

We denote the problem of deciding primality for a given DFA by Prime-DFA. Prime-DFA is NL-hard and in ExpSpace [8, Theorems 2.4 and 2.5].

3 NP-Hardness of Prime-DFA

We improve the lower complexity bound for Prime-DFA by proving:

Theorem 3.1.

The problem Prime-DFA is NP-hard.  

As mentioned, this is the first improvement of a complexity bound for Prime-DFA since [8] introduced Prime-DFA and proved that it is NL-hard and in ExpSpace.

Proof Idea

We prove the NP-hardness of Prime-DFA (Theorem 3.1) by a reduction from CNFSAT. Given a CNF-formula Φ, the reduction yields a DFA 𝒜Φ ([11, Definition A.1] (full version), Figure 1) with the goal that Φ is satisfiable if and only if 𝒜Φ is prime (Lemma 3.2).

In the following, we call DFAs of the form 𝒜Φ CNF-DFAs. The correctness of the reduction relies on a (somewhat technical) characterization of the compositionality of CNF-DFAs. Simplified, for a given CNF-DFA 𝒜Φ, only the words on which 𝒜Φ visits each of its non-sinks before entering its rejecting sink are relevant for its compositionality. We call these the max-visiting words of 𝒜Φ. We say that 𝒜Φ has the max-pumping-property (mp-prop) if every max-visiting word of 𝒜Φ has a factorization xyz so that 𝒜Φ rejects xylz for every l (˜3.7). It turns out that a CNF-DFA is composite if and only if it has the mp-prop (Lemmas 3.5 and 3.9).

The CNF-DFAs are designed so that the structure of the max-visiting words and their possible factorizations are strongly restricted (Lemma 3.11). This has two major benefits. Firstly, we will have a lot of control over the behavior of 𝒜Φ on each individual max-visiting word. And secondly, we will have a whole set of max-visiting words to reason about, which could potentially break the mp-prop.

More precisely, the max-visiting words have the form udcμ with u{0,1}r, where r is the number of Φ’s variables, c and d are dummy letters, and μ is a value dependent on |Φ| (Lemma 3.11 (i)). The prefix u is interpreted as a variable assignment for Φ. Due to the structure of 𝒜Φ, the only factorization that might witness the mp-prop for such a max-visiting word udcμ is x=ε,y=u,z=dcμ (Lemma 3.11 (ii)). Thus, exactly the pumpings of the form uldcμ are decisive for the mp-prop and thereby for the compositionality of 𝒜Φ.

Intuitively, 𝒜Φ uses the repetitions of the assignment u in ul to check whether u satisfies each clause (Lemma 3.12). Indeed, let s be the number of clauses of Φ, then the crucial pumping is us+2dcμ: To check the s clauses, s repetitions of u are needed; two further repetitions of u are needed for technical reasons. If u does not satisfy Φ, then 𝒜Φ detects an unsatisfied clause while reading us+2 and immediately enters its rejecting sink. Otherwise, that is, if u satisfies Φ, then 𝒜Φ detects no unsatisfied clause while reading us+2 and enters the accepting sink when beginning the final u-repetition.

To summarize, if Φ is unsatisfiable, then 𝒜Φ has the mp-prop and is therefore composite. Otherwise, that is, if Φ is satisfiable, then 𝒜Φ does not have the mp-prop and is therefore prime, which is witnessed by the pumping us+2dcμ of the max-visiting word udcμ, where u{0,1}r encodes a satisfying assignment for Φ.

We outline the reduction in Section 3.1 and prove its correctness in Section 3.2. To do so, we characterize the compositionality of the relevant DFAs in Section 3.2.1 and exploit this characterization to prove the correctness in Section 3.2.2. To conclude, we prove, in Section 3.3, that the restriction of Prime-DFA to the DFAs relevant for the reduction is NP-complete, meaning that the established lower bound is tight for this specific class of DFAs. The formal proofs of the results of Section 3 can be found in the full version [11, Appendix A].

3.1 Construction of 𝓐𝚽

We denote the propositional logic satisfiability problem for formulas in conjunctive normal form (CNF) by CNFSAT. It is well known that CNFSAT is NP-complete [2]. From here on, we call propositional logic formulas in CNF simply CNF-formulas.

As mentioned, we prove Theorem 3.1 by a reduction from CNFSAT. For a given CNF-formula Φ, the reduction yields a CNF-DFA 𝒜Φ so that Φ is satisfiable if and only if 𝒜Φ is prime.

Before we can describe the reduction, we have to fix some notation. For the remainder of Section 3, let X={x1,,xr} be a set of r1 numbered variables, and let Φ be a CNF-formula over X. W.l.o.g. we assume that Φ has at least one clause and that every variable appears at most once in every clause.

To simplify the construction of 𝒜Φ, we fix a special notation for Φ. Namely, we write Φ=(e11er1)(e1sers), where s1 is the number of clauses of Φ, and eik{¬xi,xi,} is the i-th element in the k-th clause where k{1,,s},i{1,,r}. In other words, in our notation, every clause has exactly r elements and the i-th element of every clause is either a literal of the i-th variable xi or . Here, is a special symbol that always evaluates to False. It is easy to see that Φ can be written in this way.

Towards the definition of 𝒜Φ, we introduce some additional notation. Let Σ={0,1,c,d}. We call a string u{0,1}r an assignment string. As usual, an assignment over X is a function γ:X{0,1}. An assignment γ over X induces an assignment string uγ{0,1}r in the following way: uγ=γ(x1)γ(xr). Conversely, an assignment string u=σ1σr{0,1}r induces an assignment γu over X in the following way: γu(xi)=σi for all i{1,,r}.

Now we can consider the reduction, that is, the construction of the CNF-DFA 𝒜Φ=(QΦ,Σ,p0,δΦ,FΦ) out of the given CNF-formula Φ. The CNF-DFA 𝒜Φ is outlined in Figure 1. It is formally defined in the full version [11, Definition A.1]. The key property of 𝒜Φ that we want to prove is formalized as:

Lemma 3.2.

The CNF-formula Φ is satisfiable if and only if the CNF-DFA 𝒜Φ is prime.  

(a) CNF-DFA 𝒜Φ for CNF-formula Φ=(e11er1)(e1sers) over set X={x1,,xr} of r1 numbered variables. Depicted are the assignment device, the k-th clause row with k{1,,s1}, and the s-th and last clause row. In the k-th clause row, the out-transitions of the states p1k,,pr1k for the letters 0,1 are omitted. For such a state pik, these 0/1-out-transitions depend on the element ei+1k and can lead to pi+1k or p^i+1k, as suggested by the dashed lines. The three possible configurations (for ei+1k{,¬xi,xi}) are depicted in Figure 1(b). The same omissions are made in the s-th clause row.
(b) Out-transitions of the states pik,p^ik of the CNF-DFA 𝒜Φ depicted in Figure 1(a), where k{1,,s},i{1,,r1}. The out-transitions of pik depend on ei+1k. (i): Out-transitions if ei+1k=. (ii): Out-transitions if ei+1k=xi. (iii): Out-transitions if ei+1k=¬xi.
Figure 1: CNF-DFA 𝒜Φ.

As mentioned above, the compositionality of 𝒜Φ depends solely on the max-visiting words of 𝒜Φ. We will discuss this in Section 3.2.1. For now, we will focus on the design of 𝒜Φ and give an intuition for it.

The CNF-DFA 𝒜Φ consists of two devices, the assignment device and the formula device. The assignment device consists of the states p0,,pr and pc0. To fully traverse the assignment device, that is, to start in p0 and reach pc0, a string ud with u{0,1}r has to be read. Therefore, the assignment device enforces that every max-visiting word is prefixed by an assignment string u{0,1}r (followed by a single d). Subsequently, the assignment string u is interpreted as the assignment γu for Φ which it induces.

The formula device consists of s clause rows. For k{1,,s}, the k-th clause row encodes the k-th clause of Φ, that is, (e1kerk). Thus, the formula device in its entirety encodes all clauses and thereby Φ. The k-th clause row consists of the states p1k,p^1k,,prk,p^rk and pck. Among these, p^rk is the positive target state of the k-th clause row, which is also the designated entry point for the subsequent clause row. And further, prk is the negative target state of the k-th clause row, which prevents 𝒜Φ from entering the subsequent clause row.

We point out that pr is part of the assignment device enforcing the prefix ud, but also functions similarly to a positive target state for letters 0 and 1. In particular, it is the designated entry point for the first clause row. Therefore, we denote the state pr also by p^r0.

The formula device is designed to enforce two assertions.

Firstly, every max-visiting word of 𝒜Φ is of the form udcμ, where u{0,1}r is an assignment string and μ depends on |Φ|. To be precise, this first assertion is enforced by the two devices together: The assignment device enforces the prefix ud and the formula device the suffix cμ. The first assertion is formalized further below in Lemma 3.11 (i).

Secondly, if γu satisfies the k-th clause, then u induces a run from the positive target state p^rk1 of the (k1)-th clause to the positive target state p^rk of the k-th clause. Else, u induces a run from the positive target state p^rk1 of the (k1)-th clause to the negative target state prk of the k-th clause. The second assertion is formalized in:

Lemma 3.3.

Consider an assignment string u{0,1}r. Let k{1,,s}. If γu satisfies the k-th clause of Φ, then δΦ(p^rk1,u)=p^rk holds. Else, δΦ(p^rk1,u)=prk holds.  

Note that reading 0 or 1 in any negative target state prk leads to p, while reading 0 or 1 in the final positive target state p^rs leads to p+. Together with the second assertion enforced by the formula device, this implies that, for every ls+2, a word of the form uldcμ is accepted by 𝒜Φ if and only if γu satisfies Φ. We expand on this argument in our discussion of Lemma 3.12 in Section 3.2.2. Also in Section 3.2.2, we will see that 𝒜Φ is prime if and only if 𝒜Φ accepts some word of the form uldcμ. Thus, 𝒜Φ is prime if and only if Φ is satisfiable.

We have outlined the CNF-DFA 𝒜Φ yielded by the reduction and given an intuition for its design. Next, we prove the correctness of the reduction.

3.2 Correctness of the Reduction

We complete the proof of Theorem 3.1 by proving the correctness of the reduction. That is, we prove Lemma 3.2, that Φ is satisfiable if and only if 𝒜Φ is prime. We accomplish this in two steps. In Section 3.2.1, we characterize the compositionality of CNF-DFAs. Then in Section 3.2.2, we exploit this characterization to prove Lemma 3.2 and thereby Theorem 3.1.

3.2.1 Compositionality of Minimal Linear Safety ADFA+s

We first define minimal linear safety ADFA+s and then characterize their compositionality.

Definitions: ADFA+s, Linear DFAs, Safety DFAs

Following convention, a DFA 𝒜 is acyclic (ADFA) if there are no cycles in 𝒜 besides those of the rejecting sinks. Building on that, a DFA 𝒜 is an ADFA-plus (ADFA+) if 𝒜 possesses both a rejecting and an accepting sink and there are no cycles in 𝒜 besides those of the sinks. Thus, an ADFA+ is “almost” an ADFA but additionally has an accepting sink.

We call a DFA 𝒜=(Q,Σ,qI,δ,F) linear if, for every q,qQ with qq, exactly one of the following holds: (i) q is reachable from q; (ii) q is reachable from q; (iii) q and q are unreachable from each other, and q or q or both are sinks. Obviously, every minimal linear DFA has at least one and at most two sinks.

For a minimal ADFA+ 𝒜=(Q,Σ,qI,δ,F), we denote by len(𝒜) the length of the longest word wΣ such that words v,vΣ with δ(qI,wv)F and δ(qI,wv)F exist. Thus, len(𝒜) is the length of the longest word on which 𝒜 does not enter a sink. Because 𝒜 is minimal and has two sinks, such a word always exists. The following holds:

Lemma 3.4.

Consider a minimal ADFA+ 𝒜=(Q,Σ,qI,δ,F). Then the following assertions hold:

  1. (i)

    |𝒜|len(𝒜)+3.

  2. (ii)

    𝒜 is linear if and only if |𝒜|=len(𝒜)+3.

Finally, we introduce a type of DFA already inspected in [8]. A regular language LΣ is a safety language if, for every wΣ, it holds that wL implies wyL for every yΣ. A DFA 𝒜 is a safety DFA if (𝒜) is a safety language. Clearly, every non-trivial minimal safety DFA has exactly one rejecting state, and this state is a sink.

The general form of minimal linear safety ADFA+s is outlined in the full version [11, Figure 3]. The following observation can be easily verified by inspecting [11, Definition A.1] and Figure 1.

Lemma 3.5.

The CNF-DFA 𝒜Φ is a minimal linear safety ADFA+.  

Clearly, 𝒜Φ is a safety DFA since the rejecting sink p is the only rejecting state of 𝒜Φ. Further, to see that 𝒜Φ is additionally a linear ADFA+, recall the following observation from Section 3.1: To fully traverse 𝒜Φ, a word of the form udcμ for u{0,1}r and a suitable μ has to be read. On such a word, the states of the assignment device are traversed in the order p0,,pr,pc0, and the states of the formula device are traversed in the order p11,p^11,,pr1,p^r1,pc1,,p1s,p^1s,,prs,p^rs,pcs. Intuitively, this order describes the “forward direction” in 𝒜Φ, and there are no “backward transitions” in 𝒜Φ. Thus, 𝒜Φ is acyclic (disregarding p+) and its states are linearly ordered, meaning that 𝒜Φ is a linear ADFA+. Lastly, regarding the minimality, note that two states of 𝒜Φ are differentiated by the suffixes of words udcμ needed to fully traverse the remainder of 𝒜Φ and enter the rejecting sink when starting in the respective states. For example, two states from the formula device are differentiated by the number of c’s needed to reach the rejecting sink. Thus, 𝒜Φ is minimal. In total, 𝒜Φ is a minimal linear safety ADFA+.

Thanks to Lemma 3.5, it is sufficient to characterize the compositionality of minimal linear safety ADFA+s in order to characterize the compositionality of CNF-DFAs.

Characterization of the Compositionality of Minimal Linear Safety ADFA+s

Now we characterize the compositionality of minimal linear safety ADFA+s. With Example 3.10 at the end of this section, we illustrate the main ideas of the characterization by considering, by way of example, two minimal linear safety ADFA+s, one composite and one prime.

We point out that when we consider the compositionality of a restricted class of DFAs, the (smaller) DFAs used in the decompositions are not restricted. In particular, the DFAs we use in the characterization of the compositionality of minimal linear safety ADFA+s need not be minimal linear safety ADFA+s themselves.

The compositionality of a DFA 𝒜 boils down to the question whether, for each word w(𝒜), there exists some DFA with w() and α(𝒜), the latter meaning ||<ind(𝒜) and (𝒜)(). Indeed, if the answer is yes, the collection of these DFAs yields a decomposition of 𝒜 (thanks to ||<ind(𝒜), the collection is finite). If, on the other hand, for some w(𝒜), there is no such , then w is a primality witness of 𝒜.

For a minimal linear safety ADFA+ 𝒜, the situation is simplified by the fact that there is only one rejecting state, namely, the rejecting sink. For words w on which 𝒜 enters the rejecting sink without visiting every non-sink, building an appropriate DFA rejecting w is relatively simple. Essentially, we can just remove one of the skipped-over states q of 𝒜 so that the constructed DFA accepts all words on which 𝒜 visits q and acts as 𝒜 on all other words, including w. Details are given in the full version [11, Definition A.3, Figure 4a and Lemma A.4]. Thus, in the following, we only need to consider the words on which 𝒜 enters its rejecting sink after visiting every non-sink. Formally, we define the set of these words as:

Definition 3.6.

Consider a minimal linear safety ADFA+ 𝒜 over an alphabet Σ. Let λ=len(𝒜). Then we define the set 𝒦(𝒜) of the max-visiting words of 𝒜 as follows:

𝒦(𝒜)={vσvΣλσΣv(𝒜)vσ(𝒜)}.

On a max-visiting word w=vσ𝒦(𝒜), the ADFA+ 𝒜 does not skip over any non-sink. Thus, the idea of removing a skipped-over state to construct an appropriate DFA rejecting w is not applicable. Indeed, the situation for the max-visiting words is more involved. It turns out that every relevant α(𝒜) is a safety DFA with an accepting sink. Thus, every such possesses one accepting sink, one rejecting sink, and at most λ accepting non-sinks. Here, we omit the details and refer to the full version [11, Lemmas A.10 and A.11]. Since has at most λ non-sinks and the prefix v of w has length λ, the initial run of on v has to visit a non-sink twice. Therefore, for some x,y,z with w=xyz and |y|,|z|>0, the DFA reaches the same state after reading x, xy and every further xyl. This observation gives rise to the definition of the max-pumping-property:

Definition 3.7.

Consider a minimal linear safety ADFA+ 𝒜 over an alphabet Σ. We say that 𝒜 has the max-pumping-property (mp-prop) if, for every max-visiting word w𝒦(𝒜), there are x,y,zΣ with w=xyz and |y|,|z|>0 so that xylz(𝒜) holds for every l.  

Before we state the desired characterization of the compositionality of minimal linear safety ADFA+s in terms of the mp-prop, we introduce an alternative formulation of the mp-prop, for which we need some additional notation. Consider a word w=σ1σnΣn. For i,j{1,,n+1},i<j,l, we define w[i,j;l]=σ1σi1(σiσj1)lσjσn. We refer to w[i,j;l] as a pumping of w. The following lemma provides an alternative formulation of the mp-prop by translating it into the w[i,j;l]-notation.

Lemma 3.8.

Consider a minimal linear safety ADFA+ 𝒜. Let λ=len(𝒜). Then 𝒜 has the mp-prop if and only if, for every max-visiting word w𝒦(𝒜), there are i,j{1,,λ+1} with i<j so that w[i,j;l](𝒜) holds for every l.  

For a minimal linear safety ADFA+ 𝒜, a max-visiting word w𝒦(𝒜) and indices i,j, we say that the mp-prop-condition holds for w,i,j if w[i,j;l](𝒜) holds for every l. Note that w[i,j;l](𝒜) implies w[i,j;l]w(𝒜) for all words w because 𝒜 is a safety DFA.

With the mp-prop defined, we can characterize the compositionality of minimal linear safety ADFA+s as follows:

Theorem 3.9.

A minimal linear safety ADFA+ is prime if and only if it does not have the mp-prop.  

We now set out to give an intuition for this result.

First, towards a proof by contraposition, assume that the minimal linear safety ADFA+ 𝒜 has the mp-prop and consider a max-visiting word w=σ1σλ+1𝒦(𝒜). Then there are some indices i,j with w[i,j;l](𝒜) for every l. Thus, when trying to build a DFA α(𝒜) rejecting w, we know that is allowed to reject every w[i,j;l] as well. We can use this to construct out of 𝒜 by essentially merging the states that 𝒜 reaches after reading σ1σi1 and σ1σj1. Since we can build a suitable DFA for every max-visiting word, 𝒜 is composite. Details for this construction are given in the full version [11, Definition A.6, Figure 4b and Lemma A.7].

Now assume that 𝒜 does not have the mp-prop. Then there is a word w𝒦(𝒜) that breaks the mp-prop, meaning that, for every indices i,j, there is an l with w[i,j;l](𝒜). We argue that this w is a primality witness of 𝒜.

Towards a contradiction, assume that there is a α(𝒜) with w(). We pointed out above that there have to be indices i,j so that, for every l, the DFA cannot differentiate between w and w[i,j;l], meaning that rejects every such pumping w[i,j;l]. Yet, because w breaks the mp-prop, there is some l so that w[i,j;l](𝒜), yielding a contradiction.

Since there is no α(𝒜) with w(), the selected max-visiting word w is a primality witness of 𝒜, meaning that 𝒜 is prime.

In conclusion, if 𝒜 has the mp-prop, we can build, for every w𝒦(𝒜), a suitable DFA rejecting w by merging appropriate states of 𝒜. Otherwise, that is, if 𝒜 does not have the mp-prop, then every word w𝒦(𝒜) breaking the mp-prop is a primality witness of 𝒜 because every DFA in α(𝒜) is necessarily confused about some pumpings of w and can therefore not reject w itself. In total, we argued that a minimal linear safety ADFA+ is prime if and only if it does not have the mp-prop, which is formalized above in Theorem 3.9.

(a) Minimal linear safety ADFA+ 𝒜 from Example 3.10. It has the mp-prop. Thus, it is composite.
(b) Minimal linear safety ADFA+ 𝒜 from Example 3.10. It does not have the mp-prop. Thus, it is prime.
(c) Decomposition of the composite minimal linear safety ADFA+ 𝒜 from Figure 2(a). The three DFAs are constructed according to [11, Definitions A.3 and A.6].
Figure 2: Minimal linear safety ADFA+s 𝒜 and 𝒜 from Example 3.10. Decomposition of 𝒜.

We conclude this discussion of the compositionality of minimal linear safety ADFA+s by using an example to further illustrate the main ideas.

Example 3.10.

In this example, we consider two simple minimal linear safety ADFA+s and argue that one of them has the mp-prop, while the other has not. Further, we outline how this leads to the one being composite and the other being prime.

Consider the two DFAs 𝒜=(Q,Σ,q0,δ,F) and 𝒜=(Q,Σ,q0,δ,F) depicted in Figures 2(a) and 2(b). It is easy to verify that both DFAs are minimal linear safety ADFA+s and that len(𝒜)=len(𝒜)=2 and 𝒦(𝒜)=𝒦(𝒜)={abb} hold. Thus, for both ADFA+s, their possession of the mp-prop, and with it their compositionality, depends solely on the max-visiting word w=abb. Note that 𝒜 and 𝒜 differ in only one transition: We have δ(q0,b)=q2 but δ(q0,b)=q+. Still, we will see that, with this difference, 𝒜 has the mp-prop and is composite, while 𝒜 does not have the mp-prop and is prime.

First, we consider 𝒜 and argue that the mp-prop-condition holds for w=abb,i=1,j=2. For l=0, we have w[1,2;l]=albb=a0bb=bb(𝒜). Here, the transition δ(q0,b)=q2 (in contrast to δ(q0,b)=q+) is crucial. For l=1, we trivially have w[1,2;l]=albb=a1bb=w(𝒜). And lastly, for l2, we have w[1,2;l]=albb(𝒜) due to δ(q0,aa)=q. Thus, the mp-prop-condition holds for w,i=1,j=2. Since 𝒦(𝒜)={w}, this immediately implies that 𝒜 has the mp-prop.

With Theorem 3.9, 𝒜 having the mp-prop implies that it is composite. In the full version, we explicitly state the decomposition of ADFA+s with the mp-prop [11, Lemma A.8] and outline all necessary DFAs [11, Definitions A.3 and A.6 and Figure 4]. Here, we discuss the decomposition of the specific ADFA+ 𝒜 to motivate how its compositionality is connected to the mp-prop.

The decomposition of 𝒜 consists of the three simple DFAs 𝒜1+,𝒜2+ and 𝒜w,1,2 depicted in Figure 2(c). In this decomposition, 𝒜w,1,2 is the only DFA exploiting the mp-prop. It is used to reject the max-visiting word w (and its extensions). Basically, it omits the state q1 and instead adds a self-loop q0𝑎q0. For this to be allowed, it is crucial that w[1,2;l]=albb(𝒜) holds for every l, that is, that the mp-prop-condition holds for w,i=1,j=2. Further, 𝒜1+ and 𝒜2+ reject the words rejected by 𝒜 on which 𝒜 does not enter q1 or q2, respectively. They are constructed out of 𝒜 by omitting the respective state qi and redirecting all in-qi-transition into q+.

Indeed, in this instance, we have (𝒜w,1,2)(𝒜1+), meaning that 𝒜1+ can be omitted in the decomposition of 𝒜. This is due to the simplicity of 𝒜: For example, simply by adding the letter c and the transitions δ(q0,c)=q2 and δ(q1,c)=δ(q2,c)=q+ to 𝒜, we get a still composite DFA in whose decomposition all three DFAs of [11, Lemma A.8] are necessary.

Next, we consider 𝒜 and argue that w=abb breaks the mp-prop. This follows from the simple observation that w[i,j;0](𝒜) holds for all i,j{1,2,3},i<j. For i=1,j=2, we have w[1,2;0]=a0bb=bb(𝒜). Here, the transition δ(q0,b)=q+ (in contrast to δ(q0,b)=q2) is crucial. For i=1,j=3, we have w[1,3;0]=(ab)0b=b(𝒜). And lastly, for i=2,j=3, we have w[2,3;0]=ab0b=ab(𝒜). In total, there is no pair i,j{1,2,3},i<j so that the mp-prop-condition holds for w,i,j, meaning that w breaks the mp-prop.

With Theorem 3.9, 𝒜 not having the mp-prop implies that it is prime. In the full version [11, Appendix A.2.1], we present the complete proof that, for an ADFA+ without the mp-prop, a max-visiting word breaking the mp-prop is a primality witness. Here, we discuss why w is a primality witness of the specific ADFA+ 𝒜.

For 𝒜 to be composite, there would have to be a α(𝒜) with w(). This would have to have at least one non-sink less than 𝒜 (see full version [11, Lemmas A.10 and A.11]) and could therefore visit only two distinct states while reading the prefix ab of w. Thus, would “confuse” w with bb, b or ab. But, as we argued above, these three words are all accepted by 𝒜, meaning that every DFA in α(𝒜) has to accept them as well. Thus, no suitable α(𝒜) with w() exists, meaning that w is a primality witness of 𝒜.  

3.2.2 From the Characterization to NP-Hardness

For Section 3.2.2, let λ=len(𝒜Φ) and μ=(λ+1)(r+1).

Together, Lemmas 3.5 and 3.9 imply that 𝒜Φ is prime if and only if it does not have the mp-prop. Following ˜3.7, this means that exactly the max-visiting words of 𝒜Φ are relevant for the compositionality of 𝒜Φ. How these look like and where they can potentially be pumped is then answered by:

Lemma 3.11.

The following assertions hold:

  1. (i)

    𝒦(𝒜Φ)={udcμu{0,1}r}.

  2. (ii)

    For every w𝒦(𝒜Φ) and every i,j{1,,λ+1},i<j, we have: If the mp-prop-condition holds for w,i,j, then i=1 and j=r+1.

Lemma 3.11 (i) formalizes the observation about the form of the max-visiting words of 𝒜Φ which we made in Section 3.1 and which we already revisited when discussing Lemma 3.5. In particular, note that, in every state of the formula device (except p^rs), reading 0 or 1 results in “skipping over” at least one state, while reading d results in entering the rejecting sink. Thus, the max-vising words of 𝒜Φ indeed have to be suffixed by cμ.

The argumentation behind (ii) is somewhat technical. For all w=udcμ𝒦(𝒜Φ) and all suitable i,j with i1 or jr+1, we can show δΦ(p0,w[i,j;0])p, meaning that it suffices to consider the pumpings with l=0 to prove (ii). For the simple case i>r+1, we have w[i,j;0]=udcx for some x<μ, which is akin to removing some c-suffix of w. Clearly, this means that the initial run of 𝒜Φ on w[i,j;0] is identical to the one on w until it ends somewhere in the formula device, without reaching the rejecting sink. For the other cases, that is, for 1<ir+1 as well as for i=1 and jr+1, the key observation is that, in w[i,j;0], some part of the prefix ud is removed so that a c or a d is read “out of place”. This means that a c is read in one of the states p0,,pr, or a d is read in one of the states p1,,pr1, which results in entering p+.

With Lemma 3.11 (i), the form of the max-vising words of 𝒜Φ is highly restricted: As mentioned, they consist of an assignment string followed by dcμ. Thus, every assignment string u{0,1}r corresponds to exactly one max-visiting word in 𝒦(𝒜Φ), namely, udcμ, and vice versa. Then (ii) greatly restricts where pumping positions for the max-visiting words can lie that could witness that 𝒜Φ has the mp-prop. For every w𝒦(𝒜Φ), only i=1,j=r+1 are possible candidates. This means that 𝒜Φ does not have the mp-prop, and is therefore prime, if and only if δΦ(p0,w[1,r+1;l])p for some w𝒦(𝒜Φ) and l. And because the words in 𝒦(𝒜Φ) have the form udcμ for u{0,1}r, the relevant pumpings are of the form uldcμ, meaning that we pump, and thereby repeat, exactly the assignment strings.

We have established that only the pumpings of the form uldcμ are relevant for the compositionality of 𝒜Φ. With the following lemma, we finally cement the connection between the compositionality of 𝒜Φ and the satisfiability of Φ, which was already perceivable in Lemma 3.3.

Lemma 3.12.

Let u{0,1}r be an assignment string and let w=udcμ𝒦(𝒜Φ) be the corresponding max-visiting word. Then the mp-prop-condition does not hold for w,i=1,j=r+1 if and only if the assignment γu induced by u satisfies Φ.  

As Lemma 3.12 connects the compositionality of 𝒜Φ and the satisfiability of Φ, it is central for the correctness of our reduction. Also, the main ideas behind the design of 𝒜Φ become apparent in its proof. Therefore, we briefly argue that it holds. Let u{0,1}r be an assignment string and let w=udcμ be the corresponding max-visiting word.

First, towards a proof by contraposition, we assume that the assignment γu induced by u does not satisfy Φ. We argue that the mp-prop-condition holds for w,i=1,j=r+1. Because γu does not satisfy Φ, there is a k{1,,s} so that γu does not satisfy the k-th clause of Φ. Let k be the minimum value for which this holds.

The key insight here is that, firstly, for all 1<l<k+1, the pumping w[1,r+1;l] is rejected because a d is read “out of place”, namely, in the state p^rl1; and that, secondly, for all lk+1, the pumping w[1,r+1;l] is rejected because, after traversing the k-th clause row on u, the state prk is reached, from which every continuation with a letter σ{0,1,d} leads to p.

To be more precise, for all 1<l<k+1, we have δΦ(p0,ul)=p^rl1 and therefore δΦ(p0,w[1,r+1;l])=p, with Lemma 3.3. This holds because γu satisfies the first k1 clauses, meaning that, if traversing any of these clause rows on u, then 𝒜Φ ends up in a p^-state, from which p is entered on reading the subsequent d. Further, for all lk+1, we have δΦ(p0,uk+1)=prk and therefore δΦ(p0,w[1,r+1;l])=p, again with Lemma 3.3. This holds because γu does not satisfy the k-th clause, meaning that, if traversing the k-th clause row on u, then 𝒜Φ ends up in the state prk, from which p is entered on reading any of the possible subsequent letters 0, 1 or d. Lastly, δΦ(p0,w[1,r+1;0])=p and δΦ(p0,w[1,r+1;1])=p hold obviously. In total, we have δΦ(p0,w[1,r+1;l])=p for all l. So the mp-prop-condition holds for w,i=1,j=r+1.

Second, we assume that the assignment γu induced by u satisfies Φ. We argue that the mp-prop-condition does not hold for w,i=1,j=r+1.

The key insight here is that, for a satisfying assignment γ and a sufficiently large l, 𝒜Φ reaches p^rs on reading uγl. The reason is that, because γ satisfies every clause, 𝒜Φ enters the p^-states in every clause row and therefore always advances to the next clause row, finally reaching p^rs. From there, the transitions are such that p+ is entered.

More precisely, with Lemma 3.3, we have δΦ(p0,us+1)=p^rs. The argument is similar to above, only that now the assignment satisfies all clauses, not just the clauses up to some k<s. With δΦ(p^rs,σ)=p+ for σ{0,1}, we then immediately have δΦ(p0,w[1,r+1;s+2])=p+p. Thus, l=s+2, and indeed every ls+2, witnesses that there is an l with δΦ(p0,w[1,r+1;l])=δΦ(p0,uldcμ)p. So the mp-prop-condition does not hold for w,i=1,j=r+1.

In total, we have argued that, for every w=udcμ𝒦(𝒜Φ), the mp-prop-condition does not hold for w,i=1,j=r+1 if and only if the assignment γu induced by u satisfies Φ. Thus, Lemma 3.12 holds.

With Theorems 3.9, 3.5, 3.11, and 3.12, we have everything we need to prove the correctness of our reduction. That is, we have everything we need to prove Lemma 3.2, that Φ is satisfiable if and only if 𝒜Φ is prime.

Proof of Lemma 3.2.

With Lemma 3.5, the CNF-DFA 𝒜Φ is a minimal linear safety ADFA+. Together with Theorem 3.9, this implies that 𝒜Φ is prime if and only if it does not have the mp-prop. Thus, we only have to prove that Φ is satisfiable if and only if 𝒜Φ does not have the mp-prop.

First, towards a proof by contraposition, let Φ be unsatisfiable. Let w𝒦(𝒜Φ). With Lemma 3.11 (i), we have w=udcμ, where u{0,1}r is an assignment string. Because Φ is unsatisfiable, the assignment γu induced by u does not satisfy Φ. With with Lemma 3.12, we therefore have that the mp-prop-condition holds for w,i=1,j=r+1. Thus, the mp-prop-condition holds for every max-visiting word, meaning that 𝒜Φ has the mp-prop.

Now let Φ be satisfiable. Let γ be a satisfying assignment. We consider the assignment string uγ induced by γ and the corresponding word w=uγdcμ. With Lemma 3.11 (i), we have w𝒦(𝒜Φ). And with Lemma 3.11 (ii), the mp-prop-condition does not hold for w,i,j where i1 or jr+1. Further, because γ satisfies Φ, we have, with Lemma 3.12, that the mp-prop-condition does not hold for w,i=1,j=r+1 either. Thus, w witnesses that 𝒜Φ does not have the mp-prop.

We have proven that Φ is satisfiable if and only if 𝒜Φ does not have the mp-prop. As outlined, this implies that Φ is satisfiable if and only if 𝒜Φ is prime. The proof is complete.

With Lemma 3.2, we have proven that our reduction is correct. Because the construction of 𝒜Φ is clearly possible in polytime, we then immediately get Theorem 3.1, the NP-hardness of Prime-DFA.

3.3 NP-Completeness of Prime-SADFA+

In Sections 3.1 and 3.2, we improved the lower complexity bound of the general problem Prime-DFA. Now we conclude Section 3 by arguing that this improved lower bound is tight for the restriction of Prime-DFA to minimal linear safety ADFA+s.

We denote the restriction of Prime-DFA to DFAs whose respective minimal DFA is a minimal linear safety ADFA+ by Prime-SADFA+.

The restriction of Prime-DFA to ADFAs, so to truly acyclic DFAs, was studied in [10]. Motivated by this, we study Prime-SADFA+. For a comparison of the compositionality of ADFAs and ADFA+s, we refer to Section 4.1. Here, we prove:

Theorem 3.13.

The problem Prime-SADFA+ is NP-complete.  

We proved Theorem 3.1, the NP-hardness of Prime-DFA, by a reduction from CNFSAT. At the heart of this reduction was the construction of the CNF-DFA 𝒜Φ out of the given CNF-formula Φ. With Lemma 3.5, every CNF-DFA is also a minimal linear safety ADFA+. Thus, we immediately get:

Lemma 3.14.

The problem Prime-SADFA+ is NP-hard.  

To arrive at Theorem 3.13, we additionally prove:

Lemma 3.15.

The problem Prime-SADFA+ is in NP.  

To prove that Prime-SADFA+ is in NP, we describe a guess-and-verify NP-algorithm for Prime-SADFA+ which exploits Theorem 3.9. Given a minimal linear safety ADFA+ 𝒜, the algorithm guesses a max-visiting word w𝒦(𝒜) and then verifies that w breaks the mp-prop, meaning that w witnesses that 𝒜 does not have the mp-prop. To do so, it simulates the initial run of 𝒜 on w[i,j;l] for every pair i,j{1,,len(𝒜)+1},i<j and every relevant l. The key insight here is that, for every such pair i,j, there is a polynomially bounded value li,j such that only the values lli,j are relevant. Thus, the algorithm has to simulate only polynomially many runs. If the algorithm finds that w indeed breaks the mp-prop, it accepts. Else, it rejects.

The polynomial runtime of the algorithm follows immediately from the key insight just mentioned. The runtime is dominated by the simulation of the runs. There are only polynomially many pairs i,j. And for each pair, there are only polynomially many relevant pumpings w[i,j;l], each having polynomial length. Thus, the algorithm has polynomial runtime.

Regarding the correctness, if 𝒜 is prime, then there is a word breaking the mp-prop. The algorithm guesses this word and subsequently accepts. Else, that is, if 𝒜 is composite, then no word breaking the mp-prop exists. Thus, the algorithm is forced to reject no matter which word it guesses. In total, the algorithm works correctly for Prime-SADFA+.

To summarize, we have described an NP-algorithm for Prime-SADFA+. Thus, we have proven Lemma 3.15. Together with the already established Lemma 3.14, we immediately get Theorem 3.13, the NP-completeness of Prime-SADFA+.

4 Discussion

We studied the primality of DFAs and thereby of regular languages. We proved the NP-hardness of Prime-DFA. This is the first improvement of a complexity bound for Prime-DFA since [8] introduced Prime-DFA and proved that it is NL-hard and in ExpSpace.

We proved the NP-hardness of Prime-DFA by a reduction from CNFSAT. For a given CNF-formula Φ, the reduction yields a so-called CNF-DFA 𝒜Φ so that Φ is satisfiable if and only if 𝒜Φ is prime. To link the satisfiability of Φ and the compositionality of 𝒜Φ, the construction of 𝒜Φ ensures that (1) Φ is encoded in 𝒜Φ, and (2) the variable assignments for Φ are encoded in the words relevant for the compositionality of 𝒜Φ.

Central to the NP-hardness proof was the characterization of the compositionality of CNF-DFAs. However, only certain structural aspects of CNF-DFAs were relevant for this characterization. Thus, we actually characterized the compositionality of the more general minimal linear safety ADFA+s. Exploiting this characterization, we then proved the NP-completeness of Prime-SADFA+, the restriction of Prime-DFA to DFAs whose respective minimal DFA is a minimal linear safety ADFA+.

To wrap up this paper, we briefly discuss two points.

Firstly, we compare the complexity of Prime-SADFA+ and Prime-DFAfin, the restriction of Prime-DFA to DFAs deciding finite languages. And secondly, we highlight that the NP-hardness of Prime-DFA carries over to S-Prime-DFA, which is a variant of the problem based on a slightly different notion of compositionality.

4.1 Prime-SADFA+ and Prime-DFAfin

We denote the restriction of Prime-DFA to DFAs deciding a finite language byPrime-DFAfin. Note that a DFA decides a finite language if and only if its minimal DFA is an ADFA. Thus, the problems Prime-DFAfin and Prime-SADFA+ are very similar: Prime-DFAfin considers ADFAs, so truly acyclic DFAs, while Prime-SADFA+ considers ADFA+s, so “almost” acyclic DFAs possessing an accepting sink.

In this paper, we have proven that Prime-SADFA+ is NP-complete. With [10, Theorem 4.1], Prime-DFAfin is NL-complete. Therefore, the simple addition of an accepting sink leads to a jump in the complexity of the primality problem (assuming NLNP). We give an intuition for this somewhat surprising fact.

The reduction from CNFSAT crucially hinges on the fact that the CNF-DFA 𝒜Φ can potentially enter the accepting sink after reading the prefix us+2 of w[1,r+1;s+2], where w=udcμ𝒦(𝒜Φ) is a max-visiting word. In other words, it can enter the accepting sink after “pumping up” w so that the assignment string u is checked against every clause row. Once in the accepting sink, the suffix dcμ of dummy letters can be read and the pumping w[1,r+1;s+2] is accepted.

No construction of this kind is possible for ADFAs. Every ADFA has a threshold value so that it rejects every word longer than that threshold value. This is obvious, because for words longer than the threshold value, it runs out of non-sinks and necessarily enters the rejecting sink. Therefore, “pumping up” and thereby lengthening the ADFA-equivalent of a max-visiting word necessarily leads to an overlong word that is rejected.

Thus, with the existence of an accepting sink, no threshold value exists so that words longer than that threshold value are rejected. This simple additional complication is enough to lead to the jump in complexity, from NL-completeness for Prime-DFAfin to NP-completeness for Prime-SADFA+.

4.2 NP-Hardness of S-Prime-DFA

With ˜2.1, we followed [8] and defined compositionality using the index of the given DFA. However, without stating so explicitly, [6, 7] employed a slightly different definition, using the size instead of the index. In [10], this difference was made explicit by introducing the notion of S-compositionality and the respective decision problem. We follow [10] and define:

Definition 4.1.

A DFA 𝒜 is S-composite if it is (|𝒜|1)-decomposable. Otherwise, it is S-prime.  

We denote the problem of deciding S-primality for a given DFA by S-Prime-DFA.

Many results known for compositionality carry over trivially to S-compositionality. In particular, Prime-DFA is in ExpSpace [8, Theorem 2.4]. The proof of this result has to be adapted only slightly to prove that S-Prime-DFA is in ExpSpace as well [10, Theorem 6.3].

However, the NL-hardness of Prime-DFA, established in [8, Theorem 2.5], does not carry over trivially to S-Prime-DFA. The NL-hardness of S-Prime-DFA is established in [10, Theorem 6.3] by using a reduction of a different problem than the one used for Prime-DFA.

Here, we highlight that the improved lower complexity bound of Prime-DFA does carry over trivially to S-Prime-DFA. We established the NP-hardness of Prime-DFA by a reduction from CNFSAT. The CNF-DFAs yielded by this reduction are minimal. Thus, with the same reduction, we get:

Theorem 4.2.

The problem S-Prime-DFA is NP-hard.  

Indeed, it is well known that DFA minimization can be done in polytime. Thus, by making the transition from NL-hardness to NP-hardness, the distinction between compositionality and S-compositionality loses its edge because we can always minimize the given DFA. This simple argument is an alternative way to arrive at Theorem 4.2.

References

  • [1] Christel Baier and Joost-Pieter Katoen. Principles of Model Checking. MIT Press, 2008. URL: https://mitpress.mit.edu/9780262026499/principles-of-model-checking/.
  • [2] Stephen A. Cook. The complexity of theorem-proving procedures. In Michael A. Harrison, Ranan B. Banerji, and Jeffrey D. Ullman, editors, Proceedings of the 3rd Annual ACM Symposium on Theory of Computing, May 3-5, 1971, Shaker Heights, Ohio, USA, pages 151–158. ACM, 1971. doi:10.1145/800157.805047.
  • [3] Willem P. de Roever, Hans Langmaack, and Amir Pnueli, editors. Compositionality: The Significant Difference, International Symposium, COMPOS’97, Bad Malente, Germany, September 8-12, 1997. Revised Lectures, volume 1536 of Lecture Notes in Computer Science. Springer, 1998. doi:10.1007/3-540-49213-5.
  • [4] Peter Gazi and Branislav Rovan. Assisted problem solving and decompositions of finite automata. In Viliam Geffert, Juhani Karhumäki, Alberto Bertoni, Bart Preneel, Pavol Návrat, and Mária Bieliková, editors, SOFSEM 2008: Theory and Practice of Computer Science, 34th Conference on Current Trends in Theory and Practice of Computer Science, Nový Smokovec, Slovakia, January 19-25, 2008, Proceedings, volume 4910 of Lecture Notes in Computer Science, pages 292–303. Springer, 2008. doi:10.1007/978-3-540-77566-9_25.
  • [5] E. Mark Gold. Complexity of automaton identification from given data. Inf. Control., 37(3):302–320, 1978. doi:10.1016/S0019-9958(78)90562-4.
  • [6] Ismaël Jecker, Orna Kupferman, and Nicolas Mazzocchi. Unary prime languages. In Javier Esparza and Daniel Král’, editors, 45th International Symposium on Mathematical Foundations of Computer Science, MFCS 2020, August 24-28, 2020, Prague, Czech Republic, volume 170 of LIPIcs, pages 51:1–51:12. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.MFCS.2020.51.
  • [7] Ismaël Jecker, Nicolas Mazzocchi, and Petra Wolf. Decomposing permutation automata. In Serge Haddad and Daniele Varacca, editors, 32nd International Conference on Concurrency Theory, CONCUR 2021, August 24-27, 2021, Virtual Conference, volume 203 of LIPIcs, pages 18:1–18:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.CONCUR.2021.18.
  • [8] Orna Kupferman and Jonathan Mosheiff. Prime languages. Inf. Comput., 240:90–107, 2015. doi:10.1016/J.IC.2014.09.010.
  • [9] Niklas Lauffer, Beyazit Yalcinkaya, Marcell Vazquez-Chanlatte, Ameesh Shah, and Sanjit A. Seshia. Learning deterministic finite automata decompositions from examples and demonstrations. In Alberto Griggio and Neha Rungta, editors, 22nd Formal Methods in Computer-Aided Design, FMCAD 2022, Trento, Italy, October 17-21, 2022, pages 325–330. TU Wien Academic Press, 2022. doi:10.34727/2022/ISBN.978-3-85448-053-2_39.
  • [10] Daniel Alexander Spenner. Decomposing finite languages. In Jérôme Leroux, Sylvain Lombardy, and David Peleg, editors, 48th International Symposium on Mathematical Foundations of Computer Science, MFCS 2023, August 28 to September 1, 2023, Bordeaux, France, volume 272 of LIPIcs, pages 83:1–83:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.MFCS.2023.83.
  • [11] Daniel Alexander Spenner. Deciding DFA-primality is NP-hard, 2026. arXiv:2605.07031.
  • [12] Stavros Tripakis. Compositionality in the science of system design. Proc. IEEE, 104(5):960–972, 2016. doi:10.1109/JPROC.2015.2510366.
  • [13] Moshe Y. Vardi and Pierre Wolper. An automata-theoretic approach to automatic program verification. In Proceedings of the Symposium on Logic in Computer Science (LICS ’86), Cambridge, Massachusetts, USA, June 16-18, 1986, pages 332–344. IEEE Computer Society, 1986. URL: https://hdl.handle.net/2268/116609.