EDT0L GRAMMARS WITH ONLY ONE VARIABLE HAVE TRACTABLE GENERATING FUNCTIONS

. We introduce new counting techniques for computing the growth of EDT0L languages based on generalized Parikh vectors. The structure generating function S ( z ) for any language formed from an unambiguous EDT0L system with one variable and m tables is tractable in the sense that its Taylor polynomial S N ( z ) can be constructed in time O (cid:0) N 2+log 2 m (cid:1) . We illustrate by example that this result is not necessarily true for systems with several variables. The dichotomy between one variable and several variables is partially explained using matrix algebra

DSV method was successfully applied to various unambiguous indexed grammars, often yielding complicated transcendental structure generating functions.
Lindenmayer systems are a broad class of grammars/languages that have been ignored by many combinatorialists. The subclass ET0L contains all context-free languages as well as the "mildly context-sensitive" languages, while being strictly contained within the indexed class. Translation from ET0L grammars to indexed grammars was analyzed early on (see Sect. 4 of [9]) where it was observed that Lindenmayer tables correspond to index flags and control strings correspond to loading flags onto variables. The known examples of indexed languages that cannot be generated by ET0L systems are all sufficiently complicated (two such examples are reviewed in [7]) as to suggest that ET0L is rich enough to encompass most combinatorial applications. On the other hand, computing growth series for ET0L languages (and their deterministic subclass of EDT0L) has not been deeply studied.
The existing literature concerning growth of languages generated by Lindenmayer systems appears to be limited to D0L, DT0L, and EDT1L grammars [19,24]. The intent of this article is to introduce new counting techniques with respect to EDT0L systems and can be viewed as a sequel to [1]. Analysis of the EDT0L full production tree can lead to fast computation of the structure generating function.
Our principal result is The upper bound is not necessarily sharp. On the other hand we provide an example of an EDT0L system using two variables, whose apparently intractable structure generating function is not amenable to our methods.

Acknowledgements
The first author gratefully acknowledges both Southern Utah University for providing a two semester sabbatical leave and University of Technology Sydney for subsidizing a six week stay at their campus as visiting research professor. Murray Elder's facilitation of the latter 2 as well as constructive comments on earlier versions of this paper are sincerely appreciated. Both authors thank the anonymous referee for discovering small errors as well as suggesting improvements to the narrative.

Summary of the paper
Section 2 contains definitions, notations, and a trivial but useful example. Section 3 introduces an extension to the DSV method by way of example. Section 4 generalizes the method to all instances of EDT0L systems having only one variable and contains a two variable EDT0L system where our method fails. Section 5 explores some underlying reasons contributing to the change in behavior from one to several variables. Data and software to explicitly compute the growth series of most of the examples below can be downloaded from [23]

Notation and definitions
Throughout we use standard terminology with respect to formal language theory. The expression b|c denotes "b exclusive-or c". We use epsilon "ε" to denote the empty word. The Kleene star (Kleene plus) applied to x, written x * (respectively x + ) means make zero or more (respectively one or more) copies of x. The length of a string w is written |w|. Grammar variables are written in bold upper case font. Grammar terminals are written in lower case italic. The Kleene star can be applied to grammar production rules: we use the notation * → to indicate the composition of several grammar productions (usually the context of the situation will imply which grammar rules are being composed). Let x be a word in the alphabet {a i : 1 ≤ i ≤ n}. The Parikh vector of x is the vector whose i th component consists of the number of occurrences of a i in the word x. It would be useful if the reader is familiar with the original DSV method [11] and its extension to indexed grammars [1].

