A Pattern Logic for Automata with OutputsWe warmly thank the anonymous reviewers for their helpful comments, and Ismaël Jecker for spotting a bug in a preliminary version of the paper. E. Filiot is a research associate of F.R.S.-FNRS. He is supported by the French ANR Project ExStream (ANR-13-JS02-0010), the ARC Project Transform Fédération Wallonie-Bruxelles and the FNRS CDR project J013116F. N. Mazzocchi is a PhD student funded by a FRIA fellowship from the F.R.S.-FNRS. J.-F. Raskin is supported by an ERC Starting Grant (279499: inVEST), by the ARC project - Non-Zero Sum Game Graphs: Applications to Reactive Synthesis and Beyond - funded by the Fédération Wallonie-Bruxelles, and by a Professeur Francqui de Recherche grant awarded by the Francqui Fondation.

# A Pattern Logic for Automata with Outputs††thanks: We warmly thank the anonymous reviewers for their helpful comments, and Ismaël Jecker for spotting a bug in a preliminary version of the paper. E. Filiot is a research associate of F.R.S.-FNRS. He is supported by the French ANR Project ExStream (ANR-13-JS02-0010), the ARC Project Transform Fédération Wallonie-Bruxelles and the FNRS CDR project J013116F. N. Mazzocchi is a PhD student funded by a FRIA fellowship from the F.R.S.-FNRS. J.-F. Raskin is supported by an ERC Starting Grant (279499: inVEST), by the ARC project − Non-Zero Sum Game Graphs: Applications to Reactive Synthesis and Beyond − funded by the Fédération Wallonie-Bruxelles, and by a Professeur Francqui de Recherche grant awarded by the Francqui Fondation.

Emmanuel Filiot Université libre de Bruxelles    Nicolas Mazzocchi Université libre de Bruxelles    and Jean-François Raskin Université libre de Bruxelles
###### Abstract

We introduce a logic to express structural properties of automata with string inputs and, possibly, outputs in some monoid. In this logic, the set of predicates talking about the output values is parametric, and we provide sufficient conditions on the predicates under which the model-checking problem is decidable. We then consider three particular automata models (finite automata, transducers and automata weighted by integers – sum-automata –) and instantiate the generic logic for each of them. We give tight complexity results for the three logics and the model-checking problem, depending on whether the formula is fixed or not. We study the expressiveness of our logics by expressing classical structural patterns characterising for instance finite ambiguity and polynomial ambiguity in the case of finite automata, determinisability and finite-valuedness in the case of transducers and sum-automata. Consequently to our complexity results, we directly obtain that these classical properties can be decided in PTime.

## 1 Introduction

### Motivations

An important aspect of automata theory is the definition of automata subclasses with particular properties, of algorithmic interest for instance. As an example, the inclusion problem for non-deterministic finite automata is PSpace-c but becomes PTime if the automata are -ambiguous for a fixed  [21].

By automata theory, we mean automata in the general sense of finite state machines processing finite words. This includes what we call automata with outputs, which may also produce output values in a fixed monoid . In such an automaton, the transitions are extended with an (output) value in , and the value of an accepting path is the sum (for ) of all the values occurring along its transitions. Automata over finite words in and with outputs in define subsets of as follows: to any input word , we associate the set of values of all the accepting paths on . For example, transducers are automata with outputs in a free monoid: they process input words and produce output words and therefore define binary relations of finite words [15].

The many decidability properties of finite automata do not carry over to transducers, and many restrictions have been defined in the literature to recover decidability, or just to define subclasses relevant to particular applications. The inclusion problem for transducer is undecidable [13], but decidable for finite-valued transducers [23]. Another well-known subclass is that of the determinisable transducers [5], defining sequential functions of words. Finite-valuedness and determinisability are two properties decidable in PTime, i.e., it is decidable in PTime, given a transducer, whether it is finite-valued (resp. determinisable). As a second example of automata with outputs, we also consider sum-automata, i.e. automata with outputs in , which defines relations from words to . Properties such as functionality, determinisability, and -valuedness (for a fixed ) are decidable in PTime for sum-automata [11, 10].

In our experience, it is quite often the case that deciding a subclass goes in two steps: define a characterisation of the subclass through a “simple” pattern, show how to decide the existence of a such a pattern. For instance, the determinisable transducers have been characterised via the so called twinning property [6, 24, 4], which, said briefly, asks that the output words produced by any two different paths on input words of the form cannot differ unboundedly when grows, with a suitable definition of “differ”. Quite often, the most difficult part is step and step is technical but less difficult to achieve, as long as we do not seek for optimal complexity bounds (by this we mean that PTime is good enough, and obtaining the best polynomial degree is not the objective). We even noticed that in transducer theory, even though step share common techniques (reduction to emptiness of reversal-bounded counter machines for instance), the algorithms are often ad-hoc to the particular subclass considered. Here is a non-exhaustive list of subclasses of transducers which are decidable in PTime: determinisable transducers [6, 24, 5, 4, 1, 7], functional transducers [5, 4], -sequential transducers (for a fixed [8], multi-sequential transducers [16, 7], -valued transducers (for a fixed [14], finite-valued transducers [18, 23]. Our goal in this paper is to define a common tool for step , i.e., define a generic way of deciding a subclass characterised through a structural pattern. More precisely, we want to define logics, tailored to particular monoids , able to express properties of automata with outputs in , such that model-checking these properties on given automata can be done in PTime.

### Contributions

We define a general logic, denoted for “pattern logic”, to express properties of automata with outputs in a fixed monoid . This logic is parameterised by a set of predicates interpreted on . We first give sufficient conditions under which the problem of model-checking an automaton with outputs in against a formula in this logic is decidable. Briefly, these conditions require the existence of a machine model accepting tuples of runs which satisfy the atomic predicates of the logic, is closed under union and intersection, and has decidable emptiness problem.

Then, we study three particular classes of automata with outputs: finite automata (which can be seen as automata with outputs in a trivial monoid with a single element), transducers (automata with outputs in a free monoid), and sum-automata (automata with outputs in ). For each of them, we define particular logics, called , and to express properties of automata with outputs in these particular monoids. Formulas in these logics have the following form:

 ∃π1:p1u1∣v1−−−→q1,…,∃πn:pnun∣vn−−−→qn,C

where the are path variables, the are state variables, the are (input) word variables and the are output value variables (interpreted in ). The subformula is a quantifier free Boolean combinations of constraints talking about states, paths, input words and output values. Such a formula expresses the fact that there exists a path from some state to some state , over some input word , producing some value , some path etc. such that they all satisfy the constraints in . In the three logics, paths can be tested for equality. Input words can be compared with the prefix relation, w.r.t. their length, and their membership to a regular language be tested. States can be compared for equality, and it can be expressed whether they are initial or final.

The predicates we take for the output values depends on the monoids. For transducers, output words can be compared with the non-prefix relation (and by derivation ), a predicate which cannot be negated (otherwise model-checking becomes undecidable), and can also be compared with respect to their length, and membership to a regular language can be tested. For sum-automata, the output values can be compared with (and by derivation ). As an example, a transducer (resp. sum-automaton) is not -valued iff it satisfies the following -formula (resp. -formula):

 ∃π1:p1u∣v1−−→q1,…,∃πn:pnu∣vn−−→qn,n⋀i=1init(pi)∧final(qi)∧⋀1≤i

For the three logics, we show that deciding whether a given automaton satisfies a given formula is PSPace-c. When the formula is fixed, the model-checking problem becomes NLogSpace-c for and , and NP-c for . If output values can only be compared via disequality (which cannot be negated), then admits PTime model-checking. We show that many of the properties from the literature, including all the properties mentioned before, can be expressed in these logics. As a consequence, we show that most of the PTime upper-bounds obtained for deciding subclasses of finite automata in [25, 2], of transducers in [6, 14, 24, 22, 16, 7, 5, 18, 8] and sum-automata in [11, 10, 8, 3], can be directly obtained by expressing in our logics the structural patterns given in these papers, which characterise these subclasses.

### Related works

In addition to the results already mentioned, we point out that the syntax of our logic is close to a logic, defined in [9] by Figueira and Libkin, to express path queries in graph databases (finite graphs with edges labelled by a symbol). In this work, there is no disjunction nor negation, and no distinction between input and output values. By making such a distinction, and by adding negation and disjunction, we were able to tailor our logics to particular automata models and add enough power to be able to directly express classical structural automata properties.

## 2 Finite Automata with Outputs

In this section, we define a general model of finite automata defining functions from the free monoid (where is a finite input alphabet) to any monoids . More precisely, they are parametrised by a monoid of output values, read input words over some alphabet and output elements of the output monoid, obtained by summing the output values met along accepting paths.

Formally, a monoid is a tuple where is a set of elements which we call here values or sometimes outputs, is an associative binary operation on , for which is neutral. Monoids of interest in this paper are the free monoid for some finite alphabet of symbols (where denotes the concatenation), and the monoid . We also let . For , denotes its length, in particular . The set of positions of is (and empty if ). We let be the th symbol of . Given , we write whenever is a prefix of . All over this paper, the input alphabet is denoted by the letter .

###### Definition 1 (Automata with outputs)

An automaton with outputs over an (output) monoid is a tuple where is a non-empty finite set of states, the set of initial states, the set of final states, the set of transitions labelled with some element of , and a mapping from transitions to output values111Often in the literature, output values are directly given in the transitions, i.e. the transition relation is a (finite) subset of . Our definition is then equivalent modulo PTime transformation, and allows for a clearer distinction between input and output mechanisms.. The set of automata over is written .

We write to refer to the number of states of . A path in is a sequence , for , such that for all we have and . The input of is defined as the word (and if ), the output of as the element (and if ), and the size of as . We may write to denote that is a path from to on input and output . For convenience we write to denote respectively the starting state and the ending state of the path . The set of all paths of is written . A path is initial if , final if and accepting if it is both initial and final. The set of accepting paths of is denoted by . The input/output relation (or just relation) defined by is the set of pairs defined by

 R(A)={(u,v)∣∃π∈Pathsacc(A)⋅in(π)=u∧out(π)=v}

### Finite automata, transducers and sum-automata

In this paper, we consider three instances of automata with outputs. First, finite automata (over ), are seen as automata with outputs in a trivial monoid (and which is therefore ignored). Transducers are automata with outputs in the free monoid . They define relations from to . Finally, sum-automata are automata with outputs in the monoid .

## 3 A Pattern Logic for Automata with Outputs

In this section, we introduce a generic pattern logic. It is built over four kind of variables, namely path, state, input and output variables. More precisely, we let , , and be disjoint and countable sets of resp. path, state, input and output variables. We define as the set of terms built over variables of , a binary function symbol (representing the monoid operation) and constant symbol (neutral element).

The logic syntax is parametrised by a set of output predicates . Output predicates of arity are called constant symbols, and we denote by the predicates of arity . Predicates talking about states, paths and input words are however fixed in the logic.

###### Definition 2

A pattern formula over a set of output predicates is of the form

 φ = ∃π1:p1u1∣v1−−−→q1,…,∃πn:pnun∣vn−−−→qn,C

where for all , and they are all pairwise different, , , , and is a Boolean combination of atoms amongst

 Input constraints:u⊑u′∣u∈L∣|u|≤|u′|u,u′∈XIOutput constraints:p(t1,…,tn)p∈O|n,ti∈Terms(XO,⊕,0)State constraints:init(q)∣final(q)∣q=q′q,q′∈XQPath constraints:π=π′π,π′∈XP

where is a regular language of words over (assumed to be represented as an NFA). The sequence of existential quantifiers before in is called the prefix of . We denote by the set of pattern formulas over , and by the fragment where output predicates does not occur under an odd number of negations.

The size of a formula is the number of its symbols plus the number of states of all NFA representing the membership constraints. We denote by the variables occurring in any pattern formula , and by (resp. , , ) its restriction to path (resp. state, input, output) variables. We finally let , , .

### Semantics

To define the semantics of a pattern formula , we first fix some monoid together with an interpretation of each output predicates of arity , such that if is a constant and otherwise. Given a valuation , the interpretation can be inductively extended to terms by letting , and .

Then, a formula is interpreted in an automaton with outputs as a set of valuations of which we now define. Each valuation maps state variables to states of , path variables to paths of , etc. Such a valuation satisfies an atom if is a prefix of , if , if . Given a predicate of arity , an atom is satisfied by if . Finally, satisfies (resp. ) if is initial (resp. is final). The satisfiability relation is naturally extended to Boolean combinations of atoms. Finally, assume that is of the form , we say that satisfies , denoted by , if there exists a valuation of such that for all , and satisfies (). Given a pattern formula and an automaton with outputs , the model-checking problem consists in deciding whether satisfies , i.e. .

###### Example 1

Given , the -valuedness property has been already expressed in Introduction (assuming ). The formula where expresses the fact that an automaton is not -ambiguous (has at least accepting paths for some input).

## 4 Model-Checking Problem

In this section, we give sufficient conditions on the output monoid and the set of output predicates by which the model-checking of automata with outputs in against pattern formulas over the output predicates is decidable. In the next sections, we study the precise complexity of the model-checking problem for particular monoids .

### Tuple acceptors

Since automata with outputs can get their output values in arbitrary monoids, to get an effective model-checking algorithm, we will assume the existence of machines, called tuple acceptors, that can recognise sets of word tuples. These machines will be required to satisfy some key properties, forming the notion of good class of tuple acceptors. First, what we call a tuple acceptor is a machine whose semantics is a set of tuples of words , for some alphabet and some arity . The notion of good class, formally defined later, require that any regular set of tuples is recognised by some machine, for a regularity notion that we will make clear (roughly, by seeing tuples of words as words resulting from the overlapping of all components), all output predicates (and their negation) are recognised by some machine, the class is closed under union and intersection.

### Regular sets of word tuples

Let be some alphabet containing some symbol , and . The padding of with respect to is the word . Let and let . For , let the padding of with respect to . Note that . The convolution is the word of length defined for all by . E.g. . The convolution can be naturally extended to multiple words as follows: .

###### Definition 3

A set of -ary word tuples is regular if is a regular language over . We often identify and .

### Good class of tuple acceptors

First, any valuation of a set of path variables into paths of some automaton with values in some monoid gives a way to interpret terms as follows: for , , and . Then, for a class (i.e. a set) of tuple acceptors, we denote by its restriction to acceptors of arity .

###### Definition 4 (Good class)

A class of tuple acceptors is said to be good for an output monoid , a set of output predicates and an interpretation for all of arity , if the following conditions are satisfied:

1. for all automata with outputs with a set of states we have:

1. , regular, for some .

2. all of arity , all finite sets of path variables and all , there exist such that

1. .

2. , , there exist such that and .

We say that is effective if all properties are effective and moreover it is decidable whether for any (effectively represented) . We say that is weakly good if all properties hold except 1(b)ii.

Effectiveness of a good class gives effective model-checking, as announced.

###### Theorem 4.1

Let be a monoid and be a set of output predicates, interpreted over . If there exists an effective good class (resp. effective weakly good class) of tuple acceptors for and , then the model-checking problem of automata with outputs in against pattern formulas (resp. ) is decidable.

###### Proof (sketch)

First, the formula is put in negation normal form: negation is pushed down to the atoms. Then, given an automaton with outputs in , we show that any tuple of paths which satisfy state, input and path predicates and their negations is a regular set of path tuples (this is doable even for input equality as well as input length comparison thanks to the way paths are overlapped by the definition of convolution). By condition 1a, these sets of tuples are accepted by acceptors of . By conditions 1(b)i and 1(b)ii, tuples of paths satisfying output predicates and their negations are also accepted by acceptors of . Then, the closure properties (condition 2) allows us to construct an acceptor for the tuples of paths satisfying the whole formula inductively.

## 5 A pattern logic for finite automata

Finite automata can be seen as automata with outputs in a trivial monoid (with a single element). As the monoid is trivial, there is no need for predicates over it and so we specialize our pattern logic into .

###### Definition 5 (Pattern logic for NFA)

The logic is the set of formulas

 φ\Coloneqq∃π1:p1u1−→q1,…,∃πn:pnun−→qn,CC\Coloneqq¬C∣C∨C∣u⊑u′∣u∈L∣|u|≤|u′|∣% init(q)∣final(q)∣q=q′∣π=π′

where for all , , is a regular language over (assumed to be represented as an NFA), , and .

As a yardstick to measure the expressiveness of , we have considered the structural properties of NFA studied in two classical papers: [25] by Weber and Seidl and in [2] by Allauzen et al. The authors of these two papers give PTime membership algorithms for -ambiguity, finite ambiguity, polynomial ambiguity and exponential ambiguity (with as applications the approximation of the entropy of probabilistic automata for example). We refer the interested readers to these papers for the formal definitions of those classes. The solutions to these membership problems follow a recurrent schema: one defines a pattern that identifies the members of the class and an algorithm to decide if an automaton satisfies the pattern. The next theorem states that all these membership problems can be reduced to the model-checking problem of using a constant space reduction. The proof of this theorem is obtained by showing how the patterns identified in [25], can be succinctly and naturally encoded into (fixed) formulas. As a corollary, we get that all the class membership problems are in NLogSpace, using a model-checking algorithm that we defined below for .

###### Theorem 5.1

The membership problem to the subclasses of -ambiguous, finitely ambiguous, polynomially ambiguous and exponentially ambiguous NFA can be reduced to the model-checking problem of with constant space reduction. The obtained formulas are constant (for fixed ).

###### Proof

For each membership problem, our reduction copies (in constant space) the NFA and considers the model-checking for this NFA against a fixed (one for each class). As illustration, -ambiguity has already been expressed in Example 1. As a second example, an automaton is not polynomially ambiguous iff there exists a state which is reachable from an initial state, and the source of two different cycles labelled identically by a word . With this gives:

The model-checking problem asks if a given NFA satisfies a given -formula .

###### Theorem 5.2

The model-checking problem of NFA against formulas in is PSpace-C. It is in NLogSpace-C if the formula is fixed.

###### Proof (sketch)

We use NFA as acceptors for tuples of paths. The algorithm presented in the proof of Theorem 4.1 yields an exponentially large NFA (and polynomial if the formula is fixed). We show that it does not need to be constructed explicitly and that a short non-emptiness witness can be searched non-deterministically on-the-fly. For PSpace-hardness, we notice that the non-emptiness of the intersection of DFA can be easily expressed in , by seeing the DFA as a disjoint union, and by asking for the existence of different accepting paths over the same input in this union.

###### Corollary 1 (of Theorems 5.1 and 5.2)

The membership problem to the classes of -ambiguous, finitely ambiguous, polynomially ambiguous and exponentially ambiguous NFA is in NLogSpace.

## 6 A pattern logic for transducers

Transducers are automata with outputs in a free monoid and therefore define subsets of . Since our general pattern logic can test for output equalities (by repeating twice an output variable in the prefix), the model-checking is easily shown to be undecidable by encoding PCP:

###### Theorem 6.1

The model-checking problem of transducers against formulas in is undecidable.

To obtain a decidable logic for transducers, we need to exclude equality tests on the output words in the logic. However, as we will see, we can instead have inequality test as long as it is not under an odd number of negations in the formula. We also allow to test (non) membership of output word concatenations to a regular language, as well as comparison of output word concatenations wrt their length. Formally:

###### Definition 6 (Pattern logic for transducers)

The logic is the set of formulas of the form

 φ\Coloneqq∃π1:p1u1∣v1−−−→q1,…,∃πn:pnun∣vn−−−→qn,CC\Coloneqq¬C∣C∨C∣u⊑u′∣u∈L∣|u|≤|u′|∣% init(q)∣final(q)∣q=q′∣π=π′|t⧸⊑t′∣t∈N∣|t|≤|t′|

where for all , and (no implicit output equality tests), (resp. ) is a regular language over (resp. ), assumed to be represented as an NFA, , , , , and does not occur under an odd number of negations.

We define the macros , and

 SDel≠(t1,t′1,t2,t′2)\lx@stackrel\makebox[0.0pt]\tiny def=(|t′1|≠|t′2|) ∨[ t′1t′2≠ϵ∧mismatch(t1,t2)]

Let us explain the latter macro. Many properties of transducers are based on the notion of output delays, by which to compare output words. Formally, for any two words , such that and where is the longest common prefix of and . It can be seen that for any words , if we have , then , but the converse does not hold. But, if , then holds for some . These two facts allows us to express all the known transducer properties from the literature relying on the notion of delays. We leave however as open whether our logic can express a constraint such as .

We review here some of the main transducer subclasses studied in the literature. We refer the reader to the mentioned references for the formal definitions. As for the NFA subclasses of the previous section, deciding them usually goes in two steps: identify a structural pattern characterising the property, decide whether such as pattern is satisfied by a given transducer. The class of determinisable transducers are the transducers which define sequential functions [6, 5, 24]. The -sequential transducers are the transducers defining unions of (graphs) of sequential functions [8]. The multi-sequential ones are the union of all -sequential transducers for all  [16, 7]. Finally, the -valued transducers are the transducers for which any input word has at most output words [14, 19], and the finite-valued ones are all the -valued transducers for all  [22, 23, 18]. All these classes, according to the given references, are decidable in PTime.

###### Theorem 6.2

The membership problem of transducers to the classes of determinisable, functional, -sequential, multi-sequential, -valued, and finite-valued transducers can be reduced to the model-checking problem of with a constant space reduction. The obtained formulas are constant (as long as is fixed).

###### Proof

Without going through all the properties, let us remind the reader that the formula for -valuedness has been given in the introduction. We also give the formulas for the class of determinisable transducer. It is known that a transducer is determinisable iff it satisfies the twinning property, which is literally the negation of:

 ∃π1:q1u∣v1−−→p1,∃π′1:p1u′∣v′1−−→p1,∃π′′1:p1u′′∣v′′1−−−→r1,∃π2:q2u∣v2−−→p2,∃π′2:p2u′∣v′2−−→p2,∃π′′2:p2u′′∣v′′2−−−→r2,init(q1)∧init(q2)∧final(r1)∧final(r2)∧SDel≠(v1,v′1,v2,v′2)□
###### Theorem 6.3

The model checking of transducers against formulas in is PSpace-C. It is in NLogSpace-C if the formula is fixed.

###### Proof (sketch)

We use Parikh automata as acceptors for tuples of paths. They extend automata with counters that can only be incremented and never tested for zero. The acceptance condition is given by a semi-linear set (represented for instance by an existential Presburger formula). The formal definition can be found e.g. in [9]. The counters allow us to compare the output length of paths, or to identify some output position of two paths with different labels (to test ). The counters are needed because this position may not occur at the same location in the convolution encoding of path tuples.

###### Corollary 2 (of Theorems 6.2 and 6.3)

The membership problem of transducers to the classes of determinisable, functional, -sequential, multi-sequential, -valued, and finite-valued transducers (for fixed ) is decidable in NLogSpace.

## 7 A pattern logic for sum-automata

We remind the reader that sum-automata are automata with outputs in the monoid (assumed to be encoded in binary) and therefore define subsets of . We consider in this section two logics for expressing structural properties of sum-automata: the logic which is obtained as where the output predicate is interpreted by the natural total order over integers, and a subset of this logic obtained as where the predicate never appears in the scope of an odd number of negations (to avoid the expressibility of the equality predicate). We show that the fragment enjoys better complexity results. Formally, those two logics are defined as follows:

###### Definition 7 (Two pattern logics for sum-automata)

The logic is the set of formulas of the form

 φ\Coloneqq∃π1:p1u1∣v1−−−→q1,…,∃πn:pnun∣vn−−−→qn,CC\Coloneqq¬C∣C∨C∣u⊑u′∣u∈L∣|u|≤|u′|∣% init(q)∣final(q)∣q=q′∣π=π′|t≤t′

where for all , , is a regular language over assumed to be represented as an NFA, , , and .

The logic is defined as above but the constraint is replaced by and this constraint does not occur under an odd number of negations, and moreover for all (no implicit output equality tests).

We review here some of the main sum-automata subclasses decidable in PTime studied in the literature. We refer the reader to the mentioned references for the formal definitions. The class of functional sum-automata [11] are those such that all accepting paths associated with a given word return the same value. The classes of -valued [10] and -sequential sum-automata [8] are defined similarly as for transducers.

###### Theorem 7.1

The membership problem of sum-automata in the class of functional, -valued, and -sequential automata can be reduced to the model-checking problem of . Moreover, the obtained formulas are constant (as long as is fixed).

###### Proof

We have already shown in the introduction that functionality [11] and more generally -valuedness [10] are expressible in . The twinning property [11, 1] is as well expressible in , just by replacing in the formula expressing it for transducers (proof of Thm. 6.2) the atom by . In [8], a generalization of the twinning property is shown to be complete for testing -sequentiality.

The proof of the results below for follows arguments that are similar to those developed for transducers in the proof of Theorem 6.3, and for the PTime result for , we use a reduction to the -valuedness problem of sum-automata [10].

###### Theorem 7.2

The model checking of sum-automata against formulas in is PSpace-C, NP-C when the formula is fixed, and NLogSpace-C if in addition the values of the automaton are encoded in unary. The model checking of sum-automata against formulas in is PSpace-C, and in PTime when the formula is fixed (even if the values of the automaton are encoded in binary).

###### Corollary 3 (of Theorems 7.1 and 7.2)

The membership problem of sum-automata in the class of functional, -valued, and -sequential automata is decidable in PTime.

Note that we have shown that the -valuedness property is expressible in , and so the -valuedness property is reducible to the model-checking problem of . Nevertheless, this result does not provide a new algorithm for -valuedness as our model-checking algorithm is based on a reduction to -valuedness [10].

## 8 Extensions and Future Work

The logics we have presented can be extended in two ways by keeping the same complexity results, no matter what the output monoid is. The first extension allows to express properties of automata whose states can be coloured by an arbitrary (but fixed) set of colours. This is useful for instance to express properties of disjoint unions of automata, the colours allowing to identify the subautomata. The second extension is adding a bunch of universal state quantifiers before the formula. This does not change the complexity, and allow for instance to express properties such as whether an automaton is trim (all its states are accessible and co-accessible). As future work, we would like to investigate other monoids (discounted sum group for instance [11]), and other data structures for which transducers and weighted automata have been defined: nested words, infinite words and trees are the main structures we want to work on.

## References

• [1] C. Allauzen and M. Mohri. Efficient algorithms for testing the twins property. Journal of Automata, Languages and Combinatorics, 8(2):117–144, 2003.
• [2] C. Allauzen, M. Mohri, and A. Rastogi. General algorithms for testing the ambiguity of finite automata and the double-tape ambiguity of finite-state transducers. Int. J. Found. Comput. Sci., 22(4):883–904, 2011.
• [3] S. Bala and A. Koninski. Unambiguous automata denoting finitely sequential functions. In LATA, LNCS 7810, 2013.
• [4] M.-P. Béal and O. Carton. Determinization of transducers over finite and infinite words. Theoretical Computer Science, 289(1):225–251, 2002.
• [5] M.-P. Béal, O. Carton, C. Prieur, and J. Sakarovitch. Squaring transducers: an efficient procedure for deciding functionality and sequentiality. TCS, 292(1), 2003.
• [6] C. Choffrut. Une caracterisation des fonctions sequentielles et des fonctions sous-sequentielles en tant que relations rationnelles. Theor. Comput. Sci., 5(3), 1977.
• [7] C. Choffrut and M. P. Schutzenberger. Decomposition de Fonctions Rationnelles. In STACS, 213–226, 1986.
• [8] L. Daviaud, I. Jecker, P.-A. Reynier, and D. Villevalois. Degree of sequentiality of weighted automata. In FOSSACS, 2017.
• [9] D. Figueira and L. Libkin. Path logics for querying graphs: Combining expressiveness and efficiency. In LICS, pages 329–340, 2015.
• [10] E. Filiot, R. Gentilini, and J.-F. Raskin. Finite-valued weighted automata. In FSTTCS, pages 133–145, 2014.
• [11] E. Filiot, R. Gentilini, and J.-F. Raskin. Quantitative languages defined by functional automata. LMCS, 11(3), 2015.
• [12] Z. Galil. Hierarchies of complete problems. Acta Informatica, 6(1):77–88, 1976.
• [13] T. V. Griffiths. The unsolvability of the equivalence problem for lambda-free nondeterministic generalized machines. Journal of the ACM, 15(3):409–413, 1968.
• [14] E. M. Gurari and O. H. Ibarra. A note on finite-valued and finitely ambiguous transducers. Theory of Computing Systems, 16(1):61–66, 1983.
• [15] J. Berstel. Transductions and Context-Free Languages. Teubner, Stuttgart, 1979.
• [16] I. Jecker and E. Filiot. Multi-sequential word relations. IJFCS, 29(2), 2018.
• [17] F. Klaedtke and H. Rueß. Monadic second-order logics with cardinalities. In ICALP, 2003.
• [18] J. Sakarovitch and R. de Souza. On the decidability of bounded valuedness for transducers. In MFCS, pages 588–600, 2008.
• [19] J. Sakarovitch and R. de Souza. Lexicographic decomposition of k -valued transducers. Theory of Computing Systems, 47(3), 2010.
• [20] B. Scarpellini. Complexity of subcases of presburger arithmetic. In Transactions of the American Mathematical Society 284, page 203â218, 1984.
• [21] R. E. Stearns and H. B. Hunt III. On the equivalence and containment problems for unambiguous regular expressions, regular grammars and finite automata. SIAM Journal on Computing, 14(3):598–611, 1985.
• [22] A. Weber. On the valuedness of finite transducers. Acta Inf., 27(8), 1990.
• [23] A. Weber. Decomposing finite-valued transducers and deciding their equivalence. SIAM Journal on Computing, 22(1):175–202, 1993.
• [24] A. Weber and R. Klemm. Economy of description for single-valued transducers. Information and Computation, 118(2):327–340, 1995.
• [25] A. Weber and H. Seidl. On the degree of ambiguity of finite automata. Theor. Comput. Sci., 88(2):325–349, 1991.
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters