machine

package
Version: v0.0.0-...-b57eb89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyTapeLength = 5

Variables

View Source
var ACTIONS = [...]string{"R", "L", "N"}

Functions

This section is empty.

Types

type Transaction

type Transaction interface {
	Validate(m TuringMachine) bool
	Simulate() (state.State, symbol.Symbol, string)
	GetCurrentState() state.State
	GetSymbolScanned() symbol.Symbol
	GetNewState() state.State
	GetSymbolWritten() symbol.Symbol
	GetMoveTape() string
	Print() string
}

Transaction interface

func NewTransaction

func NewTransaction(currentState state.State, symbolScanned symbol.Symbol, newState state.State, symbolWritten symbol.Symbol, moveTape string) Transaction

NewTransaction() Create a new Transaction with given currentState, symbolScanned, symbolWritten and moveTape action

type TuringMachine

type TuringMachine interface {
	Step() state.State
	Computed() bool
	Run()
	GetActualSymbol() symbol.Symbol
	GetActualState() state.State
	MoveHeadPointer(s symbol.Symbol, m string) int
	Print() string
}

TuringMachine interface

func NewTuringMachine

func NewTuringMachine(iss set.Set, fss set.Set, trs set.Set, as state.State, fs symbol.Symbol) TuringMachine

NewTuringMachine() Return a new TuringMachine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL