Skip to content

RezaGooner/Push-Down-Automaton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Push-Down-Automaton

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.

Features

  • 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.

Getting Started

  1. Clone the repository:

    git clone https://github.com/RezaGooner/Push-Down-Automaton.git
  2. Compile the code: Make sure you have a C++ compiler installed. Compile the source code with:

    g++ -o pda pda.cpp
  3. Run the program:

    ./pda

Example Usage

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.

Contributing

Feel free to fork this repository and contribute by submitting issues or pull requests to improve the implementation.