Bottom-Up Derivatives of Tree Expressions

In this paper, we extend the notion of (word) derivatives and partial derivatives due to (respectively) Brzozowski and Antimirov to tree derivatives using already known inductive formulae of quotients. We define a new family of extended regular tree expressions (using negation or intersection operators), and we show how to compute a Brzozowski-like inductive tree automaton; the fixed point of this construction, when it exists, is the derivative tree automaton. Such a deterministic tree automaton can be used to solve the membership test efficiently: the whole structure is not necessarily computed, and the derivative computations can be performed in parallel. We also show how to solve the membership test using our (Bottom-Up) partial derivatives, without computing an automaton.


Introduction
In 1956, Kleene [8] gave a fundamental theorem in automata theory. He showed that every regular expression E can be converted into a finite state machine that recognizes the same language as E, and vice versa. A lot of methods have been proposed to provide the conversion of a given regular expression to a finite word automaton. One of these approaches which appeared in 1964 was Brzozowski's [3] construction; the idea is to use the notion of derivation to compute a deterministic automaton: the derivative of a regular expression E w.r.t. a word w is a regular expression that denotes the set of words w such that ww is denoted by E. This construction is not necessarily finite: the derivatives of a given regular expression may form an infinite set. However, considering three equivalence rules (associativity, commutativity and idempotence of the sum), he proved that the set of (so called) similar derivatives is finite.
Antimirov [1], in 1996 introduced the partial derivation which is a similar operation to the one defined by Brzozowski; a partial derivative of a regular expression is no longer a regular expression but a set of regular expressions, that leads to the construction of a non-deterministic automaton, with at most (n + 1) states where n is the number of letters of the regular expression. However, this operation is not defined for extended expressions (i.e. regular expressions with negation or intersection operators). 1 Keywords and phrases: Regular tree expressions, derivatives tree automata, partial derivatives, bottom-Up derivatives. 1 USTHB, Faculty of Mathematics, RECITS Laboratory, BP 32, El Alia, 16111 Bab Ezzouar, Algiers, Algeria. 2 Groupe de Recherche Rouennais en Informatique Fondamentale, Université de Rouen Normandie, Avenue de l'Université, 76801 Saint-Étienne-du-Rouvray, France. 3 Associated Member of RECITS Laboratory, CATI Team, USTHB, Algiers, Algeria.
Some of these constructions have been extended to tree automata [12]. Kuske and Meinecke [9] in 2011, introduced an algorithm to convert a regular tree expression into a non-deterministic tree automaton in a Top-Down interpretation. This construction was inspired by Antimirov's construction. In 2017, Champarnaud et al. [6] have extended the inductive formulas of quotients to tree languages, following a Bottom-Up interpretation. These notions of derivatives and quotients have practical and theoretical aspects. From a practical point of view, this Bottom-Up interpretation can be related to the notion of contexts of trees, that have been studied in functional programming (e.g. zippers [7]). From a theoretical point of view, this study belongs to a large project that aims to study the algorithmic similarities between word automata and tree automata in order to generalize these notions over other algebraic structures [10].
In this paper, we define a new construction of tree automata based on the notion of derivation of an extended tree expression. We also show how to extend the notion of partial derivation in a Bottom-Up way and that the previous construction cannot be applied directly with partial derivatives. Notice that we leave the (technical) study of the finiteness of the set of derivatives and partial derivatives for a future work. This paper, which is an extended version of [2], is structured as follows: Section 2 defines preliminaries and notations considered throughout this paper. In Section 3, we recall the Bottom-Up quotient formulas for trees and for languages defined in [6]. We explain in Section 4 how we can deal with the Boolean operations. In Section 5, we define the derivative formulas for an extended tree expression. Using the sets of derivatives, in Section 6, we show how to compute a deterministic tree automaton from an extended tree expression that recognizes the same language. We then extend the computation formulae to deal with sets of expressions instead of a single expression and show their validity in Section 7. In Section 8, we present a web application allowing the computation of Bottom-Up derivatives, partial derivatives, and both the derivative tree automaton and a classical non-deterministic inductive construction, where the complement is performed via determinization.

Preliminaries
Let us first introduce some notations and preliminary definitions. For any pattern matching, we denote by the wildcard.
In the following of this paper, we consider a ranked alphabet Σ = k∈N Σ k , i.e. a finite graded set of distinct symbols. A symbol f in Σ k is said to be k-ary.
A tree t over Σ is inductively defined by t = ε j (an empty tree with no symbols) or t = f (t 1 , . . . , t n ), where j is a positive integer, f is a symbol in Σ n , and t 1 , . . . , t n are n trees over Σ. Moreover, we assume that for any integer j, the symbol ε j appears at most once in a tree. We denote by Ind ε (t) the (naturally ordered) set of integers j such that ε j appears in the tree t. The tree t is k-ary if k is the cardinal of Ind ε (t); Precisely, t is nullary if Ind ε (t) is empty. Given an integer z, we denote by Inc ε (z, t) the substitution of all symbols ε x by ε x+z in t. A tree language (a set of trees) L is k-homogeneous if it only contains k-ary trees t with the same ε-index (ordered) set, denoted by Ind ε (L) in this case. The language L is homogeneous if it is k-homogeneous for some k. We denote by T (Σ) the set of the trees over Σ, and T (Σ) k the set of k-ary trees over Σ.
Moreover, let us consider the languages L 1 = {f (a, a), a}, L 2 = {f (a, ε 1 ), ε 1 } and L 3 = {f (ε 1 , ε 2 )}. Then, L 1 contains only 0-ary trees than it is 0-homogeneous, L 2 contains only 1-ary trees then it is 1-homogeneous and last L 3 contains only 2-ary trees then it is 2-homogeneous. Given a tree t over an alphabet Σ with Ind ε (t) = {e 1 , . . . , e k } and k trees t 1 , . . . , t k over Σ, we denote by t • (t 1 , . . . , t k ) the tree obtained by substituting each ε ei by t i in t. Given a k-homogeneous language L over Σ and k languages (L 1 , . . . , L k ) over Σ, we denote by • the operation defined by (2.1) Let L be a 1-homogeneous language with Ind ε (L) = {j}. We denote by L n the language inductively defined by L 0 = {ε j }, L n = L • L n−1 , for any integer n > 0, and we set Given a tree t, a symbol a in Σ 0 and a 0-homogeneous language L , we denote by t · a L the tree language inductively defined by . . , t n ) ∈ L 1 × · · · × L n } and n trees t 1 , . . . , t n over Σ. Moreover, given a homogeneous language L, we set Finally, let us denote by L a,n the language inductively defined by L a,0 = {a} and L a,n = L a,n−1 ∪ L · a L n−1 for any integer n > 0, and we set Example 2.2. Let us consider the 1-homogeneous languages L = {f (a, ε 1 )} and A tree automaton over Σ is a 4-tuple A = (Σ, Q, F, δ) where Q is a set of states, F ⊆ Q is the set of final states, and δ ⊆ k≥0 (Q k × Σ k × Q) is the set of transitions, which can be seen as the function from Q k × Σ k to 2 Q defined by (q 1 , . . . , q k , f, q) ∈ δ ⇔ q ∈ δ(q 1 , . . . , q k , f ).
It can be linearly extended as the function from (2 Q ) k × Σ k to 2 Q defined by Finally, we also consider the function ∆ from T (Σ) to 2 Q defined by Using these definitions, the language L(A) recognized by the tree automaton A is the language {t ∈ T (Σ) | ∆(t) ∩ F = ∅}. A tree automaton A = (Σ, Q, F, δ) is deterministic if for any symbol f in Σ m , for any m states q 1 , . . . , q m in Q, |δ(q 1 , . . . , q m , f )| ≤ 1.

