Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.44 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.44 KB

PushdownAutomatonJs

A generic deterministic pushdown automaton simulator in javascript. Also supports multiple stacks (turing complete), a single stack (context-free languages) and no stack (finite automaton).

Definitions

Machine definition

M = {Σ, Q, Π, q0, F, V}

Where:
M := Machine
Σ := Alphabet
Q := States set
Π := Program function
q0 := Initial state (q0 ∈ Q)
F := Final states
V := Auxiliary alphabet

Program function definition

Π(qa, r, p1, ..., pn) = (qb, w1, ..., wn)

Where:
qa := Current state (qa ∈ Q)
qb := Next state (qb ∈ Q)
r := symbol read from the queue (r ∈ Σ)
pi := symbol read (popped) from the ith stack (r ∈ Σ)
wj := symbol written (pushed) to the jth stack (w ∈ Σ ∪ V)

Try it online

[Click here] (http://inf.ufrgs.br/~aleuck/)

Screenshot

Screenshot