State-transition table

Last updated

In automata theory and sequential logic, a state-transition table is a table showing what state (or states in the case of a nondeterministic finite automaton) a finite-state machine will move to, based on the current state and other inputs. It is essentially a truth table in which the inputs include the current state along with other inputs, and the outputs include the next state along with other outputs.

Contents

A state-transition table is one of many ways to specify a finite-state machine. Other ways include a state diagram.

Common forms

One-dimension

State-transition tables are sometimes one-dimensional tables, also called characteristic tables. They are much more like truth tables than their two-dimensional form. The single dimension indicates inputs, current states, next states and (optionally) outputs associated with the state transitions.

State-transition table
(S: state, I: input, O: output)
InputCurrent stateNext stateOutput
I1S1SiOx
I2S1SjOy
InS1SkOz
I1S2Si′Ox′
I2S2Sj′Oy′
InS2Sk′Oz′
I1SmSi″Ox″
I2SmSj″Oy″
InSmSk″Oz″

Two-dimensions

State-transition tables are typically two-dimensional tables. There are two common ways for arranging them.

In the first way, one of the dimensions indicates current states, while the other indicates inputs. The row/column intersections indicate next states and (optionally) outputs associated with the state transitions.

State-transition table
(S: state, I: input, O: output)
Input
Current state
I1I2In
S1Si/OxSj/OySk/Oz
S2Si′/Ox′Sj′/Oy′Sk′/Oz′
SmSi″/Ox″Sj″/Oz″Sk″/Oz″

In the second way, one of the dimensions indicates current states, while the other indicates next states. The row/column intersections indicate inputs and (optionally) outputs associated with the state transitions.

State-transition table
(S: state, I: input, O: output, —: illegal)
Next state
Current state
S1S2Sm
S1Ii/Ox
S2Ij/Oy
SmIk/Oz

Other forms

Simultaneous transitions in multiple finite-state machines can be shown in what is effectively an n-dimensional state-transition table in which pairs of rows map (sets of) current states to next states. [1] This is an alternative to representing communication between separate, interdependent finite-state machines.

At the other extreme, separate tables have been used for each of the transitions within a single finite-state machine: "AND/OR tables" [2] are similar to incomplete decision tables in which the decision for the rules which are present is implicitly the activation of the associated transition.

Example

An example of a state-transition table together with the corresponding state diagram for a finite-state machine is given below:

State-transition table
Input
Current state
01
S1S2S1
S2S1S2
State diagram
FSM state diagram.png

In the state-transition table, all possible inputs to the finite-state machine are enumerated across the columns of the table, while all possible states are enumerated across the rows. If the machine is in the state S1 (the first row) and receives an input of 1 (second column), the machine will stay in the state S1. Now if the machine is in the state S1 and receives an input of 0 (first column), the machine will transition to the state S2.
In the state diagram, the former is denoted by the arrow looping from S1 to S1 labeled with a 1, and the latter is denoted by the arrow from S1 to S2 labeled with a 0. This process can be described statistically using Markov Chains.

For a nondeterministic finite-state machine, an input may cause the machine to be in more than one state, hence its non-determinism. This is denoted in a state-transition table by the set of all target states enclosed in a pair of braces {}. An example of a state-transition table together with the corresponding state diagram for a nondeterministic finite-state machine is given below:

State-transition table
Input
Current state
01
S1S2S1
S2{S1, S2}S2
State diagram
NFSM state diagram.png

If the machine is in the state S2 and receives an input of 0, the machine will be in two states at the same time, the states S1 and S2.

Transformations from/to state diagram

It is possible to draw a state diagram from a state-transition table. A sequence of easy to follow steps is given below:

  1. Draw the circles to represent the states given.
  2. For each of the states, scan across the corresponding row and draw an arrow to the destination state(s). There can be multiple arrows for an input character if the finite-state machine is nondeterministic.
  3. Designate a state as the start state. The start state is given in the formal definition of a finite-state machine.
  4. Designate one or more states as accepting state. This is also given in the formal definition of a finite-state machine.

See also

Related Research Articles

<span class="mw-page-title-main">Finite-state machine</span> Mathematical model of computation

A finite-state machine (FSM) or finite-state automaton, finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. Finite-state machines are of two types—deterministic finite-state machines and non-deterministic finite-state machines. A deterministic finite-state machine can be constructed equivalent to any non-deterministic one.

In computer science, LR parsers are a type of bottom-up parser that analyse deterministic context-free languages in linear time. There are several variants of LR parsers: SLR parsers, LALR parsers, Canonical LR(1) parsers, Minimal LR(1) parsers, and GLR parsers. LR parsers can be generated by a parser generator from a formal grammar defining the syntax of the language to be parsed. They are widely used for the processing of computer languages.

In theoretical computer science, a nondeterministic Turing machine (NTM) is a theoretical model of computation whose governing rules specify more than one possible action when in some given situations. That is, an NTM's next state is not completely determined by its action and the current symbol it sees, unlike a deterministic Turing machine.

<span class="mw-page-title-main">Pushdown automaton</span> Type of automaton

In the theory of computation, a branch of theoretical computer science, a pushdown automaton (PDA) is a type of automaton that employs a stack.

A tree automaton is a type of state machine. Tree automata deal with tree structures, rather than the strings of more conventional state machines.

<span class="mw-page-title-main">Automata theory</span> Study of abstract machines and automata

Automata theory is the study of abstract machines and automata, as well as the computational problems that can be solved using them. It is a theory in theoretical computer science. The word automata comes from the Greek word αὐτόματος, which means "self-acting, self-willed, self-moving". An automaton is an abstract self-propelled computing device which follows a predetermined sequence of operations automatically. An automaton with a finite number of states is called a Finite Automaton (FA) or Finite-State Machine (FSM). The figure on the right illustrates a finite-state machine, which is a well-known type of automaton. This automaton consists of states and transitions. As the automaton sees a symbol of input, it makes a transition to another state, according to its transition function, which takes the previous state and current input symbol as its arguments.

<span class="mw-page-title-main">State diagram</span> Diagram of behavior of finite state systems

A state diagram is a type of diagram used in computer science and related fields to describe the behavior of systems. State diagrams require that the system described is composed of a finite number of states; sometimes, this is indeed the case, while at other times this is a reasonable abstraction. Many forms of state diagrams exist, which differ slightly and have different semantics.

In the theory of computation, a Mealy machine is a finite-state machine whose output values are determined both by its current state and the current inputs. This is in contrast to a Moore machine, whose output values are determined solely by its current state. A Mealy machine is a deterministic finite-state transducer: for each state and input, at most one transition is possible.

In the theory of computation, a Moore machine is a finite-state machine whose current output values are determined only by its current state. This is in contrast to a Mealy machine, whose output values are determined both by its current state and by the values of its inputs. Like other finite state machines, in Moore machines, the input typically influences the next state. Thus the input may indirectly influence subsequent outputs, but not the current or immediate output. The Moore machine is named after Edward F. Moore, who presented the concept in a 1956 paper, “Gedanken-experiments on Sequential Machines.”

Computability is the ability to solve a problem in an effective manner. It is a key topic of the field of computability theory within mathematical logic and the theory of computation within computer science. The computability of a problem is closely linked to the existence of an algorithm to solve the problem.

<span class="mw-page-title-main">Deterministic finite automaton</span> Finite-state machine

In the theory of computation, a branch of theoretical computer science, a deterministic finite automaton (DFA)—also known as deterministic finite acceptor (DFA), deterministic finite-state machine (DFSM), or deterministic finite-state automaton (DFSA)—is a finite-state machine that accepts or rejects a given string of symbols, by running through a state sequence uniquely determined by the string. Deterministic refers to the uniqueness of the computation run. In search of the simplest models to capture finite-state machines, Warren McCulloch and Walter Pitts were among the first researchers to introduce a concept similar to finite automata in 1943.

