previous contents index next
(..Table Part..) Contents Index (..Table Part)

4.2.3 Local Rule Table (Table)

Table - Syntax:

Syntax: Table

Each table is started with the keyword

TABLE

(The end of a table is either the begin of an additional table or at the same time the end of the entire SDL program.) After TABLE we place the already discussed entries of the form

ConditionPart : Consequence :

One table may contain as many entries as we want.
 
Remark:
For both ConditionPart and Consequence end with a colon, it may be of advantage to think of a layout which makes it possible to oversee the structure. Because of the author's lack of imagination we simply suggest to set every second colon on tab.

ConditionPart1
:
Consequence1
:
ConditionPart2
:
Consequence2
:

For so far the syntax. In order to understand how such a table is interpreted by SCARLET, we remind once again of the properties, the local rule of a CA has got. It is a function sigma that is in every time step simultaneously applied to each cell of the retina, in order to change their states depending on the states of certain cells in their neighbourhood. With sigma we talk about a function from Sd to S, if S denotes the state set and the neighbourhood is of order d.
 

Now we are going to compare this to the structure of a local rule table as a whole (which should finally represent sigma in SCARLET). For the features of the condition part as well as the consequence part have a big influence on it, they will be shown explicitely again there. Let us suppose that Entry1, ... , Entrym, m in IN are the entries of the table, ci,1; ci,2; ... ; ci,ji j_i in IN_0, i in {1, ... ,m}, all variable assignments of ConditionParti in right the order in which they are given there, except those which are ignored because of the nonstrict treatment. Let b_i, i in {1, ... ,m}, be the boolean value of ConditionParti, then a SDL program with this table roughly implies the algorithm beneath:


c1,1; c1,2; ... ; c1,j1;

IF b1 == TRUE

   THEN Consequence1

   ELSE {c2,1; c2,2; ... ; c2,j2;

         IF b2 == TRUE

            THEN Consequence2

            ELSE {c3,1; c3,2; ... ; c3,j3;

      ...
           }
         } 


 

It describes what happens, when the table is applied to an arbitrary cell z. According to this, a single step of the simulation will certainly require as many calls of the table part as there are cells in the lattice. This is automatically done by SCARLET.
 

Remember furthermore that

But back to the algorithm above. It says,

'Starting with the first entry, execute the commands ci and evaluate the boolean expressions in ConditionParti of the i-th entry in the order they are given. If the value of all boolean expressions bi is TRUE, then execute Consequencei - that means, assign the given values to sites and variables - skip the rest of the table, and start from the beginning with another cell.
Otherwise ignore the rest of ConditionParti as well as Consequencei, as soon as the evaluation of one of the boolean expressions leads to FALSE, and go on with entry i+1'.

However, during one run of the table part, there will at most one consequence part of every table be executed. (We will soon see that a SDL program can consist of more than one table.) It is exactly the first one for which all conditions in ConditionPart are satisfied. This is remarkable, for the belonging Consequence is the only part which may affect the state of the site, or, to put it in other words, in which there can be assigned a value according to the function sigma. In the next paragraph we will see which influence the order of the entries within a table has on the choice of that ConsequencePart that will be the affecting one.


Example 49:

We give again a look at example 46 in order to show the table in an algorithmic form:

IF center.state > 0; == TRUE
  THEN
    state++;
    state %= 3;
  ELSE 
    IF center.state==0; == TRUE
      THEN 
        sum = left.state&1 + ... ;
        IF (center.state==0; && sum <=3) == TRUE
          THEN SELF = {1};  
Note: sum is only calculated, if center.state == 0. That is the reason for the additional condition before sum = ... .

 

Order of the Entries

In order to show that the order of the entries in a table play quite an important part in the course of the simulation, we give the following example:


 
Example 50:


SIGMA signal;

DIMENSION 1;

REGISTER INT state;

NEIGHBOUR left : (-1);

TABLE

   left.state == 1; : SELF = {1}; :

   TRUE; : SELF = {0}; :   

applied to the following 1-dimensional lattice with length l

1-dimensional retina with length l.

causes a signal 1 to run from the left to the right side at "speed 1". Arriving there it disappears.

Evolution in time of the 1-dimensional retina.

But just exchanging the two entries, the behaviour will be completely different: The signal disappears already after the first step.
The reason for that is obvious, because all the combinations of neighbour configurations for which condition 1 is satisfied form a subset of the ones which conform to condition 2.
If condition 2 had been given in a form which had left the intersection empty (left.state != 1;), an exchange would not have led to a different behaviour.

Source Code: signal.sdl
signal.rdl

Thus for not losing the track creating complexer tables, it seems indeed to be of advantage to follow the strategy we have put together:

Suppose that E_1, ... ,E_m,  m >=2, are the entries of a table, z in ZZ^n the coordinate of the looked at cell, N=(n_1, ... ,n_d) the n-dimensional neighbourhood of order d. In this paragraph, Mi will represent the set of all d-tuples (s_1, ... ,s_d) in S^d for which the condition of entry Ei is satisfied, if s_1=c(z+n_1), ... , s_d=c(z+n_d) for a configuration c:ZZ^n -> S. We get the following rules:
  1. If M_i cap M_j= emptyset, i != j, then the order in which Ei and Ej appear in the table does not matter.

  2. If M_i subseteq M_j, i != j, then entry Ei (with the more special condition) must precede Ej.

  3. All the other cases can be reduced to 1. or 2. by splitting up the sets Mi in a suitable way.

 

Nondirect State Assignments

We have to pay particular attention to the behaviour of a local rule table, if the generic cell does not receive its new state from a SelfAssignment unit. Such a situation rises, if

  1. none of the entry conditions is fulfilled by the configuration of the neighbours.

  2. The configuration of the neighbours fulfils a ConditionPart, but in the belonging Consequence

    1. does exist no SelfAssignment unit,

    2. the state of SELF is only changed in parts. (That means, only single registers are affected. )

In case of 1. and 2.1. the site keeps its old state. In case of 2.2. only the values of registers which have not been captured by the assignment stay unchanged.
But in every case the new state of a site depends on its old state in the previous time step!
 

That is no problem, if the site itself is a neighbour (that means, if (0, ... ,0) in ZZ^n belongs to the neighbourhood), for then dependencies of this kind are allowed. The table constructed in SDL still competes with the demands on the local rules in the abstract model.

But troubles arise, if the site to be changed should not be a neighbour! In this case the user has to take care by himself that situations as described above do not become reality, if he wants the table to represent a valid local rule.

While it is rather easy to avoid 2. (since it is sufficient to check each entry separately), for 1. it is sometimes so difficult that the only chance is to simply guarantee that the table is complete ( M_1 cup M_2 cup , ... , cup M_m = S^d; the definition of Mi can be found above.)

If the table should indeed stay incomplete, it must be granted that all neighbour configurations missing are really not assumed.

Remark:
Therefore, the appearance of the initial configuration must also be taken in account!


previous contents index next
(..Table Part..) Contents Index (..Table Part)