Tree language quotients
In this section, we recall the inductive definition of the computation of tree quotients defined in [6].
contains all the trees t satisfying the two following conditions: As a direct consequence, Definition 3.1. The Bottom-Up quotient t −1 (L) of a tree language L w.r.t. a tree t is the tree language t ∈L t −1 (t ). and t = f (f (g(a), ε 1 )), g(a)) be two trees over Σ = Σ 0 ∪ Σ 1 ∪ Σ 2 . Then Notice that for any tree t from the set t −1 (t ), t • (g(a), ε 1 ) = f (f (g(a), ε 1 )), g(a)).
As a direct consequence of equation (3.3), the membership of a tree in a tree language can be restated in terms of a quotient: Let us now make explicit the inductive computation formulae for this quotient operation. The base cases are the three following ones. Proposition 3.4 (Prop. 7 of [6]). Let Σ be a ranked alphabet, k be an integer, and α be in Σ k : where x is an integer in N, f is a symbol in Σ n , t 1 , . . . , t n are n trees in T Σ distinct from (ε 1 , . . . , ε n ) and for all integer 1 ≤ z ≤ n, t z is the tree Inc ε (1, t z ).
By equation (3.1) and Definition 3.1, quotienting by an indexed ε is reindexing all the indexed ε in the language.
Proposition 3.5 (Prop. 9 of [6]). Let L be homogeneous with Ind ε (L) = {j 1 , . . . , j k } and j be an integer: Example 3.6. Let us consider a tree t = f (ε 2 , f (a, a)) with f ∈ Σ 2 and a ∈ Σ 0 . Let us calculate t −1 (t). Then As a direct consequence of Definition 3.1, the Bottom-Up quotient for the union of languages can be computed as follows: Lemma 3.7 (Lem. 13 of [6]). Let t be a tree in T (Σ), L 1 and L 2 be two languages over Σ. Then: (3.5) Corollary 3.8 (Cor. 14 of [6]). Let t = f (t 1 , . . . , t k ) be an l-ary tree such that f is in Σ k and (t 1 , . . . , t k ) is a k-tuple of trees in T (Σ) different from (ε 1 , . . . , ε k ). Let L be a n-homogeneous tree language over Σ with . Then: The Bottom-Up quotient for the b-product of languages can be computed as follows: Proposition 3.9 (Prop. 17 of [6]). Let Σ be an alphabet. Let L 1 be a k-homogeneous language, L 2 be a 0-homogeneous language, α be a symbol in Σ and b be a symbol in Σ 0 . Then: The Bottom-Up quotient for the composition of languages can be computed as follows: Proposition 3.10 (Prop. 20 of [6]). Let Σ be an alphabet. Let L be a k-homogeneous language with Ind ε (L) = {j 1 , . . . , j k }, L 1 , . . . , L k be k tree languages and α be in Σ n . Then: Let us explain the above formula, in order to explain the quotient of the composition of the set of k-ary trees L with k-homogeneous languages L 1 , . . . , L k w.r.t. a symbol α we first explain α −1 (t • (t 1 , . . . , t k )).
The composition of a k-ary tree t such that Ind ε (t) = {x 1 , . . . , x k }, with k trees t 1 , . . . , t k is the action of grafting these trees to t at the positions where the symbols ε x1 , . . . , ε x k appear. Thus, the obtained tree t can be seen as a tree with an upper part containing t and lower parts containing exactly the trees t 1 , . . . , t k . Therefore, if α appears in a lower tree t j , this tree must be quotiented w.r.t. α and the other parts are εincremented. Moreover, if some n trees in t 1 , . . . , t k are equal to ε 1 , . . . , ε n , for example t p1 , . . . , t pn , and if t = α(ε xp 1 , . . . , ε xp n ) appears in t, then t must be substituted by ε 1 and the other lower trees t j with j = p m , m ∈ {1, . . . , n} ε-incremented, since the inverse operation produces t. Therefore, by Definition 2.1 we can extend this operation to the case of languages and we find the above formula.
The Bottom-Up quotient for the composition closure of a language can be computed as follows: Proposition 3.11 (Prop. 22 of [6]). Let L be a 1-homogeneous language. Let α be a symbol in Σ 0 ∪ Σ 1 . Then: The Bottom-Up quotient for the iterated composition of a language can be computed as follows: Proposition 3.12 (Prop. 24 of [6]). Let L be a 0-homogeneous language. Let α and b be two symbols in Σ 0 . Then:

