In
computer scienceComputer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...
and
automata theoryIn theoretical computer science, automata theory is the study of abstract machines and problems which they are able to solve. Automata theory is closely related to formal language theory as the automata are often classified by the class of formal languages they are able to recognize.An automaton is...
, a
state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as
lexerIn computer science, lexical analysis is the process of converting a sequence of characters into a sequence of tokens. Programs performing lexical analysis are called lexical analyzers or lexers...
s and parsers.
Whether the automaton in question is a
finite state machineA finite state machine or finite state automaton , or simply a state machine, is a model of behavior composed of a finite number of states, transitions between those states, and actions. It is similar to a "flow graph" where we can inspect the way in which the logic runs when certain conditions...
, a
pushdown automatonIn automata theory, a pushdown automaton is a finite automaton that can make use of a stack containing data.- Operation :Pushdown automata differ from finite state machines in two ways:...
or a full-fledged
Turing machineA Turing machine is a theoretical device that manipulates symbols contained on a strip of tape. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside of a computer. The Turing...
, a state is a particular set of instructions which will be executed in response to the machine's input. The state can be thought of as analogous to a practical computer's main memory.
In
computer scienceComputer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...
and
automata theoryIn theoretical computer science, automata theory is the study of abstract machines and problems which they are able to solve. Automata theory is closely related to formal language theory as the automata are often classified by the class of formal languages they are able to recognize.An automaton is...
, a
state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as
lexerIn computer science, lexical analysis is the process of converting a sequence of characters into a sequence of tokens. Programs performing lexical analysis are called lexical analyzers or lexers...
s and parsers.
Whether the automaton in question is a
finite state machineA finite state machine or finite state automaton , or simply a state machine, is a model of behavior composed of a finite number of states, transitions between those states, and actions. It is similar to a "flow graph" where we can inspect the way in which the logic runs when certain conditions...
, a
pushdown automatonIn automata theory, a pushdown automaton is a finite automaton that can make use of a stack containing data.- Operation :Pushdown automata differ from finite state machines in two ways:...
or a full-fledged
Turing machineA Turing machine is a theoretical device that manipulates symbols contained on a strip of tape. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside of a computer. The Turing...
, a state is a particular set of instructions which will be executed in response to the machine's input. The state can be thought of as analogous to a practical computer's main memory. The behavior of the system is a function of (a) the definition of the automaton, (b) the input and (c) the current state.
- Compatible states - are states in a state machine which do not conflict for any input values. Thus for every input, both states must have the same output, and both states must have the same successor (or unspecified successors) or both must not change. Compatible states are redundant if occurring in the same state machine.
- Equivalent states are states in a state machine which, for every possible input sequence, the same output sequence will be produced - no matter which state is the initial state.
- Distinguishable states are states in a state machine which have at least one input sequence which causes different output sequences - no matter which state is the initial state.
In
information processingInformation processing is the change of information in any manner detectable by an observer. As such, it is a process which describes everything which happens in the universe, from the falling of a rock to the printing of a text file from a digital computer system...
, a
state is the complete
setA set is a collection of distinct objects, considered as an object in its own right. Sets are one of the most fundamental concepts in mathematics. Although it was invented at the end of the 19th century, set theory is now a ubiquitous part of mathematics, and can be used as a foundation from which...
of properties (for example, its
energy levelA quantum mechanical system or particle that is bound, confined spatially, can only take on certain discrete values of energy, as opposed to classical particles, which can have any energy. These values are called energy levels. The term is most commonly used for the energy levels of electrons in...
, etc. see
state (physics)In physics,the term state is used in several related senses,each expressing something about the way a physical system is.#In the sense state of matter, state describes the organization of matter in a phase....
) transmitted by an object to an
observerIn control theory, a state observer is a system that models a real system in order to provide an estimate of its internal state, given measurements of the input and output of the real system. It is typically a computer-implemented mathematical model....
via one or more
channelsChannel, in communications , refers to the medium used to convey information from a sender to a receiver.- Overview :...
. Any change in the nature or quantity of such properties in a state is detected by an observer and thus a transmission of
informationInformation as a concept has many meanings, from everyday usage to technical settings. The concept of information is closely related to notions of constraint, communication, control, data, form, instruction, knowledge, meaning, mental stimulus, pattern, perception, and representation.The English...
occurs.
An information system or
protocolIn computing, a protocol is a set of rules which is used by computers to communicate with each other across a network. A protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints...
that relies upon state is said to be
stateful. One that does not is said to be
stateless. For example, there are stateless firewalls and
stateless serverA stateless server is a server that treats each request as an independent transaction that is unrelated to any previous request.-Advantages and Disadvantages:...
s, and HTTP is considered a stateless protocol. A
character encodingA character encoding system consists of a code that pairs each character from a given repertoire with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the transmission of data through telecommunication networks or storage of text in...
such as ISO 2022 is said to be stateful if the interpretation of a particular code value depends on the code values that came before it.
See also
- Clumping (computer science)
Clumping is where the effective state space of a program is relatively small when compared to all reachable states....
- State diagram
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...
- program state
One of the key concepts in computer programming is the idea of state, essentially a snapshot of the measure of various conditions in the system. Most programming languages require a considerable amount of state information in order to operate properly - information which is generally hidden from...
- finite state machine
A finite state machine or finite state automaton , or simply a state machine, is a model of behavior composed of a finite number of states, transitions between those states, and actions. It is similar to a "flow graph" where we can inspect the way in which the logic runs when certain conditions...
(FSM)