In automata theory, a finite-state machine is called a deterministic finite automaton (DFA), if

In the theory of computation, a generalized nondeterministic finite automaton (GNFA), also known as an expression automaton or a generalized nondeterministic finite state machine, is a variation of a nondeterministic finite automaton (NFA) where each transition is labeled with any regular expression. The GNFA reads blocks of symbols from the input which constitute a string as defined by the regular expression on the transition. There are several differences between a standard finite state machine and a generalized nondeterministic finite state machine. A GNFA must have only one start state and one accept state, and these cannot be the same state, whereas an NFA or DFA both may have several accept states, and the start state can be an accept state. A GNFA must have only one transition between any two states, whereas a NFA or DFA both allow for numerous transitions between states. In a GNFA, a state has a single transition to every state in the machine, although often it is a convention to ignore the transitions that are labelled with the empty set when drawing generalized nondeterministic finite state machines.

In the theory of computation and automata theory, the powerset construction or subset construction is a standard method for converting a nondeterministic finite automaton (NFA) into a deterministic finite automaton (DFA) which recognizes the same formal language. It is important in theory because it establishes that NFAs, despite their additional flexibility, are unable to recognize any language that cannot be recognized by some DFA. It is also important in practice for converting easier-to-construct NFAs into more efficiently executable DFAs. However, if the NFA has n states, the resulting DFA may have up to 2n states, an exponentially larger number, which sometimes makes the construction impractical for large NFAs.

A virtual finite-state machine (VFSM) is a finite-state machine (FSM) defined in a Virtual Environment. The VFSM concept provides a software specification method to describe the behaviour of a control system using assigned names of input control properties and output actions.

Automata-based programming is a programming paradigm in which the program or part of it is thought of as a model of a finite-state machine (FSM) or any other formal automaton. Sometimes a potentially infinite set of possible states is introduced, and such a set can have a complicated structure, not just an enumeration.

The Richards controller is a method of implementing a finite state machine using simple integrated circuits and combinational logic. The method was named after its inventor, Charles L. Richards. It allows for easier design of complex finite state machines than the traditional techniques of state diagrams, state transition tables and Boolean algebra offer. Using Richards's technique, it becomes easier to implement finite state machines with hundreds or even thousands of states.

In quantum computing, quantum finite automata (QFA) or quantum state machines are a quantum analog of probabilistic automata or a Markov decision process. They provide a mathematical abstraction of real-world quantum computers. Several types of automata may be defined, including measure-once and measure-many automata. Quantum finite automata can also be understood as the quantization of subshifts of finite type, or as a quantization of Markov chains. QFAs are, in turn, special cases of geometric finite automata or topological finite automata.

In mathematics and computer science, the probabilistic automaton (PA) is a generalization of the nondeterministic finite automaton; it includes the probability of a given transition into the transition function, turning it into a transition matrix. Thus, the probabilistic automaton also generalizes the concepts of a Markov chain and of a subshift of finite type. The languages recognized by probabilistic automata are called stochastic languages; these include the regular languages as a subset. The number of stochastic languages is uncountable.

In computer science, in particular in formal language theory, a quotient automaton can be obtained from a given nondeterministic finite automaton by joining some of its states. The quotient recognizes a superset of the given automaton; in some cases, handled by the Myhill–Nerode theorem, both languages are equal.

References

  1. Breen, Michael (2005), "Experience of using a lightweight formal specification method for a commercial embedded system product line" (PDF), Requirements Engineering Journal, 10 (2): 161–172, CiteSeerX   10.1.1.60.5228 , doi:10.1007/s00766-004-0209-1, S2CID   16928695
  2. Leveson, Nancy; Heimdahl, Mats Per Erik; Hildreth, Holly; Reese, Jon Damon (1994), "Requirements Specification for Process-Control Systems" (PDF), IEEE Transactions on Software Engineering, 20 (9): 684–707, CiteSeerX   10.1.1.72.8657 , doi:10.1109/32.317428

Further reading