Boolean (homogeneous) operations
In the following, we consider that Boolean operations (such as union, intersection, complement, etc.) are not necessarily defined for all combinations of languages. Instead, we will consider particular restrictions of these operations, based on the combination of homogeneous languages with the same ε-indices.
As an example, given a k-homogeneous language L, we denote by ¬L the set By similarly restricting the classical union to pairs of languages with the same ε-indices, one can redefine any Boolean operator as a classical combination of union and complementation (e.g. symmetrical difference, set difference, etc.). Let us show how to compute the Bottom-Up quotient of a complemented language.
Proposition 4.1. Let L be an homogeneous language over Σ and t ∈ T (Σ). Then Proof. Let t be a tree in T (Σ) such that Then As a direct consequence, following equation (3.5), we get the following result.
The restriction to homogeneous languages needs a small modification in terms of computation. Indeed, let us consider equation (3.7). It is necessary to determine whether ε j belongs to a given language: how can we decide whether it belongs to ¬∅? There are two alternatives of this barred notation, because the complementation function needs to know the ε-index set of the language it complements. Either we can specify the restriction by parameterizing the operators, or we specify only the occurrences of the empty set symbol, leading to the consideration of expressions instead of languages. This is the approach that we will consider in the following: the languages and the expressions will be subtyped w.r.t. the sets of ε-indices.

Extended tree expressions
An extended tree expression (tree expression for short) E over Σ is inductively defined by where f is a symbol in Σ n , (E , E 1 , . . . , E n ) are (n + 1) tree expressions over Σ, j is a positive integer, I is a set of integers, op is an n-ary Boolean operator and a is a symbol in Σ 0 . We denote the expression ∅ ∅ by ∅.
The set of ε-indices Ind ε (E) of a tree expression E, that we use to distinguish tree expressions (e.g. distinct occurrences of ∅), is inductively defined, following equation (5.1), by In the following, we restrict the set of tree expressions that we deal with in order to simplify the different computations. More formally, we define the notion of valid tree expression, that rejects (for instance) nonhomogeneous tree expressions: A tree expression E is valid if it satisfies the predicate V (E) inductively defined, following equation (5.1), by The language L(E) denoted by a valid tree expression E with an ε-index set I is inductively defined by where f is a symbol in Σ n , (E , E 1 , . . . , E n ) are (n + 1) tree expressions over Σ, j is a positive integer, op is an n-ary Boolean operator, op is an n-ary Boolean operation over homogeneous languages with I as ε-index set (e.g. Eq. (4.1)) and a is a symbol in Σ 0 . From these definitions, we can define the derivation formulae for valid tree expressions w.r.t. symbols and trees as a syntactical transcription of the quotient formulae.
Definition 5.1. Let E be a valid tree expression and j be an ε-index of E. Then d εj (E) is obtained by incrementing all the ε-indices of E by 1 except ε j which is replaced by ε 1 .
Definition 5.2. Let α be a symbol in Σ n and F be a valid tree expression over Σ containing {1, . . . , n} as ε-indices. The derivative of F w.r.t. to α is the expression inductively defined by where d α(εj 1 ,...,εj n )(E) = d α (d εj 1 +n−1 (· · · d εj n−1 +1 (d εj n (E)) · · · )), where for all integers i the expression E i equals Inc ε (1, E i ) and where • 1 is the partial composition defined by E • 1 E = E • (E , (ε l ) l∈{j2,...,j k } ) with Ind ε (E) = {j 1 , . . . , j k }. Definition 5.3. Let t = f (t 1 , . . . , t n ) be a tree in T (Σ) and E a valid tree expression over Σ such that Ind ε (t) ⊆ Ind ε (E). The derivative of E w.r.t. t is the tree expression defined by Notice that the base cases include the one of the derivation of the empty set. In this case, the only modification that occurs is the index simulating the ε-index set of the denoted language. This is necessary in order to validate equation (3.1). As an example, consider the expression E = ¬∅ ∅ . When deriving E w.r.t. a nullary tree a, one must obtain an expression denoting all the trees that belong to T (Σ) in which one a was removed, that is the set of all the trees with only ε 1 as an ε-index. Applying the previously defined formulae: When deriving one more time w.r.t. a, one must obtain an expression denoting all the trees with only ε 1 and ε 2 as ε-indices (obtained from a tree in T (Σ) by removing two occurrences of a). Applying the previously defined formulae: Finally, when deriving by a binary symbol f , one must obtain an expression denoting all the trees that belong to T (Σ) in which one occurrence of f (a, a) was removed, that is the set of all the trees with only ε 1 as ε-index. Applying the previously defined formulae: As a direct consequence of the inductive formulae of Section 3 and of Corollary 4.2, we get the following theorem.
Theorem 5.4. The derivative of a valid tree expression E w.r.t. to a tree t denotes t −1 (L(E)).
Proof. Let us proceed in three steps.

