Abstract 1 Introduction 2 Preliminaries 3 The regular languages of UDyn𝚺𝟐 4 The regular languages of UDynProp 5 The regular languages of UDyn𝚺𝟏+ 6 Conclusion References

Algebraic Characterizations of Classes of Regular Languages in DynFO

Corentin Barloy ORCID Ruhr University Bochum, Germany Felix Tschirbs ORCID Ruhr University Bochum, Germany Nils Vortmeier ORCID Ruhr University Bochum, Germany Thomas Zeume ORCID Ruhr University Bochum, Germany
Abstract

This paper explores the fine-grained structure of classes of regular languages maintainable in fragments of first-order logic within the dynamic descriptive complexity framework of Patnaik and Immerman. A result by Hesse states that the class of regular languages is maintainable by first-order formulas even if only unary auxiliary relations can be used. Another result by Gelade, Marquardt, and Schwentick states that the class of regular languages coincides with the class of languages maintainable by quantifier-free formulas with binary auxiliary relations.

We refine Hesse’s result and show that with unary auxiliary data -formulas can maintain all regular languages. We then obtain precise algebraic characterizations of the classes of languages maintainable with quantifier-free formulas and positive -formulas in the presence of unary auxiliary relations.

Keywords and phrases:
Dynamic descriptive complexity, formal languages, monoid theory
Copyright and License:
[Uncaptioned image] © Corentin Barloy, Felix Tschirbs, Nils Vortmeier, and Thomas Zeume; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Complexity theory and logic
; Theory of computation Algebraic language theory ; Theory of computation Regular languages
Acknowledgements:
We thank the reviewers for their careful reading and insightful comments, which significantly improved the quality of this article.
Funding:
All authors are supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), grant 532727578.
Related Version:
Full Version: https://arxiv.org/abs/2601.18429
Editors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim Thắng

1 Introduction

In seminal work by Schützenberger as well as McNaugthon and Papert, the class of regular languages has been characterized algebraically as the class of languages with finite syntactic monoids [16] and logically as the class of languages definable by monadic second-order sentences [1]. In subsequent work, a multitude of algebraic and logical characterisations have been obtained for subclasses of regular languages, including a characterization of the class of star-free regular languages (languages describable by regular expressions without Kleene star but with negation) as the class of languages with finite aperiodic monoids and definable in first-order logic [17, 9]; and the characterization of piecewise testable languages (languages describable by the set of subwords appearing in the word) as languages with 𝒥-trivial syntactic monoids and definable by first-order formulas without quantifier alternation [18].

Here we are interested in algebraic properties of formal languages defined in the dynamic descriptive complexity framework of Patnaik and Immerman [10]. In this framework, strings are subject to changes, and the goal is to maintain membership within a language via logical formulas, possibly using auxiliary information stored in auxiliary relations (which need to be updated by logical formulas as well). An important class of languages in this setting are the languages maintainable via first-order formulas, called DynFO. It has been shown early on that DynFO contains all regular and even all context-free languages [10, 4].

The goal of this paper is to initiate a search for connections between algebra and dynamic descriptive complexity classes. This is in a similar spirit as the search for connections between algebra and logics initiated by Schützenberger, McNaugthon and Papert for the static realm, as sketched above. Our guiding question is:

Are there restrictions of DynFO that lead to natural subclasses of the regular languages with nice algebraic characterizations?

For answering this question, it is natural to first identify restrictions of DynFO that can still maintain all regular languages. This has been studied in prior work. A result by Hesse states that the class of regular languages is maintainable by first-order formulas even if only very restricted auxiliary information, namely only unary relations, can be used [6, Theorem 2.8]111A variant of this result has already been reported in [10], but additional built-in arithmetic has been used as auxiliary information.. A seminal result by Gelade, Marquardt, and Schwentick states that, if binary auxiliary relations can be used, then the class of regular languages coincides with the class DynProp of languages maintainable by quantifier-free formulas [4, Theorem 3.2].

We refine the result by Hesse. Denote by UDynΣ2 the class of languages maintainable by -formulas using unary auxiliary relations.

Theorem 1.

All regular language are in UDynΣ2.

This result can be obtained by close inspection of Hesse’s proof, which maintains properties of the execution graph of finite state automata. Here, we provide an algebraic reformulation of the proof relying on Green’s relations (see Section 3).

Thus, when looking for restrictions of DynFO that correspond to natural subclasses of the regular languages with nice algebraic characterizations, one can explore (a) fragments of (binary) DynProp, or (b) fragments of UDynΣ2.

We obtain results along both directions. For binary DynProp, it is natural to further restrict the auxiliary relations. We precisely characterize the languages in DynProp with unary auxiliary relations by algebraic properties of their syntactic monoids (see Section 4).

Theorem 2.

A regular language is in UDynProp if any only if its syntactic monoid is a group.

For UDynΣ2, it is natural to further restrict the syntactic structure of formulas used for updates. We precisely characterize the languages maintainable by positive -formulas, denoted UDynΣ1+, by the algebraic properties of their ordered syntactic monoids (see Section 5).

Theorem 3.

A regular language is in UDynΣ1+ if and only if its ordered syntactic monoid is in 𝐉+𝐆.

Here, 𝐉+𝐆 denotes the wreath product of the classes 𝐉+ and 𝐆.

In the proofs of both Theorem 2 and Theorem 3, the “if” direction requires to provide update formulas for all regular languages whose (ordered) syntactic monoids satisfy some property and is standard. The “only-if” direction requires to prove lower bounds against DynProp (resp. UDynΣ1+) for all non-group languages (resp. all languages whose ordered syntactic monoid is not in 𝐉+𝐆). To this end we prove a lower bound for a single language using variants of the Substructure lemma [4] (see also [20]) and lift this lower bounds to all languages without the property using algebraic insights.

We leave open the question to find a precise algebraic characterization of languages in UDynΣ1, i.e., languages maintainable by (not necessarily positive) -formulas and unary auxiliary relations. We discuss challenges towards answering this question in Section 6.

2 Preliminaries

In this section, also to fix notation, we recall basics of dynamic descriptive complexity and algebraic formal language theory.

2.1 Dynamic descriptive complexity

In this paper, we are interested in the dynamic membership problem for fixed regular languages. Let LΣ be a language over some alphabet Σ. The input structure for the dynamic membership problem Member(L) of L is an encoding of a word w=w1wn as a relational structure over the domain {1,,n} of the positions of the word. This structure has (1) for every σΣ a unary relation Wσ for storing the positions of w that contain σ and (2) a binary relation representing the linear order of the positions of w. Following Patnaik and Immerman as well as Gelade et al. [10, 4], each wi is either in Σ or ϵ, i.e., each position i[n] can occur in at most one relation Wσ. For the sake of simplicity, we denote both input words and their encoding by the same symbol w.

In the dynamic membership problem, the input structure can be changed by operations of the form setσ(y), for σΣ{ϵ}. A concrete change setσ(i) instantiates y and sets the symbol at position i to σ. The dynamic membership problem Member(L) asks whether the current input structure encodes a word in L, i.e. whether w1wnL.

We will explore the resources needed for maintaining the dynamic membership problem within the dynamic descriptive complexity framework of Patnaik and Immerman [10].

A dynamic program Π stores the input structure as well as a set 𝒜 of auxiliary relations over some (relational) schema τaux and over the same domain as the input word. For every auxiliary relation symbol Rτaux and every change operation setσ, the program Π has an update formula φσR(x¯;y), which can access input and auxiliary relations. Whenever the current input word w is changed by setσ(i) to the new input word w, the new auxiliary relation R𝒜 in the updated set 𝒜 consists of all tuples a¯ such that φσA(a¯;i) is satisfied in the structure (w,𝒜).