L-systems
Lindenmayer systems are grammars that differ from conventional phrase structure grammars by their use of parallelism. A comprehensive reference is [19]. The acronym EDT0L means Extended : the grammar contains non-terminal variables in its sentential forms. Deterministic: each production rule extends to a language homorphism; productions like a → b|c are forbidden. Table: the several different production rules are organized into two or more tables (and if deterministic, two rules like a → b and a → c cannot belong to the same table). 0-interaction: the left side of each production rule contains only one symbol. Lindenmayer : each invocation of a table applies all its rules as widely as possible in parallel fashion. Formally an ET0L system is a 4-tuple G = (Σ, T, S, ∆) where Σ is a finite alphabet consisting of terminal letters and non-terminal variables, T is a non-empty finite set of finite substitutions (called tables), S ∈ Σ * is the start string (called the axiom), and ∆ ⊂ Σ is the terminal alphabet. Note that if a table does not include a production rule for v ∈ Σ , then the identity map v → v is implied. If each table defines a homomorphism rather than a substitution, then G is actually an EDT0L grammar. In either case, the language of G is defined as where S * −→ w indicates a finite sequence of tables applied to the axiom S and ending in w. Some authors allow finitely many axioms. However, additional axiom strings can be accommodated by adding initial tables that send S to each additional axiom. All of our examples and results below assume a single axiom string.
There is an equivalent, but simpler formalism that produces the same set of languages as defined above (see [4,14]). Consider the set of tables T as a free semigroup under the operation of composition. Rather than apply any sequence of tables whatsoever, a grammar G will be assigned a particular regular language R ⊆ T + defined by a regular expression C called the control string for G. In this scenario S * −→ w is understood to mean that the finite sequence of tables applied to the axiom are particular instances of the control string C. Often (but not always) the set of tables T contain one or more evaluation tables whose productions output only terminal symbols. Most of our examples below use only one evaluation table t $ and employ the regular expression C = (T \ {t $ }) * t $ as control string. Given an ET0L system G = (Σ, T, S, ∆), a symbol α ∈ Σ is deemed active if there is a some production rule in the tables that sends α to a string different than α itself. G is said to be in active normal form provided that all active symbols are variables, i.e. belonging to Σ \ ∆. There is an algorithm [19] that converts any ET0L grammar G into active normal form without changing the language of G. In the following, all ET0L systems will be assumed to have active normal form. A variable B ∈ Σ is called expansive if there is some production rule in the tables of the form B → αBβBγ for some strings α, β, γ ∈ Σ * . The degree of expansion for symbol B is the maximum number of copies of B found on the right side of a production rule, considered over all tables.
As per context-free grammars, the membership decision problem for EDT0L languages is solvable in deterministic polynomial time. However, for ET0L languages the membership problem is NP-complete.

Indexed grammars
Indexed languages and their grammars were first introduced in 1968 as a generalization of context-free languages, with their automaton type for word recognition published a year later [2,3]. Our use of indexed grammars is confined to Example 2.2 and the beginning of Section 3, consequently we only sketch the relevant ideas here. An indexed grammar is based on a context-free grammar but with the addition of indices (also referred to as flags). A grammar variable carries with it a string of one or more flags which we designate via subscripts. For instance B f gh$ is a grammar variable with attached index string f gh$. There are three types of production rules. One type can push a new flag: B → B e adjoins the new flag e to the left end of the existing index string atttached to B. Another rule type can pop a specific leftmost flag associated to a variable. The third type of production is a standard context-free rule such as B → XY with the difference being that the current index string attached to B is also transferred to both X and Y. More details can be found in [1] or standard texts such as [15]. We note that in the Chomsky hierarchy, the set of indexed languages properly contains the set of ET0L languages [9].

Ambiguity
If the same terminal word can be obtained by two different sequences of production rules, we say that the underlying grammar is ambiguous. Given a language class L and language L, if every grammar (from class L ) that produces L is ambiguous, then we say that L is inherently ambiguous (with respect to class L ). Specifying class L is necessary because there are examples of inherently ambiguous context-free languages that can be produced by unambiguous indexed grammars [1]. The first example of an inherently ambiguous E0L language (a language generated by an ET0L system with only one table) appeared in [12,13].
The DSV method actually counts grammar productions. If the underlying context-free or indexed grammar is unambiguous, then DSV (and our methods defined below) counts words. We assume that all grammars in this paper are unambiguous.

Generating functions
Given an infinite language L over a finite alphabet A, as per [16] we define the associated structure generating function S (z) as the function whose Taylor series n≥0 u n z n has n th coefficient u n (the structure function as defined in [18]) equal to the number of words in L of length n. We use growth series as a synonym for structure generating function. It is immediate that S (z) is analytic with radius of convergence ρ satisfying 0 < ρ ≤ 1.
Definition 2.1. We say that a structure generating function S (z) is computable in polynomial time if its Taylor polynomial S N (z) = N n=0 u n z n can be computed in polynomial time with respect to N for each N > 0.
The following somewhat trivial example illustrates that the class of EDT0L languages includes complicated structure generating functions.
Example 2.2. [1,19] Consider the D0L system with alphabet {a}, axiom a, and production rule a → a 2 (so a is expansive of degree two). Since there are no variables, this system is not in active normal form. The output language is L = a 2 n : n ≥ 0 and the structure generating function is W 2 (z) = n≥0 z 2 n . It is simple enough to find an active normal form EDT0L system for this language: use axiom A, tables t 1 : A → A 2 and t $ : A → a with control string t * 1 t $ . It is just as straightforward to find an indexed grammar that does the same: use axiom Note that if the above EDT0L system was a context-free grammar, then serial use of the production rule in table t 1 would be allowed and the output language would be the free semigroup a + , albeit generated in an unbounded ambiguous fashion. Also note that the structure generating function satisfies the equation W 2 (z) = z + W 2 z 2 which implies that W 2 (z) is singular at each (2 n ) th root of unity, so the function cannot be analytically continued outside the unit circle. This observation has been attributed to Weierstrass, so we label W 2 (z) as the "Weierstrass 2-function" and more generally W k (z) = n≥0 z k n is the "Weierstrass k-function" for each positive integer k ≥ 2. Consequently W k (z) is not D-finite, indeed it cannot satisfy any algebraic differential equation [17]. Figure 1. Part of the full production tree. Left, right, and middle children are productions from tables t α , t β , and t $ , respectively.

