Unary Self-verifying Symmetric Difference Automata

. We investigate self-verifying nondeterministic ﬁnite automata, in the case of unary symmetric diﬀerence nondeterministic ﬁnite automata (SV-XNFA). We show that there is a family of languages L n ≥ 2 which can always be represented non-trivially by unary SV-XNFA. We also consider the descriptional complexity of unary SV-XNFA, giving an upper and lower bound for state complexity.


Introduction
Any nondeterministic finite automaton (NFA) has an equivalent deterministic finite automaton (DFA) which can by found by applying the subset construction [1].This subset construction uses the union set operation.Symmetric difference NFA (XNFA), on the other hand, employ the symmetric difference set operation [2] during the determinisation process with the subset construction.XNFA may also be considered as a special case of weighted automata over GF (2) [3].XNFA, even in the unary case, are interesting because of the different descriptional complexity when compared to traditional NFA.For example, an n-state unary XNFA may have an equivalent minimal DFA with 2 n − 1 states, whereas the bound is e Θ √ n ln n in the case of NFA [2].In this work, we consider selfverification for XNFA.
Self-verifying NFA (SV-NFA) [4][5][6] are automata with two kinds of final states, namely, accept states and reject states.Each path in the automaton may reach either an "Accept", "Reject" or "I do not know" state.Once a path has been found that either accepts or rejects, it is guaranteed that no other path with the same label will reach the opposite answer.Furthermore, every word is guaranteed one path that reaches either an accept or a reject state.Consequently, unlike with NFA, rejection is the result of reaching a reject state, and not the result of a failure to reach an accept state.
Assent and Seibert [4] showed that any n-state SV-NFA has an equivalent DFA with O(2 n / √ n) states.Jirásková and Pighizzini [6] improved their result, and showed a tight upper bound h(n), where h(n) grows like 3 n 3 , for an SV-NFA with a binary alphabet.In the unary case, it was shown that the upper bound of e Θ √ n ln n is not tight for unary SV-NFA.In this article, we define self-verifying XNFA (SV-XNFA), and consider the case of unary SV-XNFA.We show the existence of a family of languages accepted by unary SV-XNFA, and point out some conditions for the existence of n-state unary SV-XNFA.We also give an upper bound and lower bound for the state complexity.

