The formal definition of any machine

The general formula of any machine of function f is:

   p = i; while(a) { p = f(p, x); }
    

When a = 0, the machine ends working.
The state of the present state p represents the variables which are part of the machine.
a is either 1 or the result of a truth function of p and x.
At start, the initial state i applies.
x and p have bound sizes and form the domain of the function f.
f(p, x) is the next state which becomes the present state p.
f, i and a are sufficient to define the machine.