An instructive example
The DSV method applied to Example 3.4 from [1] presented an apparently intractable computation to find S(z). Let us review the situation. The indexed grammar is The principle difficulty is the non-commutativity of index flags α and β. Indeed, N αβ$ and N βα$ produce terminal words of different length. This ensures that there are 2 n different terminal words produced by N σ$ as the index string σ ∈ (α|β) n varies. In order to compute the N th partial sum S N (z) we would evidently need to evaluate approximately 2 N many terms.
There is a related EDT0L grammar in active normal form that produces the same language. Its axiom is N and control string is (t α |t β ) * t $ . The tables are (unsurprisingly) Note that N is an expansive variable of degree two. The full production tree for the language can be built recursively, see Figure 1. However, if we are only interested in counting word lengths, consider the following coding scheme. 3 Associate with each non-terminal sentential form a modified Parikh vector, namely the ordered pair (λ, ν) with the first coordinate indicating the overall length of the sentential form and the second coordinate storing the quantity of N in the sentential form. Then it follows that table t α maps (λ, ν) to (λ + ν, ν) while t β sends (λ, ν) to (λ + 4ν, 2ν). The evaluation table t $ sends (λ, ν) to the terminal word length λ − ν. All of this can be done using linear algebra, since the actions of the previous sentence define t α and t β as 2 × 2 matrices (we postpone using this matrix approach until Section 4 below).
The table of pairs in Figure 2 illustrates some interesting patterns. We emphasize a key observation. At the level of generating functions for subtrees, the similarity relationship can be expressed as T λ ,ν (z) = z (λ −λ) T λ,ν (z) for λ > λ. We exploit this similarity to decompose the full production tree into constituent parts. First there is the left ray based at the root having growth series 1 + z + z 2 + · · · = 1 1−z . The rest of the tree is comprised of the subtree scheme suggested in blue. Thus (1,1)  Figure 2. The subtree at label (5,2) has similar subtrees at (6, 2), (7,2), . . . In like fashion (13, 4) is a prototype for (15,4).
But the (5, 2) subtree decomposes as the union of its own left ray and further subtrees based at (13,4), (15,4), . . . so and substitution yields Although we might not understand the function T 13,4 (z), we do see that the Taylor series for S(z) has already stabilized up to the z 9 term. The subtree based at (13,4) has its own left trending ray with a sequence of similar subtrees starting at (29, 8), (33,8) . . . and the recursion continues in a predictable pattern. The formula for S(z) becomes a sum of finitely many purely rational summands which we call the stable part, plus the final summand involving a subtree at (λ, ν) = (2 n+1 − 3, 2 n ). This final summand contains only high powers of z; coefficients for smaller powers have stablized. In the limit the remaining unknown subtree is "pushed to infinity" and the stable part grows to comprise a formula for the structure generating function . Clearly S(z) and hence F (z) is singular at z = 1, but then F is singular at z = −1 and so on for each (2 n ) th root of unity. Passing to S preserves all these singularities, so S (z) has the unit circle as natural boundary to its analytic domain. As was noted earlier such a function satisfies no algebraic differential equation.
It is worth commenting on the convergence rate of formula (3.1). Suppose the N th partial sum of S N (z) (as a Taylor series) is wanted. This will be the same as that for F (z) with coefficients shifted three places, so the asymptotic time complexity of computing S N (z) versus F N (z) will be the same. However the latter has a somewhat simpler formula, so we estimate an upper bound on the number of arithmetic operations to compute F N (z).
Set N def = 3 · 2 n which implies that only n ≤ log 2 N iterations need to be evaluated. The ultimate summand n k=0 from expression (3.2) can be expanded into a product of geometric series. However, only one term contributes to F N (z), namely z 3·2 n = z N . So consider the penultimate summand of F(z) expressed (partially) as an expanded product of truncated geometric series. 3) The number of terms within each pair of parentheses are N 2 + 1, N 4 + 1, N 8 + 1, N 16 + 1, · · · , N 2 n + 1. Expansion of these denominators into partial geometric series takes less than N loops. Do a partial multiplication of the leftmost two parenthetic groups, only considering individual products with degree at most N 2 . This requires N 4 + 1 2 ≈ N 2 16 multiplications. Now multiply this product by the next parenthetic group 1 + z 4 + z 8 + · · · + z N 2 , again ignoring terms with degree more than N 2 . This requires N 4 multiplications. In this way, the expansion of expression (3.3) into a polynomial of degree at most N takes on the order of N 2 16 + N 2 32 + N 2 64 + · · · + 4 < N 2 8 multiplications. Using this method for each term of (3.2), starting from the ultimate term and working backwards gives 1, N 2 8 , 9N 2 128 , . . ., N 2 4 , 1 multiplications, respectively; each is at most quadratic in N . There are n ≈ log 2 N many addends in our partial sum version of (3.2), establishing a time-complexity upper bound of O N 2 log 2 N to compute F N (z) and hence S N (z) as a Taylor polynomial. 4 Of course, this quick and dirty estimate is in no way sharp.
The EDT0L production tree sheds light on the naïve DSV method attempted in [1]. What the latter method does is essentially sum terminal word lengths along rows in the production tree of Figure 1. The leftmost word length of row n is n while the rightmost row entry has length N = 3(2 n − 1). Trying to efficiently evaluate S N (z) by summing along rows requires checking that lengths are at most N before adding terms to the polynomial (word lengths do not generally increase monotonically when checking a generic row in a left to right fashion). This requires exponentially many comparisons.

