The Complexity of Tree Transducer Output Languages FSTTCS 2008, Bengaluru The Univ. of Tokyo Kazuhiro Inaba NICTA, and UNSW Sebastian Maneth.

Slides:



Advertisements
Similar presentations
1 Expressive Power of Safe HORS Examined Through Decomposition of Higher Order Programs to Garbage Free 1 st Order Form Kazuhiro Inaba Joint work with.
Advertisements

Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Complexity Classes: P and NP
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
Formal Language, chapter 9, slide 1Copyright © 2007 by Adam Webber Chapter Nine: Advanced Topics in Regular Languages.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture5: Context Free Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Analysis of Algorithms CS 477/677
Linear Bounded Automata LBAs
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Chapter 11: Limitations of Algorithmic Power
Normal forms for Context-Free Grammars
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Non-Deterministic Space is Closed Under Complementation Neil Immerman Richard Szelepcsenyi Presented By: Subhajit Dasgupta.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
THE COMPLEXITY OF TRANSLATION MEMBERSHIP FOR MACRO TREE TRANSDUCERS Kazuhiro Inaba (The University of Tokyo) Sebastian Maneth (NICTA & University of New.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
1 Decompositions of Higher-Order Grammars to First-Order Transducers Kazuhiro Inaba.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Higher-Order Tree Transducers and Their Expressive Power Kazuhiro Inaba at Dagstuhl Seminar, May 2013.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1 Security through complexity Ana Nora Sovarel. 2 Projects Please fill one slot on the signup sheet. One meeting for each group. All members must agree.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
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.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Multi-Return Macro Tree Transducers Kazuhiro Inaba Haruo Hosoya University of Tokyo PLAN-X 2008, San Francisco.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Finite-State Machines (FSM) Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth Rosen.
The Complexity of Translation Membership for Macro Tree Transducers
CSCI 2670 Introduction to Theory of Computing
Part VI NP-Hardness.
Linear Bounded Automata LBAs
Automata, Grammars and Languages
Other Models of Computation
Computational Complexity
Time Complexity We use a multitape Turing machine
Decidability continued….
Theory of Computability
Presentation transcript:

The Complexity of Tree Transducer Output Languages FSTTCS 2008, Bengaluru The Univ. of Tokyo Kazuhiro Inaba NICTA, and UNSW Sebastian Maneth

“Complexity of Output Languages” Given…  A language L ⊆ T Σ (Trees over Σ)  A relation (nondeterministic translation) τ ⊆ T Σ ×T Δ (from T Σ to T Δ ) What is the complexity of the language τ(L) ⊆ T Δ ? (i.e., for t ∈ T Δ, how is it computationally hard to determine whether t ∈ τ(L) or not?)

Classic Results τ: Program of Turing-Machine  Undecidable L : Regular String Language τ: Nondeterministic Finite State Transduction  τ(L) is regular!  The membership of τ(L) is solved in O(n) time, O(1) space  Corollary: for τ ∈ Finitely Many Compositions of Nondeterministic FST, τ(L) is regular

Trees? L : Regular Tree Language τ: Finitely Compositions of Nondet. Finite-State Tree Transducers  Beyond Regular Tree Language (Intuitively…) Due to Copying  τ(t) → x(t, t) is an instance of FSTT  In DSPACE(n) [Baker1978] i.e., Deterministic Context-Sensitive

Recent Result [Maneth2002, FSTTCS] L : Regular Tree Language τ: Finite Compositions of Total Deterministic Macro Tree Transducers  == Tree Transducers extended with “accumulating parameters” for each state  In DSPACE(n) Still, Deterministic Context-Sensitive

Today’s Target! L : Regular Tree Language τ: Finite Compositions of Nondeterministic Macro Tree Transducer  Is it still context-senstive? – Yes. NSPACE(n)  What about the time complexity? – NP-complete

Outline What is/Why Macro Tree Transducers? Review of the Proof for Deterministic Case “Garbage-free” Lemma “Translation Membership” Problem Summary

Macro Tree Transducer (MTT) Q : Finite Set of States q0: Initial State Σ : Input Alphabet Δ : Output Alphabet R : Set of Rewrite Rules of form: ( y 1,…, y m )  r where r ::= δ(r, …, r) | (r, …, r) | y j

Example of an MTT ()  f( ( a(e) ), () ) ()  f( ( b(e) ), () ) (y)  ( a(y) ) ) (y)  ( b(y) ) ) (y)  y ()  a( () ) ()  b( () ) ()  e a b b e b a a e a b b e f () → f( (a(e)), () ) → f( (a(a(e)), () ) → f( (a(a(a(e))), () ) → …

(Choice of Semantics) Functional Programming + Laziness + Nondeterminism We take the Runtime-Choice Semantics:   0 | 1  (y)  c(y, y)  ( () )  * { c(0,0), c(0,1), c(1,0), c(1,1) } Because of its composability: MTT ; LT ⊆ MTT

MTT*(REGT) = PTT*(REGT) = ATT*(REGT) = … DtMTT*(REGT) T*(REGT) Regular IO-Hierarchy Context Free OI-Hierarchy MSOTT*(REGT)

Review: DSPACE(n) Membership for Det. MTTs Given a (fixed) pair of  Input regular language L and  Composition sequenceτ 1 ; … ; τ n of total deterministic mtts and a tree t, How can we test t ∈ (τ 1 ; … ; τ n )(L) in linear space wrt |t|?

Review: DSPACE(n) Membership for Det. MTTs Guess the input s ∈ L Calculate (τ 1 ; … ; τ n )(s) If (τ 1 ; … ; τ n )(s) = t, then t is in the output language! Otherwise, try another input tree s Is this a possible output from τ 1 ; … ; τ n ? τ1τ1 τ2τ2 τnτn t s Guess an input: s s1s1 Compute s 1 :=τ 1 (s) s2s2 Compute s 2 :=τ 2 (s) S n-1 Compute s n-1 snsn Compute s n =?=?

Review: DSPACE(n) Membership for Det. MTTs In order to carry out the algorithm in DSPACE(|t|) …  The sizes |s|, |s 1 |, |s 2 |, …, |s n | must be linearly bounded by |t| i.e., there must be a constant c independent from t s.t. |s| ≦ c|t|  Each step τ of the computation must be done in linear space The translation must have ‘no garbage’! τ1τ1 τ2τ2 τnτn t s s1s1 s2s2 S n-1 snsn =?=?

Review: DSPACE(n) Membership for Det. MTTs ‘Garbage-Free’ Lemma  For any input language L and mttsτ1, …, τn, there exists L’ and τ’1, …, τ’n such that (τ 1 ;…;τ n )(L) == (τ’ 1 ;…;τ’ n )(L’) and every τ’ i is ‘non-deleting’ ( |in| ≦ 2|out| ) Linear Time (and Space) Computation  For any total deterministic mtt τand a tree s, τ(s) can be computed in time O( |s| + |τ(s)| ) (already known as a folklore result)

NSPACE(n)/NP Output Membership for Nondeterministic MTTs Guess the input s ∈ L and all the intermediate trees s 1, …, s n-1 Check whether (s,s 1 ) ∈ τ 1, (s 1,s 2 ) ∈ τ 2, …, (s n-1, t) ∈ τ n If it is, then t is in the output language! Otherwise, try another s, s 2, …, s n-1 τ1τ1 τ2τ2 τnτn ts s1s1 s2s2 S n-1 ∈ ? ∈ ? ∈ ?

Key Lemmas ‘Garbage-Free’ Lemma—Nondet. Version NP/NSPACE(n) “Translation Membership” for a single mtt translation

Key Lemma (1): ‘Garbage-Free’ Lemma—Nondet. Version Basic Idea  “Factor out” the deletion  τ 1 ; τ 2 == τ 1 ; (D ;τ’ 2 ) == (τ 1 ; D) ; τ’ 2 == ρ 1 ; τ’ 2 Decompose τ 2 to ‘deleting part’ D and ‘nondeleting’ τ’ 2 Associativity Compose τ 1 with D

Three Types of Deletion “Erasure”  (y 1, y 2 )  y 1  No new output node is generated at this σ node. Only returning its parameter. “Input-Deletion”  ()  δ( () )  Discarding the “x 2 ” subtree! “Skipping”  ()  ()  Occurs only at monadic node. No new output is generated here. Just going down to its child node. Lemma: If no erasing, input-deleting, or skipping rule is used during the computation, then |in| ≦ 2|out|

Eliminating The Three Types of Deletion Achieved by heavily manipulating the rules  For details, please consult the paper One of the difficulties compared to the deterministic case: Inline-Expansion  (y)  y   c( ( (e)) ) (Assume we know that ‘b’’s child is always ‘a’)   c( ( e ) )

With Nondeterminism, Inline-Expansion is Not Easy ()  e ()  f ()  ( () ) (y)  c(y, y) ()  e ()  f ()  ( e ) ()  ( f ) (y)  c(y, y) Different Translation! () → ( () ) → c( (), () ) → c( e, f ) () → (e) → c( e, e ) or → (f) → c( f, f )

Solution: “MTT with Choice and Failure” We have extended MTTs with “inline” nondeterminism  Allows inline-expansion for free!  Actually, we prove the output language complexity for mtt-cfs ()  e ()  f ()  ( +(e, f) ) (y)  c(y, y) () → ( +(e,f) ) → c( +(e,f), +(e,f) ) → c( e, f )

Key Lemma (2): “Translation Membership” of single τ i Given a pair (s i-1, s i ) of trees, we can determine whether (s i-1, s i ) ∈ τ i in linear-space & polynomial time wrt |s i-1 |+|s i | in nondet. Turing machine Naively Applying the folklore deterministic computation takes O(|s i-1 |+ |τ(s i-1 )|) time/space  New Idea is Necessary

“Translation Membership” of single τ i Naively Applying the Linear Time Computation for Deterministic MTTs:  Fails.  It relied on the decompostion of an MTT into Linear MTTs (each input variable x i occurs at most once in each rule),  …and the fact that deterministic linear MTTs read each input node at most once,  …which allows to compress the output tree as a DAG for both saving space and sharing computations OK. Similar decomposition works also for Nondet. MTTs Bad. Nondet. Linear MTTs may read each node multiple times Need More Sophisticated Compression!

Example: Linear Nondet. MTT Reading Some Node Twice ()  ( () ) ()  e ()  f (y)  g(y, y)

Solution: Compression by Context-Free Tree Grammar The set all outputs τ i (s i-1 ) of an MTT can be represented by a CFTG of size proportional to |s i-1 | [MB04] τiτi S i-1 sisi τ i (s i-1 ) ∈ ? Navigation (up,1 st child, nextsibl) on the compressed representation is efficient for linear mtts

Summary Composition sequence τ 1 ; …; τ n of mtts can be converted to an equivalent ‘garbage-free’ composition Translation Membership of any mtt is in NP/NSPACE(n)  Altogether, the output language complexity of mtt-compositions is NP/NSPACE(n)  Corollary: OI-hierarchy, PTT*(REGT), ATT*(REGT), … is in NP/NSPACE(n) Current Status (Unpublished): NSPACE(n)  DSPACE(n)