Divergence (computer science) explained

In computer science, a computation is said to diverge if it does not terminate or terminates in an exceptional state.[1] Otherwise it is said to converge. In domains where computations are expected to be infinite, such as process calculi, a computation is said to diverge if it fails to be productive (i.e. to continue producing an action within a finite amount of time).

Definitions

Various subfields of computer science use varying, but mathematically precise, definitions of what it means for a computation to converge or diverge.

Rewriting

In abstract rewriting, an abstract rewriting system is called convergent if it is both confluent and terminating.

The notation tn means that t reduces to normal form n in zero or more reductions, t↓ means t reduces to some normal form in zero or more reductions, and t↑ means t does not reduce to a normal form; the latter is impossible in a terminating rewriting system.

In the lambda calculus an expression is divergent if it has no normal form.

Denotational semantics

f:A\cup\{\perp\}B\cup\{\perp\}

where ⊥ (bottom) indicates that the object function or its argument diverges.

Concurrency theory

In the calculus of communicating sequential processes (CSP), divergence is a drastic situation where a process performs an endless series of hidden actions. For example, consider the following process, defined by CSP notation:

Clock=tickClock

The traces of this process are defined as:

\operatorname{traces}(Clock)=\{\langle\rangle,\langletick\rangle,\langletick,tick\rangle,\}=\{tick\}*

Now, consider the following process, which conceals the tick event of the Clock process:

P=Clock\backslashtick

By definition, P is called a divergent process.

See also

References

Notes and References

  1. An Axiomatic Basis for Computer Programming . C.A.R. Hoare . Communications of the ACM . 12 . 10 . 576 - 583 . Oct 1969 . 10.1145/363235.363259 . 207726175 .