A dynamic program Π maintains the dynamic membership problem Member(L) if it has a distinguished auxiliary bit q (i.e., a 0-ary auxiliary relation), which always indicates whether the current input word is in L. More precisely, following Patnaik and Immerman, we assume that the initial input word w0 is empty and the initial auxiliary structure 𝒜0 is initialized by a first-order formula depending on w0. The program Π maintains Member(L), if after changing w0 to w by any sequence of changes and subsequently applying the corresponding update formulas starting from (w0,𝒜0), the obtained bit q is true if and only if wL.

The dynamic problem Member(L) is in the class DynFO if it can be maintained by a dynamic program with FO update formulas and an FO initialization formula. It is in k-ary DynFO if all auxiliary relations are at most k-ary. For a class 𝒞 of formulas, it is in Dyn𝒞 if all update formulas are in 𝒞 and the initialization formula is in FO.

Throughout this paper we assume that formulas are in prenex normal form. Among the classes 𝒞 we study are the class Prop of quantifier-free formulas; the class Σ1 of -formulas (i.e., formulas in prenex form with only existential quantifiers); and the class Σ2 of -formulas (i.e., formulas in prenex form starting with a block of existential quantifiers followed by a block of universal quantifiers). We also consider the variants Prop+, Σ1+ and Σ2+ where negations may only be used directly in front of the linear order symbol . A focus will be on programs that can only use unary auxiliary relations, in which case we denote classes by UDyn𝒞 for classes 𝒞 of update formulas.

Example 4.

We show that the regular language Σ𝚊𝚊Σ over Σ={a,b} is in UDynΣ1, so, can be maintained using only unary auxiliary relations and update formulas in prenex form that only use existential quantifiers.

Our goal is to maintain a unary relation N that stores all positions j such that the next letter to the right of j that does not contain ϵ is an a. This relation can directly be maintained using both Σ1 and Π1 update formulas. As Π1 update formulas are not allowed, we store a slightly differently defined relation N and an additional bit c. If the flag c is true, the relation N is equal to N. If c is false, then N is the complement of N, that is, contains all position j such that either all positions to the right of j are ϵ or the first positions that is not ϵ is a b. Using this relation, we can obtain N as N(j)=(¬c¬N(j))(cN(j)).

We now describe the update formulas for maintaining N and c. We additionally use unary auxiliary relations Wσo to store the old input word before the change. These are trivial to maintain.

  • In case of a change of the form setb(i), we set c=1 and the relation N after the update is equal to N. A position j is in N if jN before the change and either ij or there is a position between i and j that is an a. The corresponding update formula for N is φbN(j;i)=k[N(j)(ij(j<ij<kk<iWa(k)))], where x<y is an abbreviation for xy¬(x=y).

  • In case of a change of the form seta(i), we set c=0 and the relation N after the update is the complement of N. A position j is in N if jN before the change and either ij or there is a position between i and j that is a b. The corresponding update formula for N is φaN(j;i)=k[¬N(j)(ij(j<ij<kk<iWb(k)))].

  • In case of a change setϵ(i), the update depends on the old symbol at position i. If the symbol was an a, the relation N is equal to N after the update and we set c=1. If the removed a was the first letter to the right of j, then we have to check the first letter to the right of i. Otherwise, the change is not relevant for position j. So, if j<i, the next letter from j is an a if and only if N(j) and N(i) were both true before the change, or there is an a between j and i and N(j) was already true.

    If the change replaces b with ϵ, the relation N is the complement of N after the update and we set c=0. If j<i, the next letter from j is not an a if and only if N(j) and N(i) were both false before the change, or there is a b between j and i and N(j) was false. The update formula is

    φϵN(j;i)=k[
    Wao(i)((ijN(j))(j<iN(j)(N(i)(j<kk<iWa(k)))))
    Wbo(i)((ij¬N(j))(j<i¬N(j)(¬N(i)(j<kk<iWb(k)))))].

Similarly, we can maintain a unary auxiliary relation P that contains all positions j such that the next letter to the left of j that does not contain ϵ is an a.

We now describe the maintenance of the bit q that is set to 1 whenever w is in L=ΣaaΣ.

  • In case of a change seta(i), the new word w is in L if and only if q or one of N(i) and P(i) was already true before the change.

  • In case of a change setb(i), we have wL if and only if there exists a position k>i with an a such that N(k) holds, or there exists a position k<i with an a such that P(k) holds.

  • In case of a change setϵ(i) it holds wL if and only if there exists a position k>i with an a such that N(k) holds, or there exists a position k<i with an a such that P(k) holds, or both N(i) and P(i) hold.

These conditions can easily be described by existential update formulas.  

During our study, we will need the following closure properties. For a language L over alphabet Σ and a letter σΣ, we define Lσ1={wwσL} and σ1L={wσwL}.

Lemma 5.

Let L be a language over alphabet Σ and Dyn𝒞{UDynProp,UDynΣ1+}. If Member(L) can be maintained in Dyn𝒞, then so can

  1. (a)

    Member(h1(L)) for any mapping h:ΓΣ and any alphabet Γ,

  2. (b)

    Member(Lσ1) and Member(σ1L), for any σΣ.

2.2 Monoids

For DynFO and many of its natural restrictions that possess favourable closure properties, we follow Skovberg Frandsen, Miltersen, and Skyum [19] in studying dynamic problems for monoids rather than languages. A monoid (M,) is a set M equipped with a binary operation that is associative and has an identity element, i.e., the operation satisfies (xy)z=x(yz) for all elements x,y,zM and there is an element 1M such that 1x=x1=x for all xM. A monoid is a group if every element x has an inverse, i.e. an element y such that xy=yx=1. An element e is said to be idempotent if ee=e. For an integer n>0 and xM, the n-fold product of x is denoted by xn. It is well known that every element xM has a unique power that is idempotent [12, Prop. II.6.31] called idempotent power of x and denoted by xω.

A morphism φ:MN between two monoids is a mapping such that φ(1)=1 and φ(xy)=φ(x)φ(y) for every x,yM. A submonoid N of a monoid M is a subset of M that is a monoid, i.e., it contains 1 and is closed under , meaning xyN for all x,yN. A monoid N is a quotient of M if there exists a surjective morphism from M to N. We say that N divides M if N is the quotient of a submonoid of M. A language L is recognized by a monoid M if there is a morphism φ:ΣM and PM such that L=φ1(P). The regular languages are precisely those recognized by a finite monoid (see for instance [12, Theorem IV.3.21]).

For a monoid M, we consider dynamic programs over the alphabet M and define the problem of evaluating a sequence of elements in M. We say that a dynamic program Π maintains the dynamic membership problem Member(M) if there are |M| dedicated auxiliary bits that respectively store for every xM whether the maintained word evaluates to x. Similarly the dynamic problem StrictPrefix (resp. StrictSuffix) is maintained via one dedicated unary relation for each xM that stores the value 1in if the prefix w1wi1 (resp. suffix wi+1wn) evaluates to x. In this setting, the symbol ϵ and the neutral element 1 of M can be used interchangeably. For instance, the initial word w0 can either be the empty word or 1n.

An important monoid is the monoid of functions f:QQ for a set Q. The operation is the composition and the neutral element is the identity function. Given a deterministic finite state automaton with transition function δ:Σ(QQ), its transition monoid is the image δ(Σ). The syntactic monoid of a regular language is the transition monoid of its minimal automaton. It is the smallest monoid that recognizes the language and reflects many properties of its regular language. Indeed, the syntactic monoid possesses more information than its regular language, as exposed by the following claim. A class of formulas 𝒞 is closed under (resp. , resp. ¬) if for every φ,ψ𝒞, we also have φψ (resp. φψ, resp. ¬φ) in 𝒞. All classes under inspection in this paper possesses this property.

Fact 6.

Let 𝒞 be a class of formulas closed under . Let L be a regular language with syntactic monoid M and k a number, then

Member(M)k-ary Dyn𝒞Member(L)k-ary Dyn𝒞.

We will see in Section 4 and Section 5 that when the class of formulas under consideration is well-behaved, the converse of this claim is also true.

We conclude this section by stating that maintainability of Member(M) for a monoid implies maintainability of Member(N) for every N that divides M.

Fact 7.

Let 𝒞 be a class of formulas closed under and k any number. Let M be a monoid such that Member(M)k-ary Dyn𝒞. Then for every N that divides M we have Member(N)k-ary Dyn𝒞.

3 The regular languages of UDyn𝚺𝟐

In this section we prove that every regular language can be maintained by Σ2-formulas and only unary relations. That is, we prove the following.

Theorem 8 (Restatement of Theorem 1).

For any regular language L:  Member(L) is in UDynΣ2.

The proof is algebraic by nature, hence we show that Member(M) for a syntactic monoid M can be maintained and then apply Fact 6. The approach towards proving Theorem 8 is as in Hesse [6]: We want to exhibit maintainable unary relations that allow to compute the evaluation of every infix of a word from M. This is formalized in the following lemma.

Lemma 9.

Let M be a finite monoid. There is a dynamic program Π that maintains unary auxiliary relations over a schema τM such that

  1. i)

    Π only uses Σ2 update formulas, and

  2. ii)

    for every xM there is a Σ2 formula ψx(j,k) over the schema of Π that is satisfied if and only if the infix wj+1wk1 of the input word w evaluates to x.

The definition of the auxiliary relations and the proof of the lemma relies on the local theory of monoids, as developed by Green [5]. We first show that Theorem 8 follows.

Proof of Theorem 8.

We prove that Member(M) is in UDynΣ2 for the syntactic monoid of a regular language. As UDynΣ2 is closed under disjunction, this implies the result due to Fact 6. Towards this end, let Π be the dynamic program and ψx the formulas expressing the evaluation of infixes of the input word, as given by Lemma 9. Note that the formulas ψx give the evaluation of the input word ahead of a change. To maintain Member(M), we need the evaluation after a change. Suppose a change setσ(i) occurs. The formula

ψxσ(j,k;i) =[(j<i<k)(yσz=xy,zMψy(j,i)ψz(i,k))][(ijki)ψx(j,k)]

then expresses that the infix from position j+1 to position k1 of the changed input word evaluates to x. As the formulas ψx,ψy,ψz are not in the scope of a negation and no further quantifiers are used, the formula is also in Σ2.

Now, the formula

φ(i)=j,k[min(j)max(k)(yvz=xv,y,zMWy(j)Wz(k)ψvσ(j,k;i))],

with min(j)=i(iji=j) and max(k)=i(iki=k) expresses that w evaluates to x after the change on position i, for any fixed xM. This formula still has only one alternation of quantifiers and belongs to Σ2. Together with the update formulas of Π, we have a dynamic DynΣ2 program for Member(M).

In the remainder of this section, we recall Green’s relations and use them to define the unary relations contained in the schema τM of the program Π from Lemma 9. The proof that these relations satisfy conditions (i) and (ii) from Lemma 9 is delegated to the full version of this paper.

Green’s relations.

The local theory of finite monoids studies the structure of monoids by considering properties of sets of elements that behave the same way. It is based on the so-called Green’s relations, which are a generalization of the notion of divisibility for any monoid. Over the integers, the divisibility relation is a partial order, whereas Green’s relations for arbitrary monoids are preorders, that is, reflexive and transitive relations. Fix a monoid M. Its Green’s preorders are defined by, for x,yM:

  • xy whenever there exists αM such that x=yα,

  • xy whenever there exists αM such that x=αy,

  • x𝒥y whenever there exists α,βM such that x=αyβ,

  • xy whenever xy and xy.

The Green’s classes , , 𝒥 and of M are the equivalence classes of the preorders. For instance, two elements x,yM are equivalent for , denoted by xy, if and only if xy and yx. It follows from the definitions that 𝒥 and 𝒥. Note that for any green relation 𝒦 among the four, 𝒦 induces a partial order on the set of 𝒦-classes. The order 𝒥 is of particular interest: assume there is an element x in some 𝒥-class J. Then, for any y,zM, yxz belongs to a 𝒥-class I with I𝒥J. Therefore, if a factor of a word w1wnM evaluates to some element of a 𝒥-class J, the whole word evaluates to an element from a class J with J𝒥J. There is an analogous statement for -classes and -classes that we will use repeatedly throughout the paper: if an element x is a prefix of another element y, that is there exists α such that xα=y, then we have yx. Likewise, if x is a suffix of y, so there exists α such that αx=y, then yx.

Example 10.

The syntactic monoid of (𝚊𝚊) is 2, the cyclic group with two elements 1 and a such that aa=1. Both elements are -equivalent (and therefore also -, -, and 𝒥-equivalent). In fact, in groups, all elements are always -equivalent.

Example 11.

The syntactic monoid of (𝚊+𝚋)𝚊(𝚊+𝚋) is usually denoted by U1. It has two elements 1 and a such that ax=xa=a for every element x. The two elements are in distinct classes for all of Green’s relations, and 1𝒥a.

Example 12.

The syntactic monoid of (𝚊+𝚋)𝚊 is usually denoted by U2. It has three elements 1, a and b such that a and b are idempotent and ab=b and ba=a. The elements a and b are -equivalent (and therefore also 𝒥-equivalent), but not -equivalent. The neutral element 1 is alone in its 𝒥-class which is 𝒥-smaller than the one of a and b.

Unary auxiliary relations for expressing evaluations of infixes.

The proof of Lemma 9 relies on the fact that finite monoids have only finitely many 𝒥-classes. Therefore, when we evaluate a word from left to right, there is only a finite number of changes of 𝒥-classes. We make that intuition explicit. In the following, for a word w=w1wnM, we write w[j,k] to denote the subword wjwk of w between indices j and k. For an element x, we denote by 𝒥(x) its 𝒥-class. When it is clear from the context, we identify a word in M by its evaluation. The following lemma is about the evaluation of a word wM from left to right, that is evaluating w1, w1w2, w1w2w3, , w1wn in that order. It states that, except for a constant number of times (depending on M and not on w), the 𝒥-class of the partial evaluations does not change.

Lemma 13.

Let w be a word from M of size n and jn a position. Then there exist integers j=0<1<<m=n+1 with m|M| such that:

  1. i)

    for 0s<m and si<s+1, w[j,s]𝒥w[j,i],

  2. ii)

    for 0s<m1, w[j,s+11]𝒥w[j,s+1].

There is a symmetric statement from right to left. That is, there exists integers 0=m<<1<0=j with m|M| such that:

  1. i)

    for 0s<m and s+1<is, w[s,j]𝒥w[i,j],

  2. ii)

    for 0s<m1, w[s+11,j]𝒥w[s+1,j].

The relations promised in Lemma 9 contain the information, for every position i, of the evaluation of the prefixes obtained in the decomposition of Lemma 13 applied to i. In the following, we slightly abuse notation and write x𝒥J to mean that the 𝒥-class of x is at least J with respect to the order of 𝒥-classes.

Let w be a word from M, i a position in the word, yM and J a 𝒥-class of M. Let k be the greatest position such that yw[j+1,k]𝒥J. Then we define RJ,y(j) as the evaluation of w[j+1,k] (notice that this is not yw[j+1,k]). Similarly, let k be the least position such that w[k,j1]y𝒥J. Then we write LJ,y(j) for the evaluation of w[k,j1]. When y=1, we simply write RJ and LJ. We also define R¯J,y and L¯J,y for the variants that include j in the intervals. Note that it is not clear how to compute one from the other without access to successor predicates.

Definition 14.

Let M be a monoid. The schema τM is defined as the following set of relations, where x,yM and J is a 𝒥-class of M:

  • RJ,y,x that contains j if and only if RJ,y(j)=x,

  • LJ,y,x that contains j if and only if LJ,y(j)=x,

  • their variants R¯J,y,x and L¯J,y,x.

These unary relations satisfy conditions (i) and (ii) of Lemma 9, see the full version. The idea to compute the evaluation of an infix w]j,k[ with these relations is to use them to compute the decomposition of w]j,n] given by Lemma 13. This can be done by existentially quantifying the positions l0,,lm and checking the properties of the decomposition using uniquely universal quantifiers. The first ls after k allows to deduce the -class of w]j,k[: indeed, w]j,ls[ is 𝒥-equivalent to w]j,k[ by the definition of the decomposition, which is strengthened into -equivalence because one is a prefix of the other. Using the second decomposition of Lemma 13, from rigth to left, we also deduce the -class of w]j,k[. This identify the -class of the infix, then more technical work is needed to compute precisely the evaluation.

4 The regular languages of UDynProp

If binary auxiliary relations are allowed, the quantifier-free fragment DynProp of DynFO is powerful enough to maintain all regular languages [4]. In this section, we provide a characterization of the regular languages that can be maintained using quantifier-free update formulas if only unary auxiliary relations are permitted. These are precisely the regular languages that are recognized by a group. Intuitively, a computation in a group can be reversed at any moment using the presence of inverses. That is, if a computation on xy ends in some memory state, it is possible to retrieve the memory state after the computation of x. We denote by 𝐆 this class of languages.

Theorem 15 (Restatement of Theorem 2).

For any regular language L:

  • Member(L)UDynProp if and only if the syntactic monoid of L is a group.

We first show that every regular group language can be maintained in UDynProp, using a simple adaptation of the dynamic program that maintains all regular languages using binary auxiliary relations. Then we prove that other regular languages cannot be maintained. For this, we adapt a lower bound result from [21] to show that UDynProp cannot maintain the regular language “there is at least one 𝚊” and then generalize this result to all regular languages whose syntactic monoid is not a group.

4.1 Maintaining regular group languages with quantifier-free formulas

We show that unary auxiliary relations and quantifier-free update formulas are sufficient to maintain the evaluation problems of groups. The upper bound from Theorem 15 follows.

Lemma 16.

If G is a group, then the problems Member(G), StrictPrefix(G) and StrictSuffix(G) are in UDynProp.

Proof sketch..

Gelade et al. [4] explain how to maintain membership, strict prefixes and suffixes for all regular languages with binary auxiliary relations. Their approach can directly be used to maintain these problems for monoids. For every monoid element g, the corresponding update formulas use a bit Qg to indicate whether the whole input evaluates to g and three further auxiliary relations:

  • a unary relation Pg that contains all positions i such that the prefix ending at position i1 evaluates to g,

  • a unary relation Sg that contains all positions i such that the suffix starting at position i+1 evaluates to g, and

  • a binary relation Ig that contains all pairs (i,j) of positions such that the infix starting at position i+1 and ending at position j1 evaluates to g.

Assume that the element at position p is set to the monoid element g1. Let i,j be positions with i<p1 and j>p+1. After the change, the infix from position i+1 to position j1 evaluates to the element g0g1g2, where g0 is the result of evaluating the infix from position i+1 to position p1 and g2 is the result of evaluating the infix from position p+1 to position j1. Both elements g0 and g2 can be read from the auxiliary relations of the form Ig without using quantifiers, given the position p of the change and the positions i,j for which the auxiliary relations are updated.

If the monoid is a group, we can replace atoms Ig(i,j) in the update formulas as follows. Let gw be the result of evaluating the whole input and let gp,gs be the evaluations of the prefix up to position i1 and the suffix starting from position j+1, respectively. Let gi and gj be the elements at position i and j. All of these elements can be obtained from the input and auxiliary relations without using quantifiers, given i and j. From gw=gpgiggjgs, for the evaluation g of the infix from position i+1 to position j1, we obtain g as g=gi1gp1gwgs1gj1, as every group element has an inverse.

So, we replace any atom Ig(i,j) by the formula g=gi1gp1gwgs1gj1QwWgi(i)Wgj(j)Pgp(i)Sgs(j) and obtain update formulas that only use at most unary auxiliary relations. The result follows.

4.2 Lower bound for regular non-group languages

We want to show that Lemma 16 is optimal and any language whose syntactic monoid is not a group cannot be maintained in UDynProp. The proof is in three steps. First, we show that a specific regular language cannot be maintained in UDynProp. We generalize this and show that UDynProp cannot maintain the membership problem for any monoid that is not a group. At last, we infer that one cannot maintain any regular language whose syntactic monoid is not a group by exploiting known closure properties of this class of languages.

4.2.1 A regular language that is not in UDynProp

Schwentick and Zeume [21] have shown that the graph reachability problem for so-called 1-layer graphs – edges may only exist from the start node s to some set A of nodes and from this set A to the target node t – is not in UDynProp. Very similarly, one can show that one cannot maintain in UDynProp whether a set is empty, where changes add elements to the set or remove elements from it. We adapt the proof to show that the regular language (𝚊+𝚋)𝚊(𝚊+𝚋), that is, the language of all words over the alphabet {𝚊,𝚋} that contain an 𝚊, is also not in UDynProp. The subtle difference between these problems is that the positions of a word are linearly ordered, but the elements of a set are not. However, despite this additional structure, basically the same proof goes through. We provide some more detail, also because we want to adapt the proof techniques in Section 5.

As proof technique we use the Substructure Lemma [4], which basically says that if two substructures including their auxiliary relations are isomorphic and subject to changes that respect that isomorphism, then also the auxiliary relations that result from applying quantifier-free update formulas are isomorphic.

We make this more formal. For any natural number n, we write [n] for the set {1,,n}. If w is a word of some length n, I is a subset of [n] and 𝒜 is a set of auxiliary relations, we write (w,𝒜)|I to denote the restriction of (w,𝒜) to the positions I. Let w,w be words of length nm respectively and let π be a mapping from [n] to [m]. We call π order-preserving if i<i implies π(i)<π(i). Two sequences α=δ1δ and α=δ1δ of changes of w and w, respectively, are π-respecting if for every pair δi,δi of changes it holds that if δi=setσ(j) for some symbol σ and some position j, then δi=setσ(π(j)).

If α is a sequence of changes and Π is a dynamic program, we denote by Πα(w,𝒜) the pair of word and auxiliary relations that is obtained by applying the changes α and the corresponding update formulas from Π to the word w and the auxiliary relations 𝒜.

Lemma 17 (Substructure Lemma [4, Lemma 1]).

Let Π be a dynamic UDynProp program and let wΣn and wΣm be two words over the alphabet Σ. Further, let 𝒜 and 𝒜 be sets of at most unary auxiliary relations over the domain of w and w and the schema of Π. Assume there are I[n] and I[m] such that (w,𝒜)|I and (w,𝒜)|I are isomorphic via some order-preserving isomorphism π. Then π is also an order-preserving isomorphism from Πα(w,𝒜)|I to Πα(w,𝒜)|I, for any π-respecting sequences α and α of changes.

To obtain a lower bound via the Substructure Lemma, we need to find isomorphic substructures such that two sequences of isomorphism-respecting changes lead to words that differ with respect to membership in a regular language. To find such structures, we use Higman’s Lemma.

Lemma 18 (see [8, Chapter 6]).

Let (wi,𝒜i)i1 be a sequence of words wiΣi and sets 𝒜i of relations over a unary schema and over the domain of wi. There exists two integers n<m, a subset I[m] and a mapping π:[n]I such π is a order-preserving isomorphism from wn to wm|I.

We now show the desired result.

Lemma 19 (c.f. [21, Proposition 4.8]).

The language (𝚊+𝚋)𝚊(𝚊+𝚋) is not in UDynProp.

Proof.

Assume towards a contradiction that there is a dynamic UDynProp program Π that maintains (𝚊+𝚋)𝚊(𝚊+𝚋). We consider the sequence (wi,𝒜i)i1, where wi is the word 𝚊i and 𝒜i are auxiliary relations that Π obtains when starting from an empty input word of size i and setting all positions to 𝚊. By Lemma 18, there are n<m, I[m] and π such that π is an order-preserving isomorphism from (wn,𝒜n) to (wm,𝒜m)|I.

The sequences α=setb(1)setb(n) and α=setb(π(1))setb(π(n)) are π respecting, so according to Lemma 17, the structures Πα(wn,𝒜n) and Πα(wm,𝒜m)|I are also isomorphic, which means that Π gives the same answer regarding whether the words are in the language (𝚊+𝚋)𝚊(𝚊+𝚋). But the first word only consists of 𝚋 after the changes are applied, so does not belong to the language, while the second word still contains at least one 𝚊, contradicting the assumption that Π maintains the language.

4.2.2 UDynProp cannot maintain any regular non-group language

We now lift the unmaintainability result of Lemma 19 to all regular languages whose syntactic monoid is not a group. First, we observe that UDynProp cannot maintain the membership problem of any monoid that is not a group.

Lemma 20.

If M is a monoid that is not a group, then Member(M) is not in UDynProp.

Proof.

The syntactic monoid U1 of the language (𝚊+𝚋)𝚊(𝚊+𝚋) has only the elements 1 and a, where 1 is the neutral element and a acts as a zero: 1x=x1=x and ax=xa=a for every x{1,a}. As a has no inverse, U1 is not a group. It follows from Fact 6 and Lemma 19 that Member(U1) is not in UDynProp.

Now assume that for some arbitrary non-group monoid M the problem Member(M) is in UDynProp. We first claim that U1 is a submonoid of M. To see that, observe that M must have an element x whose idempotent power is not the identity. Otherwise, if xω=1 for every element xM, then let n>0 be chosen such that xn=1 is the idempotent. Then xxn1=xn1x=1 holds, so x has the inverse xn1, so M is a group, contradicting the assumption. Therefore, M has an idempotent e that is different from 1 and {1,e} is a submonoid of M that is isomorphic to U1.

As U1 is a submonoid of M and in particular divides M, assuming Member(M)UDynProp leads to a contradiction, as from Fact 7 the false statement Member(U1)UDynProp would follow.

Now we have to translate Lemma 20 from monoids to languages, that is, we need a converse to Fact 6. So, we have to prove that if UDynProp can maintain some regular language, it can also maintain the membership problem of its syntactic monoid.

We employ the theory of (pseudo)varieties, which goes back to Eilenberg [3].

Let be a class of regular languages over the alphabet Σ. It is closed under Boolean operations if L1L2, L1L2 and L1c are in for any L1,L2. It is closed under quotients if σ1L={w|σwL} and Lσ1={w|wσL} are in for any L and σΣ. It is closed under inverse morphisms if μ1(L) is in for any L, where Γ is any alphabet and μ:ΓΣ is a function that is extended to Γ letter-wise.

A class 𝒱 of regular languages is a (pseudo)variety if it is closed under Boolean operations, quotients and inverse morphisms. We often omit the “pseudo” and simply call such classes “varieties”. For this work, the following result is used.

Lemma 21 ([3], see [12, Theorem XIII.4.10]).

Let 𝒱 be a variety of regular languages and let M be the syntactic monoid of some language L𝒱. Then any language recognized by M is also in 𝒱.

This implies that the converse of Fact 6 holds for UDynProp.

Fact 22.

Let 𝒞 be a class of formulas such that the regular languages L with Member(L)UDyn𝒞 form a variety. Let L be a regular language and M its syntactic monoid:

Member(L)UDyn𝒞Member(M)UDyn𝒞.
Proof.

Assume that Member(L) is in UDyn𝒞 and that M is its syntactic monoid. For each xM, the monoid M recognizes the language of all sequences of monoid elements that evaluate to x, so by Lemma 21, this language is also in UDyn𝒞. A dynamic UDyn𝒞 program for Member(M) maintains these languages for each xM.

The “only if” direction of Theorem 15 follows: observe that the regular languages of UDynProp form a variety, as UDynProp is trivially closed under Boolean operations, but also closed under quotients and inverse morphisms due to Lemma 5. Therefore, by Fact 22, if UDynProp can maintain a regular language, it can also maintain the membership problem of its corresponding syntactic monoid. But, by Lemma 20, UDynProp cannot maintain this problem for any monoid that is not a group.

5 The regular languages of UDyn𝚺𝟏+

In this section, we provide a characterization of the regular languages that can be maintained using positive Σ1-formulas if only unary auxiliary relations are permitted. Here, positive Σ1-formulas are -formulas that may not use negations in the quantifier-free part, with the only exception that negations can be used directly in front of the built-in linear order .

An inspection of the proof of Theorem 15 shows that positive quantifier-free formulas and therefore in particular Σ1+-formulas can maintain all regular languages recognized by groups. It is also known that Σ1+-formulas can express all regular languages recognized by the class 𝐉+ of ordered monoids (see Section 5.1 for a definition). It turns out that languages maintainable in UDynΣ1+ are exactly those recognizable by ordered monoids from the wreath product 𝐉+𝐆 of 𝐉+ and 𝐆. Intuitively, this class contains monoids that first do a “group computation” followed by a “𝐉+-computation” (see Section 5.1 for a formalization).

Theorem 23 (Restatement of Theorem 3).

For any regular language L:
Member(L)UDynΣ1+ if and only if the ordered syntactic monoid of L is in 𝐉+𝐆.

We will show, in Section 5.2, that every regular language recognized with 𝐉+𝐆 is in UDynΣ1+. Then, in Section 5.3, we prove that other regular languages cannot be maintained. To this end, we first show that the language 𝚋 cannot be maintained, using an adaptation of the substructure lemma to UDynΣ1+. Finally, relying on a characterization of 𝐉+𝐆, we show that if another language could be maintained, then so could the language 𝚋. We therefore look at monoids supplemented with additional ordering information.

5.1 Ordered monoids and wreath products

For the characterization obtained in Section 4, we exploited that the class of languages maintainable in UDynProp is a variety and can therefore be studied by looking at the syntactic monoids of its languages. Unfortunately, the class UDynΣ1+ of languages is not a variety, as it is not closed under complementation: we will later see that the language (𝚊+𝚋)𝚊(𝚊+𝚋) can be maintained, but its complement 𝚋 cannot. As both languages are recognized by the same monoid U1={1,a}, the information provided by syntactic monoids alone is not sufficient for understanding UDynΣ1+.

Ordered monoids.

An algebraic theory for classes of regular languages satisfying all the requirements of a variety but complementation has been developed by Pin [11]. In this theory, syntactic monoids are supplemented by an additional order. An ordered monoid is a pair (M,) where M is a monoid and is a partial order on M compatible with the operation, that is, xxyy whenever xy and xy. We write x for the set of all elements y with yx. We call PM an upset if it is closed under , that is, if xP for all xP. A morphism from (M,) to (N,) is a monoid morphism from M to N such that for all x,yM, xy implies φ(x)φ(y). The notions quotient, submonoid and division for monoids can be transferred to ordered monoids using this new notion of morphism.

A language L is recognized by (M,) if there is a (monoid) morphism φ:ΣM and an upset P such that L=φ1(P). The syntactic ordered monoid (M,) for a regular language L consists of the transition monoid M of the minimal automaton and an order such that δ1δ2 for δ1,δ2M if for some δ3M and any state q of the minimal automaton it holds that if δ3(δ1(q)) is an accepting state, so is δ3(δ2(q)).

Example 24.

Recall that U1={1,a} is the syntactic monoid of (𝚊+𝚋)𝚊(𝚊+𝚋), and therefore also of its complement 𝚋. However, these languages can be distinguished by their syntactic ordered monoids. Let U1+ (resp. U1) be the ordered monoid U1 equipped with the order 1a (resp. 1a). Then U1+ is the syntactic ordered monoid of (𝚊+𝚋)𝚊(𝚊+𝚋), whereas U1 is the syntactic ordered monoid of 𝚋. Note that 𝚋 cannot be recognized by U1+ because it is the inverse image of 1, which is not an upset.

A prominent example of a class of languages defined via ordered monoids is 𝐉+.

Definition 25.

We denote by 𝐉+ the class of all languages whose syntactic ordered monoid has the property that 1x for every xM.

It is known222In that reference, all orders are reversed. In particular, recognition is defined in terms of downsets. [2, Theorem 3.4] that this class coincides with the class of regular languages expressible by Σ1-formulas. A simple inspection of the proof gives that all formulas are furthermore Σ1+-formulas.

Ordered wreath products.

A successful application of wreath products has been to decompose languages into simpler ones, e.g. in the celebrated decomposition theorem of Krohn and Rhodes [7]. One intuition for these products comes from the cascading of finite state automata. Suppose that 𝒜1 is a deterministic finite state automaton over Σ with state set Q, and 𝒜2 is a deterministic finite state automaton over Q×Σ. On input w, their cascade product 𝒜2𝒜1 first annotates w with the states reached in its run in 𝒜1. Then the resulting enhanced word is fed into 𝒜2 to check for acceptance.

The algebraic counterpart of this cascade product is the semidirect product of monoids. Here, we use the version for ordered monoids introduced by Pin and Weil [13]. Let (M,) and (N,) be two ordered monoids. To ease notation, we make the common notational convention to denote the operation of M additively.333Note that it does not mean that M is commutative. The semidirect product of (M,) and (N,) is defined with respect to a given left action. A left action of (N,) on (M,) is a map (y,x)yx from N×M to M such that for every x,x1x2M and y,y1,y2N satisfies the axioms (1) (y1y2)x=y1(y2x), (2) y(x1+x2)=yx1+yx2, (3) 1x=x, (4) y1=1, (5) if x1x2 then yx1yx2; and (6) if y1y2 then y1xy2x.

The semidirect product (M,)(N,) of (M,) and (N,) with respect to the left action is the ordered monoid on M×N defined by the operation (x1,y1)(x2,y2)=(x1+y1x2,y1y2) for any x1,x2M and y1,y2N. The order on the product is defined componentwise, that is (x1,y1)(x2,y2) if and only if x1x2 and y1y2.

Unfolding the definition for a longer product sheds light on the connection between the semidirect product on monoids and the cascaded product on automata. For x1,,xnM and y1,,ynN, the product in MN is (by using the axioms defining a left action):

(x1,y1)(xn,yn)=(x1+y1x2+(y1y2)x3++(y1yn1)xn,y1yn) (1)

Indeed, in a cascade product, the transition function when reading a letter in the first automaton changes according to the transition function realized so far by the second automaton. When reading the ith letter, the annotation is determined by y1yi1 and the action (y1yi1)xi gives the transition function that is used.

The wreath product 𝐕𝐖 of two classes 𝐕 and 𝐖 of ordered monoids contains all ordered monoids that divide a semidirect product of the form (M,)(N,) for (M,)𝐕 and (N,)𝐖.

 Remark 26.

We chose this definition of wreath products for simplicity. While it already exists in the literature, a most standard choice for 𝐕𝐖 would have been to take all ordered monoids dividing MN×N endowed with some specific order and operation, when (M,)𝐕 and (N,)𝐖. In fact, both definitions are equivalent when both 𝐕 and 𝐖 are closed under direct products. This is the case for the classes under study here, that is for 𝐉+ and 𝐆. Furthermore, the only result on wreath products that is used out-of-the-shelf is Theorem 4.11 in [13] (stated as Theorem 31 here). Therein, the equivalence between all definitions is proved (see their Proposition 3.5, our definition is (1) and the alternative one is (2)).

5.2 Maintaining regular languages in 𝐉+𝐆 with positive 𝚺𝟏-formulas

We will now show that unary auxiliary relations and positive Σ1-formulas are sufficient to maintain the evaluation problems of ordered monoids in 𝐉+𝐆. The upper bound from Theorem 23 then follows from the following Fact 27 which is the analogon of Fact 6 for ordered monoids. For an ordered monoid (M,), define Member(M,) to be the problem that, for a word w subject to changes, maintain a dedicated bit qx that holds 1 whenever wx, for every xM.

Fact 27.

Let 𝒞 be a class of formulas closed under . Further let L be a regular language and (M,) its syntactic ordered monoid. Then:

Member(M,)UDyn𝒞Member(L)UDyn𝒞.
Lemma 28.

If (M,)𝐉+𝐆, then Member(M,) is in UDynΣ1+.

Proof sketch..

We show how to maintain Member(M,) when (M,)=(J,)(G,) for a fixed left action, where (J,)𝐉+ and G is a group. The result then follows from Fact 7, that can be easily extended to ordered monoids.

Let w=(x1,g1)(xn,gn) be the input word, where xiJ and giG for all in. Let P=(p,q)=(p,q) be an upset of (M,), where pJ and qG. We describe how to maintain whether w evaluates in P.

By Lemma 16, we can maintain all evaluations g1gi1 of strict prefixes of the projection of w to the component from G in UDynProp, as well as the information whether g1gn evaluates in q. The corresponding update formulas are actually positive: the original update formulas in [4] are positive and the adaptations of the proof of Lemma 16 do not introduce negations. This allows to maintain the values (g1gi1)xiJ using positive quantifier-free formulas.

Using the Equation 1, we still need to determine whether x1+g1x2+(g1g2)x3++(g1gn1)xn evaluates in p. As the membership problem of (J,) can be expressed by a Σ1+ formula [2, Theorem 3], Σ1+ update formulas can perform that evaluation.

5.3 Lower bound for regular languages not in 𝐉+𝐆

We want to show that Lemma 28 is optimal and any language whose ordered syntactic monoid is not in 𝐉+𝐆 cannot be maintained in UDynΣ1+. The proof is in two steps. First, we show that the regular language 𝚋 cannot be maintained in UDynΣ1+. We then introduce a characterization of 𝐉+𝐆 that implies that if a language not recognized by 𝐉+𝐆 could be maintained, then so could the language 𝚋.

5.3.1 A regular language that is not in UDyn𝚺𝟏+

We show that the language b is not in UDynΣ1+ by generalizing the substructure lemma from DynProp to UDynΣ1+ and then applying it to b.

The substructure lemma for UDynProp relies on the inability of quantifier-free formulas to access elements outside the isomorphic substructures. We adopt the lemma to allow existential quantification in update formulas by weakening the requirement on the substructures to be isomorphic. To this end, let (w,𝒜),(w,𝒜) be words of length nm respectively annotated with sets of unary auxiliary relations 𝒜,𝒜. For i[n], the type of (w,𝒜)|i consists of wi and of the set of all relations of 𝒜 containing i. Let π be a mapping from [n] to [m]. We say that π is type-monotonic if the type of (w,𝒜)|i is a subset of the type of (w,𝒜)|π(i) for all i[n], i.e. if whenever R(i)𝒜 holds then so does R(π(i))𝒜. In this case, we say that (w,𝒜) and (w,𝒜)|π([n]) are type-monotonic via π.

Lemma 29 (Substructure lemma for UDynΣ1+).

Let Π be a dynamic UDynΣ1+-program and let wΣn and wΣm be two words over the alphabet Σ. Further, let 𝒜 and 𝒜 be sets of at most unary auxiliary relations over the domain of w and w and the schema of Π.

Assume there is I[m] such that (w,𝒜) and (w,𝒜)|I are type-monotonic via some order-preserving mapping π. Then π is also a type-monotonic mapping from Πα(w,𝒜) to Πα(w,𝒜)|I, for any π-respecting sequences α and α of changes.

Proof.

We show the statement for a single change α=(setσ(i)) and α=(setσ(π(i)) with i[n]; the general statement follows by induction on the length of change sequences.

For showing that Πα(w,𝒜) and Πα(w,𝒜)|I are type-monotonic via π, consider a unary relation symbol R updated by formula φ(x;y)=defz1zkψΣ1+ when a change to σ is made. Suppose φ(j;i) evaluates to true in (w,𝒜) by choosing z1,,zk as j1,,jk. Then φ(π(j);π(i)) evaluates to true in (w,𝒜) by choosing z1,,zk as π(j1),,π(jk), because (w,𝒜) and (w,𝒜)|I are type-monotonic via π and ψ only contains positive atoms.

To conclude, we apply Higman’s lemma in a similar fashion as in Section 4.

Lemma 30.

The language 𝚋 is not in UDynΣ1+.

Proof.

Assume towards a contradiction that there is a dynamic UDynΣ1+-program Π that maintains 𝚋. We consider the sequence (wi,𝒜i)i1, where wi is the word 𝚊i and 𝒜i are the auxiliary relations that Π obtains when starting from an empty input word of size i and setting all positions to 𝚊. By Lemma 18, there are n<m, I[m] and π such that π is an order-preserving isomorphism from (wn,𝒜n) to (wm,𝒜m)|I. This implies, in particular, that π is type-monotonic on (wn,𝒜n) and (wm,𝒜m)|I.

The sequences α=setb(1)setb(n) and α=setb(π(1))setb(π(n)) are π respecting, so according to Lemma 29, the structures Πα(wn,𝒜n) and Πα(wm,𝒜m)|I are also type-monotonic. But then, because the first word belongs to the language after applying the changes, the program must also say so for the second word after applying the changes (as it must be monotonic on the answer bit). This is a contradiction, because the second word does not belong to the language after the changes.

5.3.2 UDyn𝚺𝟏+ cannot maintain any regular non-𝐉+𝐆 language

To lift the unmaintainability result of Lemma 30 to all regular languages whose syntactic monoid is not in 𝐉+𝐆, we first show that UDynΣ1+ cannot maintain the membership problem of such monoids and then lift this to all languages recognized by them.

We have seen that the definition of 𝐉+𝐆 with the wreath product is useful to design algorithms using only formulas of low complexity and to obtain upper bounds. However, for understanding which monoids do not belong to the class, an equivalent characterization due to Pin and Weil [13] is helpful. Denote by 𝐄𝐉+ the class444Note Pin and Weil denote 𝐄𝐉+ by 𝐁𝐆+ and reverse the order. of languages whose syntactic ordered monoids satisfy 1e for every idempotent e. For instance, (𝚊+𝚋)𝚊𝚊(𝚊+𝚋) is not in 𝐉+ but in 𝐄𝐉+, while (𝚊𝚋) is in neither. Furthermore, every group is in 𝐄𝐉+ as they have a single idempotent which is the identity.

Theorem 31 (Pin and Weil [13, Thm 4.11]).

𝐉+𝐆=𝐄𝐉+

This characterization immediately yields U1 as witness for non-membership in 𝐉+𝐆.

Lemma 32.

If (M,)𝐉+𝐆, then U1 divides (M,).

Proof.

By definition of 𝐄𝐉+, we can find an idempotent eM such that 1e. It implies in particular that e is different from the identity. We consider the submonoid (U1,) of (M,) with U1={1,e} and do a case distinction on :

  • If 1e, then (U1,) is exactly U1.

  • If 1 and e are incomparable, then the order restricted to U1 is the equality =. We conclude by remarking that U1 is a quotient of (U1,=), using the identity function.

Lemma 33.

If (M,) is an ordered monoid that is not in 𝐉+𝐆, then Member(M,) is not in UDynΣ1+.

Proof.

We first observe that UDynΣ1+ cannot maintain Member(U1), due to Fact 27 and Lemma 19 and because U1 is the ordered syntactic monoid of the language 𝚋.

Now assume, towards a contradiction, that Member(M,<) is in UDynΣ1+ for some monoid (M,<) which is not in 𝐉+𝐆. By Lemma 32, U1 is a submonoid of (M,) and hence Member(U1) is in UDynΣ1+ by Fact 7 straightforwardly extended to ordered monoids (it suffices to remark that the inverse image of an upset by a morphism is an upset), contradicting our observation from above.

Now we have to translate the previous lemma from ordered monoids to languages, that is, we need a converse to Fact 27. To this end, we prove that if UDynΣ1+ can maintain a regular language, it can also maintain the membership problem of its ordered syntactic monoid.

To this end, we use a variant of varieties that does not require closure under complementation. A class 𝒱 of regular languages is a positive (pseudo)variety if it is closed under positive Boolean operations, quotients and inverse morphisms.

Examples of positive varieties are 𝐕𝐖 whenever 𝐕 and 𝐖 are positive varieties [13, Proposition 3.5]. Also UDynΣ1+ is a positive variety, because it is closed under positive Boolean operations (because Σ1+ is closed under and ) and under quotients and inverse morphisms (due to Lemma 5). The theorem of Eilenberg translates to positive varieties:

Theorem 34 (Pin [12, Theorem 4.12]).

Let 𝒱 be a positive variety of regular languages and let (M,) be the syntactic ordered monoid of a language L𝒱. Then any language recognized by (M,) is also in 𝒱.

This implies that the converse of Fact 27 holds for positive varieties.

Fact 35.

Let 𝒞 be a class of formulas such that the regular languages of UDyn𝒞 form a positive variety. Let L be a regular language and (M,) its syntactic ordered monoid:

Member(L)UDyn𝒞Member(M,)UDyn𝒞.
Proof.

Assume that Member(L) is in UDyn𝒞. Let φ:MM be the morphism that evaluates a word in M, that is that maps x1xn to the product of the xi for 1in. For any fixed xM, notice that x is an upset of M. Thus Member(φ1(x)) is in UDyn𝒞 for every xM, by Theorem 34. A dynamic program for Member(M) uses each of these programs to generate one bit of output.

The “only if” direction of Theorem 23 now follows. By Fact 35 and because the regular languages of UDynΣ1+ form a positive variety: if UDynΣ1+ can maintain a regular language, it can also maintain the membership problem of its ordered syntactic monoid. But, by Lemma 33, UDynΣ1+ cannot maintain this problem for any ordered monoid not in 𝐉+𝐆.

6 Conclusion

We characterized the regular languages of UDynΣ1+ and UDynProp by properties of their (ordered) syntactic monoids. The most important fragment of DynFO for which a characterization remains open is UDynΣ1 (see also the discussion in the full version of this paper).

Open question.

Which regular languages are in UDynΣ1, i.e. can be maintained by update formulas and unary auxiliary relations?

Two obstacles to an algebraic characterization of UDynΣ1 are (1) that Σ1 is not closed under composition and thus UDynΣ1 is a priori not a (positive) variety; and (2) an absence of lower bounds techniques against UDynΣ1. One path towards resolving (1) is via considering positive lp-varieties, which only require closure under positive Boolean operations and under quotients of inverses of length-preserving morphisms [14]. For (2), new lower bound techniques beyond the substructure lemma (and its variant used for UDynΣ1+) seem to be necessary.

We shortly discuss the expressive power of UDynΣ1. Consider the class 𝐉 of languages that can be described by a Boolean combination of Σ1-formulas. This class is equal to the class of piecewise-testable languages [18]. We can show that UDynΣ1 is strictly more powerful than UDynΣ1+, by looking at the unordered counterpart of 𝐉+𝐆.

Lemma 36.

If L is a regular language in 𝐉𝐆, then Member(L) is in UDynΣ1.

Unfortunately, 𝐉𝐆 does not provide an exact characterization, because the language Σ𝚊𝚊Σ is in UDynΣ1, but its ordered syntactic monoid is not in 𝐉𝐆.

Conjecture 37.

Let 𝒱 be the positive lp-variety of regular languages L such that Member(L) is in UDynΣ1. Then 𝐉𝐆𝒱Σ2𝐆. In particular, (Σ𝚊𝚊Σ)𝚌 is not555Note that non-membership in Σ2𝐆 can be checked with the MeSCaL software [15]. in 𝒱.

Another direction is to explore (fragments of) the class of context-free languages. It is known that every context-free language can be maintained in DynFO [4], yet the known dynamic program requires Σ1-update formulas and 4-ary auxiliary relations.

Open question.

Which dynamic resources (quantifier-alterations, arity of auxiliary relations,…) are required for maintaining context-free languages?

References

  • [1] J. Büchi. Weak second-order arithmetic and finite automata. Mathematical Logic Quarterly, 6:66–92, 1960. doi:10.1007/978-1-4613-8928-6_22.
  • [2] Volker Diekert, Paul Gastin, and Manfred Kufleitner. A survey on small fragments of first-order logic over finite words. Int. J. Found. Comput. Sci., 19(3):513–548, 2008. doi:10.1142/S0129054108005802.
  • [3] Samuel Eilenberg. Automata, Languages and Machines, Vol. B. Academic Press Inc, 1976. URL: https://www.sciencedirect.com/bookseries/pure-and-applied-mathematics/vol/59/part/PB.
  • [4] Wouter Gelade, Marcel Marquardt, and Thomas Schwentick. The dynamic complexity of formal languages. ACM Trans. Comput. Logic, 13(3), 2012. doi:10.1145/2287718.2287719.
  • [5] J. A. Green. On the structure of semigroups. Annals of Mathematics, 54(1):163–172, 1951. URL: http://www.jstor.org/stable/1969317.
  • [6] William Hesse. Dynamic Computational Complexity. PhD thesis, University of Massachusetts Amherst, 2003.
  • [7] Kenneth Krohn and John Rhodes. Algebraic theory of machines. i. prime decomposition theorem for finite semigroups and machines. Transactions of the American Mathematical Society, 116:450–464, 1965. URL: http://www.jstor.org/stable/1994127.
  • [8] M. Lothaire. Combinatorics on Words. Cambridge Mathematical Library. Cambridge University Press, 2 edition, 1997.
  • [9] Robert McNaughton and Seymour A. Papert. Counter-Free Automata (M.I.T. research monograph no. 65). The MIT Press, 1971.
  • [10] Sushant Patnaik and Neil Immerman. Dyn-FO: A parallel, dynamic complexity class. J. Comput. Syst. Sci., 55(2):199–209, 1997. doi:10.1006/jcss.1997.1520.
  • [11] Jean-Éric Pin. A variety theorem without complementation. Russian Mathematics (Izvestija vuzov. Matematika), 39:80–90, 1995.
  • [12] Jean-Eric Pin. Mathematical foundations of automata theory. Lecture notes, 2014. URL: http://www.irif.fr/˜jep/PDF/MPRI/MPRI.pdf.
  • [13] Jean-Eric Pin and Pascal Weil. Semidirect products of ordered semigroups. Communications in Algebra, 30(1):149–169, 2002.
  • [14] Jean-Éric Pin and Howard Straubing. Some results on c-varieties. RAIRO - Theoretical Informatics and Applications, 39(1):239–262, March 2010. URL: http://eudml.org/doc/92759.
  • [15] Thomas Place and Marc Zeitoun. A first taste of mescal, a tool for solving membership problems for regular languages. In Giuseppa Castiglione and Sabrina Mantaci, editors, Implementation and Application of Automata - 29th International Conference, CIAA 2025, Palermo, Italy, September 22-25, 2025, Proceedings, volume 15981 of Lecture Notes in Computer Science, pages 281–298. Springer, 2025. doi:10.1007/978-3-032-02602-6_20.
  • [16] M. P. Schützenberger. Une théorie algébrique du codage. Séminaire Dubreil. Algèbre et théorie des nombres, 9:1–24, 1955. URL: http://eudml.org/doc/111094.
  • [17] M.P. Schützenberger. On finite monoids having only trivial subgroups. Information and Control, 8(2):190–194, 1965. doi:10.1016/S0019-9958(65)90108-7.
  • [18] Imre Simon. Piecewise testable events. In H. Brakhage, editor, Automata Theory and Formal Languages, pages 214–222, Berlin, Heidelberg, 1975. Springer Berlin Heidelberg. doi:10.1007/3-540-07407-4_23.
  • [19] Gudmund Skovbjerg Frandsen, Peter Bro Miltersen, and Sven Skyum. Dynamic word problems. J. ACM, 44(2):257–271, 1997. doi:10.1145/256303.256309.
  • [20] Thomas Zeume. Small dynamic complexity classes. PhD thesis, Technical University Dortmund, Germany, 2015. URL: https://hdl.handle.net/2003/34163.
  • [21] Thomas Zeume and Thomas Schwentick. On the quantifier-free dynamic complexity of reachability. Information and Computation, 240:108–129, 2015. MFCS 2013. doi:10.1016/j.ic.2014.09.011.