Goto Chapter: Top 1 2 Ind
 Top of Book   Previous Chapter   Next Chapter 

2 Operations on forest automata
 2.1 Forest
  2.1-1 Forest

2 Operations on forest automata

A bottom-up deterministic forest automaton is a tuple (S, Q, s_0, A, gamma, lambda, F) where S is a finite set of horizontal states, s_0 in S is the initial state, F subseteq S is the set of accepting states, Q is a finite set of vertical states, gamma : S x Q -> S is a semiautomaton on set S with alphabet Q, A is the alphabet of input forests and lambda : S x A -> Q is the vertical output function. DeclareGlobalFunction("ForestAutomaton"); DeclareGlobalFunction("MinimizedForestAutomaton"); DeclareGlobalFunction("MinimalForestAutomaton"); DeclareGlobalFunction("ForestHorizontalAutomaton"); DeclareGlobalFunction("ForestAutomatonAccepts"); DeclareGlobalFunction("ForestAutomatonSyntacticAlgebra"); DeclareGlobalFunction("WriteDotForestAutomaton"); DeclareGlobalFunction("DrawForestAutomaton"); DeclareGlobalFunction("WriteDotForestAutomatonAction"); DeclareGlobalFunction("DrawForestAutomatonAction");

2.1 Forest

2.1-1 Forest
> Forest( Expression )( function )

Creates a forest object. Expression can either be a string containing the decomposition of the forest into sums and rootings, following this syntax:

Forest ::= a | Forest+Forest | a(Forest)

or it can use the internal list representation; labels are lower case characters, e.g. 'a', rootings are stored in list in which the first value is the label of the rooting node and the second is the list describing the rooted forest. Finally, the sum of two forests is the concatenation of the list that describe them


gap> f := Forest("a+b(a(b)+b(a+a))+c(c(c+a)+b)");
a+b(a(b)+b(a+a))+c(c(c+a)+b)
gap> g := Forest(['b', ['a',['b','b']]]);
b+a(b+b)

 Top of Book   Previous Chapter   Next Chapter 
Goto Chapter: Top 1 2 Ind

generated by GAPDoc2HTML