Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "The Complexity of Tree Transducer Output Languages FSTTCS 2008, Bengaluru The Univ. of Tokyo Kazuhiro Inaba NICTA, and UNSW Sebastian Maneth."— Presentation transcript:

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

2 “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?)

3 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

4 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

5 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

6 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

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

8 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

9 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))), () ) → …

10 (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

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

12 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|?

13 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 =?=?

14 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 =?=?

15 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)

16 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 ∈ ? ∈ ? ∈ ?

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

18 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

19 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|

20 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 ) )

21 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 )

22 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 )

23 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

24 “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!

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

26 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

27 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)


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

Similar presentations


Ads by Google