fsm

package
v0.0.0-...-a440eaf Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2015 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 State

type State struct {
	ID      int
	Label   string
	Initial bool
}

State can be labeled with a proposition and optionally be an initial state.

func (*State) HasLabel

func (s *State) HasLabel(label string) bool

type StateMachine

type StateMachine struct {
	States      []State
	Transitions []Transition
}

StateMachine models a finite state machine with a set of states and transitions.

func Parse

func Parse(lines []string) (StateMachine, []string)

Parse parses a .fsm file (std-in) and creates and returns a StateMachine and a list of computations to be performed on the machine.

func (StateMachine) Satisfies

func (fsm StateMachine) Satisfies(res *mtx.SparseMatrix) int

func (*StateMachine) ToMatrix

func (sm *StateMachine) ToMatrix() *mtx.SparseMatrix

type Transition

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

Transition has a from state and a to state.

Jump to

Keyboard shortcuts

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