An efficient algorithm to decide periodicity of b-recognisable sets using MSDF convention
Bernard Boigelot, Isabelle Mainz, Victor Marsault, Michel, Rigo

TL;DR
This paper presents a quasi-linear algorithm for deciding whether a $b$-recognisable set of integers, represented by a finite automaton in MSDF convention, is eventually periodic, extending previous work limited to LSF representation.
Contribution
The paper introduces an efficient algorithm for determining periodicity of $b$-recognisable sets in MSDF notation, which was previously only addressed in LSF notation.
Findings
Algorithm runs in quasi-linear time.
Extends decidability results to MSDF digit order.
Provides practical decision procedure for periodicity.
Abstract
Given an integer base , a set of integers is represented in base by a language over . The set is said to be -recognisable if its representation is a regular language. It is known that eventually periodic sets are -recognisable in every base , and Cobham's theorem implies the converse: no other set is -recognisable in every base . We are interested in deciding whether a -recognisable set of integers (given as a finite automaton) is eventually periodic. Honkala showed that this problem decidable in 1986 and recent developments give efficient decision algorithms. However, they only work when the integers are written with the least significant digit first. In this work, we consider the natural order of digits (Most Significant Digit First) and give a quasi-linear algorithm to solve the problem in this case.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
\DOIPrefix
An efficient algorithm to decide periodicity of -recognisable sets using MSDF convention
Bernard Boigelot
Montefiore Institute & Department of Mathematics, Université de Liège, Belgium
{bernard.boigelot, isabelle.mainz, victor.marsault, m.rigo}@ulg.ac.be
Isabelle Mainz
Montefiore Institute & Department of Mathematics, Université de Liège, Belgium
{bernard.boigelot, isabelle.mainz, victor.marsault, m.rigo}@ulg.ac.be
Victor Marsault Supported by a Marie Skłodowska-Curie fellowship, co-funded by the European Union. Montefiore Institute & Department of Mathematics, Université de Liège, Belgium
{bernard.boigelot, isabelle.mainz, victor.marsault, m.rigo}@ulg.ac.be
Michel Rigo
Montefiore Institute & Department of Mathematics, Université de Liège, Belgium
{bernard.boigelot, isabelle.mainz, victor.marsault, m.rigo}@ulg.ac.be
Abstract
Given an integer base , a set of integers is represented in base by a language over . The set is said to be -recognisable if its representation is a regular language. It is known that eventually periodic sets are -recognisable in every base , and Cobham’s theorem implies the converse: no other set is -recognisable in every base .
We are interested in deciding whether a -recognisable set of integers (given as a finite automaton) is eventually periodic. Honkala showed that this problem decidable in 1986 and recent developments give efficient decision algorithms. However, they only work when the integers are written with the least significant digit first.
In this work, we consider the natural order of digits (Most Significant Digit First) and give a quasi-linear algorithm to solve the problem in this case.
keywords:
integer-base systems; automata; recognisable sets; periodic sets.
Introduction
Let be an integer base. We let denote the canonical alphabet of base- digits. If belongs to , we let denote the value of in base , i.e., . Note that the leftmost digit is the most significant one. We let denote the (shortest) base- representation of . We set to be the empty word . If reference to the base is needed, we write . Thus is the unique word over not starting with [math] and such that . Moreover, for every such that , there exists such that .
Our contribution
Let be an integer base. In this paper, we develop an algorithm to decide whether a given deterministic automaton over the alphabet accepts, by value, an (eventually) periodic set of integers. More precisely, the question is to decide whether there exist integers and such that, for all words , if , then is accepted by if and only if is accepted as well. Acceptance by value means that words sharing the same value are either all accepted or all rejected. Stated otherwise, a word is accepted by if and if only if is accepted. The main result of this paper is the following one.
Theorem 0.1**.**
Given an integer base and a -state deterministic automaton over the alphabet , it is decidable in time whether or not accepts, by value, some eventually periodic set of integers.
We stress the fact that the input automaton reads words most significant digit first (MSDF). This is an important difference with other results discussed in the literature. For instance, an efficient algorithm to solve this decision problem is provided for automata reading least significant digits first (LSDF) [15]. One can therefore think that it is enough to take the reversal of and thus consider entries LSDF. Nevertheless, the reversal of has first to be determinised. This potentially leads to an exponential blow-up in the number of states and thus to an inefficient procedure.
Motivations and related results
We say that a set is -recognisable if is accepted by some finite automaton. One reason why eventually periodic sets of integers play a special role comes from the celebrated theorem of Cobham about the dependence to the base of -recognisability.
Theorem** (Cobham, [11]).**
Let be two multiplicatively independent integers. A set of integers is such that the languages and are both accepted by finite automata if and only if is eventually periodic.
In combinatorics on words, when studying morphic words (for details and definitions, for instance, see [2, 5]), Cobham’s theorem can be reformulated as follows. Let be two multiplicatively independent integers. An infinite word is both -automatic and -automatic if and only if is of the form where are finite words. Indeed, a set of integers is -recognisable if and only if its characteristic sequence is -automatic. The decision problem considered in our Theorem 0.1 is well known to be decidable.
Theorem** (Honkala, [13]).**
It is decidable whether or not a given -automatic word is ultimately periodic.
Complexity issues are however not all considered in Honkala’s paper. The decidability of our problem of interest can also be obtained using a first-order logic characterization of -recognisable sets given by Büchi’s theorem, and the fact that Presburger arithmetic is decidable [9, 1]. These independent approaches all lead to decision procedures with exponential complexity.
Using LSDF convention, efficient decision procedures are known. First, Leroux obtained a quadratic decision procedure [14] for utimately-periodic -recognisable sets of integers. Then, the result was improved as follows.
Theorem** (Marsault, Sakarovitch, [15]).**
Given an integer base and a -state deterministic automaton over the alphabet , it is decidable in time whether or not accepts, with LSDF convention, some eventually periodic set of integers.
Leroux’s result is stated in a multi-dimensional setting, i.e., the problem is to decide whether or not a -recognisable subset of is semi-linear. In that direction, see [19, 17, 14].
Generalisation to real numbers
Real numbers can be encoded in a base by extending positional encoding to infinite words: A word encoding a real is composed of a finite prefix corresponding to an integer part, followed by a single occurrence of a distinguished symbol acting as a separator, and an infinite suffix representing a fractional part. Infinite-word automata are then able to recognise sets of reals. It has been established that weak deterministic automata, a restricted class of infinite-word automata, are sufficiently expressive for recognising all sets definable in mixed integer and real first-order additive arithmetic [7].
The properties of sets of real numbers that can be recognised by weak deterministic automata in all bases have been investigated [6]. Such sets generalise to the real domain the notion of eventual periodicity; they precisely correspond to finite combinations of eventually periodic sets of integers, and intervals of . Checking whether an automaton recognises such a set can be done by first splitting this automaton into finite-state machines operating on the integer and fractional parts of encodings. The former are then checked in the same way as for MSDF integer encodings, and the latter by verifying that they obey the simple structure documented in [6], which is a simple operation. As a consequence, the algorithm developed in this paper also leads to an efficient procedure for checking that a weak deterministic automaton recognises an eventually periodic set of reals.
Generalisation to other numeration systems
Automatic words form a particular class of morphic words. Similarly, integer-base systems are special cases of more general numeration systems such as those built on a linear recurrent sequence. One can define a numeration system as a one-to-one map from to a language over a finite alphabet. The integer is mapped to its representation within the considered system. Hence, it is natural to ask, for given a numeration system and a subset of accepted by a finite automaton , whether or not the -recognisable set is eventually periodic.
On the one hand, Honkala’s result is extended as follows. It is decidable whether or not a given morphic word is ultimately periodic [12, 16]. On the other hand, Büchi’s theorem can be extended to linear numeration systems whose characteristic polynomial is the minimal polynomial of a Pisot number. See, for details, [8]. In that setting, several decision problems in combinatorics on words, including the ultimate periodicity problem, are decidable [10]. Using Honkala’s techniques, the decision problem considered in our Theorem 0.1 is generalized to a large class of numeration systems in [4]. In particular, there are systems in this class for which the logical setting may not be applied. For all these decidability results presented in a wider context, no efficient procedure is known.
1 Preliminaries
In this paper, we only consider deterministic accessible finite automata with an input alphabet of the form . We use the acceptance-by-value convention. Thus, we may assume that the initial state bears a loop with label [math]. In particular, this will always be the case after minimisation. Let be an automaton. Its set of states (resp. its initial state, its set of final states) is denoted by (resp. , ). If the considered automaton is clear from the context, is the state such that s\xrightarrow{\makebox[11.84024pt][c]{\scriptstyle\hskip 1.20552ptu\hskip 1.80835pt}}s^{\prime}. The language accepted by is denoted by . In this section, we recap basic results about automata.
1.1 Automaton morphisms and pseudo-morphisms
Definition 1.1**.**
Given two (accessible) automata and over , an automaton morphism is a function that satisfies:
[TABLE]
Definition 1.2**.**
If a function satisfies , and but not necessarily , then we say that we have an automaton pseudo-morphism.
Definition 1.3**.**
Two states of an automaton are Nerode-equivalent if, for every word , exists and is final if and only if exists and is final.
The next result is classical. See, for instance, [18].
Theorem 1.4** (Myhill–Nerode).**
Let be a complete automaton. Among all the complete automata accepting , up to isomorphism, there exists a unique one with a minimal number of states, called the minimisation of . Moreover, if denotes the minimisation of , then there exists an automaton morphism (called the minimisation morphism) such that
[TABLE]
If is an automaton and is a word, we write as a shorthand for , i.e., the state reached by the run of in .
Lemma 1.5**.**
Let and be two complete (and accessible) automata. There exists a pseudo-morphism if and only if every pair of words , such that also satisfies .
Proof 1.6**.**
Forward direction. Since a pseudo-morphism respects transitions and the initial state, it follows that, for every word , . The statement follows immediately.
Backward direction. For every state , we choose a word such that (such a word exists because is accessible). We define a function as follows. For every state , . Let us show that is an automaton pseudo-morphism.
Let be a state of and let be a word such that . Since , the hypothesis implies . The definition of is therefore independent of the choice of the words .
In particular, hence satisfies (1). Moreover, since both and are complete, and since is a total function, also satisfies (2). Let t\xrightarrow{\makebox[11.84024pt][c]{\scriptstyle\hskip 1.20552pta\hskip 1.80835pt}}t^{\prime} be a transition of . By definition and since the definition of does not depend on the choice of the words , we may assume that . It then follows that
[TABLE]
In other words, \phi(t)\xrightarrow{\makebox[11.84024pt][c]{\scriptstyle\hskip 1.20552pta\hskip 1.80835pt}}\phi(t^{\prime}) is a transition of .
1.2 Ultimately-equivalent states
Our decision procedure involves the determination of ultimately-equivalent states defined as follows.
Definition 1.7**.**
Let be an automaton over . Let be an integer. Two states of are -ultimately-equivalent if
[TABLE]
Two states are ultimately-equivalent if they are -ultimately-equivalent for some .
Remark 1.8**.**
Note that ultimate-equivalence is indeed an equivalence relation: if and are -ultimately-equivalent while and are -ultimately-equivalent, then and are -ultimately-equivalent.
Considering an automaton over , the computation of this relation is easy. Let us build a directed graph as follows. The vertex-set is and the edge set is:
[TABLE]
In particular, vertices of the form never qualify for the above condition and thus never have outgoing edges. Observe that two distinct states of are ultimately-equivalent if and only if may not reach in a strongly connected component.
Computing the strongly connected components of a graph is done in linear time (see, for instance, Tarjan’s algorithm [20]). Hence, the set of the pairs of states of that are ultimately-equivalent may be decided in time . This complexity can be improved as follows.
Proposition 1.9** (Béal, Crochemore, [3]).**
Let be an automaton over . We write the number of states of . The set of the pairs of states of that are ultimately-equivalent may be decided in time .
Proof 1.10** (Sketch).**
We take verbatim the algorithm in [3]. Start from the trivial partition and iteratively merge states. Each step of the algorithm consists in merging two states that are -ultimately-equivalent. The purpose of Béal and Crochemore was to show that starting with a so-called AFT automaton , the result is the minimisation of . Starting with any automaton , the resulting automaton is not necessarily minimal. However, one can observe that its states are precisely the ultimate-equivalence classes of .
As a direct consequence of the definition of an automaton morphism, ultimate-equivalence commutes with automaton morphisms.
Lemma 1.11**.**
Let and be two automata such that there is an automaton morphism . Let and be two states of that are ultimately-equivalent (w.r.t. ), then and are also ultimately-equivalent (w.r.t. ).
2 Purely periodic -recognisable sets
Notation 2.1**.**
Let and be two integers. Throughout this section, the quantities are fixed as follows.
- •
Let be the unique integers such that where is the greatest divisor of coprime with . In particular, the prime factors occurring in the prime decomposition of all appear in the prime decomposition of . Moreover, .
- •
Let be the least integer such that is a divisor of .
- •
Since , the order of in is well defined and denoted by , i.e., .
Let and be two integers. We let denote the (unique) integer of congruent to modulo and modulo . Note that if is an integer less than , then where denote the remainder of the division of by .
2.1 The automaton and its minimisation
Definition 2.2**.**
A subset of integers is purely periodic, if there exist and a subset such that .
For instance, is purely periodic but is not. Let be an integer and be a subset of . We say that the parameter is proper, if is the smallest period of the purely periodic set . For instance, is proper but is not because .
The following definition is ubiquitous when dealing with periodic sets of integers. It is an easy exercise to show that this automaton accepts base- representations of integers whose remainder modulo belongs to .
Definition 2.3**.**
We let denote the automaton where is defined as
[TABLE]
When we are only interested in the transitions of the automaton , it is sometimes convenient to leave the set of final states unspecified. In that case, we write for the automaton where the final/non-final status of the states is not set.
Example 2.4**.**
Figure 1(c) shows in base . Transitions with label (resp. [math]) are represented with bold (resp. thin) edges.
As can be seen, for instance, in Figure 2, the automaton is not necessarily minimal.
Lemma 2.5**.**
For every word , .
Proof 2.6**.**
This follows directly from the definition of the transition function of .
Property 2.7**.**
The automaton is strongly connected.
Proof 2.8**.**
Let be two states. The state is of the form . Let be a word satisfying
[TABLE]
The last two conditions are easily satisfied by adding a suitable number of leading zeroes. Reading from leads to the initial state [math]. Obviously, reading from [math] leads to .
The next lemma states that the automaton is the product automaton . This easily follows from the Chinese remainder theorem and Lemma 2.5.
Lemma 2.9**.**
For all integers , and every word ,
[TABLE]
The fact that is coprime with implies the following result.
Lemma 2.10**.**
With the definition introduced in Notation 2.1, the automaton is a group automaton: each letter induces a permutation on the set of states.
Proof 2.11**.**
Since is coprime with , the function defined by is a permutation of . Hence, so is the function defined by , for every letter . The action of in is exactly , a permutation of the states.
2.2 Nerode-equivalence and ultimate-equivalence in
Within the setting of Example 2.4 where rows (resp. columns) of the product automaton correspond to the equivalence classes modulo (resp. modulo ), the forthcoming Proposition 2.14 shows that Nerode-equivalent states in must belong to the same column. See, for instance, Figure 2. Then, we show that all states belonging to the same column are ultimately-equivalent.
Lemma 2.12**.**
If is proper, then for all distinct integers and , , the states and are not Nerode-equivalent.
Proof 2.13**.**
Since is proper and , there exists an integer such that and .
We let denote a word such that and (in other words, is the word padded with an appropriate number of 0’s); it thus holds that . Reading the word respectively from the states and leads to the states:
[TABLE]
The integer is congruent to modulo (since ) as well as modulo (since both are obviously congruent to ) hence modulo . The same reasoning also applies to the second state, finally yielding:
[TABLE]
The first state belongs to and is thus final while the second does not belong to and thus is not final. The word is then a witness of the fact that and are not Nerode-equivalent.
Proposition 2.14**.**
Let be proper. If and are Nerode-equivalent states, then they are congruent modulo .
Proof 2.15**.**
Proof by contrapositive. Let and be two states that are not congruent modulo . By definition of , see Notation 2.1, the states and are both congruent to [math] modulo . However the operation is a permutation of , hence and are not congruent modulo . It follows that and for some distinct . Lemma 2.12 then yields that these states are not Nerode-equivalent, hence that and are not either.
Lemma 2.16**.**
Let and be two states of . With the definition introduced in Notation 2.1, if , then and are -ultimately-equivalent.
Proof 2.17**.**
Let be any word of length . Since and are congruent modulo , there exists and such that and . Then, from Lemma 2.9 and using the fact that , we get
[TABLE]
Similarly .
2.3 Circuits labelled by the digit [math]
A circuit whose every arc is labelled by the digit [math] is called for short a 0-circuit. For instance, the automaton depicted in Figure 1 has two such circuits: one reduced to the state [math] and one made of the states and . We will see that the number of states belonging to [math]-circuits has a special meaning.
Lemma 2.18**.**
A state of is a multiple of if and only if it belongs to a [math]-circuit.
Proof 2.19**.**
Forward direction. It is enough to show that every state of the form , for , has a predecessor by [math] of the form , . Simple arithmetic yields that is suitable, where is the inverse of in .
Backward direction. Proof by contrapositive. Let be a state which is not a multiple of . The state is a multiple of . Therefore, for every integer , the state is a multiple of , hence is not equal to . Since is deterministic, cannot be equal to for either.
The next proposition follows from Lemmas 2.18 and 2.12. Recall that is the largest integer coprime with such that and (see Notation 2.1).
Proposition 2.20**.**
If is proper, the minimisation of possesses exactly states that belong to [math]-circuits.
3 Characterisation of automata accepting purely periodic sets
The next result will allow us to decide whether a deterministic automaton over , given as input, is such that is a purely periodic set of integers, i.e., whether or not it is of the form for some and .
Theorem 3.1**.**
Let be a base and be a minimal automaton over bearing a self-loop labelled by [math] on the initial state. Let be the number of states in that belong to [math]-circuits. The automaton accepts by value a purely periodic set of integers if and only if the following two conditions are fulfilled.
- a.
There exists a pseudo-morphism . 2. b.
The equivalence relation induced by is a refinement of the ultimate-equivalence relation.
Proof 3.2** (Proof of forward direction).**
Since accepts by value a purely periodic set of integers, there exists a smallest period and a remainder-set such that . Note that is proper by choice of . We make use of Notation 2.1. In particular, is the greatest divisor of that is coprime with .
Since is minimal, it is isomorphic to the minimisation of any automaton accepting , in particular, to the minimisation of . It then follows from Proposition 2.20 that .
To prove that there exists a pseudo-morphism , we will apply Lemma 1.5. Let , be two words such that . Let us show that . Since , we have that . Due to Lemma 2.5, and are not congruent modulo . It then follows from Proposition 2.14 that the states and are not Nerode-equivalent, which implies that because is the minimisation of .
Let and be two states of such that . We have to show that and are ultimately-equivalent. Let and be two words such and . Since is a pseudo-morphism, we get that
[TABLE]
and so . Applying Lemma 2.5 yields that the states and are congruent modulo , and by Lemma 2.16, these states are ultimately-equivalent. Since is the minimisation of , we have an automaton morphism . Finally, since ultimate-equivalence commutes with automaton morphism (Lemma 1.11), and are ultimately-equivalent.
Proof 3.3** (Proof of backward direction).**
By assumption, for all , the states in are ultimately-equivalent. For every integer , we let denote the least integer such that, for all in , whenever . Let .
Let be two words with respective values that are congruent modulo . Note that, in particular, and are thus congruent modulo . Let us show that and reach the same state in .
Since bears a self-loop labelled by [math] on the initial state, the word is such that and . We may thus assume that and are longer than . There exist factorisations and such that the lengths of and are both equal to . Since and are congruent modulo , and are equal: , .
Assume without loss of generality that . Hence is congruent to [math] modulo . We deduce that and are congruent modulo . By Lemma 2.5, the respective runs of and in reach the same state: . From assumption a, we get . In other words, the states and are -equivalent. Hence, by assumption b, they are -ultimately-equivalent. Since (by choice of ), we get that : the run in of the words and indeed reach the same state.
We have just shown that words whose values are congruent modulo have runs in reaching the same states, hence either all are accepted by or none of them are. The run of a word is then accepted by if and only if is. Finally, a word is accepted by if and only if belongs to the set , defined by
[TABLE]
Remark 3.4**.**
In the proof of the forward direction, it was stated that (where is the greatest divisor of the period which is coprime with the base). It is also the case in the backward direction. Indeed, the automaton is shown to accept a purely periodic set of integers. Let denotes the proper parameter of this set (it is not necessarily the one given in the proof). Since is minimal, it is the quotient of . It then follows from Proposition 2.20 that, , the number of states belonging to [math]-circuits, is equal to , the greatest divisor of the period which is coprime with the base.
3.1 Complexity and algorithmic issues
Theorem 3.1 yields an algorithm to decide whether a given deterministic automaton accepts by value a purely periodic set of integers:
if necessary, minimise and make it complete; 2. 1.
count the number of states of that belong to [math]-circuits; 3. 2.
build the automaton ; 4. 3.
construct, if it exists, the pseudo morphism ; 5. 4.
check whether, for all , the states of are ultimately-equivalent.
Let us denote by the number of states of . Step can be carried out in time. Steps , can obviously be performed in time. A morphism between deterministic automata, if it exists, can be computed by a single traversal of the bigger automaton; the same algorithm also works for pseudo-morphisms: Step also runs in time. The ultimate-equivalence classes of can be computed in time from Proposition 1.9, hence so is the execution of Step .
Corollary 3.5**.**
Let be a base and be a -state deterministic automaton over . It is decidable in time whether accepts by value a purely periodic set of integers.
Remark 3.6**.**
Remark 3.4 gives a very fast rejection test. Indeed, before Step (2) we may check whether the integer (computed by Step (1)) is coprime with . If it is not the case, may be rejected already.
Example 3.7**.**
We start with the minimal automaton depicted in Figure 3. Step (1) is shown in Figure 4: has five states belonging [math]-circuits and thus, . Step (2) then consists in constructing , shown in 5. There is a pseudo-morphism , whose equivalence classes are represented in Figure 6. Finally, one could check that Step (4) holds: all states belonging to the same class are -ultimately-equivalent. Hence accepts an eventually periodic set of period . It is indeed the minimisation of .
4 Impurely periodic b-recognisable sets
In this section, we will study the eventually periodic sets of integers that are not purely periodic (see Definition 2.2). We say that such sets are impurely periodic. For denotational reasons, we will describe eventually periodic sets with three parameters: a period , a remainder-set and a finite set of “mismatches” with a purely periodic set. Such a triplet is a parameter of if
[TABLE]
where is the exclusive disjunction operation: an integer belongs to if it belongs either to or to , but not both. One can also find the terminology symmetric difference or disjunctive union (and the notation ).
Example 4.1**.**
The set can be described by the parameter . Indeed, the purely periodic set and the set differ only by the fact that and .
This way of describing eventually periodic sets has several advantages: the parameter has only three components, the set is uniquely defined and it allows to determine if is purely periodic (Lemmas 4.2 and 4.3),
Lemma 4.2**.**
Let be an eventually periodic set of integers. There is a unique purely periodic set and a unique finite set of mismatches such that .
We then say that the triplet is the proper parameter of an eventually periodic set if and is the smallest positive period for which such exist. We take the convention that the proper parameter of a finite set is , (instead of considering that the period equals [math]); this is why the smallest period is assumed to be positive in the previous sentence.
Lemma 4.3**.**
An eventually periodic set of parameter is purely periodic if and only if is empty.
Notation 4.4**.**
In what follows, we consider impurely periodic sets of integers, hence a finite non-empty set of mismatches is given. Moreover, we still follow the convention of Notation 2.1 recapped hereafter. A period and a remainder-set are given. We let denote the greatest divisor of that is coprime with the base , is the integer such that and is the smallest integer such that divides .
4.1 The automata and
We will describe an automaton accepting, by value, an eventually periodic set with parameter . We first have to deal with the set of mismatches.
Definition 4.5**.**
We denote by the greatest element of . We denote by the automaton:
[TABLE]
where if defined as follows.
[TABLE]
Simple and formal verification yields the following properties of . We write scc for strongly connected component. A trivial scc is a state belonging to no circuit.
Lemma 4.6**.**
The automaton
- a.
is deterministic, complete and trim; 2. b.
has exactly two non-trivial sccs: and ; 3. c.
has exactly two 0-circuits, the respective self-loops on [math] and ; 4. d.
accepts a word if and only if .
In the next definition, the exclusive disjunction is extended to sets of pairs of states.
Definition 4.7**.**
Given two complete automata and over the alphabet . We define the exclusive disjunction as usual:
[TABLE]
where is defined as follows.
[TABLE]
It is quite obvious that a word is accepted by if and only if it is accepted by or , but not by both of them.
Notation 4.8**.**
We let denote the exclusive disjunction .
The next lemma gives properties of that follow from Lemma 4.6 and Definition 4.7. Recall that we have seen in Property 2.7 that is strongly connected.
Lemma 4.9**.**
The following properties hold.
- a.
* is deterministic, complete and trim.* 2. b.
* possesses exactly two non-trivial sccs:*
- •
the singleton made of the initial state, ,
- •
and .
Moreover this second scc is isomorphic to by projecting to the first component, hence complete. 3. c.
* accepts a word if and only if .*
4.2 The [math]-circuits of and of its minimisation
The next statement gives a description of the [math]-circuits of and follows from Lemmas 2.18 and 4.9.
Lemma 4.10**.**
A state belongs to a [math]-circuit of if and only if either
- a.
the state is initial, or 2. b.
there exists such that .
The relationship of with its minimisation is stated by the next lemma. It is similar to the one of with its minimisation.
Lemma 4.11**.**
If is proper, the following statements hold.
- a.
For every distinct integers , the states and of are not Nerode-equivalent. 2. b.
The states of that belong to [math]-circuits are pairwise Nerode-inequivalent. 3. c.
The initial state of is not Nerode-equivalent to any other state.
Proof 4.12**.**
Item follows directly from Lemmas 2.12 and b.
. From item and Lemma 4.10, it suffices to show that there is no state which is Nerode-equivalent to the initial state. For the sake of contradiction let us assume that such a state exists.
We denote by the initial state of . Let be any word whose run reaches , hence satisfying . Since bears a loop labelled by [math], the run of reaches , hence, without loss of generality, we may assume that .
Since and are Nerode-equivalent, so are and . By iterating this reasoning, we obtain that is Nerode-equivalent to . Similarly, is Nerode-equivalent to the state , that we denote by . Moreover, since is reachable from and since belongs to the -scc (complete from Lemma b), belongs to the -scc as well.
Since , , hence \overline{\,v^{k}0^{j}\,}\equiv 0\leavevmode\nobreak\ [k]\leavevmode\nobreak\. Since is obviously a multiple of , it is also a multiple of . In other, words and the initial state is Nerode-equivalent to . This contradicts the fact that is non-empty.
. Let us denote by the Nerode-equivalence class of the initial state. Since the initial state bears a loop labeled by [math], the set is stable by reading the digit [math]. Therefore, if were containing a non-initial state, then it would contain a whole [math]-circuit (distinct from the initial state), contradicting item .
The next statement can then be established using Lemma 4.11 much like Proposition 2.14 was shown using Lemma 2.12.
Proposition 4.13**.**
If is proper, then two Nerode-equivalent states and are necessarily such that and are congruent modulo .
It follows from Lemma 4.10 that has states that belong to [math]-circuits and from Lemma 4.11(b) that such states are not merged by the minimisation process, hence the next proposition holds.
Proposition 4.14**.**
If is proper, the 0-circuits of the minimisation of have a total of states
4.3 Ultimate equivalence class of
Lemma 4.15**.**
Let and be two states of such that . If neither nor is the initial state, then and are ultimately-equivalent.
Proof 4.16**.**
Since by hypothesis, and are not initial, there exists a bound such that for every word longer that , the states and belong to the -scc. Without loss of generality, we may assume that .
Let be a word longer than . Then,
[TABLE]
Since and are congruent modulo , and since is coprime with b, it holds:
[TABLE]
Moreover, since , and since divises ,
[TABLE]
Finally, since and are coprime, (11) and (12) yield
[TABLE]
hence .
Lemma 4.17**.**
The initial state of is not ultimately equivalent to any other state.
Proof 4.18**.**
*The only state from whom the initial state may be reached is the initial state itself. Moreover, as the initial state bears a loop labelled by [math], the words of are witnesses of the fact that no state is ultimately equivalent to the initial state. *
5 Characterisation of automata accepting impurely periodic sets
Theorem 5.1**.**
Let be a base and be a minimal automaton over . We write for the number of states in that belong to [math]-circuits. The automaton accepts by value an impurely periodic set of integers if and only if the following conditions are met.
- a.
There exists a pseudo-morphism . 2. b.
The initial state excluded, the equivalence relation induced by is a refinement of the ultimate-equivalence relation. 3. c.
The initial state bears a self-loop labelled by the digit [math] and features no other incoming transitions.
Proof 5.2** (Proof of forward direction).**
Conditions a and b are obtained much like it was done in Theorem 3.1. We simply apply Propositions 4.14 and 4.13 instead of 2.20 and 2.14.
Since is minimal and accepts by value an impurely periodic set, there exists a parameter such that is the minimisation of . A simple verification yields that Condition c is satisfied by . Besides, it follows from Lemma c that the minimisation process does not merge any state of with the initial state. As a result, the incoming transitions to the initial state are the same in and .
Proof 5.3** (Proof of backward direction).**
There are finitely many ultimate-equivalence classes. Hence there exists an integer such that, if two states and are ultimately equivalent, then they are -ultimately-equivalent.
Note also that since is complete, Condition c implies that .
Let be two words whose respective values are congruent modulo and greater than . Thus, there are words , , satisfying , and such that both possess a non-zero digit. In particular, neither nor is the initial state. With exactly the same proof as was given in Theorem 3.1, it may then be shown that .
In other words, accepts an ultimately periodic set of integers of period . (In general, this period is not the smallest one, which would be for some dividing .) We moreover write the set of mismatches (existence and unicity ensured by Lemma 4.2). Let us show that it is not purely periodic, or equivalently that is not empty (Lemma 4.3).
We denote by the state reached by the run of the word , i.e., . Since , this word possesses a non-zero digit, hence is not the initial state of (Condition c). Since is minimal, and are not Nerode-equivalent. Hence there exists a word such that exactly one of the states in is final. Since and are obviously congruent modulo , is a mismatch: it belongs to .
As stated below, Theorem 5.1 gives an algorithm to decide whether an automaton accepts an ultimately periodic set of integers. It is the same as the one from Section 3.1 with an additional Step (5) at the end. It consists in verifying that Condition c holds.
Corollary 5.4**.**
Let be a base and be a -state deterministic automaton over . It is decidable in time whether accepts by value an impurely periodic set of integers.
Since an eventually periodic set is either purely or impurely periodic, Theorem 0.1 is a direct consequence of Corollaries 3.5 and 5.4.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Jean-Paul Allouche, Narad Rampersad, and Jeffrey Shallit. Periodicity, repetitions, and orbits of an automatic sequence. Theoret. Comput. Sci , 410:2795–2803, 2009.
- 2[2] Jean-Paul Allouche and Jeffrey Shallit. Automatic Sequences: Theory, Applications, Generalizations . Cambridge University Press, 2003.
- 3[3] Marie-Pierre Béal and Maxime Crochemore. Minimizing local automata. In M. Fossorier G. Caire, editor, IEEE International Symposium on Information Theory , pages 1376–1380, 2007.
- 4[4] Jason Bell, Emilie Charlier, Aviezri S. Fraenkel, and Michel Rigo. A decision problem for ultimately periodic sets in nonstandard numeration systems. IJAC , 19(6):809–839, 2009.
- 5[5] Valérie Berthé and Michel Rigo, editors. Combinatorics, Automata and Number Theory . Number 135 in Encyclopedia Math. Appl. Cambridge University Press, 2010.
- 6[6] Bernard Boigelot and Julien Brusten. A generalization of Cobham’s theorem to automata over real numbers. Theor. Comput. Sci. , 410(18):1694–1703, 2009.
- 7[7] Bernard Boigelot, Sébastien Jodogne, and Pierre Wolper. An effective decision procedure for linear arithmetic over the integers and reals. ACM Trans. Comput. Log. , 6(3):614–633, 2005.
- 8[8] V. Bruyère and G. Hansel. Recognizable sets of numbers in nonstandard bases. In R. Baeza-Yates, E. Goles, and P. V. Poblete, editors, LATIN ’95: Theoretical Informatics , volume 911 of Lect. Notes Comput. Sci. , pages 167–179. Springer, 1995.
