 # On the extreme power of nonstandard programming languages

Suenaga and Hasuo introduced a nonstandard programming language While^ dt which models hybrid systems. We demonstrate why While^ dt is not suitable for modeling actual computations.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1. Introduction

Suenaga and Hasuo  introduced an imperative programming language , which is the usual programming language equipped with a positive infinitesimal . This language is intended to hyperdiscretise hybrid systems and enable them to be formally verified by Hoare logic . On the other hand, this language is not intended to be a model of actual computation. We demonstrate why is not suitable for modeling actual computations. The main reason is that has too strong computational power caused by physically impossible settings. We clarify the causes of the power.

We refer to Suenaga and Hasuo  for the definition of ; Robinson  for nonstandard analysis; Shen and Vereshchagin  for computability theory.

## 2. Computation beyond Turing machine model

### 2.1. The first cause: unrestricted use of reals

The first cause of the power is that is furnished with the constant symbols for all real numbers and the exact comparison operator . They bring much strong computational power to this language as we will see below.

###### Lemma 1.

computes the floor function on .

###### Proof.

The following (pseudo) -program computes the floor function.

 Input: xOutput: yn:=0;while ¬(n≤x

###### Remark 2.

The floor function is a typical example of a uncomputable real function (see Weihrauch  p. 6).

###### Proposition 3.

computes every standard decision problem on .

###### Proof.

Let . The constant , where

is the characteristic function of

, has complete information deciding the membership of . Consider the following program.

 Input: xOutput: ya:=r;while x≠0 doa:=3⋅a;x:=x−1;if a−3⋅⌊(1/3)⋅a⌋≥1then y:=1else y:=0

This computes the characteristic function of for all (standard and nonstandard) inputs. ∎

###### Corollary 4.

computes every standard function on .

###### Proof.

Let . Consider the set , where is a computable bijection. decides by prop:WHILEdt-decides-st-probs. The following program computes for all inputs.

 Input: xOutput: yy:=0;a:=1;while J(x,y)∉∗A doy:=y+1

###### Remark 5.

Here the source of the computational power is not the use of infinitesimals. The foregoing argument can be applied to any other models of hybrid systems in which there is no restriction of discrete-continuous interaction.

### 2.2. The second cause: supertasks

The second cause is that can execute infinitely many steps of computation whose computational resource consumption (such as time, space and electricity usage and heat generation) is .

While the following result is a special case of cor:WHILEdt-computes-st-funs, the proof is based on an essentially different idea.

###### Proposition 6.

computes every -computable function on .

###### Proof.

Let be -computable. By Schoenfield’s limit lemma (see Theorem 48 of ), there is a computable function such that . Obviously computes for all inputs (with no use of uncomputable real numbers). Consider the following program:

 Input: xOutput: yy:=F(∞,x)

This computes the limit function for all standard inputs. ∎

###### Remark 7.

The infinity constant can be eliminated as follows.

 t:=0;u:=0;while t<1 dot:=t+dt;u:=u+1

The variable is infinite after executing this program. The while loop is repeated an infinite number of times. The instruction in the loop consumes computational resource in each execution.

If can finish such an infinite sequence of operations only within infinite time, there is no problem involving the computational power, because the computation by -programs is not considered to be actual one. On the other hand, if we want to consider to be a model of computation in the real world, must be able to finish such an infinite sequence of operations within finite time, or, in other words, must admit supertasks.

Thomson  did an insightful thought experiment to analyse the (im)possibility of supertasks. There is a lamp with a switch. The initial state of the switch is off. Consider the following supertask: in the first sec, turn on the switch; in the next sec, turn off the switch; in the next sec, turn on the switch; and so on. After this supertask, is the lamp on or off? A similar circumstance occurs in . We identify ‘on’ with and ‘off’ with . Consider the following -program.

 time:=0;lamp:=0;while time<1 dotime:=time+dt;lamp:=1−lamp

This program eventually halts. The same question then arises: after execution, is the value of on or off? The answer depends on the interpretation of the infinitesimal constant .

###### Remark 8.

The same phenomena occur in other models of hypercomputation which admit supertasks, such as the accelerated Turing machines (Copeland

; Calude and Staiger ).

## 3. Conclusion

The nonstandard programming language has too strong computational power. However, this computational power per se is not an essential reason why this model is inappropriate, because the Church–Turing thesis may be false (i.e. hypercomputation may be physically realisable). The excessive power is a consequence of the following causes: the unrestricted use of reals, the exact comparison of reals, and the possibility of supertasks consuming infinite resources. These are physically impossible. Because of this impossibility, while actual hybrid systems can be modeled by -programs, some -programs do not represent any actual hybrid system. The same applies to other nonstandard “models of computation” such as (Suenaga et.al. ), (Nakamura et.al. [6, 5]) and the internal Turing machines (Loo ).

Some restrictions are needed to metamorphose into a model of actual hybrid computation. For instance, restricting the electricity usage and/or the heat generation to finite, one can avoid “Thomson-type” problems. In the Thomson’s lamp experiment, one needs infinite energy to switch the lamp infinitely many times. This is an example of a bad supertask. On the other hand, a rubber ball uses only finite energy (the initial mechanical energy) to bounce infinitely many times (fig:rubber-ball). This is an example of a good supertask.

## References

•  Cristian S. Calude and Ludwig Staiger. A note on accelerated turing machines. Mathematical Structures in Computer Science, 20(6):1011–1017, 2010.
•  B. Jack Copeland. Accelerating Turing Machines. Minds and Machines, 12(2):281–300, 2002.
•  C. A. R. Hoare. An Axiomatic Basis for Computer Programming. Communications of the ACM, 12(10):576–580, 583, 1969.
•  Ken Loo. Internal Turing Machines, 2004. arXiv:0407056.
•  Hirofumi Nakamura. A functional programming language with infinitely small numbers. Master’s thesis, Kyoto University, 2018.
•  Hirofumi Nakamura, Kensuke Kojima, Kohei Suenaga, and Atsushi Igarashi. A Nonstandard Functional Programming Language. In APLAS 2017, pages 514–533, 2017.
•  Abraham Robinson. Non-standard Analysis. North-Holland, 1966.
•  A. Shen and N. K. Vereshchagin. Computable Functions. American Mathematical Society, 2003.
•  Kohei Suenaga and Ichiro Hasuo. Programming with Infinitesimals: A While-Language for Hybrid System Modeling. In ICALC 2011, pages 392–403, 2011.
•  Kohei Suenaga, Hiroyoshi Sekine, and Ichiro Hasuo. Hyperstream Processing Systems: Nonstandard Modeling of Continuous-Time Signals. In POPL 2013, pages 417–430, 2013.