Automata theory for XML researchers

Similar documents
Foundations of XML Types: Tree Automata

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Minimal DFA. minimal DFA for L starting from any other

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

CMSC 330: Organization of Programming Languages

1 Nondeterministic Finite Automata

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Regular expressions, Finite Automata, transition graphs are all the same!!

Designing finite automata II

Formal Languages and Automata

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Coalgebra, Lecture 15: Equations for Deterministic Automata

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Convert the NFA into DFA

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Lecture 08: Feb. 08, 2019

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

Parse trees, ambiguity, and Chomsky normal form

Harvard University Computer Science 121 Midterm October 23, 2012

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Formal languages, automata, and theory of computation

3 Regular expressions

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

More on automata. Michael George. March 24 April 7, 2014

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Nondeterminism and Nodeterministic Automata

Finite-State Automata: Recap

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Chapter 2 Finite Automata

Formal Language and Automata Theory (CS21004)

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Lecture 9: LTL and Büchi Automata

1 From NFA to regular expression

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Fundamentals of Computer Science

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Lecture 09: Myhill-Nerode Theorem

Let's start with an example:

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

CHAPTER 1 Regular Languages. Contents

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 330 Formal Methods and Models

The size of subsequence automaton

Homework 3 Solutions

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Tutorial Automata and formal Languages

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Deterministic Finite Automata

Regular Languages and Applications

In-depth introduction to main models, concepts of theory of computation:

Theory of Computation Regular Languages

Lexical Analysis Finite Automate

Model Reduction of Finite State Machines by Contraction

Validating Streaming XML Documents

input tape head moves current state

Non-deterministic Finite Automata

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CISC 4090 Theory of Computation

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Lexical Analysis Part III

DFA minimisation using the Myhill-Nerode theorem

Streamed Validation of XML Documents

CS 275 Automata and Formal Language Theory

Java II Finite Automata I

Worked out examples Finite Automata

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

FABER Formal Languages, Automata and Models of Computation

SWEN 224 Formal Foundations of Programming WITH ANSWERS

CS375: Logic and Theory of Computing

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

NFAs continued, Closure Properties of Regular Languages

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

TREE AUTOMATA AND TREE GRAMMARS

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

1.4 Nonregular Languages

Homework Solution - Set 5 Due: Friday 10/03/08

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Learning Moore Machines from Input-Output Traces

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

A negative answer to a question of Wilke on varieties of!-languages

Transcription:

Automt theory for XML reserchers Frnk Neven University of Limurg frnk.neven@luc.c.e Introduction The dvent of XML initited symiosis etween document reserch, dtses nd forml lnguges (see, e.g., the survey y Vinu [38]). This symiosis resulted, for instnce, in the development of unrnked tree utomt [3]. In rief, unrnked trees re finite leled trees where nodes cn hve n ritrry numer of children. So, there is no fixed rnk ssocited to ech lel. As the structure of XML documents cn e dequtely represented y unrnked trees, unrnked tree utomt cn serve XML reserch in four different wys: (i) s sis of schem lnguges [0, 2, 3, 8, 9] nd vlidting of schems; (ii) s n evlution mechnism for pttern lnguges [4, 32, 24]; (iii) s n lgorithmic toolox (e.g., XPth continment [6] nd typechecking [5]); nd (iv) s new prdigm: unrnked tree utomt use regulr string lnguges to del with unrnkedness. The ltter simple ut effective prdigm found ppliction in severl formlisms [4, 20, 2, 22, 27]. The present pper is n ttempt to provide gentle introduction to unrnked tree utomt nd to give references to some pplictions. We mention tht Vrdi, lredy in 989, wrote pper demonstrting the usefulness of rnked tree utomt for the sttic nlysis of dtlog progrms [37]. Dtse Principles Column. Column editor: Leonid Likin, Deprtment of Computer Science, University of Toronto, Toronto, Ontrio M5S 3H5, Cnd. E-mil: likin@cs.toronto.edu. 2 Trees Every XML document cn e represented y tree. See, for instnce, Figure. In this view, inner nodes correspond to elements which determine the structure of the document, while the lef nodes nd the ttriutes provide the content. Sometimes, for instnce in the cse of typechecking, we re only interested in the structure of documents, not in the ctul vlues of the ttriutes or the lef nodes. In such cses, we cn dequtely represent XML documents s trees over finite lphet. Agin, this is restriction s the lphet is only known when some schem informtion is ville (such s DTD for instnce). For now, however, we fix finite lphet Σ nd come ck to the finite lphet restriction in Section 5. We next provide the definitions for our strction of XML documents: Σ-trees. The set of Σ-trees, denoted y T Σ, is inductively defined s follows: (i) every σ Σ is Σ-tree; (ii) if σ Σ nd t,...,t n σ(t,...,t n ) is Σ-tree. T Σ, n then Note tht there is no priori ound on the numer of children of node in Σ-tree; such trees re therefore unrnked. Denote y N, the set of strings over the lphet consisting of the nturl numers. For every tree t T Σ, the set of nodes of t, denoted y Dom(t), is the suset of N defined s follows: if t = σ(t t n ) with σ Σ, n 0, nd t,...,t n T Σ, then Dom(t) = {ε} {ui i {,...,n},u Dom(t i )}. Thus, ε represents the root while ui represents the i-th child of u. For instnce, the domin of the ottom tree in Figure is grphiclly represented s follows:

ε 2 3 4 By l t (u) we denote the lel of u in t. In the following, when we sy tree we lwys men Σ-tree. 4 3 Unrnked Tree Automt 3. Automt on strings Before we define tree utomt, let us recll nondeterministic finite utomt on strings (NFAs). In our definition we hve initil sttes for every σ- symol. In this wy, we cn define run of the utomton tht strts on the first symol nd ends on the lst one. In prticulr, n NFA is tuple M =(Q, Σ,δ,(I σ ) σ Σ,F) where Q is the set of sttes; for every σ Σ, I σ Q is the set of initil sttes for σ; F Q is the sets of finl sttes; nd, δ : Q Σ 2 Q is the trnsition function. A run λ : {,...,n} Qon string n Σ is function such tht (i) λ() I ; (ii) for ll i {2,...,n}, λ(i) δ(λ(i ), i ). A run is ccepting if λ(n) F. A string is ccepted if there is n ccepting run for it. Exmple 3.. Consider the utomton M ccepting ll the strings over {, } tht strt nd end with the sme symol. Set Q := {q,q }, I := {q }, I := {q }, F := Q, δ(q,):=δ(q,)={q }, nd δ(q,):=δ(q,)={q }. This utomton hs only one run on every string: for instnce, on the string, we hve the run λ q q q q Usully, we view NFAs s processing input strings from left to right: n initil stte is ssigned to the first position nd from there on we ssign new sttes tht re consistent with the trnsition function. The string is ccepted if we cn ssign finl stte to the lst position. Note, however, tht we cn lso view M s right-to-left utomton y simply reversing the roles of F nd I. Indeed, we ssign finl stte to the lst position nd ssign new sttes strting from tht position to the left tht re consistent with the trnsition function. The string is ccepted if we cn ssign n initil stte from the correct set to the first position. Although processing strings from right to left might seem it strnge, for trees processing in ottom-up wy is eqully sensile s processing in top-down mnner. 3.2 Automt on inry trees For ese of exposition we ssume for this section tht ll trees re inry. Tht is, ll non-lef nodes hve exctly two children. A tree utomton is then tuple A =(Q, Σ,δ,(I σ ) σ Σ,F) where Q, F, nd ll I σ s re s efore, nd δ : Q Q Σ Q is function mpping pir of sttes nd symol to new stte. A run for t is mpping λ : Dom(t) Q such tht (i) for every lef node u, λ(u) I l t (u) ; (ii) for ll inner nodes u, λ(u) δ(λ(u),λ(u2), l t (u)). Recll tht ui is the i-th child of u. A run is ccepting if λ(ε) F. A tree is ccepted if there is n ccepting run for it. Tree utomt cn e viewed s processing their input in ottom-up or in top-down fshion depending on the roles of F nd I σ. Indeed, in the ottom-up view, initil sttes from the I σ s re ssigned to σ-leled leves nd new sttes re ssigned to inner nodes depending on their lel nd on the sttes t their children. The tree is ccepted if finl stte is ssigned to the root. In the top-down view, finl stte from F is ssigned to the root; new sttes re ssigned to the children of node u depending on the lel of u nd the stte of u. A tree is ccepted if every σ-leled lef is ssigned stte from I σ. 2

