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
0
votes
0 answers

Pushdown automata stack states?

I am studying pushdown automata for a course and I've reached a conceptual plothole. Does the stack basically have infinite memory or only space for a single symbol? If I have the following string: abba And the following rules with q6 as my…
Callat
  • 2,928
  • 5
  • 30
  • 47
0
votes
1 answer

Push down automata for a language

I want to design a pushdown automata for the language L = { a^i b^j c^k | i = j or k <= j <= 2k} The solution proposed by the instructor is as pictured in the following diagram. But my concern here is, that it does not handle string of the form…
yogeshagr
  • 819
  • 2
  • 11
  • 20
0
votes
2 answers

npda for the language number a's less than or equal to 3 times the number of b's

I am trying to construct an npda for L = {w ∈ {a,b}*| na(w) <= 3*nb(w)}. This means that for every b there can be at most 3 a's. First of all, this is what I have done so far. From the start state, we push a single "a" on to the stack. (at the…
0
votes
1 answer

Is useful the pushdown automaton in this case?

In the university they ask me for use grammar and Pushdown automaton to check the syntax of a portion of Java code. Due i have not used this automaton before, i have learnt a bit about how they work and i think that this automaton is not very…
0
votes
1 answer

The way to use JFLAP to do a Pushdown Automaton

I need to create a Pushdown Automaton with JFLAP that recognizes the following language: What steps need to be taken to do it? And how does it work?
deibbs
  • 24
  • 7
0
votes
2 answers

Can formal grammars generate other grammars?

I'm in a models of computation class, and we're just covering formal grammars. As we've defined it, a formal grammar is: Some terminal symbols Some nonterminal symbols A start symbol Some production rules Given that grammars generate strings, it…
Bronze
  • 153
  • 1
  • 8
0
votes
1 answer

Autocomplete property is not coming in visual studio 2008

i am creating windows application's for PDA Windows CE. i have a requirement to create text box with auto-complete option , it seems auto-complete property available in VS 2005 , but in VS 2008 this property is does not exist. because PDA…
Archana Palani
  • 247
  • 1
  • 6
  • 23
0
votes
4 answers

If database has no record, return a declared int

I'm facing a problem. In my case, I would like to select max and + 1 in order to create a new receipt number, if it is a new receipt, it will create a new number as the code below shown. However, I'm getting the error Object cannot be cast from…
TheButterfly
  • 85
  • 1
  • 3
  • 20
0
votes
1 answer

wondering if pushdown automata solution is correct

I have a question that says: Construct a PDA that accepts the language {a^i b^j | 0 <= i <= j} and this is the given solution: δ ( q0, a, z ) = ( q0, az ) read a, push a δ ( q0, a, a ) = ( q0, aa ) δ ( q0, b, a ) = ( q1, λ ) read b, pop a …
2316354654
  • 279
  • 2
  • 3
  • 14
0
votes
1 answer

Struct Problems for Pushdown Automata

I think my struct knowledge is lacking. I am getting errors such as: pda.c:33:26: error: 'top' undeclared (first use in this function) if(pda.stack[top] == '\0') pda.c:54:7: error: 'accepted' undeclared (first use in this…
Pareod
  • 151
  • 1
  • 11
0
votes
1 answer

pushdown automata and arithmetic expressions

I am trying to figure out how to do arithmetic expressions in Pushdown Automata ?(PDA) for example L=W|W=An Bm Cn-m What i am thinking of doing is to push As then pop Bs and then either pop As with C or Bs with C depending what is left. For example…
0
votes
1 answer

Count letter frequency in PDA

I'm trying to construct a PDA or a CFG that accepts all words where E is the most common letter. Cheese and tee would be in the language for example. I'm pretty sure this language is context free but I cannot seem to construct a PDA for it. Is this…
0
votes
1 answer

Is a Pushdown Automaton with an Epsilon Transition a NDPA?

Let's suppose we have this PA: -> q0 (e, e -> $) --> q1 Where: q0 is a final and initial state; e is epsilon (empty); and q1 is another state. If the automaton were to read the e word, it could either make the transition to q1 or stop in q0. So,…
andre_ss6
  • 1,195
  • 1
  • 13
  • 34
0
votes
1 answer

Should states in an FSM be friends with the context type?

I've built a class-based Push-down Automaton Finite State Machine. The context class (the class whose internal state is being modified) has some methods that only the states should access (incrementing/decrementing some iterators, pushing/popping…
Casey
  • 10,297
  • 11
  • 59
  • 88
0
votes
1 answer

Approach to finding the context free grammar of more complicated languages

I'm having problems approaching the following problem. Give a context free grammar for the following language: {x#y | x,y in {0,1}* and |x| != |y|} What is the best way to approach this question? At the moment I'm just using intuition to solve…