Following equation (3.4) and Definition 5.1, it holds that
2. Notice that the derivation formulae of Definition 5.2 are syntactical equivalents of the quotient formulae of Section 3 and of Corollary 4.2 and therefore it can be proved by induction over the structure of E that This reasoning is valid except for the case with indexed occurrence of the empty set and with the case of the substitution product. As discussed before, the occurrences of the empty set are "typed" w.r.t. the ε-indices set of the language they denote. Therefore, these indices should be modified using equation (3.1). In the product case, the derivation of an expression by the tree α(ε j1 , . . . , ε jn ) has to be considered. However, by considering this particular case in the induction, one can check that L(d α(εj 1 ,...,εj n ) (E)) = L(d α (d εj 1 +n−1 (· · · d εj n−1 +1 (d εj n (E)) · · · ))) = α −1 (L(d εj 1 +n−1 (· · · d εj n−1 +1 (d εj n (E)) · · · ))), this last equality obtained by applying the induction step. From item 1, it holds that that equals α(ε j1 , . . . , ε jn ) −1 (L(E)) from equation (3.6). We can conclude following equation (3.7). 3. Finally, according to equation (3.6) and item 2, Definition 5.3 implies that L(d t (E)) = t −1 (L(E)).
* a ) and E 2 = f (f (a, a), a). Let us show how to calculate the derivative of E w.r.t. t = f (f (a, a), a). First, let us compute the derivative of E 2 w.r.t. t: ε 1 , a) + f (a, ε 1 ), a) + f (f (a, a), ε 1 ), Then, in order to reduce the size of the computed tree expressions, let us set Then:

