Adding nesting structure to words
Authors:
Top Cited Papers
Open Access
- 19 May 2009
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Journal of the ACM
- Vol. 56 (3) , 1-43
Abstract
We propose the model of nested words for representation of data with both a linear ordering and a hierarchically nested matching of items. Examples of data with such dual linear-hierarchical structure include executions of structured programs, annotated linguistic data, and HTML/XML documents. Nested words generalize both words and ordered trees, and allow both word and tree operations. We define nested word automata —finite-state acceptors for nested words, and show that the resulting class of regular languages of nested words has all the appealing theoretical properties that the classical regular word languages enjoys: deterministic nested word automata are as expressive as their nondeterministic counterparts; the class is closed under union, intersection, complementation, concatenation, Kleene-*, prefixes, and language homomorphisms; membership, emptiness, language inclusion, and language equivalence are all decidable; and definability in monadic second order logic corresponds exactly to finite-state recognizability. We also consider regular languages of infinite nested words and show that the closure properties, MSO-characterization, and decidability of decision problems carry over. The linear encodings of nested words give the class of visibly pushdown languages of words, and this class lies between balanced languages and deterministic context-free languages. We argue that for algorithmic verification of structured programs, instead of viewing the program as a context-free language over words, one should view it as a regular language of nested words (or equivalently, a visibly pushdown language), and this would allow model checking of many properties (such as stack inspection, pre-post conditions) that are not expressible in existing specification logics. We also study the relationship between ordered trees and nested words, and the corresponding automata: while the analysis complexity of nested word automata is the same as that of classical tree automata, they combine both bottom-up and top-down traversals, and enjoy expressiveness and succinctness benefits over tree automata.Keywords
Funding Information
- Army Research Office (DAAD19-01-0473)
- National Science Foundation (CCR-0306382CPA-0541149)
This publication has 37 references indexed in Scilit:
- Marrying words and trees2007
- Designing and Evaluating an XPath Dialect for Linguistic Queries2006
- Adding Nesting Structure to Words2006
- Analysis of recursive state machinesACM Transactions on Programming Languages and Systems, 2005
- Congruences for Visibly Pushdown Languages2005
- Stack size analysis for interrupt-driven programsInformation and Computation, 2004
- Visibly pushdown languages2004
- MOPS2002
- Automatic predicate abstraction of C programs2001
- Context-Free Languages and Pushdown Automata1997