13.07.2015 Views

Parameterized Regular Expressions and Their Languages

Parameterized Regular Expressions and Their Languages

Parameterized Regular Expressions and Their Languages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

espect to the original expression e ′ (the number of possible valuations for e ′ is |Σ| |W| , whereW is the set of variables in e ′ ), the above procedure runs in Expspace.For the lower bound we present a reduction from the complement of the acceptanceproblem of a Turing machine. Let L be a language that belongs to Expspace, <strong>and</strong> let M bea Turing machine that decides L in Expspace. Given an input ā we construct in polynomialtime with respect to M <strong>and</strong> ā a parameterized regular expression e M,ā over some alphabet∆ such that L ✸ (e M,ā ) consists of all the strings over ∆ if <strong>and</strong> only if M does not acceptinput ā.Just as in section 4.1, we assume that M = (Q,Γ,q 0 ,{q m },δ), where Q = {q 0 ,...,q m }is the set of states, Γ is the tape alphabet (that contains the distinguished blank symbol B),the initial state is q 0 , q m is the unique final state, <strong>and</strong> δ : (Q\{q m })×Γ → Q×Γ×{L,R} isthe transition function. Notice that we assume without loss of generality that no transitionis defined on the final state q m . Since M decides L in Expspace, there is a polynomial S()such that, for every input ā over Σ, M decides ā using space of order 2 S(|ā|) .Let ā = a 0 a 1···a k−1 ∈ Σ ∗ be an input for M (that is, each a i , 0 ≤ i ≤ k−1 is a symbolin Γ). For notational convenience we will assume from now on that S(|ā|) = n.We also find it convenient to introduce the following notation. For an alphabet Σ ={b 1 ,...,b p }ofsymbols, weabusenotation<strong>and</strong>denotebyΣtheregularexpression(b 1 | ··· |b p ).Thus, for example, assume that Γ = {b 1 ,...,b p }∪{B}. Then, when we write (Γ∪(Γ×Q))we represent the language given by (b 1 | ··· | b p | B | (b 1 ,q 0 ) | ··· | (B,q m )). Furthermore,we reuse the notation introduced in Section 4.1, <strong>and</strong> write the shorth<strong>and</strong> [i] to denote thebinary representation of the number i as a string of n characters (i.e., [0] corresponds to theword 0 n , <strong>and</strong> [2] corresponds to the word 0 n−2 10).Our parameterized expression e M,ā uses the alphabet ∆ = {0,1,#,&,%}∪Γ∪(Γ×Q).The idea of the reduction is as follows. Using ∆, we represent a configuration of M by wordsin ∆ ∗ of the form:#·[0]·(Γ∪(Γ×Q))·&·[1]·(Γ∪(Γ×Q))·&·[2]·(Γ∪(Γ×Q))·&.[2 n −1]·(Γ∪(Γ×Q))·&·% (3)Intuitively, the strings [0],[1],...,[2 n − 1] indicate each one of the 2 n cells of M, <strong>and</strong> thesymbol following these strings represents either the content of the cell, or the content ofthe cell plus the state of M, if M is pointing into that particular cell of the tape in theconfiguration that is being encoded.Since each word of the form (3) represents a configuration of M, we can represent a runof M on input ā as a sequence of concatenations of words of the form (3), as long as each oneof these configurations is consistent with the computation of M. The idea of the reductionis to construct a parameterized regular expression e M,ā that represent all words w in ∆ ∗ thatare either not valid concatenations of subwords of the form (3), or, in case that they are,28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!