Tree automaton construction
In this section, we explain how we can compute a tree automaton from a valid tree expression E with Ind ε (E) = ∅ from an iterated process using the previously defined derivation.
Given a tree expression E over an alphabet Σ, we first compute the set From this set, we compute the tree automaton A 0 = (Σ, D 0 (E), F 0 , δ 0 ) where From this step, one can choose a total function tree 0 associating any tree expression E in D 0 (E) with a tree t such that by choosing for any tree expression E in D 0 (E) a symbol a ∈ Σ 0 such that (a, E ) ∈ δ 0 . From this induction basis, let us consider the transition set δ n inductively defined by Let us consider the set D n (E) = D n−1 (E) ∪ π 3 (δ n ), where π 3 is the classical projection defined by π 3 (X) = {z | ( , , z) ∈ X}. Obviously, one can once again choose a total function tree n associating any tree expression E in D n (E) with a tree t such that by choosing a transition ((E 1 , . . . , E m ), f, E ) in δ n for any tree expression E in D n (E) \ (D n−1 (E)) and defining t as f (tree n−1 (E 1 ), . . . , tree n−1 (E k )). Finally, by considering the set we can define the tree automaton A n = (Σ, D n (E), F n , δ n ). Let A(E) be the fixed point, if it exists, of this process (up to the choice of the tree * functions), called the Bottom-Up derivative tree automaton of E.
Corollary 6.4. Let t 1 , . . . , t k be k nullary trees. Let L be a nullary language. Let t 1 , . . . , t k be k nullary trees such that for any integer 1 ≤ j ≤ k, t j −1 (L) = t j −1 (L). Then Finally, we can prove our proposition.
Proof. (of Prop. 6.1) It is sufficient, by definition of the Bottom-Up derivative tree automaton, to prove by recurrence over an integer n that for any tree t of height at most n + 1, it holds that for ∆ n (t) = {E }, 1. By definition of δ 0 , the equality holds for any tree of height 1.
2. Let us consider that the hypothesis holds at the rank n − 1. Let f (t 1 , . . . , t k ) be a tree of height (n + 1). Obviously, for an integer 1 ≤ j ≤ k, the height of the tree t j is smaller than n and therefore, by application of the induction hypothesis, assuming that ∆ n−1 (t j ) = {E j }, Moreover, by definition, δ n contains the transition ((E 1 , . . . , E k ), f, d t (E)) where t = f (tree n−1 (E 1 ), . . . , tree n−1 (E k )). Let us set, for any integer 1 ≤ j ≤ k, tree n−1 (E j ) = t j , and therefore t = f (t 1 , . . . , t k ). It is easy to check, from the construction of the function tree n−1 and by a trivial recurrence, that for any state S in A n−1 , ∆ n−1 (tree n−1 (S)) = {S}.
Hence, for any integer 1 ≤ j ≤ k, and by induction hypothesis, since the height of t j is at most n, it holds L(d t j (E)) = L(E j ). Consequently, Notice that from Definition 5.3, Hence, from Corollary 6.4 and Theorem 5.4, As a direct consequence of Proposition 6.1, Proposition 3.3 and equation (7.2), the following theorem holds.
Theorem 6.5. A Bottom-Up derivative tree automaton of a tree expression E is deterministic and recognizes L(E).
Proof. Let A = (Σ, , F, δ) be the Bottom-Up derivative tree automaton of E. By construction, A is deterministic. Let t be a tree over Σ. Then: Notice that when Σ n = ∅ for n ≥ 2, the three ACI rules (associativity, commutativity and idempotence of the sum) are sufficient to obtain a finite tree automaton, isomorphic to the classical Brzozowski automaton (for words). More generally, one can wonder if these three rules are sufficient in order to obtain a finite set of (similar) derivatives. This (technical) study is the next step of our study. Example 6.6. Let us consider the tree expressions defined in Example 5.5, i.e. a, a), a), Let us show how to compute a derivative tree automaton of E. First, let us compute The tree automaton A 0 is represented in Figure 1, where the state ∅ 1 , a sink-state, and its transitions are omitted.   We choose a function to define tree 0 : tree 0 (d a (E)) = a, tree 0 (d b (E)) = b. Let us now show how to compute A 1 = (Σ, D 1 (E), F 1 , δ 1 ). According to equation (7.1), it is sufficient to compute the derivatives of E w.r.t. the trees in the set {f (a, a), f (a, b), f (b, a), f (b, b), g(a), g(b)}: There is a new non-final state, E • f (ε 1 , a), which is associated with f (a, a) by the function tree 1 , and three new transitions: The tree automaton A 1 is represented in Figure 2.
The tree automaton A 2 can be computed through the derivatives w.r.t. the trees in the set , a), f (a, a)), f (f (a, a), a), f (f (a, a), b), f (a, f (a, a)), f (b, f (a, a)), g(f (a, a))} : a,a),a) (E) = E . There is a new non-final state, E , which is associated with t = f (f (a, a), a) by the function tree 2 , and one new transition: The tree automaton A 2 is represented in Figure 3. The tree automaton A 3 is obtained by computing the derivatives w.r.t. the trees in the set {f (t, t), f (t, a), f (t, b), . . .}. There are only four computations that do not return a derivative equal to ∅ {1} : There are four new transitions: (d t (E), g, d t (E))}, but these computations does not introduce new states. Therefore the computation halts and the derivative tree automaton of E is A 3 , represented in Figure 4.