<muppet cretor="henson"> <nme> Kermit </nme> <niml> Frog </niml> <friends> <nme> Ms. Piggy </nme> </friends> </muppet> cretor Henson muppet muppet nme niml Kermit Frog friends nme Ms. Piggy cretor nme niml friends nme Figure : A smple XML document, its tree representtion, nd its structurl representtion. Exmple 3.2. Consider the lphet Σ = {,, 0, }. Suppose for ese of exposition tht trees re lwys s follows: 0 nd only pper t leves, nd nd cn pper everywhere except t leves. These re ll tree-shped oolen circuits. We next define n utomton ccepting exctly the circuits evluting to. Define A =(Q, Σ,δ,F) with Q = {0, }, I 0 = {0}, I = {},F = {}, nd δ(0, 0, ) =0 δ(0,, ) =0; δ(, 0, ) =0 δ(,, ) =; δ(0, 0, ) =0 δ(0,, ) =; δ(, 0, ) = δ(,, ) =. Intuitively, A works s follows: A ssigns 0 () to 0-leled (-leled) leves; further, A ssigns to -leled node iff oth its children re ; nd, A ssigns 0 to -leled node iff oth its children re 0. Finlly, A ccepts when the root is leled with. So, in this exmple, the ottom-up view is the most intuitive one. In Figure 2, we give n exmple of n ccepting run on tree. In Exmple 3.4, we give n utomton evluting n XPth expression for which the top-down view is more nturl. 3.3 Automt on unrnked trees Extending the tree utomt of the previous section to unrnked trees implies tht we should define the trnsition functions for ny numer of children: δ : n=0 Qn Σ 2 Q. To chieve the ltter, 0 0 Figure 2: A tree nd n ccepting run of the utomton of Exmple 3.2. Brüggemnn-Klein, Murt, nd Wood [3], sed on the work of Pir nd Quere [30] nd Tkhshi [36], use regulr string lnguges over Q to represent trnsitions. Tht is, the trnsition function δ is mpping δ : Q Σ 2 Q such tht δ(q, ) is regulr string lnguge over Q. Definition 3.3. A nondeterministic tree utomton (NTA) is tuple B =(Q, Σ, δ, F), where Q is finite set of sttes, F Q is the set of finl sttes, nd δ is function Q Σ 2 Q such tht δ(q, ) is regulr string lnguge over Q for every Σ nd q Q. A run of B on tree t is leling λ : Dom(t) Q such tht for every v Dom(t) with n children, λ(v) λ(vn) δ(λ(v), l t (v)). Note tht when v hs no children, then the criterion reduces to ε δ(λ(v), l t (v)). So, we do not need n explicit definition of the I σ s nymore. A run is ccepting iff the root is leled with finl stte, tht is, λ(ε) F. A tree is ccepted if there is n ccepting run for it. The set of ll ccepted trees is denoted y L(B). 3

