GO-V.ORG
As seen in

Regular tree grammar

In theoretical computer science and formal language theory, a regular tree grammar is a formal grammar that describes a set of directed trees, or terms.[src] A regular word grammar can be seen as a special kind of regular tree grammar, describing a set of single-path trees.[src]

In theoretical computer science and formal language theory, a regular tree grammar is a formal grammar that describes a set of directed trees, or terms.[src] A regular word grammar can be seen as a special kind of regular tree grammar, describing a set of single-path trees.[src] ==Definition== A regular tree grammar G is defined by the tuple G = (N, Σ, Z, P), where: N is a finite set of nonterminals, Σ is a ranked alphabet (i.e., an alphabet whose symbols have an associated arity) disjoint from N, Z is the starting nonterminal, with , and P is a finite set of productions of the form A → t, with , and , where T Σ (N) is the associated term algebra, i.e.[src] the set of all trees composed from symbols in according to their arities, where nonterminals are considered nullary.[src] ==Derivation of trees== The grammar G implicitly defines a set of trees: any tree that can be derived from Z using the rule set P is said to be described by G.[src] This set of trees is known as the language of G.[src] Formally, the relation ⇒ G on the set T Σ (N) is defined as follows: A tree can be derived in a single step into a tree (in short: t 1 ⇒ G t 2 ), if there is a context S and a production such that: t 1 = S[A], and t 2 = S[t].[src] Here, a context means a tree with exactly one hole in it; if S is such a context, S[t] denotes the result of filling the tree t into the hole of S.[src] The tree language generated by G is the language .[src] Here, T Σ denotes the set of all trees composed from symbols of Σ, while ⇒ G* denotes successive applications of ⇒ G .[src] A language generated by some regular tree grammar is called a regular tree language.[src] ==Examples== from G 1 in linear (upper left table) and graphical (main picture) notation Let G 1 = (N 1 ,Σ 1 ,Z 1 ,P 1 ), where N 1 = {Bool, BList } is our set of nonterminals, Σ 1 = { true, false, nil, cons(.,.) } is our ranked alphabet, arities indicated by dummy arguments (i.e.[src] the symbol cons has arity 2), Z 1 = BList is our starting nonterminal, and the set P 1 consists of the following productions: Bool → false Bool → true BList → nil BList → cons(Bool,BList) An example derivation from the grammar G 1 is BList ⇒ cons(Bool,BList) ⇒ cons(false,cons(Bool,BList)) ⇒ cons(false,cons(true,nil)).[src] The image shows the corresponding derivation tree; it is a tree of trees (main picture), whereas a derivation tree in word grammars is a tree of strings (upper left table).[src] The tree language generated by G 1 is the set of all finite lists of boolean values, that is, L(G 1 ) happens to equal T Σ1 .[src] The grammar G 1 corresponds to the algebraic data type declarations (in the Standard ML programming language): datatype Bool ==Language properties== If L 1 , L 2 both are regular tree languages, then the tree sets , and L 1 \ L 2 are also regular tree languages, and it is decidable whether , and whether L 1 = L 2 .[src] ==Alternative characterizations and relation to other formal languages== Regular tree grammars are a generalization of regular word grammars.[src] The regular tree languages are also the languages recognized by bottom-up tree automata and nondeterministic top-down tree automata.[src] Rajeev Alur and Parthasarathy Madhusudan related a subclass of regular binary tree languages to nested words and visibly pushdown languages.[src] ==Applications== Applications of regular tree grammars include: Instruction selection in compiler code generation A decision procedure for the first-order logic theory of formulas over equality (=) and set membership (∈) as the only predicates Solving constraints about mathematical sets The set of all truths expressible in first-order logic about a finite algebra (which is always a regular tree language) Graph-search ==See also== Set constraint – a generalization of regular tree grammars Tree-adjoining grammar ==References== ==Further reading== Regular tree grammars were already described in 1968 by: A book devoted to tree grammars is: Algorithms on regular tree grammars are discussed from an efficiency-oriented view in: Given a mapping from trees to weights, Donald Knuth's generalization of Dijkstra's shortest-path algorithm can be applied to a regular tree grammar to compute for each nonterminal the minimum weight of a derivable tree.[src] Based on this information, it is straightforward to enumerate its language in increasing weight order.[src] In particular, any nonterminal with infinite minimum weight produces the empty language.[src] See: Regular tree automata have been generalized to admit equality tests between sibling nodes in trees.[src] See: Allowing equality tests between deeper nodes leads to undecidability.[src] See:[src]

27 sentences · 27 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Regular tree grammar." encyclopegia.org, 2026, https://encyclopegia.org/wiki/regular-tree-grammar. Accessed 06 December 2026.

Chicago

"Regular tree grammar." encyclopegia.org. Accessed December 6, 2026. https://encyclopegia.org/wiki/regular-tree-grammar.

APA

encyclopegia.org. (2026). Regular tree grammar. Retrieved December 6, 2026, from https://encyclopegia.org/wiki/regular-tree-grammar

Accessed December 6, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Ti -Tree

stub · references available

Siberian Tree Frog

stub · references available

Olive-tree Warbler

stub · references available

Tree Pipit

stub · references available

Romanian grammar

stub · references available

Matschie's tree-kangaroo

stub · references available

phylogenetic tree

stub · references available

Gray-bellied pencil-tailed tree-mouse

stub · references available
CC BY-SA 4.0 · tier1-factual · https://en.wikipedia.org/w/index.php?oldid=1368863838 · 0.55 · snapshot regular-tree-grammar-823971-f2bd5e62e37bd0ca · QID Q7309622

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.