Partial derivatives and derived terms
The partial derivation, due to Antimirov [1], is an operation based on the same operation as the derivation. Indeed, they both implement the computation of the quotient at the expression (and then syntactical) level. The main difference is that instead of computing an expression from an expression, the partial derivation produces an expression set from an expression. Computing a sum from this set produces an expression equivalent to the one obtained via derivation. It was already extended to tree expressions by Kuske and Meinecke [9] in order to compute a Top-Down automaton. Therefore, let us then show how to extend it in a Bottom-Up way.
As in the case of (Bottom-Up) derivation, let us first explicit the derivation w.r.t. an empty tree. Let E be a valid tree expression and j be an ε-index of E. Then ∂ εj (E) is obtained, as in the case of derivation, by incrementing all the ε-indices of E by 1 except ε j which is replaced by ε 1 i.e.
Its application to an expression set can be easily defined as follows: The computation of the derived terms, that are the expressions in the set obtained by the partial derivation, can be defined w.r.t. the symbols as follows. Notice that we only deal with the sum as Boolean operator. Classically, the partial derivation is defined for (so-called) simple expressions; however, it can be easily extended to all Boolean operators [4].
Definition 7.1. Let α be a symbol in Σ n and F be a valid tree expression over Σ containing {1, . . . , n} as ε-indices. The partial derivative of F w.r.t. to α is the expression inductively defined by The extension of the partial derivation to the operation of negation can be achieved in a similar way to the composition closure: Another method is to define another partial derivation returning sets of sets of expressions, interpreted as clausal disjunctive forms (an union of intersection of languages) [4,5].
To well define the operation , an order over the expressions has to be considered. This order is important in order to distinguish between semantic and syntax. As an example, let us consider the set {a, b} ; considering a < b or b < a leads to two distinct (but equivalent) expressions, (a + b) and (b + a) . Moreover, we set ∅ = {ε 1 }. Furthermore, the partial derivative of an expression set E is defined by Finally, the partial derivative w.r.t. a tree can be defined as follows.
Definition 7.2. Let t = f (t 1 , . . . , t n ) be a tree in T (Σ) and E a valid tree expression over Σ such that Ind ε (t) ⊆ Ind ε (E). The partial derivative of E w.r.t. t is the set of tree expressions defined by where {y 1 , . . . , y n−l } = Ind ε (E) \ Ind ε (t) and ∀1 ≤ j ≤ k, t j = Inc ε (k − j, t j ).
As a direct consequence of the inductive formulae of Section 3, we get the following theorem.
Let us show how to calculate the derivative of E w.r.t. t = g(f (b, a)).
Example 7.5. Let us consider the graded alphabet defined by Σ 2 = {f }, Σ 1 = {g} and Σ 0 = {a} and let E be the tree expression defined by f (a, a), a).
Let us show how to calculate the derivative of E w.r.t. t = f (f (a, a), a). (a, a), ε 1 ), (ε 1 , ε 2 ), a)), g(ε 1 ) • (f (f (a, ε 2 ), ε 1 )), (ε 1 , a), ε 2 )), g(ε 1 ) • (f (f (a, ε 1 ), ε 2 )), Let us now show that the computation of an automaton from the partial derivation cannot be achieved via the same algorithm as the case of derivation. Let us first try to extend the previous algorithm. Given a tree expression E over an alphabet Σ, we first compute the set From this set, we compute the tree automaton From this step, one can choose a total function tree 0 associating any tree expression E in D 0 (E) with a tree t such that Notice that one can consider a greedy choice, that is a choice that minimizes the number of trees in the codomain of the function tree 0 . From this induction basis, let us consider the transition set δ n inductively defined by Let us consider the set D n (E) = D n−1 (E) ∪ π 3 (δ n ), where π 3 is the classical projection defined by π 3 (X) = {z | ( , , z) ∈ X}. Obviously, one can once again choose a total function tree n associating any tree expression E in D n (E) with a tree t such that by choosing a transition ((E 1 , . . . , E m ), f, E ) in δ n for any tree expression E in D n (E) \ (D n−1 (E)) and defining t as f (tree n−1 (E 1 ), . . . , tree n−1 (E k )). Finally, by considering the set F n = {E ∈ D n (E) | ε 1 ∈ L(E )}, (7.2) we can define the tree automaton A n = (Σ, D n (E), F n , δ n ). Let us choose tree 0 (E ) = a for any expression E in D 0 . By construction, the set δ 1 contains the transition ((f (ε 1 , a), f (a, ε 1 )), f, ε 1 ), since tree 0 (f (ε 1 , a)) = tree 0 (f (a, ε 1 )) = a and since ∂ f (a,a) (E) = {ε 1 }. In this case, since there also exist the transitions (b, f (ε 1 , a)) and (b, f (a, ε 1 )), the tree f (b, b) is recognized by the automaton, that exhibits a witness of the difference with L(E).

