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 that accepts a string with an even number 0s 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. For any non-deterministic finite-state machine, an equivalent deterministic one can be constructed.

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 generalized LR 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 with close connections to mathematical logic. 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 used in computer science and related fields to describe the behavior of systems. State diagrams require that the system 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

A fully polynomial-time approximation scheme (FPTAS) is an algorithm for finding approximate solutions to function problems, especially optimization problems. An FPTAS takes as input an instance of the problem and a parameter ε > 0. It returns as output a value which is at least times the correct value, and at most times the correct value.

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.

UML state machine, formerly known as UML statechart, is an extension of the mathematical concept of a finite automaton in computer science applications as expressed in the Unified Modeling Language (UML) notation.

In computational learning theory, induction of regular languages refers to the task of learning a formal description of a regular language from a given set of example strings. Although E. Mark Gold has shown that not every regular language can be learned this way, approaches have been investigated for a variety of subclasses. They are sketched in this article. For learning of more general grammars, see Grammar induction.

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