Generalization to an arbitrary one variable EDT0L system
It is known that every ET0L language can be produced from a system with only two tables. On the other hand, increasing the number of tables in EDT0L systems strictly increases output language classes (see for example Sect. V.1. of [19]). In a similar vein, the number of active symbols is a measure of complexity: see [5,8,10]. Even so, EDT0L systems in active normal form with only one variable can produce surprisingly complicated languages. For example, almost every example in [1] and several from [7] can be generated by a one variable EDT0L system. Our goal is to show that all unambiguous one-variable systems have structure generating functions that are computable in polynomial time.
Consider an arbitrary unambiguous EDT0L system G in active normal form involving only one variable V (which acts as axiom) and m ≥ 2 tables. In this scenario each individual table can basically have only one of three types of production rule: V gets sent to no copy of itself (an evaluation rule), exactly one copy of itself (a linear rule), or more than one copy of itself (an expansive rule). The grammar G must have at least one evaluation table t $ , else there is no output language of terminals (and unless L (G) is finite, G has at least two tables). The classification below does not consider finite languages, hence we can assume the control string for grammar G must contain at least one instance of the Kleene star * or Kleene plus + .
Case 1: Suppose that grammar G consists only of evaluation and linear productions. Since every production table/rule contains at most one instance of V on its right side, there is none of the parallelism typical of 4 The reader might object that our estimate above involved particular choices for N . But it is clear that the time complexity for F N (z) is increasing in N , so it is sufficient that our polynomial bound obtains with respect to our sampled values of N .  Lindenmayer systems: all sentential forms contain only one instance of V. In fact, it is easy to see that G mimics an unambiguous linear context-free grammar and thus its structure generating function is easily found and is rational [16].
Case 2: All tables are evaluations or expansive (there are no linear productions). In this situation, all word lengths are growing roughly as fast as the number of word productions. For the generic situation, we are unable to find a closed form for the structure generating function, however it is efficiently computable by brute force as per the following example.
Example 4.1. Consider an unambiguous EDT0L system in active normal form with one variable V, m expansive tables, and one evaluation table t $ . Suppose there are no linear productions, but there are expansive productions 5 with degrees 2 and d, with 2 < d. Also assume axiom V with the control string being the free monoid on all non-evaluation tables, followed by the evaluation table. Although the quantity of words are produced exponentially fast, the corresponding word lengths are growing exponentially fast as well, leading to a sort of equilibrium. Note that each left (respectively, right) trending ray in the full production tree contributes a multiple of the Weierstrass 2-function (respectively, Weierstrass d-function). What is a reasonable upper bound on the time complexity to compute the N th Taylor polynomial S N (z) of the structure generating function? In the full production tree for this system, all terminal words at height n > 1 in the tree have length at least 2 n , so choose n = log 2 N . This implies there are at most m n = 2 n log 2 m = N log 2 m many words of length N = 2 n . Brute force creation of each terminal word length in the partial tree of height n can be done using generalized Parikh vectors (λ, v) and the 2 × 2 matrices associated to each table. There are N log 2 m such words, each requiring at most N matrix products, which yields a time complexity bound of O N 1+log 2 m for computation of S N (z).
The choice of minimum expansion degree 2, only one other expansion degree, and free monoid control string, comprise a worst-case scenario. Changing any of those conditions only shortens the brute force computation time for S N (z).

