This repository contains an implementation of a Push-Down Automaton (PDA), a type of computational model used in formal language theory. PDAs are essential in recognizing context-free languages (CFLs) and are often used in the study of compilers, parsing algorithms, and language processing.
- Push-Down Automaton Simulation: A basic PDA simulation for processing strings.
- Context-Free Language Recognition: The implementation demonstrates how PDAs can recognize context-free languages, focusing on strings like
a^n b^n. - Educational Purpose: Ideal for students and learners of computational theory to understand the workings of PDAs.
-
Clone the repository:
git clone https://github.com/RezaGooner/Push-Down-Automaton.git
-
Compile the code: Make sure you have a C++ compiler installed. Compile the source code with:
g++ -o pda pda.cpp
-
Run the program:
./pda
To test a string, input the string as a sequence of characters. For example, aaabbb will be accepted by the PDA if it follows the context-free grammar.
Feel free to fork this repository and contribute by submitting issues or pull requests to improve the implementation.