PGA - ProGram Algebra

Molecular Dynamics

In molecular dynamics the memory state of a system is modeled as a fluid consisting of a collection of atoms which may have bindings between them to form molecules. A molecule consists of a number of atoms all reachable from one of the atoms by sequences of directed links. A directed link from one atom to another atom exists if the former has a so-called field containing the latter. By means of actions causing a change of state, fields can be added to and withdrawn from atoms, and contents of fields can be modified. Selected atoms can also be brought into focus.

Basic instruction sets

Example

Simulate this example as a PGLA.MPP program by clicking on this button
needed: a browser that knows how to deal with CSS (IE isn't one of them)
In this example we use the basic instruction set MPP to build up a list of atoms in focus x.
The resulting fluid after each step is shown on the right.

We initialize the list by creating a new atom and assigning it to the focus x with the instruction
x = new

We can add an atom the the list inf focus x with the following instructions.

We create a new atom in focus y.
y = new

We add a field f to y
y.+f

And assign the atom in focus x to this field.
y.f = x

Assign the atom in focus y to focus x.
x = y

To add another atom to the list, we repeat the last four instructions.