21
Push Down Automata That Flip Their Stacks Presented By , Bhargavi Belathur Ramalingaiah

Push Down Automata That Flip Their Stacks Presented By, Bhargavi Belathur Ramalingaiah

Embed Size (px)

Citation preview

Push Down Automata That Flip

Their StacksPresented By ,

Bhargavi Belathur Ramalingaiah

Topics to be covered

Introduction Push Down Automata Formal Model/Definition A Hierarchy of Languages Conclusion

Introduction

A pushdown automata is a finite automata equipped with an auxiliary storage device in the form of stack.

An additional power to the automata by allowing it to flip stacks, it allows the automata to read and write at both ends of the stack-double ended queue.

De-queue can simulate two stacks and hence the computational model becomes equivalent to the Turing machine model.

Push Down Automata

It is like a NFA but has an extra component called stack.

Stack has an unlimited memory and restricted access.

Access to the stack, for both reading and writing, done only at the top (LIFO)

input

input

NFA PDA

Stack `

State contro

la a b b

X

Y

Z

..

State control

a a b b

PDA P with {WWR : W belongs to {0,1}*}, as per class note

Formal Model /Definition of Flip stack PDA:

The formal computational model is a flip stack pushdown automata(FPDA) defined as follows, The FPDA is defined by a six-tuple PDA P= (Q,

Σ,Γ,δ,q0,F)

Where , Q is a finite set of states,

Σ is a finite input alphabet,

Γ is a finite stack alphabet,

δ is the transition function (A Stack-flip function – ∆)

q0 is the initial state,

F is the set of final states. Such that – FPDA F= ( P,∆)

Flip stack Pushdown Automata

PDA Flip-PDA

a a b b

Stack contro

l

z

Y

X

W

..

Stack Control

a a b b

W

x

Y

z

Contd..

The word can be pushed or popped from both the ends when the stack is flipped.

The language can be accepted by FPDA

Language L={ww:w ∈ {0,1}*} is not a CFL.

Suppose, W = “100” and the stack is flipped once then it becomes double ended queue where we can push or pop from both the ends hence we can pop the word = “100” in a same order hence we can obtain the language “WW” through Flip stack pushdown automata.

Using FPDA, a hierarchy of languages is defined for k≥0,

where k=number of flips allowed: L(k)={ L:L=L( F(k)), for some FPDA F} and

for k unlimited number of flips: L(∝)={L:L = L( F), for some FPDA F)

A Hierarchy of Languages

Proposition 3.1

Prove the following:

1. L(0) ≡ CFL

2. L(∝) ≡ All recursively enumerable languages

1. It is clear that a stack that cannot be flipped is equivalent to the stack in a PDA.

2. Proving that the FPDA with infinite flips is equivalent to a Turing Machine is equivalent to proving part 2.

Contd..

PDA with 2-stacks ,then it can accept any language as Turing machines.

Input

S1 Stack S2

State control

Contd..

There is a discussion in the textbook of how a Turing Machine is equivalent to a two-stack PDA. Clearly, a two-stack PDA is equivalent to the FPDA F ,where for each movement of P, the machine F will require one stack reversal.

When all the inputs symbols are pushed onto stack S1,once the last symbol of w has been read.

Pop S1 and push the symbols one by one to S2(next state)

Once it’s done ,move onto next state and Pop S2 If all inputs are exhausted , input string is accepted.

Turing Machines

Turing machine can simulate k-flips PDA easily.

read-write head

infinite tape

TM has an infinite-input tape for both read write the elements wherein 2-stack PDA is just a special case of a 3-tape TM that uses it’s tapes restricted way.

TM is more flexible and accurate model ,which can do everything as a real computer do.

State control

A A B - - - …

Theorem 3.2

The language class (0) is properly contained in the language class (1).

Show that L ∈ L(1). In other words, that it can be described by a PDA that flips its stack once. When the stack is flipped once ,given string of the

form ww,the FPDA accepts it as proved in earlier slide. Thus

L ∈ L(1).

Contd..

L(1) proves that L={ww:w ∈ {0,1}*} accepted FPDA.

CFL= L(0) ⊆ L(1) ⊆ L(2) ⊆ ... L⊆ (∝)=r.e. (recursively enumerable)

It’s known that CFL=L(0) And also L(k) ⊆ L(k+1) wherein Languages which are in L(k+1) could not be in L(k) ,but L(k+1) consists of L(k) and also defines extra language.

How do we show that each language class in the hierarchy is non- empty?! For each k, define a language Lk as follows:

L0 = {x1x1r : x1 ∈ {0,1}*}, as proved earlier L1 = {x1x1 : x1 ∈ {0,1}*}, as proved earlier L2 = {x1x2x1x2r : x1, x2 ∈ {0,1}*} L3 = {x1x2x3x1x3x2r : x1, x2, x3 ∈ {0,1}*}

… L2t = {x1x2 …x2t x1x2tx2rx2t-1r… xtxt+1r : x ∈i {0,1}*}

(even) L2t+1 = {x1x2… x2t+1x1x2t+1rx2rx2tr…xt-1x2txt+1r : x

∈i {0,1}*} (odd)

Contd..

Each language class in the hierarchy is non empty as each levels will define the language for their levels.

Each level will define the previous levels and also with extra sync .

Suppose, if L(k) defines k then L(k+1) defines L(k) plus additional languages hence each levels in hierarchy is non empty .

Turing Machines RE

Conclusion

Stack with no flips is equivalent to machines that produce Context Free Languages.

Stack with infinite flips is equivalent to machines that produce recursively enumerable languages (Turing Machine).

A hierarchy of languages can be formed where the languages with no flips ( L(0)) is contained within languages with one flip, two flips, etc. ( L(1), L(2)... )

Reference

1.Pushdown automaton with the ability to flip it’s stack paper by Palash Sarkar :

http://eccc.hpi-web.de/report/2001/081/

2.Introduction to Automata Theory, Languages , and Computation by John E. Hopcroft ,Rajeev Motwani and Jeffrey D. Ullman.

3.Class notes

Thank You!