Many-valued truth functions, Cern y's conjecture and road coloring
Alexandru Mateescu
Turku Centre for Computer Science, Lemminkaisenkatu 14 A, 20520 Turku, Finland and Faculty of Mathematics, University of Bucharest, Romania e-mail: mateescu@utu.
Arto Salomaa
Turku Centre for Computer Science and Department of Mathematics, University of Turku, 20014 Turku, Finland e-mail: asalomaa@utu.
Turku Centre for Computer Science TUCS Technical Report No 274 May 1999 ISBN 952-12-0450-8 ISSN 1239-1891
Abstract We investigate interconnections between many-valued truth functions and functions de ned by nite deterministic automata. Propositions in one of the theory have often their natural counterpart in the other theory. Such is the case with problems about completeness, as well as with C erny's conjecture in automata theory. Sometimes results in one theory, such as those concerning self-conjugacy of truth functions, can be applied in the other theory.
TUCS Research Group
Mathematical Structures of Computer Science
1 Sheer functions and complete sets Consider functions whose variables, nite in number, range over a nite set
N = f1; 2; : : :; ng; n 2; and whose values are elements of N . There are nnm distinct m-place functions. If N is chosen to be the set of n truth values, then the functions considered are obviously truth functions in n-valued logic. A function g is said to be generated by a set F of functions if g can be expressed as a composition of functions in F . For instance, each of the functions
f1 (x) = f (x; f (x; x)); f2(x; y) = f (f (x; f (x; y)); f (x; y)); f3(x; y; z) = f (f (x; x); f (y; z)) is generated by the set F consisting of the 2-place function f (x; y ). A set F of functions is complete or a Sheer set if F generates every function, no matter what the number m of variables is. (We of course mean here functions of the kind considered.) A function f is a Sheer function if its unit set is a Sheer set. It was shown by Post in [12] that the set of all 2-place functions is a Sheer set, for any n. The following result was established by the present columnist in 1958, [14].
Theorem 1.1 Assume that n 5 and F is a set of functions containing
all permutations of the numbers 1; 2; : : :; n and, in addition, an arbitrary function f (x; y ) which is non-degenerately binary and assumes all of the numbers 1; 2; : : :; n as values. Then F is a Sheer set.
Theorem 1.1 does not hold true for values n 4. Counter examples for n = 2 and n = 3 are provided by the functions de ned by the tables 1 1 2 2 1 3 3
1 2 1 2 1 2 1 2
2 1 3 2
3 3 2 1
It is easy to verify that neither of these functions, augmented with all permutations, generates all functions. 1
Of special interest for our considerations later is the case n = 4. To see that the statement corresponding to Theorem 1.1 does not hold, consider the function f4 (x; y ) de ned by the table 1 2 3 4
1 2 4 3 1
2 1 3 4 2
3 1 3 4 2
4 2 4 3 1
Then the set F4 consisting of f4 and the 24 permutations is not complete. Indeed, it is not dicult to verify that the set H of one-place functions generated by F4 consists of the 24 permutations, the 4 constant functions and the 36 functions assuming two values, each of them twice. Thus, H misses the 144 functions assuming exactly three values, as well as the 48 functions assuming two values in the ratio 3:1. We will discuss below also the set H 0 of one-place functions generated by f4 alone. For instance, f4 (x; y ) is the circular permutation (1234) and f4 (x; f4(x; x)) is the function whose value sequence is 1331 (that is, the sequence of the four values listed in the numerical order of the arguments). Thus, these two functions are in H 0. However, contrary to H , no constant function is in H 0. This follows because f4 is self-conjugate under the permutation p(x), de ned as the product of two transpositions: (13)(24). Self-conjugacy under p means that f satis es the equation
f (x; y) = p(f (p?1 (x); p?1(y))): By considering composition sequences, it can be veri ed that a function selfconjugate under p generates only functions self-conjugate under p. Since none of the constants is self-conjugate under (13)(24), they are not in H 0. For n 3, any function f (x; y ) generating all permutations in the symmetric group Sn is a Sheer function. This is an immediate consequence of Theorem 1.1, for n 5. The statetement holds also for n = 3 and n = 4, [15]. The statement does not hold for n = 2 because S2 is cyclic. One-place functions can never be Sheer functions. In the sequel we are mostly concerned with the (monoid of) nn one-place functions. How many one-place functions are needed to generate all one-place functions and, in particular, which one-place functions are such generators? If n = 2 then two functions suce, namely, the transposition (12) and one of the two constants. The solution for n 3 is presented in the following theorem, where by a basis of the symmetric group Sn we mean any two permutations generating Sn .
Theorem 1.2 Assume that n 3. Then three one-place functions generate all one-place functions i two of them constitute a basis of the symmetric
2
group Sn and the third assumes exactly n ? 1 values. No less than three functions generate all one-place functions.
See [15] for a proof of Theorem 1.2. [11] is a comprehensive study about the bases of the symmetric group (also about bases consisting of more than two elements). For instance, the circular permutation (12.. . n) and the transposition (12) constitute a basis, for any n. A circular permutation and an arbitrary transposition form always a basis if n is prime.
2 Functions de ned by nite automata Instead of truth values, the elements of our basic set N = f1; 2; : : :; ng can equally well be viewed as states of a nite deterministic automaton A = (f1; 2; : : :; ng; ; ), where is the alphabet and the transition function, everywhere de ned. The automata we consider are without initial and nal states. (In the early days of automata theory, such automata were often referred to as Medvedev automata, after Ju. T. Medvedev. He translated the seminal 1956 volume \Automata Studies" into Russian, and included his own article in the translation. The latter remained largely unknown in the West.) All automata considered in this paper are as indicated above. Clearly, each letter a of the alphabet can be associated to the one-place function ga(x), de ned by the condition ga (x) = (x; a). This association is extended in the natural way to concern words over : catenation of letters corresponds to the composition of functions. (Thus, the association is a morphism of the semigroup + into the semigroup of functions mapping N to N . We prefer here semigroups to monoids since we want to represent functions with nonempty words over .) The following problem areas now arise quite naturally. (i) What is the set F (A) (subsemigroup of the whole semigroup) of functions associated to a given automata A? Does this set contain functions of a particular type, for instance, constants? Is the automaton functionally complete in the sense that its set of functions contains all functions? (Of course, we are concerned here with one-place functions only.) (ii) Assuming that F (A) contains a previously speci ed function or one in a speci ed class of functions, what is the \simplest" representation of such a function as a word over ? A natural measure of complexity here is the word length. Problems (ii) can be restricted to concern only functionally complete automata. Consider rst the two-state automaton 3
b
a; b
?
2
1
6
a Figure 1
with the alphabet fa; bg. The value sequences of the two functions ga and gb are 21 and 22, respectively. All 4 functions, with value sequences 11, 12, 21, 22, are represented by the words ba; a2; a; b, respectively. Thus, the automaton is functionally complete and all functions are represented by words of length 2. Consider next the three-state automaton
b
-
1
A K
A A A
a
a; c
c
-
b a; b A A A A A
2
c 6
3
Figure 2
with the alphabet fa; b; cg. By Theorem 1.2, the automaton is functonally complete. In the following table we give a shortest possible representation for each of the 27 functions. The functions are numbered according to the \alphabetical" order of their value sequences. 4
number value sequence representation 1 111 bcaca 2 112 ca2 113 cba 3 4 121 aca2 122 a2 cab 5 6 123 b2 131 acba 7 132 b 8 2 9 133 a ca 211 a2ca2 10 11 212 acab 213 ba 12 13 221 cab 222 ca2c 14 223 c 15 16 231 a 232 ac 17 18 233 a2 cb 311 abcba 19 20 312 a2 313 aca 21 321 ab 22 23 322 a2 c 323 acb 24 331 ca 25 26 332 cb 333 acac 27 Thus, altogether 10 dierent functions are represented by words of length
2. Additionally, 6 functions are represented by words of length 3, and 7
further functions by words of length 4. The remaining exceptional functions 1, 5, 10, 19 require a word of length 5 for their representation. We observe that one of these exceptional functions is a constant, whereas the other two constants are represented by words of length 4 but by no shorter words. Since there are altogether 120 (nonempty) words of length 4, some functions possess many representations using such words. The greatest number is possessed by function 15 which has no less than 17 representations using words of length 4:
c; c2; bac; b2c; cb2; c3; a3c; a2bc; bac2; b2c2; ca3; cacb; cbac; cb2c; cbcb; c2b2; c4:
Further details are contained in [7]. By Theorem 1.2, functionally complete n-state automata over the alphabet fa; b; cg can be constructed, for any n. 5
Finally, consider the following two four-state automata:
b
-
1
a; c
6
6
4
-
1
a; c
2
6
a
b; c b; c
c
-
b
a; b
c ?
a
6
Figure 3
a
-
3
2
? 6 ?? ?? ?? a; c b???? b ?? ?? ?? ? ?? ? 3 4 a 6
Figure 4
b; c
In both cases, a, b and c are a circular permutation, a transposition and a non-permutation, respectively. However, the situation is drasticly dierent in both cases. While the former automaton is functionally complete by Theorem 1.2, the latter automaton A0 generates only functions in the set H 0 discussed in Section 1. Indeed, the value sequences of the functions ga(x), gb(x) and gc (x) in the latter automaton are 2341, 1432, 1331, respectively. Considering the function f4 (x; y ) de ning the set H 0, we see that
ga(x) = f4 (x; x); gc(x) = f4 (x; f4(x; x)); gb(x) = f4 (x; f4(f4(x; x); f4(x; x))): This shows that every function represented by the latter automaton A0 is in H 0 and, consequently, self-conjugate under the permutation (13)(24). Hence, 6
no constants are represented. We leave it to the reader to verify that the permutations represented constitute the group consisting of the identity (1), two circular permutations (1234) and (1432), two transpositions (13) and (24), as well as three products (12)(34), (13)(24) and (14)(23). All these permutations p satisfy the equation p = gpg ?1, where g is the permutation (13)(24).
3 Target functions We now discuss the problem area (ii) referred to in the preceding section. Thus, we specify a function f : f1; 2; : : :; ng ?! f1; 2; : : :; ng and consider representations of f by n-state deterministic automata, in the sense described above. Of course, given f , we can immediately construct an automaton, where one of the letters directly gives rise to f . We want to consider all n-state automata and, for each automaton, look for the \simplest" representation of f . It is also possible that f is not at all represented by a speci c automaton. For instance, if f is a constant, a 3-cycle or a function assuming exactly 3 values, then it is not represented by the automaton A0 considered at the end of the preceding section. By de nition, if an automaton A is functionally complete, then any f is represented. Given a nite deterministic automaton A = (f1; 2; : : :; ng; ; ) and a function f : f1; 2; : : :; ng ?! f1; 2; : : :; ng, we denote by L(A; f ) + the language, consisting of all words representing f . Thus w 2 L(A; f ) means that w takes the automaton A from the state i to the state f (i), for any i = 1; 2; : : :; n. Being an intersection of regular languages, L(A; f ) is always regular. L(A; f ) being empty means that f is not represented by A. In choosing the \simplest" representation, we indicate complexity by word length. This gives rise to the following de nitions, [7]. For a language L, we denote by min(L) the length of the shortest word in L. By de nition min(;) = 1. (Since we don't consider languages containing the empty word, min(L) is always a positive integer or 1.) For a given A and f , the complexity C (A; f ) of f with respect to A is de ned by C (A; f ) = min(L(A; f )): The complexity C (f ) of a function f : f1; 2; : : :; ng ?! f1; 2; : : :; ng is de ned by C (f ) = max C (A; f ); where A ranges over n-state automata such that L(A; f ) 6= ;. The complete complexity CC (f ) of f is de ned by
CC (f ) = max C (A; f ); where A now ranges over functionally complete n-state automata. 7
Some observations are immediate. For any f , an automaton Af with C (Af ; f ) = 1, as well as an automaton A0f with C (A0f ; f ) = 1, can be eectively constructed. Both of the complexities C (f ) and CC (f ) are positive integers and, for any f , CC (f ) C (f ). Also the upper bound C (f ) nn is clear, in view of the total number of functions. The next theorem, [7], shows that, for some functions f , C (f ) has an exponential lower bound.
Theorem 3.1 There are functions f : f1; 2; : : :; ng ?! f1; 2; : : :; ng for which no polynomial P (n) with the property C (f ) P (n) exists. Proof outline. We let f be the identity function and consider values of n of the form n = p1 + p2 + : : : + pk , where the p's are distinct primes. (For instance, we may take the rst k primes.) Consider now the automaton An = (f1; 2; : : :; ng; fag; ), where the transitions are de ned as follows. The state set is divided into k pairwise disjoint subsets, consisting of p1 ; p2; : : :; pk elements, respectively. In each of the subsets, the only letter a aects a
circular permutation. It is now clear that
C (An; f ) = p1 p2 : : :pk : Since there exists no polynomial upper bound for the product of k primes in terms of their sum, our theorem follows. The proof is not valid for the complete complexity CC (f ). We return to the discussion of CC (f ) in [7]. Clearly, there are functions f such that CC (f ) < C (f ).
4 C erny's conjecture We consider now constant functions fc : f1; 2; : : :; ng ?! fcg, where 1 c n. The following result holds for the complexity C (fc ).
Theorem 4.1
C (fc) n(n ? 1):
The proof of Theorem 4.1 is given in detail in [7]. The following outline should be quite helpful. We may assume that c = n; this can always be achieved by a renumbering. Consider the following automaton Bn = (f1; 2; : : :; ng; fa; bg; ), where is de ned by the following graph: 8
b
-
1
a
6
n
2
@ @ R @
a; b
b a qqq a b
-
? ?
?
n?1
a
6
Figure 5
Thus, (i; a) = i + 1, for 1 i n ? 1, (n; a) = 1 and (i; b) = i, for 1 i n ? 1, (n; b) = 1. It is easily veri ed that the constant fn is represented by the word (ban?1)n?1 of length n(n ? 1). It is somewhat more complicated to show that no shorter word suces. The result C (Bn ; fn ) = n(n ? 1) proves the theorem. C erny's conjecture. C (fn ) = n(n ? 1). In view of Theorem 4.1, C erny's conjecture amounts to the following statement. For any automaton A with L(A; fc ) 6= ;, we have C (A; fc) n(n ? 1). C erny's conjecture is usually presented in terms of synchronizing words. By de nition, w is a synchronizing word for an automaton A if w takes A from any of its states to the same state. In this terminology, C erny's conjecture says that, whenever an n-state automaton possesses a synchronizing word, then it possesses a synchronizing word of length (n ? 1)2. Our version of the conjecture, presented above, is slightly weaker than the \synchro-version". Indeed, assume that the synchro-version holds true and A is an n-state automaton with L(A; fc) 6= ;. Then some constant function fd is represented by a word of length (n ? 1)2. This implies that the previously chosen constant function fc is represented by a word of length (n ? 1)2 + n ? 1 = n(n ? 1), because the longest path without loops in A is of length n ? 1. There is no direct argument from our version to the synchro-version. However, it is very unlikely that the synchro-version of the conjecture is false and our version true. Indeed, in view of the rich possibilities for functional constructions (for instance, see [16]), both versions can very well be wrong. We have not seen C erny's original paper [2] and cannot comment on his possible arguments supporting the conjecture. We discuss here brie y two arguments that could be used to support it. 9
Consider rst the following argument by enumeration. The total number of all words of length at most (n ? 1)2 is much larger than the total number of functions. Hence, it is likely that some constant gets an early representation among such a huge number of words. The weakness of this argument lies in the fact that many functions possess multiple representations. This was observed already for the functionally complete 3-state automaton discussed in Section 2. Another argument possibly supporting the conjecture concerns the longest possible descent to a constant. Consider the synchro-version of the conjecture. We know that a synchronizing word exists, and want to nd a short one. The function ga associated to a letter a maps each subset S of the state set N into another subset S 0. Thereby the cardinality of S 0 is at most that of S . We begin with the whole set N and aim at a set of cardinality 1, using dierent functions ga . In this process, there are descending steps when the cardinality becomes strictly smaller, as well as permuting steps, preparing for the next descent. There are at most n ? 1 descending steps. Between two descending steps, there are at most n ? 1 permuting steps because the longest path without loops has n ? 1 edges. Hence, the total number of steps is at most (n ? 1) + (n ? 2)(n ? 1) = (n ? 1)2. The weakness of this argument lies in the estimate concerning permuting steps. Double transitivity might be needed: we might have to transfer the pair (i1; i2) to the pair (j1; j2) in order to descend further. For this transfer, n ? 1 steps might not suce. (Actually, they always suce with n = 3, for which value the argument is valid.) The following example, originally due to [3], illustrates this point very well.
b
a
-
2
1
@ I @ a
a
6 ? ?b ?
@ @ ? b @ ? ? @ @ ? @ ? @ ?? 4
b
a
?
3
Figure 6
The automaton is small enough for us to give also its \subset chart", indicating the subset transformations aected by the two functions ga and gb. Observe that, in general, the subset chart gives very little information 10
about the semigroup of functions generated by the automaton but it gives all necessary information about synchronizing words. For the above automaton, the subset chart looks as follows:
' a a -
a
1234
$ b b & % a b b a ' $ a b a a; b b b &b& a % % a b a a b b a b & &a % % b
b - a -
123
6
?
12
6
-
-
134
124
13
-
1
234
? -?
14
23
? ? ?
? ?
? ?
? ?
6
-
2
-
6
3
?
24
6
-?
?
34
4
6
Figure 7
11
In this example, (n ? 1)2 = 9 and n(n ? 1) = 12. On the other hand, the shortest path from the whole set f1; 2; 3; 4g to some singleton set is of length 9, and to the previously chosen singleton set f4g is of length 12. However, 4 > n ? 1 permuting steps are needed at the level of two-element subsets. The conjecture is saved because, \miraculously", 2 < n ? 1 permuting steps suce at the level of three-element subsets. It would be too lengthy to summarize here the literature around C erny's conjecture. The contributions of J.-E. Pin have been quite substantial. (For instance, see [8 - 10].) In fact, his recent inspiring visit to Turku, largely initiated our interest in the conjecture. The references [4], [5], [6], [13] should be mentioned as recent contributions to the area.
5 Road coloring The decidability of most (but not all!) of the problems for functions introduced in Section 1 is fairly obvious. It is decidable whether or not a given automaton is functionally complete, or whether a speci c function belongs to the set of functions represented. It is decidable whether or not a synchronizing word exists for a given automaton and, if it does, a shortest synchronizing word can be found. However, the algorithms are mostly based on an exhaustive search; nice necessary and sucient conditions are largely missing. The road coloring problem, [1], belongs to the area of synchronizing words. We are given a nite directed graph G, where the edges are unlabeled. The task is to nd a labeling of the edges that turns G into a deterministic automaton possessing a synchronizing word. The term \road coloring" is due to the following interpretation. A traveler lost in the graph G can always nd a way back home regardless of where he/she actually started, provided he/she follows a sequence of labels (colors) constituing a synchronizing word. In the setup of the problem, the given graph G satis es the following requirements: (i) All vertices have the same outdegree (a condition necessary for making G an automaton) and (ii) G is strongly connected and the greatest common divisor of the cycle lengths is 1 (a condition necessary for synchronizing words). For instance, consider the graph 12
-
1
?
-
2
? 66 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? 4 3 6
Figure 8
The labeling
c b -
1
a
?
a
-
2
? 66 ?? ?? ?? c b???? b a c ?? ?? ?? ?? ?? ? 4 3 a 6
Figure 9
c b
constitutes a wrong solution: as seen in Section 2, no synchronizing word can exist. However, the change of the labels b and c in the arrows emanating from the state 2 leads to the correct solution 13
c b -
1
a
?
a
-
2
? 66 ?? ?? ?? c b???? c a b ?? ?? ?? ?? ?? ? 4 3 a 6
Figure 10
c b
Here we have the shortest synchronizing word babb.
References [1] [2] [3] [4] [5]
Adler, R., Goodwin, I. and Weiss, B.; Equivalence of topological Markov shifts, Israel. J. Math. 27 (1977) 49 - 63. C erny, J.; Poznamka k homogennym experimentom s konecnymi automatmi, Mat. fyz. cas. SAV 14 (1964), 208 - 215. C erny, J., Piricka, A. and Rosenauerova; On directable Automata, Kybernetika, 7, 4 (1971) 289 - 298. y, Dubuc, L.; Sur les automates circulaires et la conjecture de Cern Informatique theorique et Applications, 32, 1 - 2 - 3 (1998) 21 - 34. y's Gohring, W.; Minimal Initializing Word: a Contribution to Cern Conjecture, Journal of Automata, Languages and Combinatorics 2 (1997) 4, 209 - 226.
[6]
Imreh, B. and Steinby, M.; Directable nondeterministic automata, Acta Cybernetica, 14, 1 (1999) 105 - 116.
[7]
Mateescu, A. and Salomaa, A.; Functional constructions in nite automata. In preparation. 14
[8] [9]
[10] [11] [12] [13] [14] [15] [16]
Pin, J.-E.; Le probleme de la synchronisation, Contribution a l'etude y, These de 3e cycle a l'Universite Pierre et de la conjecture de Cern Marie Curie (Paris 6), 1978. y, Pin, J.-E.; Le probleme de la synchronisation et le conjecture de Cern Noncommutative structures in algebra and geometric combinatorics, De Luca, A., ed., Quaderni de la Ricerca Scienti ca, CNR, Roma, 1981, 109, 37 - 48. Pin, J.-E.; On two combinatorial problems arising from automata theory, Annals of Discrete Mathematics, 17 (1983) 535 - 548. Piccard, S.; Sur les bases du groupe symetrique et les couples de substitutions qui engendrent un groupe regulier, Paris, Librairie Vuibert (1946). Post, E.L.; Introduction to a general theory of elementary propositions, Amer. J. Math. 43 (1921) 163 - 185. Rystsov, I.K.; Quasioptimal Bound for Length Reset Words for Regular Automata, Acta Cybernetica, 12 (1995) 145 - 152. Salomaa, A.; A theorem concerning the composition of functions of several variables ranging over a nite set, J. Symbolic Logic, 25 (1960) 203 - 208. Salomaa, A.; On the composition of functions of several variables ranging over a nite set, Ann. Univ. Turkuensis, Ser. AI, 41 (1960). Salomaa, A.; On basic groups for the set of functions over a nite domain, Ann. Acad. Scient. Fennicae, Ser. AI, 338 (1963).
15
Turku Centre for Computer Science Lemminkaisenkatu 14 FIN-20520 Turku Finland http://www.tucs.abo.
University of Turku Department of Mathematical Sciences
Abo Akademi University Department of Computer Science Institute for Advanced Management Systems Research
Turku School of Economics and Business Administration Institute of Information Systems Science