We illustrte the ove definition with two exmples. In the first exmple we represent the trnsition functions y regulr expressions. In the second exmple we use logicl formuls. Exmple 3.4. () We continue Exmple 3.2. Inner nodes cn now hve n ritrry numer of children. Agin, we define n utomton ccepting exctly the circuits evluting to. Define B =(Q, Σ, δ, F) with Q = {0, }, F = {}, nd δ(0, 0) := δ(, ) := {ε}; δ(0, ) := δ(, 0) := ; δ(0, ) := (0+) 0(0 + ) ; δ(, ) := ; δ(0, ) := 0 ; δ(, ) := (0+) (0 + ). Intuitively, B works s follows: B ssigns 0 () to 0-leled (-leled) leves; B ssigns to - leled node iff ll its children re ; B ssigns 0 to -leled node iff ll its children re 0. Finlly, B ccepts when the root is leled with. In Figure 3, we give n exmple of tree nd n ccepting run. (2) Let p e the XPth expression ///[/]//. We construct n utomton ccepting precisely the trees mtching p. The set of sttes Q consists of ll the suptterns of p nd F = {///[/]//}. The trnsition function is defined in Figure 4. We use logicl formuls to denote regulr lnguges. For ll sttes q,...,q n Q the formul n i= q i denotes the set of strings contining ll the sttes q i (nd possily some others). If ϕ nd ϕ 2 re formuls, then ϕ ϕ 2 denotes the union of the set of strings defined y ϕ nd ϕ 2 ; true denotes the set of ll strings over Q. Clerly, these formuls cn only define regulr lnguges. Trnsitions tht re not mentioned re empty. The most intuitive wy to interpret the utomton is to red the rules in top-down wy. The utomton strts t the root in stte ///[/]//. A run strted s such cn only e vlid if the root is leled with nd one of the children mtches //[/]//. Further, -leled node cn only e in stte //[/]// if () it hs child tht mtches //[/]//; (2) there re two children mtching / nd //, respectively; or, (3) there is one child mtching ///. An-leled node cn only e in stte //[/]// if one of its children mtch the pttern //[/]//. The remining rules re selfexplntory. We give n exmple in Figure 5. 3.4 Reltionship with rnked utomt Unrnked trees cn e encoded into inry ones in severl wys. In Figure 6 we illustrte one such possiility. Intuitively, the first child of node remins the first child of tht node in the encoding. But it is explicitly encoded s left child. The other children re right descendnts of the first child in the encoding. Whenever there is right child ut no left child, # is inserted. Also, when there is only left child, # is inserted for the right child. By using the encodings enc nd dec of Figure 6 one otins the following proposition. Proposition 3.5. [34] For every unrnked NTA B there is tree utomton A over inry trees such tht L(A) = {enc(t) t L(B)}. For every tree utomton A over inry trees there is n unrnked NTA B such tht L(B) = {dec(t) t L(A)}. Although Proposition 3.5 provides tool for trnsferring results from rnked to unrnked trees, it does not del with issues which re specific for unrnked tree utomt. The complexity of decision prolems for NTAs, for instnce, depends on the formlism used to represent the regulr string lnguges δ(q, ) in the trnsition function. As there re mny wys to represent regulr string lnguges (logicl formuls, utomt with vrious forms of control, grmmrs, regulr expressions,... ), Proposition 3.5 does not offer immedite help. Let NTA(M) denotes the set of NTAs where the regulr lnguges δ(q, ) re represented y elements in the clss M (for instnce, the clss of NFAs). A closer inspection of enc nd dec revels tht the trnsltion etween inry nd unrnked tree utomt is polynomil for NTA(NFA) s. For this reson, the ltter clss cn e seen s the defult for unrnked tree utomt. Also the complexity of the memership prolem for this clss is trctle. 4

0 0 0 0 0 0 0 0 0 0 0 Figure 3: A tree nd n ccepting run of the utomton of Exmple 3.4(). δ(///[/]//,) := //[/]// δ(//[/]//,) := //[/]// (/ //) /// δ(//[/]//,) := //[/]// δ(///,) := // δ(//,) := true δ(//,) := // δ(/,) := true Figure 4: The utomton of Exmple 3.4(2) ccepting ///[//]//. ///[/]// //[/]// // //[/]// // / // Figure 5: A tree nd n ccepting run of the utomton of Exmple 3.4(2). enc dec # # # # # Figure 6: An unrnked tree nd its inry encoding. 5

Proposition 3.6. Let t T Σ nd B NTA(NFA). Testing whether t L(B) cn e done in time O( t B 2 ). However, when using tree utomt to otin upper ounds on the complexity of prolems relted to XML, one sometimes needs to turn to more expressive formlisms. In [5], n upper ound on the complexity of the typechecking prolem for structurl recursion is otined y reduction to the emptiness prolem of NTA(2AFA) s. Here, 2AFA re two-wy lternting string utomt. 3.5 Schems Like extended context-free grmmrs form strctions of DTDs, unrnked tree utomt re n strction of the vrious XML schem proposls. Definition 3.7. A DTD is tuple (d, s d ) where d is function tht mps Σ-symols to regulr expressions over Σ nd s d Σ is the strt symol. Exmple 3.8. As n exmple consider the following DTD (tken from [35]) descriing ctlog of products d(ctlog) := product d(product) := nme? (mfr-price + sle-price) color Here, w? denotes w + ε. The equivlent unrnked tree utomton is defined next: B = (Q, Σ, δ, F) with Q := {ctlog, product, nme, mfr-price, sle-price, color}, F := {ctlog}, for ll {nme, mfr-price, sle-price, color}, δ(, ) ={ε}, nd δ(ctlog, ctlog) := product δ(product, product) := nme? (mfr-price + sle-price) color The δ(q, ) tht re not mentioned re empty. It is not so hrd to see tht for every DTD there is n equivlent unrnked tree utomton. Moreover, the unrnked tree utomt re equivlent to the specilized DTDs of Ppkonstntinou nd Vinu[3] nd the XDuce types of Hosoy nd Pierce [0]. Lee, Mni, nd Murt provide provide comprison of XML schem lnguges sed on forml lnguge theory [3]. 4 Relted work We riefly discuss numer of pplictions of unrnked tree utomt or relted formlisms. We refer the interested reder to [26] for more detiled overview of pttern lnguges sed on tree utomt. Severl reserchers defined pttern lnguges for unrnked trees tht cn e implemented y unrnked tree utomt: Neumnn nd Seidl develop µ-clculus for expressing structurl nd contextul conditions on forests [2]. They show tht their formlism cn e implemented y push-down forest utomt. The ltter re specil cses of unrnked tree utomt. Murt defines n extension of pth expressions sed on regulr expressions over unrnked trees [20]. Brüggemnn-Klein nd Wood consider cterpillr expressions [4]. These re regulr expressions tht in ddition to lels cn specify movement through the tree. Neven nd Schwentick define gurded frgment ETL of mondic second-order logic (MSO) whose comined complexity is much more trctle thn tht of generl MSO [32, 24]. Expressiveness nd complexity results on ETL re prtly otined vi techniques sed on unrnked tree utomt. Neven nd Schwentick define query utomt [27]. These re two-wy deterministic unrnked tree utomt tht cn select nodes in the tree. Query utomt correspond exctly to the unry queries definle in mondic second-order logic. By result of Gottlo nd Koch they lso correspond to the unry queries definle in mondic dtlog [9]. In [22], n extension of the Boolen ttriute grmmrs considered in [29] to unrnked trees is defined. These lso express precisely the unry queries in MSO. A trnsltion of the region lger, considered y Consens nd Milo [5], into these ttriute grmmrs drsticlly improves the complexity of the optimiztion prolems of the former. A forest is conctention of unrnked trees. 6

5 Discussion We reclled the definition of unrnked tree utomt nd provided some exmples of pplictions in the context of XML. In ddition to tree utomt, some other formlisms regined ttention in the re of dtses: Tree-wlking. The tree-wlking prdigm dtes ck from the erly reserch on compilers nd ttriute grmmrs [, 6]. Tree-wlking utomt re still considered in forml lnguge theory s the connection with tree utomt is still unknown [7, 8, 25]. In the context of XML, the tree-wlking prdigm ttrcted ttention s n strction of XML query lnguges [2, 7, 23] nd streming [33]. Infinite lphets. The frmework considered in this pper is limited in two wys. It ssumes tht the element nmes of XML documents re from finite nd known set nd it ignores the dt vlues in the lef nodes nd ttriutes of XML documents. For this reson, the work of Kminski nd Frncez [] on utomt on infinite lphets hs een reexmined from n XML perspective [28, 23]. We mention tht Miklu nd Suciu otined trnsltion of XPth expressions to rnked tree utomt through n involved simultion [6]. The trnsltion shows how the different XPth lnguge constructs prmeterize the complexity of the XPth continment prolem. Although direct trnsltion of tht XPth frgment to unrnked utomt is immedite, it is not cler t the moment whether there is n esy trnsltion to unrnked tree utomt which gives the sme prmeterized results for continment. The min prolem is the filter predicte s ech predicte introduces conjunction. Acknowledgment The uthor thnks Dn Suciu, Leonid Likin, Jn Vn den Bussche, Wim Mrtens, nd Stijn Vnsummeren for comments on n erlier version of this pper. References [] A. V. Aho nd J. D. Ullmn. Trnsltions on contextfree grmmr. Inform. nd Control, 9:439 475, 97. [2] G. J. Bex, S. Mneth, nd F. Neven. A forml model for n expressive frgment of XSLT. Informtion Systems, 27():2 39, 2002. [3] A. Brüggemnn-Klein, M. Murt, nd D. Wood. Regulr tree nd regulr hedge lnguges over unrnked lphets: Version, pril 3, 200. Technicl Report HKUST- TCSC-200-0, The Hongkong University of Science nd Technology, 200. [4] A. Brüggemnn-Klein nd D. Wood. Cterpillrs: A context specifiction technique. Mrkup Lnguges, 2():8 06, 2000. [5] M. Consens nd T. Milo. Algers for querying text regions: Expressive power nd optimiztion. Journl of Computer nd System Sciences, 3:272 288, 998. [6] P. Dernsrt, M. Jourdn, nd B. Lorho. Attriute Grmmrs: Definition, Systems nd Biliogrphy, volume 323 of Lecture Notes in Computer Science. Springer, 988. [7] J. Engelfriet nd H. J. Hoogeoom. Tree-wlking pele utomt. In J. Krhumki, H. Murer, G. Pun, nd G.Rozenerg, editors, Jewels re forever, contriutions to Theoreticl Computer Science in honor of Arto Slom, pges 72 83. Springer-Verlg, 999. [8] J. Engelfriet, H.J. Hoogeoom, nd J.-P. vn Best. Trips on trees. Act Cyernetic, 4:5 64, 999. [9] G. Gottlo nd C. Koch. Mondic dtlog nd the expresive power of lnguges for we informtion extrction. In Proc. 2th Symposium on Principles of Dtse Systems (PODS 2002), pges 7 28. ACM Press, 2002. [0] H. Hosoy nd B. C. Pierce. Regulr expression pttern mtching for XML. In Proceedings of 28th Symposium on Principles of Progrmming Lnguges (POPL 200), pges 67 80. ACM Press, 200. [] M. Kminski nd N. Frncez. Finite-memory utomt. Theoreticl Computer Science, 34(2):329 363, 994. [2] N. Klrlund, A. Moller, nd M. I. Schwrtzch. The DSD schem lnguge. In Proceedings of the 3th ACM SIGSOFT Workshop on Forml Methods in Softwre Prctice (FMSP 2000), 2000. [3] D. Lee, M. Mni, nd M. Murt. Resoning out XML schem lnguges using forml lnguge theor. Technicl report, IBM Almden Reserch Center, 2000. Log# 9507. [4] S. Mneth nd F. Neven. Structured document trnsformtions sed on XSL. In R. Connor nd A. Mendelzon, editors, Reserch Issues in Structured nd Semistructured Dtse Progrmming (DBPL 99), volume 949 of Lecture Notes in Computer Science, pges 79 96. Springer, 2000. 7

[5] W. Mrtens nd F. Neven. Typechecking of top-down uniform unrnked tree trnsducers. Mnuscript. [6] G. Miklu nd D. Suciu. Continment nd equivlence for n XPth frgment. In Proc. 2th Symposium on Principles of Dtse Systems (PODS 2002), pges 65 76, 2002. [7] T. Milo, D. Suciu, nd V. Vinu. Type checking for XML trnsformers. In Proceedings of the Nineteenth ACM Symposium on Principles of Dtse Systems, pges 22. ACM Press, 2000. [8] M. Murt. Relx. http://www.xml.gr.jp/relx/. [9] M. Murt. Dt model for document trnsformtion nd ssemly. In E. V. Munson, K. Nichols, nd D. Wood, editors, Proceedings of the workshop on Principles of Digitl Document Processing, volume 48 of Lecture Notes in Computer Science, pges 40 52, 998. [20] M. Murt. Extended pth expressions for xml. In Proc. 20th Symposium on Principles of Dtse Systems (PODS 200), pges 26 37. ACM Press, 200. [2] A. Neumnn nd H. Seidl. Locting mtches of tree ptterns in forests. In V. Arvind nd R. Rmnujm, editors, Foundtions of Softwre Technology nd Theoreticl Computer Science, Lecture Notes in Computer Science, pges 34 45. Springer, 998. [22] F. Neven. Extensions of ttriute grmmrs for structured document queries. In R. Connor nd A. Mendelzon, editors, Reserch Issues in Structured nd Semistructured Dtse Progrmming (DBPL 99), volume 949 of Lecture Notes in Computer Science, pges 97 4. Springer, 2000. [23] F. Neven. On the power of wlking for querying treestructured dt. In Proc. 2th Symposium on Principles of Dtse Systems (PODS 2002), pges 77 84. ACM Press, 2002. [24] F. Neven nd T. Schwentick. Expressive nd efficient pttern lnguges for tree-structured dt. In Proc. 9th Symposium on Principles of Dtse Systems (PODS 2000), pges 45 56, 2000. [25] F. Neven nd T. Schwentick. On the power of treewlking utomt. In U. Montnri, J. D. P. Rolim, nd E. Welzl, editors, Interntionl Colloquium on Automt, Lnguges nd Progrmming (ICALP 2000), volume 853 of Lecture Notes in Computer Science, pges 547 560. Springer, 2000. [26] F. Neven nd T. Schwentick. Automt- nd logic-sed pttern lnguges for tree-structured dt. Unpulished, 200. [27] F. Neven nd T. Schwentick. Query utomt on finite trees. Theoreticl Computer Science, 275:633 674, 2002. [28] F. Neven, T. Schwentick, nd V. Vinu. Towrds regulr lnguges over infinite lphets. In J. Sgll, A. Pultr, nd P. Kolmn, editors, Mthemticl Foundtions of Computer Science (MFCS 200), volume 236 of Lecture Notes in Computer Science, pges 560 572. Springer, 200. [29] F. Neven nd J. Vn den Bussche. Expressiveness of structured document query lnguges sed on ttriute grmmrs. Journl of the ACM, 49(), 2002. [30] C. Pir nd A. Quere. Définition et etude des ilngges réguliers. Informtion nd Control, 3(6):565 593, 968. [3] Y. Ppkonstntinou nd V. Vinu. DTD inference for views of XML dt. In Proc. 20th Symposium on Principles of Dtse Systems (PODS 200), pges 35 46. ACM Press, 200. [32] T. Schwentick. On diving in trees. In Proceedings of 25th Mthemticl Foundtions of Computer Science (MFCS 2000), pges 660 669, 2000. [33] L. Segoufin nd V. Vinu. Vlidting streming XML documents. In Proc. 2th Symposium on Principles of Dtse Systems (PODS 2002), pges 53 64. ACM Press, 2002. [34] D. Suciu. Typechecking for semistructured dt. In Proceedings of the 8th Workshop on Dt Bses nd Progrmming Lnguges (DBPL 200), 200. [35] D. Suciu. The XML typechecking prolem. SIGMOD Record, 3():89 96, 2002. [36] M. Tkhshi. Generliztions of regulr sets nd their ppliction to study of context-free lnguges. Informtion nd Control, 27(): 36, 975. [37] M. Y. Vrdi. Automt theory for dtse theoreticins. In Proceedings of the Eighth ACM Symposium on Principles of Dtse Systems, pges 83 92. ACM Press, 989. [38] V. Vinu. A we odyssey: From Codd to XML. In Proc. 20th Symposium on Principles of Dtse Systems (PODS 200), pges 5, 200. 8