187 questions
0 votes
1 answer
38 views
JFLAP PDA error on transition from q1 to q2 despite valid string
I'm trying to build a pushdown automaton (PDA) in JFLAP that accepts the following language: L={0 1^N 2^P 3^R 4^S ∣ N,P,R,S>0, and N+P<R+S} with input alphabet Σ={0,1,2,3,4}Σ={0,1,2,3,4} This ...
3 votes
1 answer
189 views
How should I design and implement a PDA (Pushdown Automaton) graph for syntax validation? [closed]
I'm building a compiler for a custom programming language called FLOW, written in C. After lexical analysis using a DFA, I want to implement a PDA (Pushdown Automaton) to validate the syntax of the ...
1 vote
1 answer
2k views
Push Down Automata for the language L = { a^i b^j c^k | i, j, k >= 0 and j = i + 2k }
I drew PDA diagram for this language but it still does not work. Can some please help me? My PDA accepts 'bc' which it should not. I have no idea to control the b and c of the language. My scala code ...
0 votes
1 answer
230 views
Unable to create an DPDA that accepts strings in binary notation multiples of 3
Just learned about DPDA's on my Theory of computation class. Professor gave us a semester task to create a deterministic pushdown automaton state diagram that is able to accept all strings multiples ...
0 votes
1 answer
232 views
DFA for complement language of given language
We have a language W over the alphabet {a,b,c,d,e,f,g} that is defined by, starting with : <A> ::= <A> <Z> 'c' | <A> <X> 'd' | 'b' <Z> ::= <Y'> 'e' <Z> |...
2 votes
0 answers
225 views
Confusion on the Syntax of a Python Module named automata.pda.npda within automata -lib
I have been asked to construct a NPDA that accepts the following language L = {anb2n : n ≥ 1}. I have completed the written assignment portion and after testing it thoroughly i am sure that my NPDA is ...
0 votes
1 answer
3k views
Pushdown Automata for the Language {wwR | w∈{0,1}*}
I am currently enrolled in the undergraduate version of Theory of Computation at my university and we are discussing Pushdown Automata, Turing Machines, and the Church-Turing Thesis. In our homework ...
2 votes
2 answers
423 views
Why does the grammar I defined not use tokens?
I'm working on define to a new language with lex and yacc. The lexer works fine but parser doesn't. I thought the problem is the grammar is not recognizing tokens but after lots of researches and ...
0 votes
2 answers
378 views
A specific push down automaton for a language (PDA)
I'm wondering how could I design a pushdown automaton for this specific language. I can't solve this.. L2 = { u ∈ {a, b}∗ : 3 ∗ |u|a = 2 ∗ |u|b + 1 } So the number of 'a's multiplied by 3 is equals to ...
0 votes
2 answers
3k views
pda to accept the language L={a^n b^m | n<m}
I know how to solve for m<n but I'm struggling to understand the logic for m>n. In m<n we push all a's in the stack and when we get b we popped out one a, when the input ends with a stack ...
0 votes
1 answer
261 views
How to define delta in a PDA
I'm a little confused about PDA's and how to define the tuple. I have the language L = { 0^n1^n | n >= 0 } and I know that PDA's are six tuple with Q, sigma, gamma, delta, q0, and F. I know how to ...
0 votes
1 answer
411 views
How to construct a pushdown automata for L= { w ∈ {a, b}* | w does not equal xx^R for some x ∈ {a, b}* }?
How to construct a pushdown automata for L= { w ∈ {a, b}* | w does not equal xx^R for some x ∈ {a, b}* }
0 votes
2 answers
2k views
Clarification regarding PDA for L = {a^nb^(2n) | n>=1}
The solution says for every 'a' you read, push 2 a's into the stack . Finally when you encounter 'b' , pop an 'a'. But won't this give the output as a^n b^n? For example: Input = aabbbb On reading the ...
0 votes
1 answer
609 views
How can I write pushdown automata?
Starting with the letter b and the number of the letters b is 1 more than the number of the letters a a PDA that accepts language It confused me a lot. Can anyone explain how it's done?
4 votes
2 answers
5k views
PDA for {a^n b^m | n<=m<=2n}
Can someone help me design PDA for {a^n b^m | n<=m<=2n}. Can you please design one with explanation.