State Complexity of Unary SV-XNFA with Different Acceptance Conditions

. Unary self-verifying symmetric diﬀerence automata were introduced in [1], with an upper bound of O (2 n ) and lower bound of 2 n − 1 − 1 for state complexity. Implicit in the interpretation of self-verifying acceptance for the symmetric diﬀerence case was the assumption that no state could be both an accept state and a reject state. We present another interpretation of acceptance more aligned to the equivalence of symmetric diﬀerence automata to weighted automata over GF(2), where states that both accept and reject are allowed, and we give a tight bound of 2 n − 1 − 1 for state complexity for both interpretations of acceptance.


Introduction
In [1] we showed how the concepts of symmetric difference finite state automata (XNFA) and self-verifying acceptance (SV) could be combined, resulting in selfverifying symmetric difference finite automata (SV-XNFA).We also provided an upper bound of O(2 n ) on state complexity for n-state SV-XNFA in the unary case, as well as a lower bound of 2 n−1 − 1. XNFA are useful in practice, with applications in, for example, cryptography [2], and succinctly recognize groups of languages that cannot be recognized succinctly by NFAs [3].SV-NFAs are interesting per se [4], and so we present a comparison between SV-NFAs and SV-XNFAs.
It is customary for XNFA states to reflect the parity of the symmetric difference operation with the requirement that any state in the equivalent deterministic automaton (XDFA) contain an odd number of final XNFA states [5].For SV-XNFA, we extended this to both the accepting state set F a and the rejecting state set F r , requiring that an SV-XDFA state contain an odd number of either of the two final state sets, but not both.The implicit assumption was that an SV-XNFA state must itself either accept or reject or do neither, which is consistent with self-verification for union automata [4] and automata theory in general, where any particular state usually cannot both accept and reject.
In this paper we examine this implicit assumption more closely.We call the interpretation of SV-XNFA acceptance where it is required that F a ∩ F r = ∅ disjunctive acceptance and we define so-called GF(2)-acceptance, where we allow F a ∩ F r to be non-empty.The result is that a final state may be an accept state, a reject state, or it may be both, and we show the implications of this interpretation in Section 3. We present various results for SV-XNFA for each of these forms of acceptance, finally showing that 2 n−1 − 1 is indeed a tight bound for the state complexity of both forms of acceptance.

