multitape nfa: weak synchronization of the input heads · multitape nfa: weak synchronization of...

29
Motivation Previous Work Main Results An Open Problem Multitape NFA: Weak Synchronization of the Input Heads Ömer E ˘ gecio ˘ glu 1 , Oscar H. Ibarra 1 and Nicholas Tran 2 1 Department of Computer Science University of California at Santa Barbara {omer,ibarra}@cs.ucsb.edu 2 Department of Mathematics & Computer Science Santa Clara University [email protected] SOFSEM 2012 gecio ˘ glu, Ibarra & Tran Weakly Synchronized Multitape Automata

Upload: others

Post on 30-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Multitape NFA: Weak Synchronizationof the Input Heads

Ömer Egecioglu1, Oscar H. Ibarra1 and Nicholas Tran2

1Department of Computer ScienceUniversity of California at Santa Barbara

{omer,ibarra}@cs.ucsb.edu

2Department of Mathematics & Computer ScienceSanta Clara [email protected]

SOFSEM 2012

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 2: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Outline

1 Motivation

2 Previous Work

3 Main Results

4 An Open Problem

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 3: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Motivation & FA Models

String synchronization:

Vulnerability analysis (SQL Injection Attacks)

Verification

Reachability (Reachability Analysis of String Systems)

Finite Automata Models of String Systems:

Single-track DFA to represent individual strings [Xu et al.],[Shannon et al.]

Multi-track DFA to represent groups of strings [Yu et al.]

Multi-tape and multi-head FA/PDA to represent groups ofstrings [Ibarra et al.]

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 4: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

NFA, Stack and Counter Machines

NFA: Nondeterministic, one-way FA

PDA: Nondeterministic, one-way FA with a stack

CM: PDA where stack alphabet is unary

Reversal-bounded CM: the stack height function has abounded number of local maxima/minima

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 5: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Multitrack vs. Multitape Automata

Multitape automata are more expressive but haveTuring-complete decision problems.

Best of both worlds: expressiveness of multitape butdecidability of multitrack automata.

Naturally leads to synchronization/synchronizability:

Does a multitape automaton "behave" like a multitrackautomaton?

Can a multitape automaton be converted to an equivalentmultitrack automaton?

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 6: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Basic Model

2-tape NFA, input (a1a2a3a4a5a6a7$,b1b2b3b4b5$).

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 7: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Weak/Strong Synchronization & Synchronizability

Given an n-tape NFA M,M is strongly k-synchronized if no two heads, neither ofwhich is on $, are more than k cells apart for anycomputation (accepting or not).

M is weakly k-synchronized if for each accepted input tuplethere exists an accepting computation in which no twoheads, neither of which is on $, are more than k cells apart.

M is strongly/weakly synchronized if it is strongly/weaklyk-synchronized for some k .

M is strongly/weakly k-synchronizable if there is astrongly/weakly k-synchronized M ′ such thatL(M) = L(M ′).

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 8: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Strong Synchronization 6= Weak Synchronization

L = {(am$,bn$) | m,n > 0}.

M: 2-tape NFA. On input (am$,bn$), executes one of:1 M reads am$ on tape 1 until head 1 reaches $, and then

reads bn$ on tape 2 until head 2 reaches $, then accepts.2 M reads the symbols on the two tapes simultaneously until

one head reaches $. Then the other head scans theremaining symbols on its tape and accepts.

M is not strongly synchronized, but it is weakly synchronized(weakly 0-synchronized).

Strongly synchronized → weakly synchronized, but notconversely.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 9: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

A Strong Synchronization Result [DCFS11]

TheoremIt is decidable to determine, given an n-tape NFA M, whether itis strongly k-synchronized for some k. If this is the case, thesmallest such k can be found.

Recall:M is strongly k-synchronized if no two heads, neither of whichis on $, are more than k cells apart for any computation(accepting or not).

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 10: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Sample Strong Synchronization Results [DCFS11]

One-way 2-tape 2-counter DCM (for a fixed k):undecidable

One-way n-tape PDA + reversal-bounded counters (forsome k): decidable

Two-way 2-tape DFA (for some k): undecidable

Two-way n-tape NFA (for a fixed k): decidable

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 11: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Definitions: Bounded and Unary Inputs

DefinitionLet a1,a2, . . . ,ak be arbitrary symbols.

A string x is

unary if x ∈ a∗

1;

bounded if x ∈ a∗

1a∗

2 · · · a∗

k .

A tuple of strings (x1, . . . , xn) is

unary if each xi is unary;

bounded if each xi is bounded;

all-but-one bounded (ABO) if all xi except one is bounded.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 12: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Definitions: Semilinear sets

Definition

Linear set in Nk : Q = {v0 + t1v1 + · · · + tnvn | t1, . . . , tn ∈ N}.

v0 constant vector, v1, . . . , vn period vectors.

Semilinear set: Finite union of linear sets.

Properties:

Every finite subset of Nk is semilinear

Semilinear sets are closed under (finite) union,complementation and intersection

Disjointness, containment, and equivalence problems forsemilinear sets are decidable

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 13: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Definitions: Parikh mapping

Definition

Σ = {a1, . . . ,ak}, w ∈ Σ∗.|w |ai : the number of occurrences of ai in w .

Parikh image of a word: P(w) = (|w |a1 , . . . , |w |ak ) ∈ Nk

Parikh image of a language L: P(L) = {P(w) | w ∈ L} ⊆ Nk .

Properties:

The Parikh image of a language L accepted by a PDA is aneffectively computable semilinear set [Parikh].

The Parikh image of a language L accepted by a PDA with1-reversal counters is an effectively computable semilinearset [Ibarra].

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 14: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Weak Synchronization & Synchronizability Results

2-tape 2-ambiguous NFA is k-synchronized for a given k?

2-tape 2-ambiguous NFA has an equivalent 0-synchronized version?

unde

cida

ble

decidable

n-tape unambiguous NFA + reversal-bounded counters isk-synchronized for some k?

n-tape ABO NFA is k-synchronized for a given k?

2-tape unary NFA is k-synchronized for some k?

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 15: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Helpful Fact: 0-synchronization and Regularity

Definition

Let (x1, . . . , xn) be a tuple of strings. Define 〈x1, . . . , xn〉 to bean n-track string where the symbols of xi ’s are left-justified andthe shorter strings are right-filled with blanks (λ) to make alltracks the same length.

For a language L of n-tuples, 〈L〉 = {〈x〉 : x ∈ L}.

Lemma

Let L be a set of n-tuples. L is accepted by a weakly0-synchronized n-tape NFA iff 〈L〉 is regular.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 16: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Proof Sketch of an Undecidability Result

TheoremIt is undecidable to determine whether a 2-tape NFA M is0-synchronized.

ProofBy reduction from the Post Correspondence Problem: given aPCP instance I = (u1, . . . ,un); (v1, . . . , vn) we construct a2-tape NFA M to accept

L = {(xc i , yd j) : i , j > 0, x 6= y}∪{(xc i , xd j) : i , j > 0, j = 2i , x ∈ solution(I)}

such that M is weakly 0-synchronized iff I has no solutions.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 17: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Proof Sketch (cont.): A 2-tape NFA for L

L = {(xc i , yd j) : i , j > 0, x 6= y}∪{(xc i , xd j) : i , j > 0, j = 2i , x ∈ solution(I)}

Define a 2-tape NFA M as follows: on input w = (xc i , yd j), Mnondeterministically does one of the following:

M verifies that x 6= y by moving the two heads in0-synchrony from left to right until both heads reach theirendmarkers $ and noting that x and y differ at some point;

M guesses a sequence of indices i1, . . . , ik , and verifies(one index at a time) that x = ui1 · · · uik and y = vi1 · · · vikand that j = 2i .

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 18: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Proof Sketch (cont.)

L = {(xc i , yd j) : i , j > 0, x 6= y}∪{(xc i , xd j) : i , j > 0, j = 2i , x ∈ solution(I)}

If I has no solutions, the second part is empty and hence 〈L〉 isregular.

If I has a solution, then L contains a string w = (xc i , xd2i) forsome x and i . If 〈L〉 is regular, pump w to obtain〈xc i+k , xd2i+k〉 /∈ 〈L〉 for some k , a contradiction.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 19: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

A General Undecidability Result

Theorem

The following problems are undecidable, given a 2-tape (andhence multitape) NFA M:

1 Is M weakly k-synchronized for a given k?2 Is M weakly k-synchronized for some k?3 Is there a 2-tape (multitape) NFA M ′ that is weakly

0-synchronized (or weakly k-synchronized for a given k, orweakly k-synchronized for some k) such thatL(M ′) = L(M)?

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 20: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

An Undecidability Result for 2-ambiguous NFA

Theorem

The following problems are undecidable, given a 2-ambiguous2-tape (and hence multitape) NFA M:

1 Is M weakly k-synchronized for a given k?2 Is M weakly k-synchronized for some k?3 Is there a 2-tape (multitape) NFA M ′ that is weakly

0-synchronized (or weakly k-synchronized for a given k, orweakly k-synchronized for some k) such thatL(M ′) = L(M)?

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 21: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Some Decidability Results: ABO and Unary Cases

Theorem

It is decidable to determine, given a 3-tape ABO NFA M and anonnegative integer k, whether M is weakly k-synchronized.

Unary case: input is of the form (an$,bm$).

Theorem

Suppose M is a unary 2-tape NFA. Then it is decidable whetheror not M is weakly synchronized.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 22: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Unary Case

Transitions of M → letters from Σ = {a,b, $} → NFA M ′.Computation paths of M → words over Σ. Any acceptingcomputation path w for input (an$,bm$) has P(w) = (n,m).

There are two types of accepting computations:1 w = x$y$ with x ∈ {a,b}∗ and y ∈ {b}∗,2 w = x$y$ with x ∈ {a,b}∗ and y ∈ {a}∗.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 23: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Unary Case (cond.)

Whether M is weakly k-synchronized is equivalent to showingthat for any given word w ∈ L(M ′), there is a stronglyk-synchronized word u such that either

ubj ∈ L(M ′) and P(w) = P(u) + (0, j), oruai ∈ L(M ′) and P(w) = P(u) + (i ,0).

Segueway to regular languages.Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 24: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Synchronization and Regular Languages

Definition

w ∈ Σ∗ is strongly k-synchronized if for any factorization x = uv

−k ≤ |u|a − |u|b ≤ k .

A language L over Σ is:

Strongly k-synchronized if all of its words are stronglyk-synchronized.

Strongly synchronized if it is strongly k-synchronized for somek .

Weakly k-synchronized if for every w ∈ L, there is a w ′ ∈ Lsuch that P(w ′) = P(w) and w ′ is strongly k-synchronized.

Weakly synchronized if it is weakly k-synchronized for some k .

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 25: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Balanced Cycles and Periods

Balanced cycles of length 4:

For a linear set

{(a0,b0) + k1(a1,b1) + · · ·+ ks(as,bs) | k1, k2, . . . , ks ≥ 0},

that appears in P(L), a period (ai ,bi), i > 0 is balanced ifai = bi .

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 26: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Synchronization and Regular Languages

Theorem

For a regular language L over Σ = {a,b}, the following areequivalent:

1 L is strongly synchronized2 L is weakly synchronized3 The minimum state DFA for L has no unbalanced simple

cycles4 The Parikh image P(L) has no unbalanced periods

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 27: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

In Closing

An easy to state open problem on weak synchronization ofmultitape NFA.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 28: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

An Open Decidability Problem

ProblemIs it decidable to determine, given a 2-tape NFA whose tapesare over bounded languages, whether it is weaklyk-synchronized for some k?

Note:

We only know this (in the positive) for the bounded unarycase.

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata

Page 29: Multitape NFA: Weak Synchronization of the Input Heads · Multitape NFA: Weak Synchronization of the Input Heads Ömer Egecio˘ glu˘ 1, Oscar H. Ibarra and Nicholas Tran2 1Department

MotivationPrevious Work

Main ResultsAn Open Problem

Sample Strong Synchronization Results [DCFS11]

One-way 2-tape 2-counter DCM (for a fixed k):undecidableOne-way n-tape PDA + reversal-bounded counters (forsome k): decidable

One-way 2-head DFA (for some k): undecidableOne-way n-head PDA + reversal-bounded counters (for afixed k): decidable

Two-way 2-tape DFA (for some k): undecidableTwo-way n-tape NFA (for a fixed k): decidable

Two-way 2-head DCM (for a fixed k): undecidableTwo-way n-head NFA (for a fixed k): decidableTwo-way 2-head reversal-bounded DCM (for a fixed k):decidable

Egecioglu, Ibarra & Tran Weakly Synchronized Multitape Automata