\section{Introduction}\sectlabel{intro}

\subsection{Structural Organization}\sectlabel{intro::so}

Past work in Amorphous computing has focused on how to produce
Structural organization in an amorphous computing medium, starting
from nearly homogeneous initial conditions, and producing complicated
pre-specified patterns.  As an outgrowth of that effort, a number of
very powerful ideas have come about in the form of programming
paradigms.  Most recently, Daniel Coore's Growing Point Language ({\sc
gpl})
has demonstrated how to configure pre-specified patterns using
abstract high-level concepts such as {\em pheremones}, {\em materials}, and 
{\em growing points}. Growing points are processes that move from
processor to processor according to a {\em tropism}.  They can secrete
long-range pheremone concentrations to establish a gradient field in
an amorphous computing medium.  As growing points travel, they label
processors they visit with a material.  

 For example, in order to create a line segment  that
connects two distantly located computational elements
{\tt a }  and {\tt b}, we define two
growing points, {\tt B-point} and  {\tt A-to-B-segment}.

\begin{verbatim}
(define-growing-point (B-point)
  (material B-material)
  (size 0)
  (for-each-step
   (secrete+ 10 B-pheromone)))
\end{verbatim}
{\tt B-point} has no tropism, so it does not move, but it secretes a
{\tt B-pheremone} at every time step, creating a gradient field with
an extent of 10 hop counts.  
\begin{verbatim}
(define-growing-point (A-to-B-segment)
  (material A-material)
  (size 1)
  (tropism (ortho+ B-pheromone))
  (for-each-step
   (when ((sensing? B-material)
          (terminate))
         (default
           (propagate)))))
\end{verbatim}
{\tt A-to-B-segment} deposits {\tt A-material} to every processor it
visits. When {\tt A-to-B-segment} detects {\tt B-pheromone}, it
propagates from processor to processor, with a preference for
processors with higher concentration levels of the {\tt B-pheremone}. 
Eventually, it senses the presence of the {\tt B-material} and terminates.
\begin{verbatim}
(color
 ((B-material) "yellow")
 ((A-material) "red"))
\end{verbatim}
By the time the program finishes, a red line segment should be
displayed.
\begin{verbatim}
(with-locations
 (a b)
 (at a (start-growing-point A-to-B-segment))
 (at b (start-growing-point B-point)))
\end{verbatim}
In order to specify initial conditions, specific processor id's will get bound
to $a$ and $b$.


These abstractions are then compiled 
into rules for interacting with neighbors through the Extensible
Calculus of Local Interactions ({\sc ecoli}).  For example, to implement
a propagating growing point in {\sc ecoli}, one must imagine how the amorphous
computing environment looks to a single processor.  Suppose an
{\tt A-to-B-segment}  growing point wishes to propagate. First, it
must poll its neighbors for their pheremone concentrations.  Then it
must select a successor and notify it, so that the next processor may
be activated.  This process may be expressed as the Finite State
Machine shown in figure \ref{fig::fsm}.
%%\Fig{FSM}{\includegraphics{FSM.eps}}
% {Finite State Machine of a Propagating Growing Point}\label{fig::fsm}

Similar Finite State Machines must be written for each primitive
action of the Growing point language.

 Finally, each Finite State machine is used to program thousands of
processors on a High-Level Simulator ({\sc hlsim}) which emulates an
amorphous computing environment where message broadcasting is
unreliable, clocks are asynchronous, and the layout of processors is
randomly distributed.  With these tools, it has been shown that a wide
variety of pre-specified patterns may be configured fairly reliably,
with a reasonable chance of success.  On {\sc hlsim}, the code for a
line-segment produces the image shown in figure \ref{fig::ls}:

%%\Fig{line-segment}{\includegraphics{line-segment-w1.eps}}
%% {{\sc hlsim} snapshot of a Line Segment}\label{fig::ls} 

As Amorphous Computer engineers, we are not only interested in
what structures we can make, but also in how reliable we can make them.

