Skip to content

A simple python implementation of non-deterministic pushdown automata (PDA).

Notifications You must be signed in to change notification settings

theodoregold/pushdown-automata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

What is this?

Description says it all.

How to use?

First you need create a automata file where you define your productions, start states and stuff like that.

Q P F # total states
a # input word symbols
Z Y # stack symbols
Q # starting state
Z # starting stack
F # accepting states
F # E - accepts with empty stack or F - accepts with accepting state
Q a Z Q YZ # list of productions (current state, read from word, take from stack, next state, add to stack)
Q a Y Q YY
Q e Z P Z
Q e Y P Y 
P a Z P e 
P a Y P e
P e Z F e

notes:

  • We agree that "e" means epsilon and will not show up as state symbol.
  • You shouldn't use stack symbols that are longer than one character anything else is fine.

Thats it! Just run the script and it should ask for input file location and words to test. Have fun!

Issues

This was a rush thing. It could really use some more edge case tests or tests in general.

About

A simple python implementation of non-deterministic pushdown automata (PDA).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages