|
|
|
|
state machine
|
(Definition)
|
|
|
It is a common practice to view a function as a black box that magically produces outputs upon giving an input. The inner workings of the black box are ignored.
If one takes the internal structure of the black box into consideration, then one has a machine, or commonly known as a state machine. The word state refers to the various stages, or states, that an input goes through, before any outputs are produced.
Specifically, a state machine is a five-tuple
where
is a non-empty set whose elements are called states,
is a non-empty set whose elements are called input symbols,
is a non-empty set whose elements are called output symbols,
is a function from
to , the powerset of , and
is a function from
to .
is called a next-state or transition function, and is the output function. A configuration of is an element of
.
When an input symbol
is fed into the machine current in state , a set
of output symbols is produced, and machine reaches a set of next states
. Note that there is no restrictions on the sizes of
and
. There are various classifications of state machines, depending on the cardinality of
and
:
- when none of the
and
are empty sets for any configurations
, then is said to be complete. Otherwise, it is incomplete;
- when each
and
consists of at most one element, then is called a sequential machine.
- Therefore, a complete sequential machine is just a state machine such that both
and
are singletons. A complete sequential machine is also known as a Mealy machine, named after its inventor.
- A Mealy machine
such that the output function is input-independent is called a Moore machine. Specifically, this means that for any two input symbols
, and any state ,
. Alternatively, in a Moore machine, can be viewed as a function
.
In many examples where the state machine has finite and , then is called a finite-state machine, although sometimes a finite-state machine is identified with a more specific type of machine called an automaton.
The transition and the output functions of a state machine are defined to work only over individual symbols in as inputs. However, these functions can be easily extended so as to apply to all finite strings, or words over . First of all, notice that a state machine
can be thought of as a semiautomaton
with an output alphabet and an output function . As such, the transition function can be extended to all of . Therefore, the next state of a word
is the next state of the symbol
when the machine reaches the state as a result of processing
.
Given an input string
, there are two ways of producing outputs. Without causing any confusion, let us use to denote the output function over . The two output methods are:
produces an output symbol every time an input symbol is processed, and is appended to the string of output symbols that have already been produced. Formally,
- Or, an output symbol is produced only when the last symbol
is processed. In other words,
A state machine
can be viewed as either a language acceptor or a language generator. The way this works is as follows:
as an acceptor.
- First fix a non-empty subset
and fix a non-empty subset
. Then is called an acceptor. is the set of final or accepting states. A string
is said to be accepted by if
and
for some state . The set of all strings accepted by is denoted by .
A typical example of an acceptor is an automaton: a state machine where the output alphabet and the output function are not essential ( may be taken as a singleton).
as a generator.
- On the other hand, if we fix a non-empty
and a non-empty
, then is a generator. is the set of initial or starting states. A string
is said to be generated by if there
for some and some . The set of all strings generated by is also denoted by .
A typical example of a generator is a Post system: a state machine where the output alphabet is the input alphabet, and the set of states and the state function is suppressed ( may be taken as a singleton).
- 1
- S. Ginsburg, An Introduction to Mathematical Machine Theory, Addision-Wesley, (1962).
- 2
- M. Arbib, Algebraic Theory of Machines, Languages, and Semigroups, Academic Press (1968).
|
"state machine" is owned by CWoo.
|
|
(view preamble)
| Also defines: |
complete machine, sequential machine, complete sequential machine, incomplete sequential machine, Mealy machine, Moore machine |
|
|
Cross-references: Post system, generated by, subset, fix, generator, acceptor, language, alphabet, semiautomaton, strings, automaton, type, finite, singletons, incomplete, complete, empty sets, sizes, restrictions, current, configuration, transition function, powerset, state, structure, inner, function
There are 30 references to this entry.
This is version 12 of state machine, born on 2008-01-31, modified 2008-02-16.
Object id is 10231, canonical name is StateMachine.
Accessed 1090 times total.
Classification:
| AMS MSC: | 68Q45 (Computer science :: Theory of computing :: Formal languages and automata) | | | 03D05 (Mathematical logic and foundations :: Computability and recursion theory :: Automata and formal grammars in connection with logical questions) |
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|