A straightforward idea is to explicitly state even - odd <strong>and</strong> odd - even cases, that is,redefine e 5 1 as e5 1,e | e5 1,o , wheree 5 1,e = ⋃ a∈Γ∆ ∗ ·x 1···x n ·a·&·(∆\{% even ,% odd }) ∗ ·% even·# odd ·((0|1) n ·(Γ∪(Γ×Q))·& )∗ ·x 1···x n ·((Γ\{a})∪((Γ\{a})×Q) )·∆ ∗e 5 1,o = ⋃ a∈Γ∆ ∗ ·y 1···y n ·a·&·(∆\{% even ,% odd }) ∗ ·% odd·# even ·((0|1) n ·(Γ∪(Γ×Q))·& )∗ ·y 1···y n ·((Γ\{a})∪((Γ\{a})×Q) )·∆ ∗The problem is that these expressions are not simple: they reuse the variables x 1 ,...,x nor y 1 ,...,y n . The solution is instead a bit more technical. We redefine e 5 1 as e6 1,e | e6 1,o , where:e 6 1,e = ⋃ a∈Γ∆ ∗ # even ·(∆\{% even }) ∗·(x 1···x n ·( (a·&·(∆\{%even }) ∗ ·% even ·# odd (∆\{% odd }) ∗ ·& ) |(((Γ\{a})∪((Γ\{a})×Q))·(∆\{%odd ,# even ,% even }) ∗))) ∗·% odd ·∆ ∗e 6 1,o = ⋃ a∈Γ∆ ∗ # odd ·(∆\{% odd }) ∗·(y 1···y n( (a·&·(∆\{%odd }) ∗ ·% odd ·# even (∆\{# even }) ∗ ·& ) |(((Γ\{a})∪((Γ\{a})×Q))·(∆\{%even ,# odd ,% odd }) ∗))) ∗·% even ·∆ ∗Notice then that e 6 1,e | e 6 1,o is a simple parameterized regular expression. In order to seethat the intended meaning of these expressions remains the same, notice that L ✸ (e 5 1,e ) ⊆L ✸ (e 6 1,e) <strong>and</strong> L ✸ (e 5 1,o) ⊆ L ✸ (e 6 1,o). Moreover, it is not difficult to check that none of thewords that belong to L ✸ (e 6 1,e ) but not to L ✸(e 5 1,e ) represent a valid run of M, <strong>and</strong> neitherdoes anyword inL ✸ (e 6 1,o ) but not inL ✸(e 5 1,o ). Thus, thewords in L ✸(e 6 1,e ) but not inL ✸(e 5 1,e )(respectively, in L ✸ (e 6 1,o) but not in L ✸ (e 5 1,o)) are not harmful for our purposes, since theseextra words already belong to the language of some other disjunction in e M,ā .With these observations, it is not difficult to modify the remainder of the reduction ofthe proof of Theorem 6 so that every expression is simple. The proof then follows along thesame lines as the proof of Theorem 6.✷32
4.4. ContainmentRecall that the Containment problem asks, given parameterized regular expressions e 1<strong>and</strong>e 2 , whether L ✷ (e 1 ) ⊆ L ✷ (e 2 ) or L ✸ (e 1 ) ⊆ L ✸ (e 2 ) holds. The bounds for thecontainmentproblem are easily obtained from the fact that both nonemptiness <strong>and</strong> universality can becast as its versions. That is, we have:Theorem 8. Both Containment ✷ <strong>and</strong> Containment ✸ are Expspace-complete.Proof: SinceΣ ∗ ⊆ L ✸ (e)iffUniversality ✸ (e)istrue,<strong>and</strong>L ✷ (e) ⊆ ∅iffNonemptiness ✷ (e)is false, we get Expspace-hardness for both containment problems. To check whetherL ✷ (e 1 ) ⊆ L ✷ (e 2 ), we must check that ⋂ ν L(ν(e 1)) ∩L(ν ′ (e 2 )) = ∅ for each valuation ν ′ one 2 . This is doable in Expspace, since one can construct exponentially many automata forL(ν(e 1 )) in Exptime, as well as the automaton for the complement L(ν ′ (e 2 )), <strong>and</strong> checkingnonemptiness of the intersection of those is done in polynomial space in terms of their size,i.e., in Expspace. Since this needs to be done for exponentially many valuations ν ′ , theoverall Expspace bound follows. The proof for the L ✸ semantics is almost identical.Containment with one fixed expression We look at two variations of the containmentproblem, when one of the expressions is fixed: Containment ∗ (e 1 ,·) asks, for a parameterizedregular expression e 2 , whether L ∗ (e 1 ) ⊆ L ∗ (e 2 ); <strong>and</strong> Containment ∗ (·,e 2 ) is definedsimilarly. The reductions proving Theorem 8 show that Containment ✷ (·,e 2 ) <strong>and</strong>Containment ✸ (e 1 ,·) remain Expspace-complete. For the other two versions of the problem,the proposition below shows that the complexity is lowered by at least one exponential.Proposition 9.• Containment ✷ (e 1 ,·) is Pspace-complete.• Containment ✸ (·,e 2 ) is coNP-complete.Proof: (Part 1) It is well known that Containment ✷ (e 1 ,·) is Pspace-hard even forst<strong>and</strong>ard regular expressions. For the upper bound, let e ′ 1 be an expression such thatL(e ′ 1) = L ✷ (e 1 ). Since e 1 is fixed, the expression e ′ 1 can be computed in constant time.Then, it suffices to guess a valuation ν <strong>and</strong> a word w such that w ∈ L(e ′ 1 ), but w /∈ L(ν(e 2)),which can clearly be done in Pspace.(Part 2) We begin with the upper bound for the problem Containment ✸ (·,e 2 ). Assumethat the input is a parameterized regular expression e 1 over Σ, <strong>and</strong> that W ⊂ V isthe set of variables mentioned in e 1 . The following coNP algorithm solves the problemContainment ✸ (·,e 2 ). First, construct a DFA A e2 such that L(A e2 ) = L ✸ (e 2 ), <strong>and</strong> thenconstruct A C e 2, the DFA that accepts the complement of L(A e2 ). Since e 2 is fixed, A C e 2canbe constructed in constant time. Next, guess a valuation ν : W → Σ, <strong>and</strong>, from ν(e 1 ),construct the NFA A ν(e1 ) that accepts L(ν(e 1 )). It is well-known that this automaton canbe constructed in polynomial time from ν(e 1 ). Finally, check that A ν(e1 ) ∩A C e 2 ≠ ∅, whichcan be performed in polynomial time using a st<strong>and</strong>ard reachability test over the productof A ν(e1 ) <strong>and</strong> A C e 2. It is not hard to see that this algorithm is sound <strong>and</strong> complete for the33
- Page 1 and 2: Parameterized Regular Expressions a
- Page 3 and 4: sequence prediction for dynamic mem
- Page 5 and 6: set of variables in V, can of cours
- Page 7 and 8: Lemma 2. Given a set e 1 ,...,e k o
- Page 9 and 10: code an accepting run τ for M on i
- Page 11 and 12: polynomial number of regular expres
- Page 13 and 14: polynomial with respect to E (Mn,1
- Page 15 and 16: • The case where for some 1 ≤ k
- Page 17 and 18: a different variable x i ∈ V. We
- Page 19 and 20: time with respect to the size of A
- Page 21 and 22: Next we show that ϕ is satisfiable
- Page 23 and 24: 3. For each word w ∈ Σ ∗ , the
- Page 25 and 26: Next we show that there is an imple
- Page 27 and 28: Finally, it suffices to perform a r
- Page 29 and 30: that the sequence of configurations
- Page 31: e 5 6 =⋃(a,q) | δ(q,a)=(q ′ ,a
- Page 35 and 36: Again, we shall denote this word al
- Page 37 and 38: Given a collection S of words over
- Page 39 and 40: • its size is at most exponential
- Page 41 and 42: states from A e . One reads words o
- Page 43: [20] W. Gelade, F. Neven, Succinctn