Declarative languages and their potential use in describing biological systems

20 views
Skip to first unread message

Dilawar Singh

unread,
Oct 6, 2013, 2:35:56 AM10/6/13
to wncc...@googlegroups.com
A program written in declarative paradigm does not specify "how to do it" (like
we do in C, Python etc.), it only contains statements which at best tells the
computer "what to do". The spice netlist is one such example, here we just tell
the ngspice or some other spice, what to compute (like .OP, .DC, .AC etc.). To
be sure, these distinction are rather based on arguments which are nothing if
not "hand-waving" but too many people use these terms to ignore them. For
example, FIFO (First In First Out) is an algorithm, but people often use it as
if it is an object (Queue).


There is no line which strictly separate which language falls in which category.
Following example to compute factorial can be classified is "somewhat"
declarative (written in functional programming language haskell). We are not
saying how to "really" compute a factorial of a natural number.

fact 0 = 0
fact n = n * fact (n -1)

This will not be declarative at all.

unsigned long factorial(unsinged n)
{
if(n == 0)
return 0;
unsigned long result = n;
for(unsigned i = n-1; i > 0; i--)
result *= i;
return result;
}

(None of these snippet are tested).

I don't know if to be declarative, a program must lack control flow or there
is a consistent theoretical category into which a program must fit.

Till people with neat theoretical mind fix the confusion for us, we can look at
the uses of these paradigm. There are many and quick search will reveal some.
Let me share one on which currently I have to work (not enjoying it too much)
i.e. modelling large scale neural networks.

A VLSI engineer is trained not to be frightened with numbers. But unlike CMOS
devices, two neurons, even if they belong to same class much like two humans, do
not behave in the same way. Fortunately their behaviour is not without a
pattern, so attempts are being made to model them (as a real biological network)
for a computer to answer few questions.

Already much work is done in classifying neurons and finding equivalent
"electrical models" of them; they have been simulated independently and
sometimes as a group of few. These models were saved in some format and there
are now many such formats. Efforts are on way to standardize them, and it was
found that some declarative paradigm will be most suitable for Biologists would
not learn languages and tell the computer "how to do it", they would rather
concentrate on "what to do". Neither it is expected from them; engineers find it
hard to learn a second language. Many avoid going thoroughly into the first one.

Astronomers have long used HDF5 format to store complex data (hierarchical
patterns). Now there is XML technology all around. XML looks dirty but a
computer can easily read them. So why not describe "what to do" in XML. Just
imagine, rewriting a ngspice script in XML format and what they wish to do will
be clear. The major difference however remains, two neurons belonging to same
class do not behave like two capacitor or two registers. Much depends on how
they are connected and who is around them and what is happening at different
scale. A release of certain chemicals or presence of certain ions, changes the
values of component in equivalent circuit model. The speed of computation
depends mainly on how fast you can solve electrical circuits.

Multiscale modelling, as it is called these days, is found to be most suitable
to model neural systems, in fact biological systems. How changes in "one scale"
changes the behaviour at different scale? This is done by experimentalists. And
how to describe them is usually done by, well, programmers. Now the problem, is
how to describe multiscale-modellings? If not using some data-base (XML)?

To me, it looks like more of sociology of neurons than computation of networks.
There is a lot of scope of hand-waving and null-hypothesises. And along with it,
as usually the case in these professions, there is much scope for personal
ingenuity. I prefer my boring subjects where step by step reasoning using
well-established tricks yield results about an idea.

Some people have used Erlang to model "brain" given its capacity to easily
launch millions of threads. Each neuron is encoded in a process and one cab
launch as many as one wants. Messages among these process are the changing
environment. Theoretically, there would be as neat as this.

The principle of reality appears to ruin the party: how to crunch numbers as
soon as next update is available? One can simulate them as VLSI models in HDL
but that is incredibly slow. Erlang is not reputed to be a number-crunching
language. But there is scope here for at least modelling very simple "spike
models" or "integrate and fire model" but I am not aware of anything done on
these lines. Availability of many-core hardware on which one can launch million
thread will solve many problems. But again since the behaviour of two neuron is
not same, you can not model them which will put you in a position to use
embarrassingly parallelism available as "single instruction" working on
"multiple data". Besides that would not be research, that just development.

Those who are more interested in how biological systems are modelled in
multi-scale ways can look-up this entry from the lab for last year google summer
of code. GSoC is co-ordinated by INCF India node.

http://www.incf.org/programs/training-committee/gsoc

--
Dilawar
NCBS Bangalore
EE, IIT Bombay
Reply all
Reply to author
Forward
0 new messages