Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Introduction
- 2 Preliminaries
- PART I BASIC TOPICS
- PART II ADVANCED TOPICS
- 8 On-the-fly algorithms
- 9 Alternating tree automata
- 10 Tree transducers
- 11 Exact typechecking
- 12 Path expressions and tree-walking automata
- 13 Logic-based queries
- 14 Ambiguity
- 15 Unorderedness
- Appendix Solutions to selected exercises
- References
- Index
8 - On-the-fly algorithms
from PART II - ADVANCED TOPICS
Published online by Cambridge University Press: 05 July 2014
- Frontmatter
- Dedication
- Contents
- Preface
- 1 Introduction
- 2 Preliminaries
- PART I BASIC TOPICS
- PART II ADVANCED TOPICS
- 8 On-the-fly algorithms
- 9 Alternating tree automata
- 10 Tree transducers
- 11 Exact typechecking
- 12 Path expressions and tree-walking automata
- 13 Logic-based queries
- 14 Ambiguity
- 15 Unorderedness
- Appendix Solutions to selected exercises
- References
- Index
Summary
This chapter presents efficient algorithms for several important problems related to XML processing, namely: (1) membership for tree automata (to test whether a given tree is accepted by a given tree automaton); (2) evaluation of marking tree automata (to collect the set of bindings yielded by the matching of a given tree against a given marking tree automaton); and (3) containment for tree automata (to test whether the languages of given two tree automata are in subset relation). For these problems we describe several “on-the-fly” algorithms, in which only a part of the whole state space is explored to obtain the final result. In such algorithms there are two basic approaches, top-down and bottom-up. The top-down approach explores the state space from the initial states whereas the bottom-up approach does this from the final states. In general, the bottom-up approach tends to have a lower complexity in the worst case whereas the top-down often gives a higher efficiency in practical cases. We will also consider a further improvement from combining these ideas.
Membership algorithms
In this section, we will consider three algorithms for testing membership. The first is a top-down algorithm, which can be obtained rather simply from the semantics of tree automata but takes time that is exponential in the size of the input tree, in the worst case.
- Type
- Chapter
- Information
- Foundations of XML ProcessingThe Tree-Automata Approach, pp. 93 - 116Publisher: Cambridge University PressPrint publication year: 2010