Case 3:
There is at least one linear rule, and at least one expansive rule. Limiting to a single expansive degree is dealt with using the recursion technique of Section 3, so we may assume at least two different degrees of expansion. In this situation, brute force evaluation of the partial sum of the growth series takes exponential time because terminal word lengths grow linearly on some rays in the full production tree and exponentially in other rays. However, a combination of recursion and brute force can be utilized. We illustrate the idea with Example 4.2. As a test case, we consider a linear rule, and expansive productions of degree two and three.
The axiom is V and the control string is (t 1 |t 2 |t 3 ) * t $ which creates a full ternary tree of productions. We use modified Parikh vectors (λ, v) as node labels (refer to Fig. 3). Let T v denote the subtree whose root sentential form has v many occurrences of V and has minimal height in the full tree. The subtrees rooted at (λ, v) are all similar to T v . We abuse notation by allowing T v to also denote the structure generating function of that subtree. Then by definition S(z) = T 1 (z). We use a recursion similar to that of Section 3. The leftmost ray from the root contributes 1 1−z , the subtrees with blue Parikh vectors are all similar, as are the reds. By repeating the same idea on successive subtrees, the basic recursion is easily derived for all v ≥ 1. Each iteration of the recursion creates one more unknown subtree in the formula for S(z). The first two iterations yield the following.
The following facts are easily verified by applying induction to the basic recursion. After n iterations, the structure generating function consists of a sum of purely rational functions (the stable rational part) plus higher order rational function multiples of unknown subtrees. There are at most n denominator factors in any rational function, each factor having form (1 − z r ) where r is a product of twos and threes. If the stable rational part is converted to a Taylor series, all terms of degree at most 2 n − 2 are fixed by further iterations (hence the adjective "stable"; also observe that this degree depends entirely on the grammar rule V → bV 2 from table t 2 ). The quantity of rational multiples of subtrees are generated by a binomial type formula, in that the number of different rational multiples of an unknown subtree T v is the binomial coefficient n k , where n is the iteration number and k is the quantity of threes in the prime factorization of tree index v. It follows that the total number of such subtree multiples is 2 n = n k , that there are n + 1 unknown subtrees, and that the number of addends in the stable rational part is 2 n − 1. In fact, we can say more: there are 2 k−1 stable addends that have exactly k denominator factors for k = 1, 2, · · · , n. Although a limiting formula for S (z) may be guessed and verified by induction, we are content to estimate the time complexity to compute the N th Taylor polynomial S N (z). Let 2 n − 2 = N which means that the stable rational part after n iterations will produce S N (z). First we count how many operations are required to make n iterations for S (z). Substitution and simplification of the basic recursion indicates that 2 n = N + 2 multiplications are needed to perform these iterations. Now consider the denominators in the stable rational part. They look like (1 − z)(1 − z 2 or 3 )(1 − z 4 or 6 or 9 ) · · · 1 − z 2 n etc . We can overestimate the work done by replacing every denominator with (1 − z) 1 − z 2 1 − z 4 · · · 1 − z 2 n . Expanding a denominator into partial geometric series up to the z N term takes less than (N + 2) + N +2 2 + N +2 4 + · · · + 2 < 2 (N + 2) loops. Now consider multiplying these partial geometric series, keeping only terms with degree at most N + 2. As per our previous estimate for formula (3.3), this can be done with less than (N + 2) 2 individual multiplications for one stable rational addend. At iteration n there are 2 n − 1 = N + 1 such stable rational addends, which implies an overall upper bound of O N 4 = O N 2+log 2 m , where m = 4 is the number of tables in G. Adding the initial N + 2 operations needed to iterate the formula does not change this upper time complexity bound.
Having come this far, it is not hard to generalize. Broaden our EDT0L system to include a total of m + 2 tables with corresponding rules V → a 2 V 2 , V → a 3 V 3 , V → a 5 V 5 , . . . , V → a pm V pm having distinct expansion degrees of prime order (here p m represents the m th prime number). So there are now m expanding rules, one linear rule, and one evaluation rule. The by now standard recursion technique applies with basic recursion After n iterations, the formula for S (z) continues to output a purely rational part, stable to degree 2 n − 2 and unknown subtrees multiplied by higher order rational functions. All rational functions have at most n many denominator factors. The number of rational functions attached to a specific subtree T v is now a multinomial coefficient n k 1 , k 2 , . . . , k m where k 1 , k 2 , . . . , k m denote the respective number of 2, 3, 5, 7, . . . , p m factors in v. Consequently the total number of rational functions attached to subtrees is the sum of all such multinomial coefficients, namely m n . The number of distinct multinomial coefficients reflects the number of unknown subtrees, namely n + m − 1 m − 1 . Observe the size of the latter grows subexponentially with respect to n. The number of stable rational summands is 1 m−1 m n−1 . An upper bound on the number of operations to compute the Taylor polynomial S N (z) can now be estimated, again using N = 2 n − 2. It takes roughly m n = 2 n log 2 m = (N + 2) log 2 m multiplications to generate the n th iteration of S (z) . Given a stable rational summand, it takes less than 2 (N + 2) loops to expand its denominator into truncated geometric series. Multiplying these polynomials takes at most (N + 2) 2 multiplications. There are m n = (N + 2) log 2 m many rational summands. This gives the polynomial upper bound for the time complexity to evaluate S N (z). Now we can completely generalize to the full case. First, if one or more of the expansion degrees are repeated in several tables or some are not relatively prime, the number of distinct subtrees is less, implying less time to compute S N (z). Second, if one or more production rules have form V → wV r x for terminal strings w, x and r > 1 then the terminal word lengths grow more quickly, resulting in less operations to count words up to length N . Third, our chosen control string (t 1 |t 2 |t 3 ) * t $ is as general as possible. A different control string will require computing only a subset of the words done above. Fourth, additional linear tables collapse into the standard recursive schema seen above. Our computation time for this can be overestimated by merely increasing the table count m to accommodate the additional tables.
We summarize our results as and control string (t 1 |t 2 ) * t $ . Figure 4 (left) shows the partial production tree. We note that G is a propagating system (no variables are erased or sent to ε) in active normal form. Variable B is expansive, but A is not. Define Parikh vectors (λ, α, β) that record (overall length, #A, #B) for each sentential form in the production tree.    However, an easy induction shows that if W is a sentential form, the overall lengths of both W and its associated terminal word w satisfy |W | = |w| = 2β + 1 , where β is the quantity #B in W . This allows us to dispense with keeping track of sentential form lengths λ in our Parikh vectors. It suffices to use abbreviated Parikh row vectors (α, β) that count the number of A and B, respectively. The revised table matrices t 1 = 1 1 0 1 and t 2 = 1 0 1 2 are merely the lower right 2 × 2 block matrices fromt 1 andt 2 , sending (α, β) to (α, α + β) and (α, β) to (α + β, 2β), respectively. Note that these are both invertible maps.
Since G is propagating and the revised axiom vector is (1, 1), it is clear that all Parikh vectors will have positive integer entries. The full production tree of Parikh vectors is shown in Figure 4 (right). As per Remark 3.1, it is evident that two rooted subtrees are similar in the manner of Section 3 if and only if their respective root Parikh vectors are equal (in both coordinates).
We show that all Parikh vectors are unique. In fact, suppose by way of contradiction, that there are duplicated vectors in the full tree. Pick such a duplicated pair with label (α, β) such that one of the occurences has minimal height in the tree compared to all other pairs of duplicated Parikh vectors. This implies that the respective parent nodes for the two copies of (α, β) are unequal. These unequal parent nodes must be (α, β) t −1 1 = (α, β − α) and (α, β) t −1 2 = α − 1 2 β, 1 2 β . It follows immediately that β > α and 2α > β. Now consider the parent of (α, β) t −1 1 , which must be either (α, β) t −2 . In fact, the former is impossible since β > 2α contradicts the previously established 2α > β.
In the latter case, no ancestor of (α, β) can have form for any n ≥ 0 since the second coordinate contradicts 2α > β. We deduce that all ancestors of (α, β) are obtained by (α, β) t −1 1 t −n 2 for some n ≥ 0. But this implies (α, β) = (1, 1) t n 2 t 1 , in other words (α, β) is found by following the right ray from the main root, then ending after one left edge. The Parikh vector for such a node has form 2 m , 2 m+1 , which again contradicts 2α > β. Therefore no duplicate Parikh vectors exist and thus there are no subtree similarities to derive recursions as per Section 3.
On the other hand t 2 is an expansive rule, but t 1 is non-expansive. Brute-force enumeration of words of length m requires exponential time in m. One might try to exploit the fact that each left trending ray generates a rational growth series: enumerate rational functions using only those nodes in the tree having addresses (t 1 |t 2 ) * t 2 such that the sentential form W at that address satisfies |W | ≤ m. Unfortunately the number of such nodes is at least k · 2 m for some fixed constant k > 0, so this idea still requires exponential time. 7 Such a hybrid calculation was done via computer and the erratic nature of the growth coefficients is illustrated in Figure 5. The code and output data is available at [23].

The underlying algebra
To summarize the previous sections, every non-trivial one-variable EDT0L system allows either brute force or a recursive method that permits computing the growth series in polynomial time. However, two-variable systems do not generally permit the same recursive methodology. The striking difference between one-variable EDT0L systems and those with several variables can be partially explained via matrix algebra (and perhaps amenability versus non-amenability of the underlying matrix groups).
Consider an EDT0L system G with only one variable V. We will assume that G contains at least one linear production table and at least one expansive table in the following. A linear table will consist of a single rule having form V → uVw where u, w are strings of terminal letters. As usual, let (λ, v) denote a Parikh row vector associated to a sentential form with λ representing the overall length of the sentential form and v counting the number of V in the sentential form. Without loss of generality we may assume V is also the axiom, making the initial Parikh vector (1, 1). The matrix form (acting on the right) for a linear table is L = 1 0 d 1 where entry d = |u| + |w|. Any expansive table/rule will send V to a sentential form containing q ≥ 0 terminal letters and l ≥ 2 copies of V. The matrix for such a table is E = 1 0 k l where k = q + l − 1. Since types L and E are nonsingular matrices, they generate a multiplicative group.
Lemma 5.1. The matrix group G generated by both linear and expansive tables of a one-variable EDT0L system is solvable. The corresponding semigroup G + consisting of all positive powers of linear and expansive matrices is not free.
Proof. Assume that G is an EDT0L system with one variable, at least one linear table, and at least one expansive table. The group G generated by the linear and expansive tables is a lower triangular matrix group whose generators have integer entries, which implies G is a solvable group. The subgroup L generated by all linear tables is cyclic. In fact, if are two such matrices, then let δ = gcd (d 1 , d 2 ). Writing δ as the integer linear combination δ = xd 1 + yd 2 shows that both L 1 , L 2 belong to the cyclic group generated by L x 1 L y 2 . Incorporate each remaining linear table in this manner to see L is cyclic. The semigroup relations EL = L l E contribute to duplications of Parikh vectors that allow recursions in the tree of Parikh vectors. But exact duplications of full vectors are only part of the story. As stated in and below Remark 3.1, T (λ ,v) is always similar to T (λ,v) . In the case of G with one variable, equality of second Parikh coordinates is sufficient to create a tree recursion.
Lemma 5.1 requires linear production tables. But for one variable EDT0L systems lacking linear productions, Example 4.1 above showed that a brute force computation is feasible without need for recursions. Consider the special case of that example with E 1 = 1 0 2 2 and E 2 = 1 0 3 3 being the matrix versions of tables V → aV 2 and V → bV 3 , respectively. Section 4, Proposition 3 of [6] implies that (E 1 |E 2 ) + is a free semigroup of rank two. We implicitly assumed that fact during our worst-case complexity analysis for both Examples 4.1 and 4.2. (Code and data for this particular example is available at [23].) The situation changes for EDT0L systems having p > 1 variables. The size (p + 1) × (p + 1) matrices associated to tables are not generally lower triangular. Even if they were, the general problem of determining whether a pair of 3 × 3 matrices generate a free semigroup is undecidable [6]. Worse yet for p > 1 variables, one or more of the table matrices can be singular. Supposing invertible matrices, the Tits alternative [21] says that the group generated by such matrices is either virtually solvable (hence amenable) or contains a rank two free group (and hence non-amenable). As we have seen above, solvable groups can contain a rank two free semi group.
Example 4.4 above demonstrates a full tree of abbreviated Parikh vectors containing no duplications. In other words the semigroup (t 1 |t 2 ) + acts faithfully on the orbit of s = (1, 1), making (t 1 |t 2 ) + a free rank two semigroup. The corresponding group t 1 ,t 2 of 3 × 3 matrices is not triangular. Neither is the 2 × 2 submatrix group t 1 , t 2 . Nevertheless, the group t 1 , t 2 does contain a rank two free subgroup and is therefore not solvable. In fact, consider the generating matrices as living in the quotient group P GL (2, R) ∼ = GL (2, R) / {rI 2 : r ∈ R}, so they inherit well-defined fractional linear transformations on the upper halfspace model of the hyperbolic plane. The matrix t 1 corresponds to the parabolic translation z → z + 1. The matrix t 2 corresponds to the hyperbolic translation z → z z+2 which fixes the boundary points −1, 0. The conjugate t 2 1 t 2 t −2 1 corresponds to another hyperbolic translation z → 3z−2 z which fixes boundary points 1, 2. By the usual "ping-pong lemma" (e.g. see 2J of [22]) there is an exponent k ∈ N for which t k 2 , t 2 1 t 2 t −2 1 k is a free group. Lifting from the quotient P GL (2, R) back to the original group t 1 , t 2 preserves the free subgroup structure. 8