Multi-Return Macro Tree Transducers Kazuhiro Inaba Haruo Hosoya University of Tokyo PLAN-X 2008, San Francisco.

Slides:



Advertisements
Similar presentations
Chapter 6 Languages: finite state machines
Advertisements

Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
IRP ∩ LSI is not RE presentation by Kazuhiro Inaba (NII, IPL-Group Seminar May 25, 2010 ( Introduction of the manuscript:
QuickSort Average Case Analysis An Incompressibility Approach Brendan Lucier August 2, 2005.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
Department of Computer Eng. & IT Amirkabir University of Technology (Tehran Polytechnic) Data Structures Lecturer: Abbas Sarraf Search.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Chapter 9 Turing Machine (TMs).
CSC 2300 Data Structures & Algorithms February 6, 2007 Chapter 4. Trees.
Streaming Tree Transducers Loris D'Antoni University of Pennsylvania Joint work with Rajeev Alur 1.
Induction and recursion
10.1 Adding and Subtracting Polynomials
Induction and recursion
Morphological Recognition We take each sub-lexicon of each stem class and we expand each arc (e.g. the reg-noun arc) with all the morphemes that make up.
Chapter 4 Polynomials TSWBAT determine if an expression is a monomial, binomial, or polynomial; determine the degree of a monomial or polynomial; add and.
THE COMPLEXITY OF TRANSLATION MEMBERSHIP FOR MACRO TREE TRANSDUCERS Kazuhiro Inaba (The University of Tokyo) Sebastian Maneth (NICTA & University of New.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
1 Chapter Elementary Notions and Notations.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Closure.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
CHAPTER 1 Regular Languages
Multi-Return Macro Tree Transducers The Univ. of Tokyo Kazuhiro Inaba The Univ. of Tokyo Haruo Hosoya NICTA, and UNSW Sebastian Maneth CIAA 2008, San Francisco.
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Recursive Definitions of Properties of Data Structures  Recursive.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
Tree Traversals, TreeSort 20 February Expression Tree Leaves are operands Interior nodes are operators A binary tree to represent (A - B) + C.
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Recursive Definitions of Properties of Data Structures  Recursive.
The Complexity of Tree Transducer Output Languages FSTTCS 2008, Bengaluru The Univ. of Tokyo Kazuhiro Inaba NICTA, and UNSW Sebastian Maneth.
Binary Search Trees (BST)
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
1 Proving Properties of Recursive Functions and Data Structures CS 270 Math Foundations of CS Jeremy Johnson.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
The Complexity of Translation Membership for Macro Tree Transducers
CSCI 2670 Introduction to Theory of Computing
Proving Properties of Recursive Functions and Data Structures
Context-Free Languages
Bottom-up parsing Pumping Theorem for CFLs
Recall last lecture and Nondeterministic TMs
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Finite-State Machines with No Output
CSCE 355 Foundations of Computation
Presentation transcript:

Multi-Return Macro Tree Transducers Kazuhiro Inaba Haruo Hosoya University of Tokyo PLAN-X 2008, San Francisco

Models of Tree Translation (Top-down) Tree Transducer (TOP) [Rounds/Thatcher, 70’s]  Finite set of relations from a tree to a tree  Defined by structural (mutual) recursion on the input tree → fst(, ) → leaf() → snd(, ) → leaf()

→ fst(, ) → leaf() → snd(, ) → leaf() bin leaf fst snd fst leaf

Models of Tree Translation Macro Tree Transducer (MTT) [Engelfriet/Vogler 85]  Tree Transducer + Accumulating parameters  Strictly more expressive than TOP (y) → bin( (1(y)), (2(y)) ) (y) → y

(y) → bin( (1(y)), (2(y)) ) (y) → y bin leaf bin leaf

Multi-Return Macro Tree Transducer [Our Work]  Macro Tree Transducer + Multiple return values (y) → let (z1,z2) = (1(y)) in let (z3,z4) = (2(y)) in (bin(z1,z3), fst(z2,z4)) (y) → (leaf(), y) (y) → let (z1,z2) = (1(y)) in let (z3,z4) = (2(y)) in (bin(z1,z3), snd(z2,z4)) (y) → (leaf(), y)

Outline Why Multi-Return? Definition of Multi-Return MTT Expressiveness of Multi-Return MTT  Deterministic case  Nondeterministic case

Why Multi-Return?

MTT is not symmetric  can pass multiple tree-fragments from a parent to the children via accumulation parameters → ( some(tree,here), other(tree,here) ) (y1,y2) → use( y1, and(y2), here )

Why Multi-Return? MTT is not symmetric  can not pass multiple tree-fragment from a child to the parent  Multi-Return MTT can: → can( use( ), here ) → one(tree) → let (z1,z2) = in can( use(z1), and(z2), here ) → (one(tree), two(tree))

Inefficiency caused by the lack of child-to- parent multiple tree passing Gather all subtrees with root node labeled “a” and all subtrees labeled “b” pair cons nil a a a b b cons nil

Normal MTT realizing this translation must traverse the input tree twice  For gathering “a” and gathering “b”  No way to pass two intermediate lists from child to parent! → pair( (nil()), (nil()) ) (y) → cons( a(x), (y) ) (y) → (y) … (y) → (y) (y) → cons( b(x), (y) )

Multi-Return MTT realizing this translation must traverse the input tree twice → let (z1,z2) = (nil(),nil()) in pair(z1, z2) (ya,yb) → let (z1,z2) = (ya,yb) in (cons(a(x),ya), yb) (ya,yb) → let (z1,z2) = (ya,yb) in (ya, cons(b(x),yb))

Definition of (Multi-Return) MTT

Macro Tree Transducer (MTT) A MTT is a tuple consisting of  Q : Set of states  q0 : Initial state  Σ : Set of input alphabet  Δ : Set of output alphabet  R : Set of rules of the following form: (y1, …, ym) → rhs rhs ::= δ(rhs, …, rhs) | ( rhs, …, rhs ) | yi

Macro Tree Transducer (MTT) A MTT is defined to be  Deterministic if for every pair of q ∈ Q, σ ∈ Σ, there exists at most one rule of the form (…) → …  Nondeterministic otherwise Call-by-Value (Inside-Out) Evaluation  Arguments are evaluated first, before function calls () → ( () ) (y)→ b(y, y) () → c() () → d() ⇒ b(c(),c()) or b(d(),d())

Multi-Return Macro Tree Transducer (mr-MTT) A mr-MTT is a tuple consisting of  Q : Set of states  q0 : Initial state  Σ : Set of input alphabet  Δ : Set of output alphabet  R : Set of rules of the following form: (y1, …, ym) → rhs rhs ::= (let (z1,..zn) = (t,…,t) in) * (t,…,t) t ::= δ(t,…,t) | yi | zi

Multi-Return Macro Tree Transducer (mr-MTT) A mr-MTT is defined to be  Deterministic if for every pair of q ∈ Q, σ ∈ Σ, there exists at most one rule of the form (…) → …  Nondeterministic otherwise Call-by-Value (Inside-Out) Evaluation  Arguments are evaluated first, before function calls

Expressiveness

Question Are multi-return MTTs more expressive than single-return MTTs? (Is there any translation that can be written in mr-MTT but not in MTT?)

Answer Deterministic mr-MTTs are equal in expressiveness to normal MTTs  In other words, every deterministic mr-MTT can be simulated by a normal MTT Nondeterministic mr-MTTs are strictly more expressive than normal MTTs

Proof Sketch (Deterministic Case) A state returning n-tuples of trees can be split into n states returning a single tree (…)→let (z1,z2) = in (a(z1,z2), b(z2,z1)) (…) → let z1 = in let z2 = in a(z1,z2) (…) → let z1 = in let z2 = in b(z2,z1) (…) → a(, ) (…) → b(, )

Nondeterministic case… State-splitting may change the behavior → let (z1,z2) = in bin(z1,z2) → (a(), a()) → (b(), b()) → bin(, ) → a() → b() bin aa bb aa bb ba ab

Nondeterministic case… In fact, there is no general way to simulate a nondeterministic mr-MTT in a normal MTT Example of such translation ⇒ “twist” Nondeterministically translates one input string sss…ss of length n to two string of the same length: - one consists of symbols a and b, and - the other consists of symbols A and B such that the outputs are being reversal of each other.

“twist” root s s z a a e A A E a b e B A E b a e A B E b b e B B E

“twist” in Multi-Return MTT → let (z1,z2) = ( E() ) in root(z1, z2) (y)→ let (z1,z2) = ( A(y) ) in (a(z1), z2) (y)→ let (z1,z2) = ( B(y) ) in (b(z1), z2) (y) → (e(), y)

How to prove the inexpressibility in MTT? Known proof techniques  Height Property  Size Property  Output Language  … … all fails here. → Long and involved proof specialized for the “twist” translation

Proof Sketch (Inexpressibility of “twist”) “Reductio ad absurdum” argument  First, suppose a MTT realizing twist  Then, we show that the size of the set of output from the MTT has polynomial upper bound w.r.t. the size of the input tree  which is not the case for “twist”, having exponential number of outputs

Rough Proof Sketch :: Step 0/5 Suppose a MTT M is realizing “twist”

Rough Proof Sketch :: Step 1/5 Lemma 4  If a term of M is evaluated to a proper subpart of an output, it MUST be evaluated to the term root (…) root B A a b e if

Rough Proof Sketch :: Step 2/5 Lemma 5  Any term of M generating only the output of “twist” is equivalent to a term if the following form: Example: wnf ::= (wnf, …, wnf) (always generates “root”) | ct ct ::= δ(ct, …, ct) ( (a(e), A(E)), (), ( (b(a(e), E)) )

Rough Proof Sketch :: Step 3/5 Lemma 7  Any term of M in the form of preceding slide is equivalent to a set of terms in the following form (“normal form” in the paper): nf ::= (st, …, st) st ::= a(st) | b(st) | e() | A(st) | B(st) | E()

Rough Proof Sketch :: Step 4/5 Lemma 8  Two normal form terms with the same head produces “similar” set of outputs – the number of different output trees are constant  Shown by a similar argument to the first lemma

Rough Proof Sketch :: Step 5/5 Lemma 10 / Cor 1  The MTT M can produce at most O( n 2 ) number of output trees, where n is the length of the input string  This is a contradiction, since M is supposed to realize “twist” The number of output trees from “twist” is 2 n

Conclusion

Multi-return MTT  MTT + Multiple Return Values Expressiveness  Deterministic: same as MTT  Nondeterministic: more powerful than MTT

Future/Ongoing Work Decomposition of mr-MTT  Is a mr-MTT can be simulated by a composition of multiple MTTs? Hierarchy of mr-MTT  The width of returned tuples affects the expressivenss? Application of the proof technique to other translations know “as a folklore” not to be expressible in MTT Thank you for listening!