Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implementation of PushDown Automata to track acceptance or rejection of a string.

NotificationsYou must be signed in to change notification settings

msindev/PushDown-Automata-Implementation

Repository files navigation

The code PDA . py file shows the transistions for a PDA.

Input-

The automata file is loaded from a specific file which has the following input format-

Line 1: Total StatesLine 2: Input Word SymbolsLine 3: Stack SymbolsLine 4: Initial State SymbolLine 5: Initial Stack SymbolLine 6: List of Final StatesLine 7 and onwards: Productions in form of     (Current State, Current Input Symbol, Current Top of Stack, Next State, Push/Pop Operation Symbol)

Currently 3 examples have been included-

  1. 0ⁿ1ⁿ
  2. Number of 0's = Number of 1's
  3. Palindrome - wcwᴿ

Usage

To run use -python PDA.pyYou can also define your own productions and use them. Make sure to give full path of the automata file, or better keep the automata file in the same directory as the program.

Output

Pushdown Automata Working Example Screenshot

About

Implementation of PushDown Automata to track acceptance or rejection of a string.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp