User:AmirOnWiki/sandbox

In theoretical computer science, a pointer machine is an atomistic abstract computational machine whose storage structure is a graph. A pointer algorithm could also be an algorithm restricted to the pointer machine model.

Some particular types of pointer machines are called a linking automaton, a KU-machine, an SMM, an atomistic LISP machine, a tree-pointer machine, etc..

From its "read-only tape" (or equivalent) a pointer machine receives input—bounded symbol-sequences ("words") made of at least two symbols e.g. { 0, 1 } — and it writes output symbol-sequences on an output "write-only" tape (or equivalent). To transform a symbol-sequence (input word) to an output symbol-sequence the machine is equipped with a "program"—a finite-state machine (memory and list of instructions). Via its state machine the program reads the input symbols, operates on its storage structure—a collection of "nodes" (registers) interconnected by "edges" (pointers labelled with the symbols e.g. { 0, 1 }), and writes symbols on the output tape.

Pointer machines do not have arithmetic instructions. Computation proceeds only by reading input symbols, modifying and doing various tests on its storage structure—the pattern of nodes and pointers, and outputting symbols based on the tests. In this sense, the model is similar to the Turing machine.

Types of "pointer machines"
Both Gurevich and Ben-Amram list a number of very similar "atomistic" models of "abstract machines" ; Ben-Amram believes that the "atomistic models" must be distinguished from "high-level" models. The following atomistic models will be presented below:


 * Schönhage's storage modification machines (SMM) ,
 * Kolmogorov–Uspenskii machines (KUM or KU-Machines).

Ben-Amram also presents the following varieties, not further discussed in this article:
 * Atomistic pure-LISP machine (APLM)
 * Atomistic full-LISP machine (AFLM),
 * General atomistic pointer machines,
 * Jone's I language (two types).

Schönhage's storage modification machine (SMM) model
The following presentation follows van Emde Boas.

The machine consists of a fixed alphabet of input symbols, a fixed program, and a mutable directed graph with its arrows labelled by alphabet symbols. The graph is the machine's storage. Each node of the graph has exactly one outgoing arrow labelled with each symbol, although some of these may loop back into the original node. One fixed node of the graph is identified as the start or "active" node.

Each word of symbols in the alphabet can then be translated to a pathway through the machine; for example, 10011 would translate to taking edge 1 from the start node, then edge 0 from the resulting node, then edge 0, then edge 1, then edge 1. Thus a word identifies a node, the final node of the path, but this identification will change as the graph changes during the computation.

The machine can receive instructions which change the layout of the graph. The basic instructions are:

(1) new w instruction, which creates a new node at the end of the path w, with all its edges directed to the next-to-last node in w. (2) set w to v instruction which (re)directs an edge to a different node. Here w and v represent words. The instruction results in changing the destination of the last edge in the path w.



(3)If v = w then instruction z : Conditional instruction that compares two paths represented by words w and v to see if they end at the same node; if so jump to instruction z else continue. This instruction serves the same purpose as the if command in any imperative programming language.



(4) read and write instructions for input/output.

Knuth noted that the SMM model coincides with a type of "linking automaton" briefly explained in volume one of The Art of Computer Programming.

Kolmogorov–Uspenskii machine (KU-machine) model
KUM differs from SMM in allowing only invertible pointers: for every pointer from a node x to a node y, an inverse pointer from y to x must be present, labeled by the same symbol. In other words, the storage graph is undirected. Since outgoing pointers must be labeled by distinct symbols of the alphabet, both KUM and SMM graphs have O(1) outdegree. However, KUM pointers' invertibility restricts the in-degree to O(1), as well. This addresses some concerns for physical (as opposite to purely informational) realism.

There are other, minor differences between the models, such as the form of the program - a state table instead of a list of instructions.

Considerations regarding the pointer-machine model
Use of the model in complexity theory: van Emde Boas (1990) expresses concern that this form of abstract model is:
 * "an interesting theoretical model, but ... its attractiveness as a fundamental model for complexity theory is questionable. Its time measure is based on uniform time in a context where this measure is known to underestimate the true time complexity. The same observation holds for the space measure for the machine" (van Emde Boas (1990) p. 35)

Gurevich also expresses concern:
 * "Pragmatically speaking, the Schönhage model provides a good measure of time complexity at the current state of the art (though I would prefer something along the lines of the random access computers of Angluin and Valiant)".

Schönhage demonstrates the real-time equivalences of two types of random-access machine with the SMM.

Algorithms in the SMM model: Schönhage demonstrates that the SMM can perform integer multiplication in linear time.

Potential uses for the model: Gurevich wonders whether or not a parallel KU machine "resembles somewhat the human brain"