behzadshomali / Pushdown_automaton

In the theory of computation, a pushdown automaton (PDA) is a type of automaton that employs a stack. In this program, a PDA is going to be constructed by the input grammar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDA (Pushdown Automaton)

How does it work?

First, when you run the code, you'll be asked to input your grammar in the form of Greibach (read more about Greibach Normal Form here). By typing END, you'll notice the program that inputting the grammar finished.

Afterward, you'll bump into the list of transition functions extracted from the input grammar. Now it's time to input the string that you wish to check by the PDA constructed by your grammar! The PDA will process the input string based on a backtracking technique.

Let's see two examples of this program:

Accepted by PDA Not accepted by PDA

About

In the theory of computation, a pushdown automaton (PDA) is a type of automaton that employs a stack. In this program, a PDA is going to be constructed by the input grammar.


Languages

Language:Python 100.0%