The compression of bottom-up tree automata and their representation as implemented in the OPTRAN tree transformation system are described here as a four-step process. First, the vertically working tree automata traversing one generation in one step are replaced by horizontally working automata, splitting this step into rank (operator) steps, This replaces each matrix of dimension rank (operator) by a tree of depth rank (operator), A second step replaces this tree by a shortened directed acyclic graph (DAG), that is, a DAG where equivalent states of the tree are identified and paths in the tree with no gain in information are condensed, The acceptance property of the automaton is not changed. This and the following size reduction steps critically depend on the “no-error” assumption, that is, the assumption that input trees are correctly built and that no error detection is required of the tree automata. The third step embeds the DAG, which is naturally represented by two-dimensional tables, into a linear array using row displacement and row column schemes. In addition, this step compresses strings of consecl~.,ve identical entries, which occur often in this type of automaton. The last step exploits the memory structure and addressability of the target machine. Using information on automata and table sizes, the most efilcient storage representation is selected. The data structures and access functions are generated as C objects and functions, respectively. Results showing the effectiveness of the different steps are given.
[1]
Reinhard Wilhelm,et al.
OPTRAN, a Language for the Specification of Program Transformations
,
1980,
Fachtagung über Programmiersprachen.
[2]
Ellis Horowitz,et al.
Algorithms for trie compaction
,
1984,
TODS.
[3]
Reinhard Wilhelm,et al.
OPTRAN - A Language/System for the Specification of Program Transformations: System Overview and Experiences
,
1988,
CC.
[4]
Christoph M. Hoffmann,et al.
Pattern Matching in Trees
,
1982,
JACM.
[5]
David R. Chase,et al.
An improvement to bottom-up tree pattern matching
,
1987,
POPL '87.
[6]
Peter Dencker,et al.
Optimization of parser tables for portable compilers
,
1984,
TOPL.
[7]
Robert E. Tarjan,et al.
Storing a sparse table
,
1979,
CACM.
[8]
Hans H. Kron,et al.
Tree templates and subtree transformational grammars.
,
1975
.
[9]
Alfred V. Aho,et al.
Compilers: Principles, Techniques, and Tools
,
1986,
Addison-Wesley series in computer science / World student series edition.
[10]
Eduardo Pelegri-Llopart,et al.
Rewrite systems, pattern matching, and code generation
,
1988
.