Preliminaries
Definition 1.An SV-XNFA with disjunctive acceptance is an SV-XNFA as defined in [1], i.e. a 6-tuple N = (Q, Σ, δ, Q 0 , F a , F r ), where Q, Σ, δ and Q 0 are defined as for XNFA, and F a and F r are the accept states and reject states, respectively, with the following requirement: for each input string w in Σ * , there exist an odd number of paths ending in accept states, and zero or an even number of the paths ending in reject states, or vice versa.This is consistent with the parity acceptance typically applied to XNFA.Furthermore, F a ∩ F r = ∅.
The transition function δ : Q × Σ → 2 Q (where 2 Q represents the power set over Q) can be extended to strings in the Kleene closure Σ * of the alphabet: For convenience, we write δ(q, w) to mean δ * (q, w).The choice of F a and F r for a given SV-XNFA N is called an SV-assignment of N .An SV-assignment where either F a or F r is empty, is called a trivial SVassignment.Otherwise, if both F a and F r are nonempty, the SV-assignment is non-trivial.An SV-assignment that results in a language that is not the empty language or the universal language is called an interesting SV-assignment.For a detailed introduction to unary SV-XNFA, the interested reader is referred to [1].
XNFA have been shown to be equivalent to weighted automata over the finite field (Galois field) of two elements, or GF(2) [5,6].Let N = (Q, Σ, δ, Q 0 , F ) be a unary XNFA with n states and Σ = {a}.We can represent the transition function δ : Q × Σ → 2 Q as an n × n matrix M over GF(2) whose (p, q)-th entry represents the weight (1 or 0) of the transition from p to q.Such a matrix has a characteristic polynomial c(X) = det(XI − M ), where I is the identity matrix.Note that in [1] we used column vectors to represent the transitions from one state to another.In this paper we use row vectors as described, because it allows for a more intuitive presentation of the matrix and vector multiplication that follows.However, the results are identical, since any matrix and its transpose have the same characteristic polynomial.
We encode the initial states Q 0 as a vector of length n of elements in GF(2), namely v(Q 0 ) = [q 00 q 01 ... q 0n−1 ], where q 0i = 1 if q i ∈ Q 0 and q 0i = 0 otherwise.Similarly, we encode the final states as an n-length vector, v(F ) = [q F0 q F1 ... q Fn−1 ].We abuse notation by letting δ : Q × Σ → 2 Q (a function to sets of states) and δ : Q × Σ → Z n 2 (a function to vectors of length n over GF(2)) depending on the context.Then the weight of a word w k of length k is given by In fact, v(Q 0 )M k is a vector that encodes the XNFA states reachable from the initial states after reading k letters, or equivalently, it encodes the XDFA state that is reached from the initial state after reading k letters.That is, ∆(w) = δ(w)v(F ) T .
The important advantage of this interpretation is the fact that one can perform a change of basis on the transition matrix and initial and final state vectors of an XNFA to produce an equivalent XNFA.This ability is essential in, for example, minimisation algorithms for XNFA [6].
Let N = (Q, Σ, δ , Q 0 , F ) be an XNFA, with transition matrix M = A −1 M A for some non-singular n × n matrix A, and let Q 0 and F be such Now, if we require for SV-XNFA that F a and F r be disjunct, a similar change of basis where v(F a ) T = A −1 v(F a ) T and v(F r ) T = A −1 v(F r ) T would not necessarily result in an equivalent SV-XNFA, since the resulting F a and F r might not be disjunct.Given M and Q 0 , it might be possible to choose another F a and F r that are disjunct so that the result is an SV-XNFA, but it is not immediately clear that such a choice would always be possible nor that the language would be preserved [7].
This brings us to the interpretation of SV-XNFA acceptance that excludes the requirement that F a and F r be disjunct.The result is that any SV-XNFA state is allowed to be both an accept and a reject state, or one or neither, as long as the SV-condition is met, i.e. that every word is either explicitly accepted by the automaton or explicitly rejected, but not both.We call this GF(2)-acceptance, since it is consistent with the interpretation of XNFA as weighted automata over GF(2) because a change of basis results in an equivalent XNFA (see Section 3).Definition 2. An SV-XNFA with GF(2)-acceptance is an SV-XNFA as defined in [1], i.e. a 6-tuple N = (Q, Σ, δ, Q 0 , F a , F r ), where Q, Σ, δ and Q 0 are defined as for XNFA , and F a and F r are defined as in the disjunctive acceptance case, but without the requirement that F a ∩ F r = ∅.
Note that an SV-assignment for disjunctive acceptance is also an SV-assignment for GF(2)-acceptance, but the reverse is not necessarily true, since the latter may involve assigning some states to both F a and F r .

Unary XNFA: matrices and polynomials over GF(2)
Unary XNFA have been shown to be equivalent to linear feedback shift registers (LFSRs) [3].We now give some relevant results from [2] relating LFSRs, and hence unary XNFA, to matrices and polynomials over GF (2).
Any n × n matrix M over GF(2) has a characteristic polynomial c(X) = det(XI − M ).On the other hand, every polynomial c(X) over GF (2) is the characteristic polynomial of some matrix M of the form shown in Fig. 1. M is said to be the companion matrix of c(X).The following theorem further relates matrices and polynomials over GF(2).
[2] Every matrix M over GF( 2) is similar to a matrix M of the form shown in Figure 2, where each of the submatrices A i is a companion matrix of a polynomial that is irreducible over GF(2) or of a power of a polynomial that is irreducible over GF (2), and the 0's are 0 submatrices of appropriate sizes.
Each c(X) over GF( 2) is associated with a certain cycle structure.Specifically, the properties of the characteristic polynomial of a unary XNFA N allow conclusions about the possible length of the cycle of states of its equivalent XDFA N D (see [1] in particular, as well as for example [2,3,8]).The choice of initial states for an XNFA determines which cycle in its polynomial cycle structure is the equivalent XDFA.
We say that a matrix M has an SV-assignment if some XNFA with M as its transition matrix has an SV-assignment.
In the rest of this paper, we consider only unary SV-XNFA with non-singular matrices, whose cycle structures do not include transient heads, i.e. states that are only reached once before a cycle is reached.By Lemma 1 of [1], this means that we only consider matrices with a characteristic polynomial c(X) = X n + c n−1 X n−1 + ... + c 1 X + c 0 that does not have X as a factor, and hence c 0 = 1.

