Questions tagged [pushdown-automaton]

A pushdown automaton (PDA) is a finite-state automaton with added stack based memory. It is a mathematical description of an algorithm for parsing context-free languages.

PDAs extend finite automata via a stack-based memory, and transitions can push/pop symbols to/from the stack. Deterministic PDAs (ones for which there exists only one legal transition at any time) are strictly weaker than non-deterministic ones; such is not the case for finite automata (PDAs are more powerful) or Turing machines (PDAs are weaker).

186 questions
1
vote
1 answer

How to use zero_copy with anchor in Solana PDAs

I'm building on Solana and need some PDAs to store my program state. The default with anchor is constantly serialize/deserialize the accounts, even when just passing the address into instructions, which crushes BPM's 4k stack limit REALLY soon for…
1
vote
1 answer

construct a PDA for the following language

I'm studying automata and I have this problem related to PDAs construct a PDA for the language L = { w = x1y1x2y2….xnyn | where w belongs to {0,1}*, and the string y1y2….yn is the same as x1x2….xn except the 1’s in y come after the 0’s} For example…
Ike
  • 13
  • 4
1
vote
1 answer

Push Down Automata Using Fixed States

I've been asked to find the PDA for the language L over the alphabet {a,b,c,d} where L={(a^p)(b^2p)(c^r)(d^s)| p,r,s > 0 AND r=s} I have solved it using 5 states but I must solve it using 6 states. Could anyone help me solve it? [1]:…
1
vote
0 answers

bounded PDA and context-free languages

How can we prove that: Class of linear bounded PDA languages ∼ Class of CFLs I know that for a linear bounded PDA there is a constant k such that the stack size for w is at most k|w|. I also read about PDA's and CFL's and know that pushdown…
1
vote
1 answer

How do I construct this pushdown automata following this rules

The rules are: It cant start by letter a. It cant finish by letter b. It must contain b=i a=2i. The alphabet is a,b. Ive tried do it empty the stack. But unfortunately I cant reach it. The input like this for example: bbaaaa its ok because for every…
1
vote
1 answer

What is the PDA for this grammar?

For the grammar given below obtain the corresponding PDA: S -> aABB | aAA A -> aBB | a B -> bBB | A C -> a I tried solving it but apparently it was incorrect . If anyone knows how to solve it help me out.
1
vote
1 answer

Is the given language a valid CFG?

Language, L = { a^n b^n a^n ; n=1,2,3,.. } I want to check whether the given language L is context free or not. CFG make use of PDA which uses stacks. So, first store each 'a' to the stack. Then pop twice for each occurrence of 'b'. Is this logic…
1
vote
1 answer

How do I get the context free grammar of this language?

With this language: L = {x^i, y^j, z^k : i != j ∨ j != k; i ≥ 0; j ≥ 0; k ≥ 0}, Σ = {x, y, z} How do I get the context-free grammar of this language?
1
vote
1 answer

can i push two symbols to the stack of a pushdown automata?

I would like to know if for a given pushdown automata, where the initial symbol or Z0 is y, can i stack two Xs when i read 'a' from chain of strings during a transition? Say that i have a transition function as it follows: (s1, a, y) -> (s2, e,…
1
vote
1 answer

Design the NDPA for the following grammar (Pushdown Automata)

Im trying to design the NDPA for the following grammar. I'm confused. Can you help me? ∑ = {a,b} G = (V,∑,R,S) V = {S,T,X} S -> aTXb T -> XTS|ε X -> a|b
VolkanK
  • 11
  • 2
1
vote
1 answer

Construct pushdown automata

I learned about pushdown automata in today's lecture, but I posted a question because I didn't understand it well. I don't know why use a stack here. (a) {a^n b^m a^n ┤| m,n∈ N,m>0,n>0} (b) {a^i b^j c^k ┤| i,j,k∈ N,i≥0,k≥0,i+k=j} Can someone…
JUN_0
  • 49
  • 1
  • 5
1
vote
1 answer

Multiple Push / pop in PDA

While designing Push Down Automata consider my inputs are {a,b} Now can I push multiple a's or multiple b's while scanning them...and then while popping can I pop multiple number of a's or multiple number of b's... OR is it the case that I can…
1
vote
2 answers

Design a PDA of all strings of 0's and 1's that are not of the form ww^R

I have to create a PDA(pushdown automata) that accepts strings that not of the form . For example it accepts 0011, 1100, 11000 but not accepts 1001, 011110, 0110. How can I create this PDA? I know the answer of not accepting ww, but can't get an…
Jinwoo Park
  • 99
  • 1
  • 10
1
vote
0 answers

Why this DK test is wrong?

I want to solve the problem 2.24 of "Introduction to the theory of computation" Sipser 3th edition, below: Let G be the following grammar: S → T- T → TaTb | TbTa | ε ( - is the end symbol for endmarked languages) Use the DK-test to show that G is a…
fabianod
  • 501
  • 4
  • 17
1
vote
1 answer

Construct a PDA that satisfies {w | w∈{0,1,#}∗,w=b(n)R#b(n+1),n≥1, b(x) converts x to binary with no leading 0}

Construct a PDA for the language {w | w∈{0,1,#}∗,w=b(n)R#b(n+1),n≥1, b(x) converts x to binary with no leading 0} b(n)R means the binary string reversed. I tried making a CFG that can describe this language and then converting to PDA, but I…
Jayleen
  • 174
  • 1
  • 12