Overall Objectives
Scientific Foundations
Application Domains
New Results
Contracts and Grants with Industry
Other Grants and Activities

Section: Scientific Foundations

Chemical programming

The chemical reaction metaphor has been discussed in various occasions in the literature. This metaphor describes computation in terms of a chemical solution in which molecules (representing data) interact freely according to reaction rules. Chemical models use the multiset as their basic data structure. Computation proceeds by rewritings of the multiset which consume elements according to reaction conditions and produce new elements according to specific transformation rules.

To the best of our knowledge, the Gamma formalism was the first “chemical model of computation” proposed as early as in 1986  [64] and extended later  [65] .

A Gamma program is a collection of reaction rules acting on a multiset of basic elements. A reaction rule is made of a condition and an action. Execution proceeds by replacing elements satisfying the reaction condition by the elements specified by the action. The result of a Gamma program is obtained when a stable state is reached that is to say when no more reactions can take place. Here is an example illustrating the Gamma style of programming:

Im1 ${\#119901 \#119903 \#119894 \#119898 \#119890 \#119904 =\#119851 \#119838 \#119849 \#119845 \#119834 ... ~y~\#119842 \#119839 ~\#119898 \#119906 \#119897 \#119905 \#119894 \#119901 \#119897 \#119890 (x,y)}$

The reaction Im2 $\#119901 \#119903 \#119894 \#119898 \#119890 \#119904 $ computes the prime numbers lower or equal to a given number N when applied to the multiset of all numbers between 2 and N (Im3 ${\#119898 \#119906 \#119897 \#119905 \#119894 \#119901 \#119897 \#119890 (x,y)}$ is true if and only if x is a multiple of y ). Let us emphasize the conciseness and elegance of these programs. Nothing had to be said about the order of evaluation of the reactions. If several disjoint pairs of elements satisfy the condition, the reactions can be performed in parallel.

Gamma makes it possible to express programs without artificial sequentiality. By artificial, we mean sequentiality only imposed by the computation model and unrelated to the logic of the program. This allows the programmer to describe programs in a very abstract way. In some sense, one can say that Gamma programs express the very idea of an algorithm without any unnecessary linguistic idiosyncrasies. The interested reader may find in  [65] a long series of examples (string processing problems, graph problems, geometry problems, etc.) illustrating the Gamma style of programming and in  [63] a review of contributions related to the chemical reaction model. Later, the idea was developed further into the Cham   [67] , the P-systems  [84] , etc. Although built on the same basic paradigm, these proposals have different properties and different expressive powers.

The $ \gamma$ -calculus  [62] is an attempt to identify the basic principles behind chemical models. It exhibit a minimal chemical calculus, from which all other “chemical models” can be obtained by addition of well-chosen features. Essentially, this minimal calculus incorporates the $ \gamma$ -reduction which expresses the very essence of the chemical reaction, and the associativity and commutativity rules which express the basic properties of chemical solutions.


Logo Inria