Web application
The computation of a derivative and partial derivative, and both the construction of a derivative tree automaton and the classical non deterministic inductive construction have been implemented in Haskell (made in Haskell, compiled in Javascript using the reflex platform, represented with viz.js) in order to help the reader to manipulate the notions. This web application can be found here [11]. As an example, the tree expression ¬(g(a)

Conclusion and perspectives
We have shown how to compute a derivative tree automaton as a fixed point of an inductive construction when it exists. Even when it does not exist, the process can be used in order to solve the membership test (i.e. does a tree belong to the language denoted by a tree expression?): it is easy to see that, for a tree t of height h, the tree automaton A h is sufficient, since t ∈ L(A h ) if and only if t ∈ L(A). As an example, consider the tree automaton A 1 of Example 6.6. This tree automaton is sufficient to determine that the trees in T ({f, g, b, c}) belong to L(E). And even the subautomaton of A h restricted to the transitions used in order to compute ∆(t) is enough. Moreover, due to the independence of the computations of derivatives, this process can be performed in a parallel/concurrent way.
Furthermore, we can wonder whether the choices of the tree * functions during the computation of the derivative automaton impact the produced automaton. We conjecture that all of these choices lead to a unique automaton, and the statement of Proposition 6.1 could be replaced by ∆(t) = {d t (E)}.
Let us notice that this fixed point computation cannot be extended directly to deal with partial derivatives but the partial derivation can be used to solve the membership test syntactically. This is not the only loss of the extension of partial derivation from words to trees. It also seems that partial derivation tends to produce more expressions than derivation. It could be the consequence of the distributions that occur when the product and the composition are applied to sets of expressions in conjunction with the composition closure of sets of expressions, that seems to cancel the reduction power of this process.
Finally, the ACI rules of the sum used here are the same as used in the case of words, the difficulties that we have found reside on the sufficiency of these rules to prove that the set of derivatives is finite. Seen that we deal with symbols of rank ≥ 1 and with operations like the composition (•), the a-product (· a ), the iterated composition ( ) which are somehow "complicated". However, all the examples that we have made (taking into account these rules) halt. So for now, this is only an hypothesis to justify. The study of the finiteness of the set of (similar) derivatives is the next step of our study: are the three ACI rules sufficient to obtain a finite set of derivatives? Moreover, the same question arises as far as partial derivatives are concerned: unlike the word case, does the partial derivation need reduction rules to produce a finite set of derived terms from an expression?