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
13 - Logic-based queries
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
In this chapter we present the third approach to subtree extraction, namely, firstorder (predicate) logic, and its extension, monadic second-order logic (MSO). An advantage of using logic-based queries is that this allows a direct way of expressing retrieval conditions. That is, we do not need to specify the structure of a whole tree (as for patterns in Chapter 5) nor to navigate around the tree (as for path expressions in Chapter 12); we simply need to specify the logical relationships among relevant nodes. Furthermore MSO can express any regular queries, that is, it is at least as powerful as marking tree automata (and thus patterns). However, MSO can express no more than regular queries; indeed, any MSO formula can be translated to a marking tree automaton (Chapter 6). It does mean, however, that we can use efficient on-the-fly algorithms (Chapter 8).
First-order logic
When we consider a logical framework, we usually think of models on which logic formulas are interpreted. In our setting, the models are XML documents; for simplicity, we consider here the binary tree format. Then we can talk about whether a given (binary) tree satisfies a given logic formula.
- Type
- Chapter
- Information
- Foundations of XML ProcessingThe Tree-Automata Approach, pp. 161 - 175Publisher: Cambridge University PressPrint publication year: 2010