Managing State - Archive ouverte HAL Accéder directement au contenu
Article Dans Une Revue Computing in Science and Engineering Année : 2012

Managing State

Résumé

The notion of state is fundamental to the study of dynamical systems. State refers to the minimal set of information that fully describes the system at a specific time. The simplest state model is found in Fortran 77, where a program's state consists of the values of all its scalar variables and of all the elements of all arrays, the statement to be executed next, and the statements at which execution resumes at the end of each active subroutine or function. In the following, I'll concentrate on the variables, because the statement references are part of control flow and not directly accessible to the programmer. It's important, however, to remember that each state is associated with a precise point in the program's execution. The two important concepts in understanding data handling in Fortran 77 are thus value and variable, where the latter term includes the elements of arrays. Each variable has a value at each point in execution. This value is changed by an assignment statement. It can be used in an expression, where it's combined with other values (constants or the values of other variables) by operations, such as arithmetic, to produce new values. Languages such as C or Fortran 90 that offer pointers and dynamic memory allocation lead to a much more complicated description of state. Obviously the contents of the dynamically allocated storage must be included in the total state of a program, but that's only the first step. Each such storage block can itself contain pointers to other storage blocks. The neat distinction between variables and values disappears: the value of a variable can define another variable. As a consequence, it's no longer possible to compile a list of all parts of a program's state just by looking at its source code. What is or isn't part of the state is defined by the state itself.
Fichier non déposé

Dates et versions

hal-00726599 , version 1 (30-08-2012)

Identifiants

Citer

Konrad Hinsen. Managing State. Computing in Science and Engineering, 2012, 14 (1), pp.80-86. ⟨10.1109/MCSE.2012.11⟩. ⟨hal-00726599⟩
55 Consultations
0 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More