LangToGroup-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

SMType

Description

This module represents types of S-machine.

Synopsis

Documentation

data StateName Source #

This is state name data type of State.

Every constructor here represents name of the State.

Constructors

E 
X 
F 
P 
Q 
R 
S 
T 
U 

Instances

Instances details
Eq StateName Source # 
Instance details

Defined in SMType

Ord StateName Source # 
Instance details

Defined in SMType

Show StateName Source # 
Instance details

Defined in SMType

data Tag Source #

This is tag data type of State.

Hat it's like a house roof.

Quote is a '.

Dash is a overline.

Constructors

Hat 
Quote 
Dash 

Instances

Instances details
Eq Tag Source # 
Instance details

Defined in SMType

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Ord Tag Source # 
Instance details

Defined in SMType

Methods

compare :: Tag -> Tag -> Ordering #

(<) :: Tag -> Tag -> Bool #

(<=) :: Tag -> Tag -> Bool #

(>) :: Tag -> Tag -> Bool #

(>=) :: Tag -> Tag -> Bool #

max :: Tag -> Tag -> Tag #

min :: Tag -> Tag -> Tag #

Show Tag Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

data SMTag Source #

SMTag is a tag for S-machines and shows what kind is it.

T4 for S-machine number 4.

T9 for number 9.

TAlpha for alpha S-machine.

TOmega for omega S-machine.

Constructors

T4 
T9 
TAlpha 
TOmega 

Instances

Instances details
Eq SMTag Source # 
Instance details

Defined in SMType

Methods

(==) :: SMTag -> SMTag -> Bool #

(/=) :: SMTag -> SMTag -> Bool #

Ord SMTag Source # 
Instance details

Defined in SMType

Methods

compare :: SMTag -> SMTag -> Ordering #

(<) :: SMTag -> SMTag -> Bool #

(<=) :: SMTag -> SMTag -> Bool #

(>) :: SMTag -> SMTag -> Bool #

(>=) :: SMTag -> SMTag -> Bool #

max :: SMTag -> SMTag -> SMTag #

min :: SMTag -> SMTag -> SMTag #

Show SMTag Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> SMTag -> ShowS #

show :: SMTag -> String #

showList :: [SMTag] -> ShowS #

data TMCMD Source #

This is data type of Turing machine commands and has uses in StateVal in order to define for which command belongs to StatevVal.

Instances

Instances details
Eq TMCMD Source # 
Instance details

Defined in SMType

Methods

(==) :: TMCMD -> TMCMD -> Bool #

(/=) :: TMCMD -> TMCMD -> Bool #

Ord TMCMD Source # 
Instance details

Defined in SMType

Methods

compare :: TMCMD -> TMCMD -> Ordering #

(<) :: TMCMD -> TMCMD -> Bool #

(<=) :: TMCMD -> TMCMD -> Bool #

(>) :: TMCMD -> TMCMD -> Bool #

(>=) :: TMCMD -> TMCMD -> Bool #

max :: TMCMD -> TMCMD -> TMCMD #

min :: TMCMD -> TMCMD -> TMCMD #

Show TMCMD Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> TMCMD -> ShowS #

show :: TMCMD -> String #

showList :: [TMCMD] -> ShowS #

data StateVal Source #

StateVal represents belongnes of State to tape, Turing machine commands and S-machine SM.

Constructors

StateVal 

Instances

Instances details
Eq StateVal Source # 
Instance details

Defined in SMType

Ord StateVal Source # 
Instance details

Defined in SMType

Show StateVal Source # 
Instance details

Defined in SMType

data State Source #

This data type represents state of S-machine SM.

s_name represents a name of State.

s_idx represents a low index of State.

s_tags represents a set of Tag of State.

s_val represents a StateVal of State.

Constructors

State 

Instances

Instances details
Eq State Source # 
Instance details

Defined in SMType

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

Ord State Source # 
Instance details

Defined in SMType

Methods

compare :: State -> State -> Ordering #

(<) :: State -> State -> Bool #

(<=) :: State -> State -> Bool #

(>) :: State -> State -> Bool #

(>=) :: State -> State -> Bool #

