Abstract 1 Introduction 2 Factorized Relations 3 Context-Free Grammars and Their Connection to FRs 4 Some Consequences of the Isomorphism 5 Path Representations in Graph Databases 6 Future Work References

A Formal Language Perspective on Factorized Representations

Benny Kimelfeld ORCID Technion, Haifa, Israel Wim Martens ORCID University of Bayreuth, Germany Matthias Niewerth ORCID University of Bayreuth, Germany
Abstract

Factorized representations (FRs) are a well-known tool to succinctly represent results of join queries and have been originally defined using the named database perspective. We define FRs in the unnamed database perspective and use them to establish several new connections. First, unnamed FRs can be exponentially more succinct than named FRs, but this difference can be alleviated by imposing a disjointness condition on columns. Conversely, named FRs can also be exponentially more succinct than unnamed FRs. Second, unnamed FRs are the same as (i.e., isomorphic to) context-free grammars for languages in which each word has the same length. This tight connection allows us to transfer a wide range of results on context-free grammars to database factorization; of which we offer a selection in the paper. Third, when we generalize unnamed FRs to arbitrary sets of tuples, they become a generalization of path multiset representations, a formalism that was recently introduced to succinctly represent sets of paths in the context of graph database query evaluation.

Keywords and phrases:
Databases, relational databases, graph databases, factorized databases, regular path queries, compact representations
Copyright and License:
[Uncaptioned image] © Benny Kimelfeld, Wim Martens, and Matthias Niewerth; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Information systems Data management systems
Related Version:
Full Version: https://arxiv.org/abs/2309.11663 [38]
Funding:
This work was supported by the German Israeli Foundation for Scientific Research and Development (GIF), grant I-1502-407.6/2019. Martens and Niewerth were supported by ANR project EQUUS ANR-19-CE48-0019; funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), project number 431183758.
Editors:
Sudeepa Roy and Ahmet Kara

1 Introduction

Factorized databases (FDBs) aim at succinctly representing the result of join queries by systematically avoiding redundancy. Since their introduction by Olteanu and Zavodny [54, 55], they were the inspiration and key technical approach toward the development of algorithms for efficient query evaluation [10, 52], including the construction of direct-access structures for join queries [18, 19], evaluation of aggregate queries [9, 62, 51], and the application of machine-learning algorithms over databases [59].

At the core of factorized databases are factorized relations. In essence, a factorized relation (FR) is a relational algebra query that builds the represented set of tuples. It involves data values and only two operators: union and Cartesian product. The restriction to these two operators provides succinctness and, at the same time, ensures the efficiency of downstream operations. We refer to [53] for a gentle introduction into factorized databases.

Factorized relations have been introduced in the named database perspective, where tuples are defined as functions from a set of attribute names to a set of attribute values [6] and are therefore unordered. In this paper, we explore FRs from the unnamed perspective, where tuples are ordered. Our motivation to explore this perspective is twofold. First, we believe that tuples in many database systems are ordered objects and second, we want to understand the relationship between factorized relations and path multiset representations (PMRs).

Path Multiset Representations (PMRs) were recently introduced to succinctly represent (multi)sets of paths in graph databases [41]. In particular, they aim at representing paths that match regular path queries (RPQs), which are the fundamental building block of modern graph database pattern matching [24, 30] and have been studied for decades [11, 12, 13, 16, 17, 22, 23, 27, 60]. Compared to traditional research, modern graph query languages such as Cypher [50, 31], SQL/PGQ [36, 24], and GQL [34, 24] use RPQs in a fundamentally new way. In a nutshell, in most of the research literature, an RPQ q returns pairs of endpoints of paths that are matched by q. In Cypher, SQL/PGQ, and GQL, it is possible to return the actual paths that match q [24, 30], which is much less explored [42, 43, 44]. The challenge for PMRs is to succinctly represent the (possibly exponentially many or even infinitely many) paths that match an RPQ, and to allow query operations to be performed directly on the PMR. In fact, several experimental studies show that using PMRs can drastically speed up query evaluation [41, 26, 15].

While FDBs and PMRs aim at the same purpose of succinctly representing large (intermediate) results of queries, they are quite different. For instance, factorized databases represent database relations, which are tuples of the same length and which are always finite. Path multiset representations represent (multi)sets of paths in graphs, with varying lengths, and these sets can be infinite. Finally, even though going from a fixed-length setting to a varying-length setting seems like a generalization, it is not clear how PMRs generalize factorized databases. Viewing FRs through the unnamed database perspective however, will make the relationship between FRs and PMRs much clearer.

Our contributions are the following. Let us use the term named factorized representations (nFR) to refer to the d-representations, also called factorized representations with definitions, introduced by Olteanu and Zavodny [54, 55]. We define unnamed factorized relations (uFRs) which are, analogously to the named case, relational algebra expressions built from data values, union, and Cartesian product. Although uFRs are conceptually very similar to nFRs, they are incomparable in size, since worst-case exponential blow-ups exist in both directions. The blow-up from uFRs to nFRs disappears, however, when we impose a disjointness condition on the columns of uFRs. We then observe that there exists a bijection β between uFRs and a class of context-free grammars (CFGs) for languages in which all words have the same length. Furthermore, each uFR F is isomorphic to the grammar β(F) and its represented relation is the straightforward encoding of the language of β(F) as tuples. Loosely speaking, this means that uFRs and this class of context-free grammars are the same thing.

This tight connection between uFRs and CFGs allows us to immediately infer a number of complexity results on uFRs, e.g., on their membership problem, on their equivalence problem (“Do two uFRs represent the same set of tuples?”), on the counting problem (“How many different tuples are represented by a uFR?”), their enumeration problem, and on size lower bounds. It also allows us to generalize uFRs to a setting in which database relations can contain tuples of different arities, which is a model that is currently being implemented by RelationalAI [58].

Finally, it allows us to clarify the connection between uFRs and PMRs. Loosely speaking, whereas uFRs are context-free grammars for uniform-length languages, PMRs are non-deterministic finite automata. In this sense, PMRs are more expressive than uFRs, because they can represent infinite objects. On uniform-length languages, uFRs and PMRs can represent the same languages, but PMRs are a special case of uFRs. Indeed, it is well-known that CFGs with rules only of the form AbC and Ab are isomorphic to non-deterministic finite automata. In consequence, uFRs can be more succinct than PMRs.

Once we understand how PMRs and uFRs compare, we ask ourselves what are the tradeoffs between them if one would use them as compact representations in the same system. In principle, a CFG for a finite language can be converted into an NFA or, conversely, an NFA representing a finite number of paths could be made even more succinct as a CFG. Different representations may have different benefits. For example, if we want to compute the complement of a relation R represented by a uFR (i.e., a CFG), it may be a viable plan to convert the CFG into a DFA and use the trivial complement operation on DFAs (slightly modified so that we only take the complement on words of the relevant length). As such, even a naive algorithm for complementation is able to avoid fully materializing R in some cases (for example, the cases where the CFG is right-linear). In this paper, we embark on this (quite extensive) tradeoff question and investigate relative blow-ups between the different relevant classes of context-free grammars and automata.

Further related work.

