Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
.
Instances
Eq TmsTapeSquare Source # | |
Defined in TmsType (==) :: TmsTapeSquare -> TmsTapeSquare -> Bool # (/=) :: TmsTapeSquare -> TmsTapeSquare -> Bool # | |
Ord TmsTapeSquare Source # | |
Defined in TmsType 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 (==) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # (/=) :: TmsTapeHeadMovement -> TmsTapeHeadMovement -> Bool # | |
Ord TmsTapeHeadMovement Source # | |
Defined in TmsType 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 showsPrec :: Int -> TmsTapeHeadMovement -> ShowS # show :: TmsTapeHeadMovement -> String # showList :: [TmsTapeHeadMovement] -> ShowS # |
newtype TmsSingleTapeCommand Source #
Type of Tms command for one tape. TmsSingleTapeCommand (action, movement).
Instances
Eq TmsSingleTapeCommand Source # | |
Defined in TmsType (==) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # (/=) :: TmsSingleTapeCommand -> TmsSingleTapeCommand -> Bool # | |
Ord TmsSingleTapeCommand Source # | |
Defined in TmsType 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.
Instances
Eq TmsCommand Source # | |
Defined in TmsType (==) :: TmsCommand -> TmsCommand -> Bool # (/=) :: TmsCommand -> TmsCommand -> Bool # | |
Ord TmsCommand Source # | |
Defined in TmsType 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.