max :: State -> State -> State #

min :: State -> State -> State #

Show State Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

data Y Source #

This data type represents a tape letter of S-machine SM.

Constructors

Y Square 
Alpha 
Delta 
Omega 

Instances

Instances details
Eq Y Source # 
Instance details

Defined in SMType

Methods

(==) :: Y -> Y -> Bool #

(/=) :: Y -> Y -> Bool #

Ord Y Source # 
Instance details

Defined in SMType

Methods

compare :: Y -> Y -> Ordering #

(<) :: Y -> Y -> Bool #

(<=) :: Y -> Y -> Bool #

(>) :: Y -> Y -> Bool #

(>=) :: Y -> Y -> Bool #

max :: Y -> Y -> Y #

min :: Y -> Y -> Y #

Show Y Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> Y -> ShowS #

show :: Y -> String #

showList :: [Y] -> ShowS #

data Smb Source #

This is a data type of symbols that can be on SM tape.

Symbols can be Y (SmbY), its invertions (SmbY') and State (SmbQ).

Constructors

SmbY Y 
SmbY' Y 
SmbQ State 

Instances

Instances details
Eq Smb Source # 
Instance details

Defined in SMType

Methods

(==) :: Smb -> Smb -> Bool #

(/=) :: Smb -> Smb -> Bool #

Ord Smb Source # 
Instance details

Defined in SMType

Methods

compare :: Smb -> Smb -> Ordering #

(<) :: Smb -> Smb -> Bool #

(<=) :: Smb -> Smb -> Bool #

(>) :: Smb -> Smb -> Bool #

(>=) :: Smb -> Smb -> Bool #

max :: Smb -> Smb -> Smb #

min :: Smb -> Smb -> Smb #

Show Smb Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> Smb -> ShowS #

show :: Smb -> String #

showList :: [Smb] -> ShowS #

newtype Word Source #

This is a admissible word of the S-machine SM, which consist of the Smb.

Constructors

Word [Smb] 

Instances

Instances details
Eq Word Source # 
Instance details

Defined in SMType

Methods

(==) :: Word -> Word -> Bool #

(/=) :: Word -> Word -> Bool #

Ord Word Source # 
Instance details

Defined in SMType

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Show Word Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> Word -> ShowS #

show :: Word -> String #

showList :: [Word] -> ShowS #

newtype SRule Source #

This is a rule of the S-machine SM.

Left part of the pair represents what substitute.

Right part -- for what substitute.

Constructors

SRule [(Word, Word)] 

Instances

Instances details
Eq SRule Source # 
Instance details

Defined in SMType

Methods

(==) :: SRule -> SRule -> Bool #

(/=) :: SRule -> SRule -> Bool #

Ord SRule Source # 
Instance details

Defined in SMType

Methods

compare :: SRule -> SRule -> Ordering #

(<) :: SRule -> SRule -> Bool #

(<=) :: SRule -> SRule -> Bool #

(>) :: SRule -> SRule -> Bool #

(>=) :: SRule -> SRule -> Bool #

max :: SRule -> SRule -> SRule #

min :: SRule -> SRule -> SRule #

Show SRule Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> SRule -> ShowS #

show :: SRule -> String #

showList :: [SRule] -> ShowS #

data SM Source #

This is data type of S-machine.

It consists of a lists of tape letters Y, states State and rules SRule.

Constructors

SM 

Fields

Instances

Instances details
Eq SM Source # 
Instance details

Defined in SMType

Methods

(==) :: SM -> SM -> Bool #

(/=) :: SM -> SM -> Bool #

Ord SM Source # 
Instance details

Defined in SMType

Methods

compare :: SM -> SM -> Ordering #

(<) :: SM -> SM -> Bool #

(<=) :: SM -> SM -> Bool #

(>) :: SM -> SM -> Bool #

(>=) :: SM -> SM -> Bool #

max :: SM -> SM -> SM #

min :: SM -> SM -> SM #

Show SM Source # 
Instance details

Defined in SMType

Methods

showsPrec :: Int -> SM -> ShowS #

show :: SM -> String #

showList :: [SM] -> ShowS #