| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
TmsType
Description
This module provides types for representing turing machines in a format suitable for the service: https://turingmachinesimulator.com/ Below this format will be called Tms.
Synopsis
- data TmsTapeSquare
- data TmsTapeHeadMovement
- newtype TmsState = TmsState String
- newtype TmsSingleTapeCommand = TmsSingleTapeCommand (TmsTapeSquare, TmsTapeHeadMovement)
- type OneTapeTMCommand = (TmsState, TmsSingleTapeCommand, TmsState)
- toTmsCommand :: OneTapeTMCommand -> TmsCommand
- newtype TmsCommand = TmsCommand (TmsState, [TmsSingleTapeCommand], TmsState)
- newtype Tms = Tms (String, TmsState, [TmsState], [TmsCommand], [String])
- filterStateName :: String -> String
- fst3 :: (a, b, c) -> a
- snd3 :: (a, b, c) -> b
- thd3 :: (a, b, c) -> c
Documentation
data TmsTapeSquare Source #
Type of Tms tape square action.
Leave is leave any character unchanged.
'ChangeFromTo f t' is change it from f to t.
Constructors
| Leave | |
| ChangeFromTo Char Char |
Instances
| Eq TmsTapeSquare Source # | |
Defined in TmsType Methods (==) :: TmsTapeSquare -> TmsTapeSquare -> Bool # (/=) :: TmsTapeSquare -> TmsTapeSquare -> Bool # | |
| Ord TmsTapeSquare Source # | |
Defined in TmsType Methods compare :: TmsTapeSquare -> TmsTapeSquare -> Ordering # (<) :: TmsTapeSquare -> TmsTapeSquare -> Bool # (<=) :: TmsTapeSquare -> TmsTapeSquare -> Bool # (>) :: TmsTapeSquare -> TmsTapeSquare -> Bool # (>=) :: TmsTapeSquare -> TmsTapeSquare -> Bool # max :: TmsTapeSquare -> TmsTapeSquare -> TmsTapeSquare # min :: TmsTapeSquare -> TmsTapeSquare -> TmsTapeSquare # | |
data TmsTapeHeadMovement Source #
Type of Tms tape head movement
Instances
| Eq TmsTapeHeadMovement Source # | |
Defined in TmsType Methods (==) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # (/=) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # | |
| Ord TmsTapeHeadMovement Source # | |
Defined in TmsType Methods compare :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Ordering # (<) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # (<=) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # (>) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # (>=) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # max :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> TmsTapeHeadMovement # min :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> TmsTapeHeadMovement # | |
| Show TmsTapeHeadMovement Source # | |
Defined in TmsType Methods showsPrec :: Int -> TmsTapeHeadMovement -> ShowS # show :: TmsTapeHeadMovement -> String # showList :: [TmsTapeHeadMovement] -> ShowS # | |
newtype TmsSingleTapeCommand Source #
Type of Tms command for one tape. TmsSingleTapeCommand (action, movement).
Constructors
| TmsSingleTapeCommand (TmsTapeSquare, TmsTapeHeadMovement) |
Instances
| Eq TmsSingleTapeCommand Source # | |
Defined in TmsType Methods (==) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # (/=) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # | |
| Ord TmsSingleTapeCommand Source # | |
Defined in TmsType Methods compare :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Ordering # (<) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # (<=) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # (>) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # (>=) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # max :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> TmsSingleTapeCommand # min :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> TmsSingleTapeCommand # | |
type OneTapeTMCommand = (TmsState, TmsSingleTapeCommand, TmsState) Source #
Type of Tms single tape command
newtype TmsCommand Source #
Type of Tms command for entire Turing machine.
Constructors
| TmsCommand (TmsState, [TmsSingleTapeCommand], TmsState) |
Instances
| Eq TmsCommand Source # | |
Defined in TmsType | |
| Ord TmsCommand Source # | |
Defined in TmsType Methods compare :: TmsCommand -> TmsCommand -> Ordering # (<) :: TmsCommand -> TmsCommand -> Bool # (<=) :: TmsCommand -> TmsCommand -> Bool # (>) :: TmsCommand -> TmsCommand -> Bool # (>=) :: TmsCommand -> TmsCommand -> Bool # max :: TmsCommand -> TmsCommand -> TmsCommand # min :: TmsCommand -> TmsCommand -> TmsCommand # | |
Type of Tms format. Tms (name, init accept commands, tapeAlphabets).
filterStateName :: String -> String Source #
Process string so that it does not contain illegal characters.