Preliminaries
An NFA N is a five-tuple N = (Q, Σ, δ, Q 0 , F ), where Q is a finite set of states, Σ is a finite alphabet, δ : Q×Σ → 2 Q is a transition function (here, 2 Q indicates the power set of Q), Q 0 ⊆ Q is a set of initial states, and F ⊆ Q is the set of final (acceptance) states.The transition function δ can be extended to strings in the Kleene closure Σ * of the alphabet: δ (q, w 0 w 1 . . .w k ) = δ(δ(. . .δ(q, w 0 ), w 1 ), . . ., w k ) .
For convenience, we write δ(q, w) to mean δ (q, w).An NFA N is said to accept a string w ∈ Σ * if q 0 ∈ Q 0 and δ(q 0 , w) ∈ F , and the set of all strings (also called words) accepted by N is the language L(N ) accepted by N .Any NFA has an equivalent DFA which accepts the same language.The DFA equivalent to a given NFA can be found by the subset construction [1].In essence, the subset construction keeps track of all the states that the NFA may be in at the same time, and forms the states of the equivalent DFA by grouping of the states of the DFA.In short, for any A ⊆ Q and σ ∈ Σ.
An XNFA M = (Q, Σ, δ, Q 0 , F ) is defined similarly to an NFA, with the difference that the XNFA accepts a string w ∈ Σ * if q 0 ∈ Q 0 , and |δ(q 0 , w) ∩ F | is odd.This acceptance condition reflects the parity nature of the XNFA, so that a string is accepted when there is an odd number of paths which lead to final states [7].This definition of acceptance ensures that an XNFA can be seen as a special case of a weighted automaton [3].When the subset construction is applied to find the DFA equivalent to the XNFA, the symmetric difference (in the set theoretic sense) is used to reflect the parity of the paths.That is, For clarity, the DFA equivalent to an XNFA N is termed an XDFA and denoted with N D (with corresponding Q D , δ D etc).
It was shown (amongst others) in [2,7] that XNFA can be investigated by considering them as linear machines over the Galois field GF (2).We also use that approach in this work.Consider the transition table of a unary XNFA N = (Q, Σ, δ, Q 0 , F ), where each row represents a mapping from a state q ∈ Q to a set of states P ∈ 2 Q .Then P can be written as a vector with a one in position i if q i ∈ P , and a zero in position i if q i ∈ P .Hence, the transition table can be represented as a matrix of zeroes and ones (see Example 1).This is known as the characteristic or transition matrix of the XNFA.
Initial and final states can be represented by vectors, and appropriate vector and matrix multiplications over GF (2) represent the behaviour of the XNFA3 .For more detail, see for example [3].For the purposes of this work, we consider only unary XNFA with one alphabet symbol.In general, for larger alphabets, there is a matrix associated with each alphabet symbol.
Let M be the characteristic matrix of N .The characteristic polynomial c(X) of M is given by det(M − IX), and c(X) is said to be the characteristic polynomial of N .
Note that the characteristic matrix of an XNFA does not contain information about the choice of initial and final states, so in fact any such matrix represents a set of XNFA sharing a transition graph but differing in choice of initial and final states.A characteristic polynomial is associated with the matrix, but many matrices may share the same polynomial, so a polynomial over GF(2) represents a set of characteristic matrices.A useful result from linear field theory [8] states that any monic polynomial c(X) = X n + c n−1 X n−1 + . . .c 2 X 2 + c 1 X + c 0 over GF(2) has a so-called companion matrix (also called a normal form matrix) M of the form Thus, given a polynomial over GF (2), it is possible to construct its companion matrix directly, and then construct an XNFA from the companion matrix.Such an XNFA will have the transition function δ(q i , a) = q i+1 for 0 ≤ i < n − 1, and q j ∈ δ(q n−1 , a) for all j such that c j = 0.
Finally, each c(X) over GF(2) is associated with a certain cycle structure.Specifically, given a unary XNFA N , the properties of its characteristic polynomial c(X) allow conclusions about the possible length of the cycle of states of the equivalent XDFA N D (see for example [2,8,9]).Theorem 1. [8] Let c(X) be a polynomial of degree n over GF(2) that does not have X as a factor.(2), consider its factors.For each cycle of length k i induced by factor φ i (X) and for each cycle of length k j induced by factor φ j (X), c(X) has gcd(k i , k j ) cycles of length lcm(k i , k j ).
The choice of initial states for N determines which cycle in the cycle structure of c(X) represents the equivalent XDFA N D .We give an example of an XNFA to illustrate the discussion above.
The transition function δ D of the equivalent XDFA N D is shown in Table 2 and N D is shown in Fig. 1.Note that [q 0 , q 1 , q 3 ] / ∈ F D , since it contains an even number of states from F .We now recap the definition of SV-NFA: , where Q, Σ, δ and Q 0 are defined as for standard NFA.Here, F a ⊆ Q and F r ⊆ Q are the sets of accept and reject states, respectively.The remaining states, that is, the states belonging to Q \ (F a ∪ F r ), are called neutral states.For each input string w in Σ * , it is required that there exists at least one path ending in either an accept or a reject state; that is, δ(q 0 , w)∩(F a ∪F r ) = ∅ for any q 0 ∈ Q 0 , and there are no strings w such that both δ(q 0 , w) ∩ F a and δ(q 1 , w) ∩ F r for any q 0 , q 1 ∈ Q 0 are nonempty.
Unlike an NFA, an SV-NFA leads to an explicit answer state for any string w ∈ Σ * .Hence, its equivalent DFA must do so too.The path for each w in a DFA is unique, so each state in the DFA is an accept or reject state.Hence, for any DFA state d, there is some SV-NFA state q r ∈ d such that q r ∈ F a so that d ∈ F a D or q r ∈ F r so that d ∈ F r D .Since each state in the DFA is a subset of states of the SV-NFA, accept and reject states cannot occur together in a DFA state.That is, if d is a DFA state, then for any p, q ∈ d, if p ∈ F a then q / ∈ F r and vice versa.
Combining the notions of SV-NFA and XNFA, we now define SV-XNFA.
, where Q, Σ, δ and Q 0 are defined as for XNFA, and F a and F r are defined as for SV-XNFA.That is, each state in the SV-XDFA equivalent to N must contain an odd number of states from either F a or F r , but not both.
Note that the acceptance condition for SV-XNFA (or the SV condition) implies that if a state in the SV-XDFA of an SV-XNFA N contains an odd number of states from F a , it may also contain an even number of states from F r , and so belongs to F a D , and vice versa.Parity is not applied to neutral states, so that any state in the XDFA may contain any number of neutral states from N .
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.Definition 3. Let N be an XNFA.A non-trivial SV-assignment for N such that L(N ) = ∅ and L(N ) = Σ * , is called an interesting SV-assignment.An SV-XNFA with an interesting SV-assignment is called an interesting SV-XNFA.
We now investigate when interesting SV-assignments are possible for unary XNFA.Consider any unary XNFA N and its corresponding transition matrix M over GF (2).Then M can be either singular, or non-singular.If M is singular, it is known [8] that the XDFA N D equivalent to N forms a state graph with a transient head followed by a cycle.If M is non-singular, then N D forms a cycle.
In the rest of this article, we only consider unary XNFA whose transition matrices are non-singular.By Lemma 1 below, this means we only consider polynomials over GF(2) that do not have X as a factor.Noting the correspondence between a given XNFA, its matrix representation over GF (2), and the corresponding characteristic polynomial c(X), we investigate whether there are properties of polynomials that guarantee the existence or non-existence of SV-assignments for XNFA with certain characteristic polynomials.We are specifically interested in finding properties that will guarantee the existence of SV-XNFA with n states that accept languages that require n D > n states in the equivalent SV-XDFA.This implies that we focus on interesting SV-assignments when determining the existence of SV-XNFA for certain polynomials.
Lemma 1.The companion matrix of a polynomial over GF(2) is singular if and only if X is a factor of the polynomial.
Proof.Let c(X) be some polynomial over GF(2) of degree n.If and only if X is a factor of c(X), then the coefficient of X 0 is zero, and so in the companion matrix, M 0,n−1 = 0. Then det(M ) = 0, which implies that M is singular [9].Theorem 2. There is no n-state SV-XNFA such that its characteristic polynomial is primitive and irreducible.
Proof.Let N = (Q, Σ, δ, Q 0 , F ) be an n-state unary XNFA with characteristic polynomial c(X).If c(X) is primitive and irreducible, then the XDFA N D forms a cycle of length 2 n − 1.Each state in the cycle is a non-empty subset of Q.If there are 2 n − 1 states, then every non-empty subset of Q is a state in the XDFA, including the state consisting of all the states in Q.
Since each q ∈ Q appears as a state in the cycle, each q must either be an accept or reject state.There are two cases to consider.If n is even, then the state consisting of all the states in Q contains either an even number of accept states and an even number of reject states, or an odd number of accept states and an odd number of reject states.In either case the SV condition is violated, since each SV-XDFA state must contain an odd number of either F a or F r , but not both.
On the other hand, if n is odd, then -in order for the state consisting of all the states in Q to be either accepting or rejecting -some A ⊂ Q where |A| is odd must contain, say, the accepting states, while Q \ A contains the rejecting states and |Q \ A| is even.But the XDFA also contains a state consisting of Q \ A, that is a state consisting entirely of an even number of reject states.Hence if n is odd, this necessarily results in a neutral state in the XDFA, which again violates the SV condition.Therefore, no SV-XNFA is possible.
Note that Theorem 2 excludes all SV-assignments for primitive polynomials, including trivial or uninteresting SV-assignments.On the other hand, we now prove that for a certain family of polynomials, interesting SV-assignments are always possible.Theorem 3. Let c(X) = X n + X n−1 + X + 1, with companion matrix M , and let N be an XNFA with transition matrix M and Q 0 = {q 0 }.Then N has an interesting SV-assignment, and the equivalent XDFA N D forms a cycle of length 2n − 2.
each state in the XDFA contains an odd number of states from either F a or F r and zero or an even number of states from the other, and hence will be a non-trivial SV-assignment.Since [q 0 ], [q 1 ], ..., [q n−1 ] ∈ Q D , it will also necessarily be an interesting SV-assignment.

Languages for unary SV-XNFA
Given the existence of SV-XNFA for certain c(X) as shown above, we may now consider whether there is a family of languages L n≥2 such that each L i may be represented by an SV-XNFA in a non-trivial way.That is, we consider whether there are languages that may be represented by SV-XNFA with n states that require n D > n states in their equivalent SV-XDFA.The next theorem presents such a language family.Theorem 4. For any integer n ≥ 2, let L n = a (2n−2)i+j , for i ≥ 0 and 0 ≤ j < n − 1, and L c n = a (2n−2)i+j , for i ≥ 0 and n − 1 ≤ j < 2n − 2. Then there exists a pair of SV-XNFA with n states and the same transition graph that accept L n and L c n respectively.Moreover, these languages each require an SV-XDFA with 2n − 2 states.
Proof.Using the construction given in the proof of Theorem 3, we construct N with n states so that N D has 2n−2 states.The states in the SV-XDFA are given in Figure 3. Then Since this pattern of n − 1 accept states followed by n − 1 reject states requires 2n − 2 states, N D is the minimal SV-XDFA that accepts L n . Also, Similarly as for L n , 2n − 2 states are required to accept L c n .This leads to a pair of SV-XNFA with n states and the same transition graphs that accept L n and L c n respectively, while in the deterministic case, an SV-XDFA with at least 2n − 2 states is required.The ability of self-verifying automata to represent complementary pairs of languages using the same transition graph is discussed in [10].

Descriptional complexity of unary SV-XNFA
We now turn to the question of state complexity for SV-XNFA.By Theorem 1, the maximum cycle length for any c(X) of degree n is 2 n − 1, and therefore this is an upper bound for the number of states in the equivalent XDFA of any XNFA with n states.However, it is not a tight upper bound for SV-XNFA, because this cycle length is only achieved if c(X) is primitive and from Theorem 2 it is clear such XDFA cannot have SV-assignments.Instead, we show in this section that for certain c(X) of degree n, there exist SV-XNFA with characteristic polynomial c(X) for which the equivalent SV-XDFA have at least 2 n−1 − 1 states, and that for any n ≥ 2, there is a language L n that can be represented by an n-state SV-XNFA while requiring an (2 n−1 − 1)-state SV-XDFA.Lemma 2. Let c(X) = (X + 1)φ(X) be a polynomial of degree n with nonsingular companion matrix M , and let N be an XNFA with transition matrix M and Q 0 = {q 0 }.Then the equivalent XDFA N D has the following properties: Since X + 1 is a factor, 1 is a root of the polynomial, and so c(X) must have an even number of terms, including X 0 .The companion matrix M of c(X) is .
The last column contains an odd number of 1's, representing an odd number of transitions from state q n−1 .That is, δ(q n−1 , a) = {q c |c ∈ C} = Q c where |C| is odd.
Since δ(q i , a) = q i+1 for all i < n−1, N D contains the states [q 0 ], [q 1 ], ..., [q n−1 ], as well as [Q c ], and therefore forms a cycle with at least n+1 states.These states all have odd size, so it only remains to show that all other states in the cycle must have odd size as well.
Therefore, any state with odd size in N D transitions to a state with odd size, and so all the states in the XDFA cycle have odd size.
Theorem 5. Let c(X) = (X + 1)φ(X) be a polynomial of degree n with nonsingular companion matrix M .Then there is an XNFA N with transition matrix M and Q = {q 0 } for which there is an interesting SV-assignment.
Proof.From Lemma 2 it follows that the XNFA N whose transition matrix is the companion matrix of c(X) has a cycle with length greater than n in which each state has odd size.Furthermore, [q 0 ], [q 1 ], ..., [q n−1 ] are all states in Q D , so q 0 , q 1 , ..., q n−1 must all be in either F a or F r .
Therefore, any choice of F a and F r so that F a ∪ F r = Q and F a ∩ F r = ∅ with F a and F r non-empty will guarantee that each state in the XDFA contains an odd number of states from either F a or F r and zero or an even number of states from the other, and hence will be an interesting SV-assignment.Lemma 3. Let c(X) = (X + 1)φ(X) be a polynomial of degree n with nonsingular companion matrix M and where φ(X) is a primitive polynomial.Let N be an XNFA with transition matrix M and Q 0 = {q 0 }, then N D forms a cycle of length 2 n−1 − 1.
Proof.We calculate the number and lengths of all cycles for c(X).By Theorem 1, factors X + 1 and φ(X) each induce a single cycle of length 2 m − 1 with m = 1 and m = n − 1 respectively, as well as a single cycle each of length 1, which is the so-called empty cycle ε.Therefore c(X) has the following cycles: -ε X+1 and X + 1: gcd(1, 1) cycle(s) of length lcm(1, 1) -ε φ(X) and X + 1: gcd(1, 1) cycle(s) of length lcm(1, 1) -ε X+1 and φ(X): gcd(1, Therefore, c(X) has two cycles of length 1, one of which is ε c(X) , and two cycles of length 2 n−1 − 1.By Lemma 2, N D must be a cycle with length greater than n, so it must have length 2 n−1 − 1. Theorem 6.For any n ≥ 2, there is an interesting SV-XNFA N whose equivalent N D has 2 n−1 − 1 states.
Proof.Let c(X) = (X + 1)φ(X) be a polynomial of degree n, where φ(X) is a primitive polynomial, and let M be its non-singular companion matrix.Let N be an XNFA with transition matrix M and let Q 0 = {q 0 }.By Theorem 5, N has an interesting SV-assignment, and by Lemma 3, the equivalent N D has 2 n−1 − 1 states.
The following theorem shows that, for any n ≥ 2, there exists an n-state SV-XNFA that accepts a language requiring at least 2 n−1 − 1 states in an equivalent SV-XDFA.Theorem 7.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.Let c(X) = (X + 1)φ(X) where φ(X) is a primitive polynomial and let c(X) have degree n.We construct an SV-XNFA N with n states whose equivalent N D has 2 n−1 − 1 states as in Theorem 6, and let F a = {q 0 } and F r = Q \ F a .Then L = a (2 n−1 −1)i+j for i ≥ 0 and j ∈ J, where J is some set of integers.Now, from the transition matrix of N it follows that 0, n ∈ J, while 1, 2, ..., n − 1 / ∈ J, since q 0 ∈ δ(q 0 , a n ) and q 0 / ∈ δ(q 0 , a m ) for m < n.If there is an N D with fewer than 2 n−1 − 1 states that accepts L, then there must be some d j = {q 0 } ∈ Q D such that q 0 ∈ d j , q 0 ∈ δ(d j , a n ) and there is no m < n so that q 0 ∈ δ(d j , a m ).
Let d k be any state in N D such that d k = {q 0 }.Let max(d k ) be the largest subscript of any SV-XNFA state in d k .Then max(d k ) > 0. Let m = n−max(d k ), so m < n, then from the transition matrix of N it follows that q 0 ∈ δ(d k , a m ).That is, for any d k there is an m < n so that q 0 ∈ δ(d k , a m ).
Therefore, there is no N D with fewer than 2 n−1 − 1 states that accepts L.
This gives a lower bound of 2 n−1 −1 for the state complexity of unary SV-XNFA.

Conclusion
We introduced the notion of unary self-verifying symmetric difference automata, and showed that for certain polynomials, interesting SV-XNFA exist.We also showed that for primitive polynomials, no SV-assignments for unary XNFA are possible.This provides an upper bound of 2 n − 1 on the state complexity of unary SV-XNFA that is known not to be tight.Furthermore, we demonstrated that 2 n−1 − 1 is a lower bound for unary SV-XNFA.Directions for future work include determining a tight bound, as well as providing a more detailed exposition of the properties of polynomials over GF(2) that lead to SV-assignments, and especially interesting SV-assignments.Also, further consideration may be given to the question of which languages can be represented succinctly by SV-XNFA.

Table 3 .
Transition function of N

Table 4 .
Transition function of ND