\subsection{Representational Organization}
Representational organization is an outgrowth of the effort to create
self-adaptive software systems\cite{shrobe:amorph}. 
Our model is inspired from biological regeneration where multiple
strategies are implemented in a single organism to recognize an injury
and respond appropriately.  For example, in healthy bullfrogs,
scientists have observed a continuous DC voltage drop along the nerve
sheath as it travels away from the major nerve ganglions. However,
when the frog sustains an injury, such as a fibula fracture, the nerve
sheath near the trauma produces a strong negative
potential. Additionally, the piezoelectric properties of the broken
bone produce a strong positive potential at the site. Inside the
bielectric gradient thus produced, blood cells from the surrounding
tissue adhere to the 
injury site, forming a blood clot. Experiments have shown that blood
cells of bullfrogs are sensitive to tiny DC currents, and will
actually {\em dedifferentiate} from a highly specialized blood cell to
a cell indistinguishable from an undifferentiated, embryonic
blastema. At higher body temperatures, the 
bullfrog will instead dedifferentiate periosteum and marrow cells to
form the blastema.  When placed near the fractured fibula, the
undifferentiated cells will then redifferentiate into appropriate
cartilage and bone-forming cells. Furthermore, the bioelectric
gradient appears to guide and control cell growth in the
redifferentiation process\cite{selden:body-electric}.

From a purely engineering point of view, bone regeneration in
bullfrogs displays all the hallmarks of robust design.  We may view
the process of blood cell dedifferentiation as one subsystem, and the
process of bone marrow and periosteum dedifferentiation as a separate
subsystem which accomplishes the same task under
slightly different environmental conditions. In a similar vein,
bioelectric gradients can be generated from two completely independent
sources: from the piezoelectric properties of a broken bone, or from
the myelin sheath surrounding the nerve. Therefore, the bioelectric
and cellular components pools are redundantly 
designed, and the implementation is structured to use the redundant
designs.  Furthermore, since bioelectric gradients and cellular components
are used in both the dedifferentiation and redifferentiation
subsystems, we get a controlled redundancy that is quite
powerful\cite{sussman:robust-diversity}. 

By taking inspiration from this engineering
marvel, we propose a strategy for increasing reliability in amorphous computing
structures through the metaphor of recognizing and responding to
injury.  Intuitively, suppose a structure we
design is later damaged by the local environment.  How does the
structure ``recognize'' an injury has occurred?  By what means can it
``diagnose'' the environmental factors which caused the injury, and how
can it utilize existing resources to ``repair'' the damage?  More
concretely, in order to respond appropriately to changes in its
environment, a self-adaptive software system must provide the
following services at runtime:
\begin{description}

\item[Monitoring:]
 Sentinels placed in the code detect the failure of a module
to maintain invariants or to achieve conditions promised by the plan.

\item[Diagnosis:]
 Diagnostic services localize the source of the failure and
characterize the form of the breakdown.

\item[Repair Selection:]
 Having identified the form of the breakdown, the system
selects an alternative way of achieving the desired behavior. This
alternative may include running the same code again or it may use alternative
implementations which appear more likely to work given the nature of the
breakdown.

\item[Rollback and Recovery:]
 Before a repair strategy can be attempted, the structure
must be put into a consistent state. This involves rolling back unwanted
side effects and recovering data necessary to start the selected alternative
strategy.
\item[Resource Allocation:]
 Before the restart can be attempted it must obtain
resources. This is particularly critical since resources have been
consumed in the failed execution and have perhaps been rendered unusable
or untrusted as a result of the failure\cite{shrobe:dda}.
\end{description}

The challenges that Representational organization pose for Amorphous
 computation seem quite formidable.  Nonetheless, the ability to
 predict and control the behavior of an amorphous computing structure
 in the face of unknown environmental changes will almost certainly
 require us to provide these sorts of services. In this paper, we
 provide explicit monitoring, diagnosis, and repair algorithms for
 dealing with two types of failures: A growing point which has become
 ``stuck,'' and a line segment which has become disconnected.  For
 structures, we provide a mechanism for checking
 the consistency of the intermediate results.  If this consistency check
 fails, the structure will know it has sustained an injury. In
 response, the system employs mechanisms analagous to bioelectric
 gradients and cellular differentiation in order to isolate and repair
 the injury. These strategies can be implemented on a High level
 Simulator ({\sc hlsim}) using the Growing Point Language ({\sc gpl})
 design language\cite{adams:hlsim}\cite{coore:phd}.














