machine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2014 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// contains filtered or unexported fields
}

func (*Conf) MovTapePosLeft

func (self *Conf) MovTapePosLeft()

func (*Conf) MovTapePosRight

func (self *Conf) MovTapePosRight()

func (*Conf) SetCurrState

func (self *Conf) SetCurrState(state State)

type Dir

type Dir string
const (
	DirMovLeft  Dir = "L"
	DirMovRight Dir = "R"
	DirStay     Dir = "N"
)

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

func NewMachine

func NewMachine(machineDesc *MachineDesc) (*Machine, error)

func (*Machine) Run

func (self *Machine) Run()

type MachineDesc

type MachineDesc struct {
	Alphabet  []Sym   `json:"Σ"`
	InitState State   `json:"s"`
	InputSyms []Sym   `json:"x"`
	States    []State `json:"K"`
	TransMap  []struct {
		Map struct {
			Dir   Dir   `json:"dir"`
			State State `json:"state"`
			Sym   Sym   `json:"sym"`
		}
		State State `json:"state"`
		Sym   Sym   `json:"sym"`
	} `json:"δ"`
}

type MachineTransMapKey

type MachineTransMapKey struct {
	// contains filtered or unexported fields
}

type MachineTransMapVal

type MachineTransMapVal struct {
	// contains filtered or unexported fields
}

type State

type State string
const (
	StateValHalt State = "@HALT"
)

type Sym

type Sym string

type Tape

type Tape struct {
	// contains filtered or unexported fields
}

func NewTape

func NewTape(syms []Sym) *Tape

func (*Tape) ReadSym

func (self *Tape) ReadSym(i uint) Sym

func (*Tape) String

func (self *Tape) String() string

func (*Tape) WriteSym

func (self *Tape) WriteSym(i uint, sym Sym)

Jump to

Keyboard shortcuts

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