The present paper mainly aims at connecting areas that were previously thought to be different (to the best of our knowledge). In the named database perspective, factorized relations are known to be closely connected to decision diagrams. (See, e.g., [4].) A recent overview on connections between binary decision diagrams (BDDs) and various kinds of automata was made by Amarilli et al. [3]. The authors focus on translations that preserve properties of interest, like the number of objects represented (variables and truth assignments), even if the objects themselves change in the translation. Here, on the other hand, we focus on much stronger correspondences, namely isomorphisms. Put differently, we are interested in preserving not only certain properties of the represented objects, but even the objects themselves. Another difference between our work and the research on circuits is that the latter usually represent unordered objects; we focus on ordered tuples and paths (and connect with factorizations for unordered tuples in Section 2.3). In Section 5.3, we consider size bounds for (classes of) factorized relations in the unnamed (ordered) perspective, which has been investigated in the named perspective by Berkholz and Vinall-Smeeth [14].

This paper is certainly not the first that considers context-free grammars for compression purposes. In fact, the area of straight-line programs, see, e.g., [20, 32, 39] is completely centered around this idea. The focus there, however, is on compactly representing a single word. Factorized relations on the other hand focus on representing a database relation; or a finite set of words.

For space limitations, some proofs are omitted and can be found in the archive version of the paper [38].

2 Factorized Relations

Factorized relations were introduced by Olteanu and Závodný [55], who defined them in the named database perspective, where tuples are unordered [6]. We investigate them in the unnamed perspective (i.e., for ordered tuples), so that we can connect them to sets of paths in graphs (Section 5), which are inherently ordered.

2.1 The Named and Unnamed Perspectives

The principles of databases can be studied in the named perspective and the unnamed perspective, which are slightly different mathematical definitions of the relational model [6, Chapter 2]. Let us provide a bit of background on both, since the difference between them is important in this paper.

Let 𝖵𝖺𝗅 and 𝖠𝗍𝗍 be two disjoint countably infinite sets of values and attribute names. In the named perspective, a database tuple is defined as a function t:X𝖵𝖺𝗅, where X is a finite subset of 𝖠𝗍𝗍. Such functions t are usually denoted as A1:a1,A2:a2,,Ak:ak, to say that t(Ai)=ai for every ik. Notice that tuples are unordered in the sense that A:a,B:b and B:b,A:a denote the same function. The arity of t is |X|. A database relation is a set of tuples that are defined over the same set X. A schema in the named perspective assigns a finite set of attribute names to each relation R in the database. The semantics is that each tuple in R should then be a tuple over the set of attribute names assigned by the schema.

A path in a graph is usually an ordered sequence. (Sometimes containing only nodes, sometimes only edges, and sometimes nodes and edges depending on the concrete definition of the graph or multigraph.) Such paths can therefore be seen as ordered tuples of the form (u1,,un), where u1,,un are objects in the graph.

In the unnamed perspective, a (k-ary) database tuple is simply an element of 𝖵𝖺𝗅k. A database relation is a finite set of tuples of the same arity. We define schemas in the unnamed perspective a bit differently from the standard definition [6, Chapter 2], in order to be closer to the named perspective. (In the standard definition, a schema simply assigns an arity to each relation name R. The semantics is that each tuple in R should have the arity that is assigned by the schema.)

2.2 Unnamed Factorized Relations

For defining unnamed factorized relations (uFR), we follow the intuition that factorized relations are relational algebra expressions that can use names to re-use subexpressions [55]. We also follow [55] in disallowing unions of with non-empty relations. Let X𝖭𝖺𝗆𝖾𝗌 be a finite set of expression names and let 𝑎𝑟:X be a function that associates an arity to each name in X. A relation expression that references X, or X-expression for short, is a relational algebra expression built from singletons, products, unions, and names from X. We inductively define X-expressions E and their associated arity 𝑎𝑟(E) as follows:

(empty)

E= is an X-expression with 𝑎𝑟(E)=0;

(nullary tuple)

E= is an X-expression with 𝑎𝑟(E)=0;

(singleton)

E=a is an X-expression for each a𝖵𝖺𝗅, with 𝑎𝑟(E)=1;

(name reference)

E=N is an X-expression for each NX, with 𝑎𝑟(E)=𝑎𝑟(N);

(union)

for X-expressions E1,,En with 𝑎𝑟(E1)==𝑎𝑟(En), we have that E=(E1En) is an X-expression with 𝑎𝑟(E)=𝑎𝑟(E1)==𝑎𝑟(En);

(product)

for X-expressions E1,,En, we have that E=(E1××En) is an X-expression with 𝑎𝑟(E)=i[n]𝑎𝑟(Ei).

Definition 2.1.

A k-ary unnamed factorized relation (uFR) is a pair F=(S,D), where S𝖭𝖺𝗆𝖾𝗌 is the start symbol and D={N1:=E1,,Nn:=En} is a set of expressions where:

  1. 1.

    N1=S and 𝑎𝑟(N1)=k;

  2. 2.

    each Ni is an expression name;

  3. 3.

    each Ei is an Xi-expression for Xi={Ni+1,,Nn}; and

  4. 4.

    𝑎𝑟(Ni)=𝑎𝑟(Ei) for all i=1,,n.

Note that the expression En does not use name references. Hence, En can be evaluated without resolving references, and the result is a relation Rn. Once we have Rn, we can construct Rn1 from En by replacing Nn with Rn. We continue this way until we obtain R1, which is a k-ary relation, and is the relation that F represents. We denote this relation, R1, by F. Furthermore, we will denote Ri by Ni for every i[n].

Note that, since D is a set, we should indicate which element is S. Indeed, choosing a different start symbol changes F (and may make some parts of F useless since they cannot be reached from S). One may use a notational convention that we always take S to be the first name that we write down in D, as is done in [55, Section 4.2].

(a) A database example.
(b) Visualization of a factorized relation representing Customer PurchaseHistory Supplies.
SA1A2A3
A1B1n1A2B2n2
A3B3n3
B1c1C1B2c2C2
B3c3C3
C1P1P2C2P2P3
C3P1P4
P1fluteDP2wires3
P3harpDP4phones3
Ds1s2
(c) Context-free grammar isomorphic to the factorized relation.
Figure 1: Factorized relation and context-free grammar representing the join of the relations in Figure 1(a).
Example 2.2.

Consider the database in Figure 1(a). We assume that the attributes of each relation are ordered from left to right, i.e., cid is the first attribute of Customer, and so on. The following is a factorized relation that represents Customer PurchaseHistory Supply. (The ordering of rules is top-to-bottom, left-to-right; and the start symbol is N1.)

N1:=A1A2A3B2:=c2×C2P1:=flute×DA1:=B1×n1B3:=c3×C3P2:=wire×s3A2:=B2×n2C1:=P1P2P3:=harp×DA3:=B3×n3C2:=P2P3P4:=phone×s3B1:=c1×C1C3:=P1P4D:=s1s2

Figure 1(b) contains a visualization of the factorized relation. (We annotated some of the elements of 𝖭𝖺𝗆𝖾𝗌 in orange and omitted around data values.)

2.3 Relationship to Named Factorized Relations

We refer to the d-representations of Olteanu and Zavodny [55] as named factorized relations (nFR). For an nFR F, we use F to denote the named relation R represented by F.111F is formally defined in [55]. The definition is completely analogous to Definition 2.1 but starts from tuples in the unnamed perspective. We therefore do not repeat the definition here. Although the definitions of named and unnamed factorized relations are similar, we show that unnamed factorized relations can be exponentially more succinct than named factorized relations and vice versa. In the direction from uFRs to nFRs, the exponential size difference is due to the capability of uFRs to be able to factorize “horizontally” and can be alleviated by imposing that every column uses different values. The exponential size difference in the other direction is due to the unordered nature of nFRs and tuples in the named perspective.

In order to compare uFRs with nFRs, we need to explain when we consider an nFR and a uFR to be equivalent. We consider the standard conversion between named and unnamed database relations in [6, Chapter 2] and write unnamed(R) for the unnamed relation obtained from converting the named relation R to the unnamed perspective. (Intuitively, the conversion assumes a fixed ordering on relation-attribute pairs and converts tuples A1:a1,,Ak:ak in a named relation R into tuples (a1,,ak).) Finally, we say that an nFR F1 and uFR F2 are equivalent if unnamed(F1)=F2.

Proposition 2.3.
  1. (1)

    For each n, there exists a uFR of size O(n) such that the smallest equivalent nFR is exponentially larger.

  2. (2)

    For each n, there exists an nFR of size O(n) such that the smallest equivalent uFR is exponentially larger.

Proof sketch.

For (1), consider the unnamed factorized relation F with the expressions

N1:=N2×N2N2:=N3×N3Nn1:=Nn×NnNn:=M×MM:=01.

This uFR defines the set of all 2n-ary tuples with values in {0,1}. Notice that the uFR is exponentially smaller than the arities of the tuples that it defines, and doubly exponentially smaller than the number of tuples in F, which is 22n. The following can be shown using a standard inductive argument.

Claim 2.4.

For every nFR F, the size of F is at most exponentially smaller than the size of F.

For (2), consider a relation R[A1,,An,B1,,Bn] with the fixed attribute ordering being R.A1<<R.An<R.B1<<R.Bn for converting from the named to unnamed perspective. Consider the set of tuples R={tπA1,,Ant=πB1,,Bnt} in which all data values are 0 or 1. It is easy to construct an nFR for R of size O(n): take S1:=((A1:0×B1:0))((A1:1×B1:1))×S2, S2:=((A2:0×B2:0))((A2:1×B2:1))×S3, etc. The lower bound for uFRs is proved in Corollary 4.4.

The significant size increase when going from the unnamed to the named perspective exists because tuples in the named perspective are “never same in different columns”. Indeed, in the named perspective, tuples A1:a1,,Ak:ak are such that all attribute names Ai are pairwise distinct. Therefore, the named values Ai:ai are also pairwise distinct.

In the unnamed perspective, we can enforce the same restriction by requiring that coordinates in tuples come from disjoint domains. (This notion is similar to the notion of decomposability in circuits [3].) We say that a relation R has disjoint positions if no value occurs in two different columns. More precisely, if a[i]b[j] for all a,bR and 1i<jk. We say that an unnamed factorized relation F has disjoint positions if F has disjoint positions.

Proposition 2.5.

For each n and uFR of size n with disjoint positions, there is an equivalent nFR of size n.

3 Context-Free Grammars and Their Connection to FRs

Let Σ be a finite set, whose elements we call symbols. By ε we denote the empty word, that is, the word of length 0. By Σ we denote the set of all words over Σ, i.e., the set of words w=a1an, where ε and are not elements of Σ. A regular expression (RE) over Σ is inductively defined as follows. Every aΣ is a regular expression, and so are the symbols ε and . Furthermore, if e1 and e2 are regular expressions over Σ, then so are e1e2 (concatenation), e1e2 (union), and e1 (Kleene star). As usual, we often omit the concatenation operator in our notation. When taking e1e2, we assume that neither e1 nor e2 are .222Indeed, a union with is never useful and the restriction is easy to enforce. We make this restriction because unions in uFRs are defined with the same restriction. Theorem 3.8, which states that uFRs and uniform-length ECFGs are the same, also holds if unions in uFRs and REs both allow the empty set. By L(e) we define the language of e, which is defined as usual.

Definition 3.1 (see, e.g., [40]).

An extended context-free grammar (abbreviated ECFG) consists of rules where nonterminals are defined using arbitrary regular expressions over terminals and nonterminals. Formally, an ECFG is a tuple G=(T,N,S,R) where:

  • T is a finite set of terminals;

  • N is a finite set of nonterminals such that TN=;

  • SN is the start symbol; and

  • R is a finite set of rules of the form Ae, where e is a regular expression over TN.

For the purpose of this paper, we will always choose T𝖵𝖺𝗅 and N𝖭𝖺𝗆𝖾𝗌. Furthermore, we assume that all terminals in T are actually used in the grammar, that is, for each terminal a, there exists a rule Ae such that a appears in the expression e.

The language of G, denoted L(G), is defined as usual. A derivation step of G is a pair (u,v) of words in (TN) such that u=αXβ and v=αγβ where XN and α,β, γ(TN), and where R contains a rule Xe with γL(e). We denote such a derivation step as uGv. A derivation is a sequence u0,,un such that ui1Gui for every i[n]. We denote by uv that there exists a derivation that starts in u and ends in v and by u+v the case where this derivation has at least one step. By L(u) we denote the language {wTuGw}. Finally, the language of G, denoted L(G), is the language L(S) of words derived from the start symbol S.

A nonterminal AN is useful if there exists a derivation SGαAβGw for some word wΣ. The grammar G=(T,N,S,R) is trimmed if every nonterminal in N is useful. It is well-known that an ECFG can be converted into a trimmed ECFG in linear time. A grammar G is recursive if there exists a derivation AG+αAβ for some AN and α,β(TN).

 Remark 3.2.

Context-free grammars (CFGs) are defined analogously to ECFGs, except that rules are required to be of the form Aα1αn, where each αi is a concatenation over TN. It is well known that CFGs and ECFGs have the same expressiveness and that they can be translated back and forth in linear time [35, p. 202].

3.1 Isomorphisms

In this section we want to define when we consider a uFR and an ECFG to be isomorphic. To warm up, we first explain when we consider two ECFGs G1 and G2 to be isomorphic. Intuitively, this is the case when they are the same up to renaming of non-terminals. Formally, we define isomorphisms using a function h:𝖭𝖺𝗆𝖾𝗌𝖭𝖺𝗆𝖾𝗌 that we extend to regular expressions as follows:

h()=h(e1e2)=h(e1)h(e2)h(ε)=εh(e1e2)=h(e1)h(e2)h(a)=a for every a in 𝖵𝖺𝗅h(e)=h(e)

Then, G1=(T1,N1,S1,R1) is isomorphic to G2=(T2,N2,S2,R2) if there is a bijective function h:N1N2 such that h(S1)=S2, for each rule Ae in R1, the rule h(A)h(e) is in R2, and each rule in R2 is of the form h(A)h(e) for some rule Ae in R1.

Example 3.3.

(Extended) context-free grammars are isomorphic if and only if they are the same up to renaming of non-terminals. For example, the grammars

SASBCAaBbCc     and     SXSYZXaYbZc

(both with start symbol S) are isomorphic. They recognize {anbnn}L(c).

Observation 3.4.

If G1 and G2 are isomorphic, then L(G1)=L(G2).

We want to extend this notion of isomorphism to factorized relations and want to maintain a property such as Observation 3.4 which says that, if the objects are syntactically isomorphic, also their semantics is the same. To this end, for a tuple t=a1,,ak, we denote the word a1ak as word(t). Hence, word()=ε. For a set T of tuples, we define word(T):={word(t)tT}.

We now define isomorphisms between uFRs and (star-free) ECFGs. The idea is analogous as before, but with the difference that the Cartesian product operator (×) in uFRs is replaced by the concatenation operator () in ECFGs. That is, we define isomorphisms using a function h:𝖭𝖺𝗆𝖾𝗌𝖭𝖺𝗆𝖾𝗌 that we extend to X-expressions as follows:

h()=h(E1×E2)=h(E1)h(E2)h()=εh(E1E2)=h(E1)h(E2)h(a)=a for every a in 𝖵𝖺𝗅

A uFR (N1,D) with D={N1:=E1,,Nn:=En} is isomorphic to an ECFG G=(T,N,S,R) if there is a bijective function h:{N1,,Nn}N such that

  • the start symbol S is h(N1);

  • for every expression Ni:=Ei in D, the rule h(Ni)h(Ei) is in R; and

  • for every rule Ne in R, there is an expression Ni:=Ei in D with h(Ni)=N and h(Ei)=e.

Example 3.5.

Consider the uFR in Example 2.2, which is visualized in Figure 1(b). It is routine to check that it is isomorphic to the extended context-free grammar in Figure 1(c). In fact, the isomorphism in this case is the identity function.

We now observe that isomorphisms preserve the size and, in a strong sense, also the semantics of uFRs and ECFGs. To this end, the size |E| of an X-expression or regular expression E is defined to be the number of occurrences of symbols plus the number of occurrences of operators in E. For example, |a|=1, |(a(×b)|=5, and |(ab)|=4. The size of a uFR (resp., ECFG) is the sum of the sizes of its X-expressions (resp., regular expressions).

Proposition 3.6.

If h is an isomorphism from a uFR (N1,D) to an ECFG (T,N,S,R) then, for each expression Ni:=Ei in D such that Ai=h(Ni) and ei=h(Ei), we have that

  1. (a)

    |ei|=|Ei| and

  2. (b)

    L(Ai)=word(Ni).

Corollary 3.7.

If a uFR F and ECFG G are isomorphic then they have the same size and L(G)=word(F).

3.2 FRs and ECFGs are Isomorphic on Database Relations

A factorized relation F defines a database relation, where all tuples have the same arity. An ECFG defining the same relation (i.e., word(F)) defines a language in which each word has the same length (which is, in particular, finite).

Let G=(V,N,S,R) be an ECFG. Notice that, if G is trimmed and L(G) is finite, then G cannot use the Kleene star operator in a meaningful way. Indeed, it can only use subexpressions e if L(e)= or L(e)=ε, in which case L(e)=ε. The same holds for recursion. We therefore assume from now on that ECFGs that define a finite language are non-recursive and do not use the Kleene star operator. We call a nonterminal AN uniform length if every word wL(A) has the same length. We say that G is uniform length if S is uniform length. We now prove that factorized relations are the same as uniform-length ECFGs.

Theorem 3.8.

There is a bijection β between the set of uFRs and the set of uniform-length ECFGs such that each factorized relation F is isomorphic to β(F).

Similarly, we say that a uniform-length ECFG G has disjoint positions if, for every pair of words a1akL(G) and b1bkL(G) we have that aibj if ij.

Theorem 3.9.

There is a bijection β between the set of uFRs with disjoint positions and the set of uniform-length ECFGs with disjoint positions such that each factorized relation F is isomorphic to β(F).

In the remainder of the paper, for an uFR F, we will refer to β(F) as the CFG corresponding to F.

4 Some Consequences of the Isomorphism

We now discuss some immediate consequences of Theorems 3.8 and 3.9. We note that our list is far from exhaustive. In principle, every result on context-free grammars that holds for uniform-length languages can be lifted to uFRs. Conversely, every result that is shown for uFRs can be transferred to CFGs for uniform length words. Since uFRs are a class of CFGs due to Theorem 3.8, we use some standard terminology for CFGs to uFRs, e.g., the notion of derivation trees. We call a uFR F deterministic if the CFG G corresponding to F is unambiguous, i.e., every word in L(G) has a unique derivation tree.333The definition of an nFR F being deterministic in [55] says that each monomial that can be obtained from using distributivity of product over union is distinct. This is equivalent to saying that each tuple in F has a unique derivation tree.

4.1 Membership

We define the membership problem for uFRs to be the problem that, given a tuple t and uFR F, tests if tF. The CYK algorithm [35] decides membership for context-free languages in polynomial time.

Corollary 4.1.

The membership problem for uFRs is in polynomial time.

4.2 FRs versus Non-Deterministic Finite Automata

We call a uFR (S,D) right-linear (resp., left-linear) if every expression in D is of the form A:= or A:={b}×C for A,CN and bT (resp., A:= or A:=C×{b}). (The corresponding definition for CFGs is analogous.) Due to [35], we know that right-linear CFGs are isomorphic to non-deterministic finite automata. The isomorphism, formulated in terms of uFRs, is that a rule A{b}×C corresponds to a transition from state A to state C with label b, and a rule A:= corresponds to A being an accepting state. A state A is a start state if A does not occur on the right-hand side of a rule in S. (The argument for left-linear uFRs is analogous.)

Corollary 4.2.

Right-linear (and left-linear) uFRs are isomorphic to non-deterministic finite automata for uniform-length languages.

Let us define the equivalence problem of uFRs as follows. Given two uFRs F1 and F2, is F1=F2? Likewise, the containment problem asks, given two uFRs F1 and F2, whether F1F2. Due to [61, Corollary 5.9], we now know

Corollary 4.3.

Equivalence and containment of deterministic right-linear (resp., left-linear) uFRs is in polynomial time.

We recall that determinism in uFRs corresponds to unambiguity in context-free grammars and finite automata. In particular, Corollary 5.9 in [61], which shows that equivalence and containment of unambiguous finite automata is solvable in polynomial time is non-trivial. In fact, the result is even more general: it holds for k-ambiguous automata for every constant k. Here, k-ambiguity intuitively means that each tuple in F is allowed to have up to k derivation trees in F.

4.3 Size Lower Bounds

Filmus [28] proves a lower bound on the size of CFGs that, in terms of uFRs, is stated as follows.

Corollary 4.4 ([28], Theorem 7).

Consider the set of tuples S={(a1,,an,b1,,bn){0,1}2na1an=b1bn}. Then the smallest uFR for S has size Ω(2n/4/2n).

In fact, the proofs of Corollary 4.4 and 4.1 use the fact that CFGs (uFRs) can be brought into Chomsky Normal Form [21], which may be yet another classical result that is useful for proving results on uFRs.

4.4 Counting

Corollary 4.2 allows us to connect recent results on counting problems for automata and grammars [7, 8, 45] to uFRs. For a class 𝒞 uFRs, counting for 𝒞 is the problem that, given a uFR F𝒞, asks what is the cardinality of F. First, recall that the number of words of a given length n in an unambiguous CFG (or ECFG) can be counted in polynomial time [29, Section I.5.4] by a simple dynamic programming approach.

Corollary 4.5.

Counting for deterministic uFRs is in polynomial time.

For general right-linear uFRs, the counting problem is #P-complete, but the following is immediate from the existence of an FPRAS for #NFA [7] and Theorem 3.8.

Corollary 4.6.

Counting for right-linear uFRs admits an FPRAS.

Furthermore, the recent more efficient FPRAS for #NFA by Meel et al. [45] can be applied verbatim to counting for right-linear uFRs. In fact, Meel et al. [46] recently generalized the result to #CFG. The result is still unpublished, but it would imply:

Corollary 4.7.

Counting for uFRs admits an FPRAS.

Notice that counting for uFRs (and subclasses thereof) is a practically relevant question: it is the result of the COUNT DISTINCT query for a factorized representation.

4.5 Enumeration

In terms of enumeration, Dömösi shows that, given a context-free grammar G and length n, the set of words in L(G) of length n can be enumerated with delay polynomial in n [25]:

Corollary 4.8.

Given an uFR F, the set of tuples in F can be enumerated with delay polynomial in the arity of F.

We note that, in the case of right-linear uFRs, more efficient algorithms are possible [1, 2]. The same holds if the uFR is deterministic [56]. For example, Muñoz and Riveros [49] considered Enumerable Compact Sets (ECS) as a data structure for output-linear delay algorithms. ECS can be viewed as context-free grammars in Chomsky Normal Form for finite languages (using a similar isomorphism as in Section 3.1). In terms of uFRs, [49] shows that, if the uFR is deterministic and k-bounded (which means that unions on right-hand sides have constant length), then all its tuples can be enumerated in output-linear delay.

4.6 FRs for Variable-Length Relations

We now consider a slightly more liberal relational data model in the sense that a database relation no longer needs to contain tuples of the same arity. The reason why we consider this case is twofold. First, this data model leads to representations for the finite languages, which is a fundamental class in formal language theory. Second, this data model is the underlying data model [57] for the query language Rel [58], implemented by RelationalAI. So it is used in practice. We say that a variable-length database relation is simply a finite set R of tuples.

The correspondence between uFRs and ECFGs in Theorems 3.8 and 3.9 allows us to define a natural generalization of FRs for variable-length relations, which corresponds to ECFGs for finite languages. We inductively define variable-length X-expressions (vl-X-expression for short) E as follows:

  • E= is a vl-X-expression;

  • E= is a vl-X-expression;

  • for each a𝖵𝖺𝗅, we have that E=a is a vl-X-expression with 𝑎𝑟(E)=1 (singleton);

  • for each NX, we have that E=N is a vl-X-expression (name reference);

  • for vl-X-expressions E1,,En we have that

    • E=(E1En) is a vl-X-expression (union); and

    • E=(E1××En) is a vl-X-expression (Cartesian product).

Definition 4.9.

A variable-length factorized relation (vlFR) is a pair (S,D), where S𝖭𝖺𝗆𝖾𝗌 is the start symbol and D={N1:=E1,,Nn:=En} is a set of expressions where:

  1. 1.

    N1=S;

  2. 2.

    Each Ni is an expression name;

  3. 3.

    Each Ei is a vl-Xi-expression for Xi={Ni+1,,Nn}; and

The semantics F of a variable-length factorized relation F is defined analogously as for FRs. The difference is that the result is now a variable-length database relation.

Theorem 4.10.

There is a bijection β between the set of vlFRs and the set ECFGs for finite languages such that each factorized representation F is isomorphic to β(F).

5 Path Representations in Graph Databases

We now start exploring the relationship between uFRs and Path Multiset Representations (PMRs), which were recently introduced as a succinct data structure for (multi)sets of paths in graph databases [41]. Several studies demonstrate that they can drastically speed up evaluation of queries that involve regular path queries with path variables [41, 26, 15].

We briefly introduce PMRs and explain their connection to finite automata. This allows us to relate them to uFRs and study some size tradeoffs later in this section.

5.1 Path Multiset Representations

We use edge-labeled multigraphs as our abstraction of a graph database.444PMRs were originally defined on property graphs, which are more complex than edge-labeled graphs. The definition of PMRs presented here is therefore slightly simplified. A graph database is a tuple G=(N,E,lab), where N is a finite set of nodes, EN×N is a finite set of edges, and lab:E𝖵𝖺𝗅 is a function that associates a label to each edge. A path in G is a sequence of nodes u0,,un, where (ui1,ui)E for every i[n].

Definition 5.1.

A path multiset representation (PMR) over a graph database G=(NG,EG,labG) is a tuple R=(N,E,γ,S,T) where

  • N is a finite set of nodes;

  • EN×N is a finite set of edges;

  • γ:NNG is a homomorphism (that is, if (u,v)E, then (γ(u),γ(v))EG);

  • SN is a finite set of start nodes;

  • TE is a finite set of target nodes.

The semantics of PMRs is defined as follows. They can be used as a representation of a set or a multiset of paths. More precisely, we define 𝖲𝖯𝖺𝗍𝗁𝗌(R)={γ(p)p is a path from some node in S to some node in T in R}. Notice that each γ(p) is indeed a path in G, since γ is a homomorphism. 𝖬𝖯𝖺𝗍𝗁𝗌(R) is defined similarly, but it is a multiset, where the multiplicity of each path p in G is the number of paths p in R such that γ(p)=p.

(a) An edge-labeled graph G.
(b) A PMR R of the paths of even length from A to D (with multiplicity two for the shortest path).
Figure 2: An edge-labeled graph G and a PMR for a multiset of its paths.
Example 5.2.

Consider the graph in Figure 2(a). Figure 2(b) depicts a PMR R representing the set of paths from A to D in G that have even length. The homomorphism γ simply matches both nodes A1 and A2 to A; and similarly for the other indexed nodes. We define S={A1} and T={D}. Following our definition, we now have that 𝖲𝖯𝖺𝗍𝗁𝗌(R) is indeed the set of paths from A to D in G that have even length. In 𝖬𝖯𝖺𝗍𝗁𝗌(R), the shortest such path (having length two) has multiplicity two, whereas all other paths have multiplicity one.

5.2 PMRs versus Finite Automata

PMRs are closely connected to finite automata by design. One reason for this design choice is that graph pattern matching in languages such as Cypher, SQL/PGQ, and GQL starts with the evaluation of regular path queries, which match “regular” sets of paths.

We explain this connection next and assume familiarity with finite automata. In the following, we will denote nondeterministic finite automata (NFAs) as tuples A=(Σ,Q,δ,I,F) where Σ is its symbols (or alphabet), Q its finite set of states, δ its set of transitions of the form q1𝑎q2 (meaning that, in state q1, the automaton can go to state q2 by reading the symbol a), IQ its set of initial states, and FQ its set of accepting states. As usual, we denote by L(A) the language of A, which is the set of words accepted by A.

The connection between PMRs and NFAs is very close. Indeed, we can turn a PMR R=(N,E,γ,S,T) over graph G=(NG,EG,lab) into an NFA NR=(Σ,Q,δ,I,F) where

  1. 1.

    the alphabet Σ is the set NG of nodes of G;

  2. 2.

    the set Q of states is N{s}, where we assume sN;

  3. 3.

    for every edge e=(u,v)E, there is a transition uγ(v)v;

  4. 4.

    for every node uS, we have a transition sγ(u)u;

  5. 5.

    I={s}; and F=T.

As usual, we denote by L(NR) the set of words accepted by NR. The automaton NR accepts precisely the set of paths represented by R.

Proposition 5.3 (Implicit in [41]).

L(NR)=𝖲𝖯𝖺𝗍𝗁𝗌(R).

In fact, there also exists a multiset language of NFAs, denoted ML(A), in which the multiplicity of each word wML(A) is the number of accepting runs that A has on w. Analogously to Proposition 5.3, one can show the following.

Proposition 5.4 (Implicit in [41]).

𝑀𝐿(NR)=𝖬𝖯𝖺𝗍𝗁𝗌(R).

The correspondence in Proposition 5.4 is interesting for the purposes of representing path multisets, because deciding for given NFAs A1 and A2 if 𝑀𝐿(A1)=𝑀𝐿(A2) is in polynomial time [63] if the NFAs do not have ε-transitions, which is the case here. Deciding if L(A1)=L(A2) on the other hand is pspace complete [48]. (The same complexities hold for the respective containment problems.) This can be interesting if we want to consider questions like finding optimal-size representations of a (multi)set of paths.

5.3 Comparing uFRs and PMRs

In this section, we identify a path u1,,un with the database tuple (u1,,un). Furthermore, for an uFR F and PMR R, we compare F with 𝖲𝖯𝖺𝗍𝗁𝗌(R), i.e., we compare them under set semantics. (A similar comparison can be made when considering them both under bag semantics.) Under these assumptions, we have the following observation.

Proposition 5.5.

PMRs are strictly more expressive than uFRs.

Proof.

Every uFR represents a finite relation, which can be represented by a PMR (in formal language terms: every finite language is regular). Furthermore, PMRs can represent some infinite relations, namely those whose corresponding word language is regular [41].

It is interesting to compare the relative size of PMRs and uFRs. Indeed, most practical query languages (e.g., GQL, Cypher) use keywords to ensure that the sets of paths to be considered in graph pattern matching are finite (SHORTEST, TRAIL, SIMPLE, ACYCLIC).555It is an interesting question if such keywords that force finite number of paths are indeed always needed, and PMRs show one way to finitely represent an infinite number of paths. This means that, when using these languages, one can in principle use PMRs as well as uFRs to represent sets of paths.

Using uFRs to represent sets of paths in graph database systems opens up a wide array of questions. More precisely, context-free grammars (CFG), unambiguous context-free grammars (UCFG), non-deterministic finite automata (NFA), unambiguous finite automata (UFA), and deterministic finite automata (DFA) for finite-length languages are all special cases of uFRs and are all able to represent some set of n tuples using a representation of size O(logn). All these formalism have different properties. (E.g., counting for UFA is easy by [61, Corollary 5.9], but #P-complete for NFA, we know that we can convert an NFA into a DFA in exponential time, etc.) So, which representation can be used in which case? This question actually calls for an investigation that is too extensive for one paper – here we investigate the size tradeoffs between the different models.

Figure 3: Worst-case unavoidable blow-ups for succinct representations of uniform length relations. Every path that consists of only blue edges represents an unavoidable exponential blow-up and every path that contains at least one red (solid) edge represents an unavoidable double exponential blow-up. If there is no path, then there exists a linear translation. For the dashed edges, we only prove an upper bound. The corresponding lower bounds are conditional on Conjecture 5.7.

Uniform-Length Relations

We say that there is an f(n)-size translation from one model X to a model Y, if there exists a translation from X to Y such that each object of size n in X can be translated to an equivalent object of size O(f(n)) in Y. We say that these translations are tight if there is an infinite family of objects in X in which, for each object of size n, the smallest equivalent object in Y has size Ω(f(n)). When F is a set of functions (such as the exponential or double-exponential functions), we say that there’s an F-translation if there exists a function fF such that there is an f(n)-size translation. Again, we say that the translations are tight, if there is a function fF for which the translation is tight.

Theorem 5.6.

Over uniform-length languages, there are exponential translations

  1. (E1)

    from CFG to NFA;

  2. (E2)

    from UCFG to UFA;

  3. (E3)

    from NFA to UCFG;

  4. (E4)

    from NFA to UFA;

  5. (E5)

    from UFA to DFA;

  6. (E6)

    from DFA to Set; and

  7. (E7)

    from NFA to Set.

There are double-exponential translations

  1. (DE1)

    from CFG to UFA;

  2. (DE2)

    from CFG to UCFG;

  3. (DE3)

    from UCFG to DFA; and

  4. (DE4)

    from CFG to Set.

Furthermore, these translations are tight for (E1–E2,E4–E7) and (DE1,DE3–DE4).

We conjecture that the translations for (DE2) and (E3) are also tight. In fact, they are tight under Conjecture 5.7. To the best of our knowledge, the literature does not yet have well-developed methods for proving size lower bounds for UCFGs. A proof of Conjecture 5.7 using communication complexity has recently been claimed by Mengel and Vinall-Smeeth [47].

Conjecture 5.7.

For each n, the smallest unambiguous context-free grammar for the language

Ln={(a+b)ka(a+b)na(a+b)nkkn}

of words of length 2n+2 has size 2Ω(n).

One reason why we believe in Conjecture 5.7 is because there does not exist a UCFG for the generalized version of the language to the unbounded length setting.

Proposition 5.8.

There does not exist a UCFG for the (infinite) language

L={(a+b)na(a+b)na(a+b)nkk,n,kn}.
Theorem 5.9.

Over uniform-length languages with disjoint positions, there are exponential translations

  1. (E1)

    from CFG to NFA;

  2. (E2)

    from UCFG to UFA;

  3. (E3)

    from CFG to UCFG;

  4. (E4)

    from NFA to UCFG;

  5. (E5)

    from NFA to UFA;

  6. (E6)

    from UFA to DFA;

  7. (E7)

    from DFA to Set; and

  8. (E8)

    from CFG to Set.

Furthermore, the translations (E1–E2,E5–E8) are tight.

Again, if Conjecture 5.7 holds true, the translations (E3–4) are also tight.

5.4 Variable-Length Relations

Theorems 5.6 and 5.9 also hold for variable-length (but finite) relations, as we considered in Section 4.6. The lower bounds are immediate from those results and the upper bound constructions are analogous.

6 Future Work

The connection between database factorization and formal languages gives rise to a plethora of questions for future investigation. What is the complexity of basic operations (e.g., enumeration, counting, and direct access) over compact representations of different formalisms? What is the impact of non-determism on this complexity? Some questions naturally emerge in the context of answering queries efficiently with compact representations. Given a query and a database, what is the best formal language for representing the result? What is the impact of the choice of formalism of on our ability to efficiently maintain the query result (as a database view) to accommodate updates in the database? Specifically, which of the formalisms allow to apply past results on updates of compact representations (e.g., [5, 37])? These questions, as well as the connection between factorized relations and path multiset representations, are especially relevant in light of the ongoing efforts on the graph query languages SQL/PGQ and GQL, as these languages combine graph pattern matching (through regular path query evaluation) and relational querying [24, 30].

In addition to the above, some questions arise independently of the manner (e.g., query) in which the factorized representation is constructed. What is the complexity of minimizing a representation of each formalism? What is the tradeoff that the variety of formalisms offers between the size and the complexity of operations? What is the best lossy representation if we have a size (space) restriction on the representation? Here, the definition of loss may depend on the application, and one interesting application is summarization of a large table via lower-resolution representations, as done by El Gebaly et al. [33].

References

  • [1] Margareta Ackerman and Erkki Mäkinen. Three new algorithms for regular language enumeration. In Hung Q. Ngo, editor, Computing and Combinatorics, 15th Annual International Conference, COCOON 2009, Niagara Falls, NY, USA, July 13-15, 2009, Proceedings, volume 5609 of Lecture Notes in Computer Science, pages 178–191. Springer, 2009. doi:10.1007/978-3-642-02882-3_19.
  • [2] Margareta Ackerman and Jeffrey O. Shallit. Efficient enumeration of words in regular languages. Theor. Comput. Sci., 410(37):3461–3470, 2009. doi:10.1016/J.TCS.2009.03.018.
  • [3] Antoine Amarilli, Marcelo Arenas, YooJung Choi, Mikaël Monet, Guy Van den Broeck, and Benjie Wang. A circus of circuits: Connections between decision diagrams, circuits, and automata. CoRR, abs/2404.09674, 2024. doi:10.48550/arXiv.2404.09674.
  • [4] Antoine Amarilli, Pierre Bourhis, Louis Jachiet, and Stefan Mengel. A circuit-based approach to efficient enumeration. In Ioannis Chatzigiannakis, Piotr Indyk, Fabian Kuhn, and Anca Muscholl, editors, 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017, July 10-14, 2017, Warsaw, Poland, volume 80 of LIPIcs, pages 111:1–111:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPICS.ICALP.2017.111.
  • [5] Antoine Amarilli, Pierre Bourhis, Stefan Mengel, and Matthias Niewerth. Enumeration on trees with tractable combined complexity and efficient updates. In Symposium on Principles of Database Systems (PODS), pages 89–103. ACM, 2019. doi:10.1145/3294052.3319702.
  • [6] Marcelo Arenas, Pablo Barceló, Leonid Libkin, Wim Martens, and Andreas Pieris. Database Theory. Open source at https://github.com/pdm-book/community, 2022.
  • [7] Marcelo Arenas, Luis Alberto Croquevielle, Rajesh Jayaram, and Cristian Riveros. #NFA admits an FPRAS: efficient enumeration, counting, and uniform generation for logspace classes. J. ACM, 68(6):48:1–48:40, 2021. doi:10.1145/3477045.
  • [8] Marcelo Arenas, Luis Alberto Croquevielle, Rajesh Jayaram, and Cristian Riveros. When is approximate counting for conjunctive queries tractable? In Symposium on Theory of Computing (STOC), pages 1015–1027. ACM, 2021. doi:10.1145/3406325.3451014.
  • [9] Nurzhan Bakibayev, Tomás Kociský, Dan Olteanu, and Jakub Zavodny. Aggregation and ordering in factorised databases. Proc. VLDB Endow., 6(14):1990–2001, 2013. doi:10.14778/2556549.2556579.
  • [10] Nurzhan Bakibayev, Dan Olteanu, and Jakub Zavodny. FDB: A query engine for factorised relational databases. Proc. VLDB Endow., 5(11):1232–1243, 2012. doi:10.14778/2350229.2350242.
  • [11] Pablo Barceló, Diego Figueira, and Miguel Romero. Boundedness of conjunctive regular path queries. In International Colloquium on Automata, Languages, and Programming (ICALP), pages 104:1–104:15, 2019. doi:10.4230/LIPIcs.ICALP.2019.104.
  • [12] Pablo Barceló, Carlos A. Hurtado, Leonid Libkin, and Peter T. Wood. Expressive languages for path queries over graph-structured data. In Symposium on Principles of Database Systems (PODS), pages 3–14. ACM, 2010. doi:10.1145/1807085.1807089.
  • [13] Pablo Barceló, Leonid Libkin, and Juan L. Reutter. Querying graph patterns. In Symposium on Principles of Database Systems (PODS), pages 199–210. ACM, 2011. doi:10.1145/1989284.1989307.
  • [14] Christoph Berkholz and Harry Vinall-Smeeth. A dichotomy for succinct representations of homomorphisms. In International Colloquium on Automata, Languages, and Programming (ICALP), volume 261 of LIPIcs, pages 113:1–113:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPICS.ICALP.2023.113.
  • [15] Vicente Calisto, Benjamín Farias, Wim Martens, Carlos Rojas, and Domagoj Vrgoc. Pathfinder demo: Returning paths in graph queries. In ISWC 2024 Posters, Demos and Industry Tracks, volume 3828 of CEUR Workshop Proceedings. CEUR-WS.org, 2024. URL: https://ceur-ws.org/Vol-3828/paper34.pdf.
  • [16] Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Moshe Y. Vardi. Rewriting of regular expressions and regular path queries. In Symposium on Principles of Database Systems (PODS), pages 194–204. ACM Press, 1999. doi:10.1145/303976.303996.
  • [17] Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Moshe Y. Vardi. Containment of conjunctive regular path queries with inverse. In International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 176–185. Morgan Kaufmann, 2000.
  • [18] Nofar Carmeli, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld, and Mirek Riedewald. Tractable orders for direct access to ranked answers of conjunctive queries. ACM Trans. Database Syst., 48(1):1:1–1:45, 2023. doi:10.1145/3578517.
  • [19] Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Alessio Conte, Benny Kimelfeld, and Nicole Schweikardt. Answering (unions of) conjunctive queries using random access and random-order enumeration. ACM Trans. Database Syst., 47(3):9:1–9:49, 2022. doi:10.1145/3531055.
  • [20] Moses Charikar, Eric Lehman, Ding Liu, Rina Panigrahy, Manoj Prabhakaran, Amit Sahai, and Abhi Shelat. The smallest grammar problem. IEEE Trans. Inf. Theory, 51(7):2554–2576, 2005. doi:10.1109/TIT.2005.850116.
  • [21] Noam Chomsky. On certain formal properties of grammars. Inf. Control., 2(2):137–167, 1959. doi:10.1016/S0019-9958(59)90362-6.
  • [22] Mariano P. Consens and Alberto O. Mendelzon. GraphLog: a visual formalism for real life recursion. In Symposium on Principles of Database Systems (PODS), pages 404–416, 1990. doi:10.1145/298514.298591.
  • [23] Isabel F. Cruz, Alberto O. Mendelzon, and Peter T. Wood. A graphical query language supporting recursion. In International Conference on Management of Data (SIGMOD), pages 323–330, 1987. doi:10.1145/38713.38749.
  • [24] Alin Deutsch, Nadime Francis, Alastair Green, Keith Hare, Bei Li, Leonid Libkin, Tobias Lindaaker, Victor Marsault, Wim Martens, Jan Michels, Filip Murlak, Stefan Plantikow, Petra Selmer, Oskar van Rest, Hannes Voigt, Domagoj Vrgoc, Mingxi Wu, and Fred Zemke. Graph pattern matching in GQL and SQL/PGQ. In International Conference on Management of Data (SIGMOD), pages 2246–2258. ACM, 2022. doi:10.1145/3514221.3526057.
  • [25] Pál Dömösi. Unusual algorithms for lexicographical enumeration. Acta Cybern., 14(3):461–468, 2000. URL: https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3539.
  • [26] Benjamín Farias, Wim Martens, Carlos Rojas, and Domagoj Vrgoc. Pathfinder: Returning paths in graph queries. In International Semantic Web Conference (ISWC), pages 135–154. Springer, 2024. doi:10.1007/978-3-031-77850-6_8.
  • [27] Diego Figueira, Adwait Godbole, Shankara Narayanan Krishna, Wim Martens, Matthias Niewerth, and Tina Trautner. Containment of simple conjunctive regular path queries. In International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 371–380, 2020.
  • [28] Yuval Filmus. Lower bounds for context-free grammars. Inf. Process. Lett., 111(18):895–898, 2011. doi:10.1016/J.IPL.2011.06.006.
  • [29] Philippe Flajolet and Robert Sedgewick. Analytic Combinatorics. Cambridge University Press, 1 edition, 2009.
  • [30] Nadime Francis, Amélie Gheerbrant, Paolo Guagliardo, Leonid Libkin, Victor Marsault, Wim Martens, Filip Murlak, Liat Peterfreund, Alexandra Rogova, and Domagoj Vrgoč. A researcher’s digest of GQL (invited talk). In International Conference on Database Theory (ICDT), pages 1:1–1:22, 2023. doi:10.4230/LIPICS.ICDT.2023.1.
  • [31] Nadime Francis, Alastair Green, Paolo Guagliardo, Leonid Libkin, Tobias Lindaaker, Victor Marsault, Stefan Plantikow, Mats Rydberg, Petra Selmer, and Andrés Taylor. Cypher: An evolving query language for property graphs. In International Conference on Management of Data (SIGMOD), pages 1433–1445. ACM, 2018. doi:10.1145/3183713.3190657.
  • [32] Moses Ganardi, Artur Jez, and Markus Lohrey. Balancing straight-line programs. J. ACM, 68(4):27:1–27:40, 2021. doi:10.1145/3457389.
  • [33] Kareem El Gebaly, Parag Agrawal, Lukasz Golab, Flip Korn, and Divesh Srivastava. Interpretable and informative explanations of outcomes. Proc. VLDB Endow., 8(1):61–72, 2014. doi:10.14778/2735461.2735467.
  • [34] GQL. https://www.gqlstandards.org/, 2023.
  • [35] John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. Introduction to automata theory, languages, and computation, 2nd edition. Addison-Wesley, 2 edition, 2001.
  • [36] ISO. Information technology - database languages SQL - Part 16: Property graph queries (SQL/PGQ), 2023.
  • [37] Ahmet Kara, Milos Nikolic, Dan Olteanu, and Haozhe Zhang. Conjunctive queries with free access patterns under updates. In International Conference on Database Theory (ICDT), pages 17:1–17:20, 2023. doi:10.4230/LIPICS.ICDT.2023.17.
  • [38] Benny Kimelfeld, Wim Martens, and Matthias Niewerth. A unifying perspective on succinct data representations. CoRR, abs/2309.11663, 2023. doi:10.48550/arXiv.2309.11663.
  • [39] Markus Lohrey. Algorithmics on slp-compressed strings: A survey. Groups Complex. Cryptol., 4(2):241–299, 2012. doi:10.1515/GCC-2012-0016.
  • [40] Ole Lehrmann Madsen and Bent Bruun Kristensen. LR-parsing of extended context free grammars. Acta Informatica, 7:61–73, 1976. doi:10.1007/BF00265221.
  • [41] Wim Martens, Matthias Niewerth, Tina Popp, Carlos Rojas, Stijn Vansummeren, and Domagoj Vrgoc. Representing paths in graph database pattern matching. Proc. VLDB Endow., 16(7):1790–1803, 2023. doi:10.14778/3587136.3587151.
  • [42] Wim Martens, Matthias Niewerth, and Tina Trautner. A trichotomy for regular trail queries. In International Symposium on Theoretical Aspects of Computer Science (STACS), pages 7:1–7:16, 2020. doi:10.4230/LIPICS.STACS.2020.7.
  • [43] Wim Martens and Tina Popp. The complexity of regular trail and simple path queries on undirected graphs. In Symposium on Principles of Database Systems (PODS), pages 165–174. ACM, 2022. doi:10.1145/3517804.3524149.
  • [44] Wim Martens and Tina Trautner. Evaluation and enumeration problems for regular path queries. In International Conference on Database Theory (ICDT), pages 19:1–19:21, 2018. doi:10.4230/LIPIcs.ICDT.2018.19.
  • [45] Kuldeep S. Meel, Sourav Chakraborty, and Umang Mathur. A faster FPRAS for #NFA. Proc. ACM Manag. Data, 2(2):112, 2024. doi:10.1145/3651613.
  • [46] Kuldeep S. Meel and Alexis de Colnet. #CFG and #DNNF admit FPRAS. CoRR, abs/2406.18224, 2024. doi:10.48550/arXiv.2406.18224.
  • [47] Stefan Mengel and Harry Vinall-Smeeth. A lower bound on unambiguous context free grammars via communication complexity. CoRR, abs/2412.03199, 2024. doi:10.48550/arXiv.2412.03199.
  • [48] Albert R. Meyer and Larry J. Stockmeyer. The equivalence problem for regular expressions with squaring requires exponential space. In SWAT (FOCS), pages 125–129. IEEE Computer Society, 1972. doi:10.1109/SWAT.1972.29.
  • [49] Martin Muñoz and Cristian Riveros. Streaming enumeration on nested documents. In Dan Olteanu and Nils Vortmeier, editors, 25th International Conference on Database Theory, ICDT 2022, March 29 to April 1, 2022, Edinburgh, UK (Virtual Conference), volume 220 of LIPIcs, pages 19:1–19:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPICS.ICDT.2022.19.
  • [50] Neo4j. Intro to Cypher. https://neo4j.com/developer/cypher-query-language/, 2017.
  • [51] Milos Nikolic and Dan Olteanu. Incremental view maintenance with triple lock factorization benefits. In International Conference on Management of Data (SIGMOD), pages 365–380, 2018. doi:10.1145/3183713.3183758.
  • [52] Dan Olteanu and Maximilian Schleich. F: regression models over factorized views. Proc. VLDB Endow., 9(13):1573–1576, 2016. doi:10.14778/3007263.3007312.
  • [53] Dan Olteanu and Maximilian Schleich. Factorized databases. SIGMOD Rec., 45(2):5–16, 2016. doi:10.1145/3003665.3003667.
  • [54] Dan Olteanu and Jakub Zavodny. Factorised representations of query results: size bounds and readability. In International Conference on Database Theory (ICDT), pages 285–298. ACM, 2012. doi:10.1145/2274576.2274607.
  • [55] Dan Olteanu and Jakub Závodný. Size bounds for factorised representations of query results. ACM Trans. Database Syst., 40(1):2:1–2:44, 2015. doi:10.1145/2656335.
  • [56] Steven T. Piantadosi. How to enumerate trees from a context-free grammar. CoRR, abs/2305.00522, 2023. doi:10.48550/arXiv.2305.00522.
  • [57] The Rel language (relations). https://docs.relational.ai/rel/primer/basic-syntax#relations, 2023.
  • [58] RelationalAI. The Rel language, 2024. https://learn.relational.ai/.
  • [59] Maximilian Schleich, Dan Olteanu, and Radu Ciucanu. Learning linear regression models over factorized joins. In International Conference on Management of Data (SIGMOD), pages 3–18, 2016. doi:10.1145/2882903.2882939.
  • [60] Markus L. Schmid. Conjunctive regular path queries with string variables. In Symposium on Principles of Database Systems (PODS), pages 361–374. ACM, 2020. doi:10.1145/3375395.3387663.
  • [61] Richard Edwin Stearns and Harry B. Hunt III. On the equivalence and containment problems for unambiguous regular expressions, regular grammars and finite automata. SIAM J. Comput., 14(3):598–611, 1985. doi:10.1137/0214044.
  • [62] Szymon Torunczyk. Aggregate queries on sparse databases. In Symposium on Principles of Database Systems (PODS), pages 427–443. ACM, 2020. doi:10.1145/3375395.3387660.
  • [63] Wen-Guey Tzeng. On path equivalence of nondeterministic finite automata. Inf. Process. Lett., 58(1):43–46, 1996. doi:10.1016/0020-0190(96)00039-7.