turingMachine-0.1.3.0: An implementation of Turing Machine and Automaton

Copyright(c) Jorge Santiago Alvarez Cuadros, 2016
LicenseGPL-3
Maintainersanjorgek@ciencias.unam.mx
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010
Extensions
  • TypeOperators
  • ExplicitNamespaces

Math.Model.Automaton.Stack

Description

Stack Automaton

Synopsis

Documentation

type Delta a = (:->:) a (Symbol, Symbol) [Symbol] Source

Delta for stack machine, takes a state, a symbol in string input and a symbol in stack head and returns next state and update stack

liftD :: Ord a => [(a, Symbol, Symbol, a, [Symbol])] -> Delta a Source

Takes a list of tuples and lift a Delta

>>> let delta = liftD [(0,'1','A',1,[AA]),(0,'0',blank,0,[A])]

data StackA a Source

Stack machine only needs a delta and a init state

Constructors

S (Delta a) (State a) 

checkString :: Ord a => StackA a -> Wd -> Bool Source

Executes a stack machine over a word

>>> checkString autStack 'aaabbbcccccc'
True