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");
> 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) |
generated by GAPDoc2HTML