PGA - ProGram Algebra

Combining Programs and State Machines

Basic instruction set

A basic instruction sets that supports interactions with state machines is FMN (Focus Method Notation).

Instructions

f.a(x)
Here, f is the focus of the instruction, and a(x) its co-instruction part (or co-action). The bracket pair can be empty. A focus is loaded the first time it is used.
It returns the value replied by the co-instruction.
f.p:a(x)
Here, p is the prefix of the action that will be performed, indicating a particular copy of the state machine. A copy of the state machines is created the first time the prefix is used.
It returns the value replied by the co-instruction.
Alternative versions of the above instructions:
f.a:x
f:i.a:x
Here, i is the instance of the method.

Available state machines

Examples