Unary XNFA: linear recurrences over GF(2)
Since the structure of an XDFA is cyclic, for any state d k of the XDFA that is reached after k letters have been read, there is some integer l so that, if We introduce the notion of linear recurrences with respect to XNFA to provide more information about how XDFA states occur together in a cycle.A linear recurrence over a finite field has a characteristic polynomial [9].Specifically, the polynomial c(X) = X n + c n−1 X n−1 + ... + c 0 characterises the linear recurrence s t = c n−1 s t−1 +c n−2 s t−2 +...+c 0 s t−n .Let c(X) be the characteristic polynomial of 1. a transition matrix M for an n-state XNFA N , 2. a linear recurrence over GF(2), namely Let st = [s t0 s t1 ... s tn−1 ] be a vector of length n of elements in GF (2).Then, (1) . The linear recurrence and the behaviour of the XNFA are both characterised by c(X),

Notation
In this paper we let si refer to either the vector representing some set of states, or the set of states themselves, depending on the context.We use the symbol ⊕ and its sigma notation equivalent to denote the boolean XOR operation when applied to boolean ones and zeroes, and the symmetric difference set operation when applied to sets, and specifically sets of states.

Main Results
This section presents results on SV-XNFA with both disjunctive acceptance and GF(2)-acceptance.We start by giving an example, to which we will refer back in the rest of the section, as various notions are discussed.
Example 1.Let N be an SV-XNFA with Q 0 = {q 0 }, F a = {q 0 , q 1 } and F r = {q 2 , q 3 } and with its transition matrix being the companion matrix M for the polynomial c(X) = X 4 + X 3 + X 2 + 1 given in Fig. 1.Let the matrices A and M (also shown in Fig. 1) be related to M in the sense that Fig. 6.N D now we only say that N and N are SV-XNFA derived from N (both have M as their transition matrix), and their equivalent XDFA's are given in Fig. 5 and Fig. 6, respectively, with a double edge indicating an accept state and a thick edge indicating a reject state.
Our first lemma provides a way to determine, given any cycle, whether an SVassignment is possible.
Lemma 1.Let (d 1 , d 2 , ..., d m ) be a cycle representing an XDFA where d i ⊆ Q for 1 ≤ i ≤ m, and Q is the set of states of the equivalent XNFA.Given either disjunctive acceptance or GF(2)-acceptance, the cycle has an SV-assignment if and only if for some some choice of Q F ⊆ Q, where p j = 1 for all q j ∈ Q F and p j = 0 otherwise, then m i=1 qj ∈di Proof.The expression in Equation 3 can only evaluate to 1 if every XDFA state d i contains an odd number of XNFA states that result in a value of 1.This means that for some choice of Q F , an odd number of its elements must be present in every XDFA state.For disjunctive acceptance, Q F represents those XNFA states that must be assigned to either F a or F r for the cycle to have an SV-assignment.
For GF(2)-acceptance, Q F represents those XNFA states that must be assigned to either F a or F r but not both for the cycle to have an SV-assignment.
That is, every XDFA state must contain an odd number of states that contribute to the count of either F a or F r but not both, so that one but not both of the counts sum to an odd number.
Since p ∧ p = p, we also have the following corollary.
We assign some index l > m to a repeated state and generalise in the following way for any L ⊆ {m + 1, m + 2, ...}: Example 2. Consider an XNFA with Q 0 = {q 0 , q 3 } and the transition matrix given in Fig. 1.Then the states of the equivalent XDFA are those shown in the cycles of Fig. 5 and Fig. 6, which leads to the following expression: If we choose choose Q F = {q 0 , q 1 }, the expression becomes the following: We can assign F a = {q 1 } and F r = {q 0 }, and for now we only note that it is an SV-assignment given either disjunctive acceptance or GF(2)-acceptance.Fig. 6 corresponds to this choice of final states.
Example 3. Consider again the XNFA and equivalent XDFA in Example 2. The characteristic polynomial of M is c(X) = X 4 + X 3 + X 2 + 1, so state transition behaviour is characterised by s The following two lemmas shed more light on linear recurrences in XDFA cycles.
Lemma 2. The RHS (right hand side) of the linear recurrence s has an odd number of terms if X + 1 is a factor of c(X) and an even number otherwise.
Lemma 3. Let d 1 be any state in an XDFA cycle of an equivalent XNFA with state set Q and let the cycle be characterised by the linear recurrence Let σ 1 = qj ∈d1 p j for some choice of Q F ⊆ Q so that p j = 1 if q j ∈ Q F and p j = 0 otherwise.Furthermore, let T ⊆ {2, ..., n} be the set of indices such that d 1 = k∈T d k .Then In the case where the cycle length m ≤ n, it is possible that d 1−i = d 1−j for some i, j.We assign to the l-th duplicate of a state d k (including any occurrences of d 1 itself ) the index lm + k, referring to it as d lm+k .
Theorem 2. An XNFA N with characteristic polynomial c(X) = X n +c n−1 x n−1 + ...+c 1 x+c 0 has no SV-assignment, given either disjunctive acceptance or GF(2)acceptance, if X + 1 is not a factor of c(X).
Proof.From the discussion in Section 2.2, we know that the state transition behaviour of N is described by That is, in its equivalent XDFA N D , each state is the ⊕-sum of some number of states in its cycle.Consider any cycle of N D and let d 1 be any state in the cycle.Let T = {2, ..., n} and let T 1 ⊆ T be the set of indices so that If m > n, we use Equation 3from Lemma 1 as well as Lemma 3 to determine if the cycle has an SV-assignment.Since Lemma 1 applies to both disjunctive and GF(2)-acceptance, the rest of the proof applies similarly.
If m ≤ n, we let K = {i ∈ T 1 | i > m} and use Equation 5from Corollary 1 and Lemma 3 in the following way: In both cases, if c(X) does not have X + 1 as a factor, then by Lemma 2, |T 1 | is even.Therefore, i∈T1 σ i ∧ i∈T1 σ i = 0, and so the cycle does not have an SV-assignment.
Having shown that a characteristic polynomial with X + 1 is a necessary condition for a to have an SV-assignment, we now prepare the ground for showing in Theorem 3 that it is also a sufficient condition.We first determine that performing a change of basis on an SV-XNFA always results in another SV-XNFA, albeit in different ways for disjunctive acceptance and GF(2)-acceptance.
Lemma 4. Given GF(2)-acceptance, for any n-state XNFA N with transition matrix M , if N has an SV-assignment, then there is an N with transition matrix M that is similar to M , so that N has an SV-assignment and N and N accept the same language.Hence, if N has an (interesting) SV-assignment, then so does N .
Proof.If M is similar to M , then M = A −1 M A for some non-singular n × n matrix A. We encode the initial states as the vector v(Q 0 ) = [q 00 q 01 ... q 0n−1 ], where q 0i = 1 if q 0i ∈ Q 0 and q 0i = 0 otherwise.Similarly, we let v(F a ) = [q a0 q a1 ... q an−1 ] and v(F r ) = [q r0 q r1 ... q rn−1 ], where q ai and q ri indicate membership to F a and F r respectively.We define the following functions, where the SV-constraint is choosing F a and F r in such a way that accept(N, a k ) = reject(N, a k ) for any k.
Now, we choose the initial states Q 0 , and final states F a and F r so that v(Q By assumption, F a and F r are an (interesting) SV-assignment for N , and so F a and F r are an (interesting) SV-assignment for N .Furthermore, N and N accept the same language.
Lemma 5. Given disjunctive acceptance, for any n-state XNFA N with transition matrix M , if N has an SV-assignment, then there is an N with transition matrix M that is similar to M , so that N has an SV-assignment, but N and N do not necessarily accept the same language.
Proof.We construct N so that Q 0 = Q 0 as in Lemma 4.However, we let F a = F a \ F r and F r = F r \ F a .That is, F a is the set of states that occur in F a but not in F r and vice versa for F r , so that F a ∩ F r = ∅.Recall from Lemma 1 that for F a and F r to be an SV-assignment for GF(2)-acceptance, there must be some Q F so that an odd number of XNFA states in each XDFA state are either accept or reject states but not both.F a and F r are precisely those states, and so are an SV-assignment for disjunctive acceptance.
However, it is possible that F a ⊂ F r or vice versa, and so it is possible that F a or F r is empty even if F a and F r are non-empty.So although F a and F r are an SV-assignment, clearly N does not necessarily accept the same language as N .
Example 4. Let N be the SV-XNFA with matrix given in Fig. 1.Then the equivalent XDFA N D is the cycle as shown in Fig. 4. Note that in this cycle, both disjunctive acceptance and GF(2)-acceptance place the same constraints on possible SV-assignments, since the XNFA states each appear alone in XDFA states and therefore must accept or reject but cannot do both.
We use non-singular matrix A as shown in Fig. 1, and we perform two changes of basis: as described in Lemma 4 to get an XNFA N , and as described in Lemma 5 to get an XNFA N D .Both N and N have transition matrix M (Fig. 1).The equivalent XDFA N D with GF(2)-acceptance is the cycle as shown in Fig. 5, with F a = {q 1 , q 3 } and F r = {q 0 , q 3 }.Note, for example, that the state {q 0 , q 2 , q 3 } accepts, because it contains an odd number of accept states, i.e. q 3 , and an even number of reject states, i.e. q 0 and q 3 .The XDFA N D with disjunctive acceptance is shown in Fig. 6, with F a = {q 1 } and F r = {q 0 }.
The following lemma asserts the existence of SV-assignments for certain matrices.Lemma 6.Any matrix M that is a block diagonal matrix of companion matrices, with characteristic polynomial c(X) = (X + 1)φ(X), has an SV-assignment, given either disjunctive or GF(2)-acceptance.Theorem 3. Given either disjunctive acceptance or GF(2)-acceptance, any matrix M with characteristic polynomial c(X) = (X+1)φ(X) has an SV-assignment.
Proof.By Theorem 1, M is similar to some block diagonal matrix M with the companion matrices of factors of c(X) on the diagonal.By Lemma 6, M has an SV-assignment given either disjunctive acceptance or GF(2)-acceptance.Therefore, by Lemma 4 M has an SV-assignment given GF(2)-acceptance, and by Lemma 5 M has an SV-assignment given disjunctive acceptance.
The following theorem follows directly from Theorems 2 and 3.
Theorem 4. Any matrix M has an SV-assignment given either disjunctive acceptance or GF(2)-acceptance, if and only if its characteristic polynomial has X + 1 as a factor.
Along with Theorem 4, Lemma 7 and Theorem 5 that follow provide the grounds for concluding that 2 n−1 − 1 is a tight bound on the state complexity of unary SV-XNFA for both disjunctive acceptance and GF(2)-acceptance.
Lemma 7.For an XNFA with a characteristic polynomial c(X) with degree n that has X + 1 as a factor, the longest possible cycle has length 2 n−1 − 1.
Proof.Proof.Suppose c(X) has two irreducible factors, φ 1 = X + 1 and φ 2 , where φ 2 is an irreducible polynomial with degree n − 1.By Theorem 1 of [1], if φ 2 is primitive it has a single cycle of length 2 n−1 − 1, and together with X + 1 induces a cycle for c(X) of the same length.If it is non-primitive it has cycles of length b where b is a factor of 2 n−1 − 1, inducing cycles of length b for c(X) together with X + 1.Hence, the maximum cycle length is 2 n−1 − 1.Now suppose that c(X) has three irreducible factors, φ 1 = X +1, φ 2 of degree k ≤ n − 2 and φ 3 of degree n − k − 1, with k > n − k − 1. Cycles of c(X) induced together with X + 1 can only produce at most cycles of length 2 k − 1 < 2 n−1 − 1.Consider the cycle induced by φ 2 and φ 3 .Since it will have greatest possible length if 2 k and 2 n−k−1 are relatively prime, we assume this to be the case.The cycle induced has length lcm(2 k − 1, 2 n−k−1 − 1) = (2 k − 1) * (2 n−k−1 − 1).That is, Cycles of c(X) are induced by pairs of factors of c(X), and so if c(X) had more irreducible factors, they would have smaller degree and so would induce even shorter cycles.Therefore, 2 n−1 − 1 is the longest possible cycle for a polynomial c(X) of degree n that has X + 1 as a factor.Theorem 5. Given either disjunctive acceptance or GF(2)-acceptance, for any n ≥ 2, there is a language L n so that some n-state SV-XNFA accepts L n and the minimal SV-XDFA that accepts L n has 2 n−1 − 1 states.
Proof.Theorem 7 of [1] gives a proof of the statement with regards to disjunctive acceptance.Since any SV-assignment for disjunctive acceptance is also an SVassignment for GF(2)-acceptance, it is also a proof for the statement with regards to GF(2)-acceptance.

Conclusion
We have shown a close similarity between SV-XNFA with two different acceptance conditions, namely disjunctive acceptance and GF(2)-acceptance.In particular, they have the same state complexity bound of 2 n−1 − 1. Disjunctive acceptance shares a typical requirement of most other finite state automata, i.e. that a state cannot both accept and reject.However, for self-verification in unary XNFA, this removes the equivalence known between XNFA and weighted automata over GF (2), since a so-called change of basis does not preserve the language.This has implications for operations such as minimisation, which depend upon it [6].GF(2)-acceptance does preserve the equivalence, but results in the need for SV-XNFA states that both accept and reject.Whereas for disjunctive acceptance, neutral states are non-final, since they neither accept nor reject, GF(2)-acceptance introduces the notion of neutral final states that both accept and reject.While this is perhaps counter-intuitive, it allows for SV-XNFA that behave more predictably.