turingMachine-0.1.2.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
  • GADTSyntax
  • MultiParamTypeClasses
  • ExistentialQuantification
  • ExplicitForAll

Math.Model.Turing

Description

Turing machine abstaction

Documentation

class Ways a where Source

Methods

oposite :: a -> a Source

Instances

data LRS Source

Constructors

L

Left move

S

No move

R

Right move

data FW Source

Constructors

Dw 
Lf 
Rt 
Up 

type Delta a b c = (:->:) a b (b, c) Source

type MDelta a b c = (:->:) a [b] ([b], [c]) Source

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

liftMD :: (Ord a, Ord b) => [(a, [b], a, [b], [c])] -> MDelta a b c Source

class Applicative t => Tapeable t a where Source

Methods

getHead :: t a -> a Source

liftTape :: Monoid (t a) => [a] -> t a Source

Instances

Tapeable Tape Symbol Source
>>> let tapeLifted = (liftTape "word")::Tape Symbol
>>> tapeLifted
T "" 'w' "ord"
Tapeable Tape [Symbol] Source 

data MultiTape t a Source

Constructors

MT [t a] 

Instances

Eq (t a) => Eq (MultiTape t a) Source 
Show (t a) => Show (MultiTape t a) Source 

getMHead :: Tapeable t a => MultiTape t a -> [a] Source

liftMTape :: (Tapeable t a, Monoid (t a)) => [a] -> MultiTape t a Source

class (Tapeable t b, Ways w) => TuringM t b w where Source

Methods

moveHead :: Monoid b => w -> t b -> t b Source

data Model a b c where Source

Constructors

TS :: Ways c => Delta a b c -> State a -> Final a -> Model a b c 

data MultiModel a b c where Source

Constructors

MTS :: Ways c => MDelta a b c -> State a -> [Final a] -> MultiModel a b c