Processes

Just about everything in LOTOS is a process. Processes are black boxes, with carefully defined interactions with the outside world, which are the only ways of influencing their behavior. The general form of a process definition is:

#figure858#
Figure: LOTOS Process Syntax

Process parameters are lists of gates and values that the process may be instantiated with. For example:

#figure861#
Figure: Recursive Definition of Buffer in LOTOS

Note that a process definition may be recursive, indicating that the process continues to run rather than implicitly running the <#864#> stop <#864#> process at the end. A process is defined as <#865#> event gates<#865#> at which <#866#> events <#866#> cause process interaction.

#figure867#
Figure: LOTOS Gates

Processes may be built up together to form more complex processes. The composition of basic components of complex processes is done with various operators. Where you want to override operator precedence, or for clarity, <#870#> ;SPM_quot;();SPM_quot; <#870#> brackets may be used. The <#871#> ;SPM_quot;;;SPM_quot; <#871#> operator builds sequences of processes as we saw in the first example of a process. The <#872#> ;SPM_quot;[];SPM_quot; <#872#> operator denotes a choice of alternate paths of execution for the process. For example, a user interface to a connection protocol might be specified as follows:

#figure873#
Figure: Service Interface in LOTOS

The || operator allows us to specify parallel processes. When two parallel processes offer to synchronise with events at the same gates, the conflict is resolved by some internal mechanism to the system. In other words, some internal event not a choice of the environment of the processes (e.g. a user typing something or a cosmic ray!), causes a choice. Internal events may be written <#876#> ;SPM_quot;i;SPM_quot;<#876#>. The <#877#> [;SPM_gt;<#877#> operator allows us to specify the disruption of one process by another. Given verbatim33 and verbatim34 at any point in Activity, Disrupt can come along and do whatever it does, and then Activity is finished with completely. The <#878#>
<#878#> or Hiding operator is used to hide gates from the environment, so that a process may selectively filter which gates it is prepared to receive events on, as it wishes. The <#879#> ;SPM_gt;;SPM_gt;<#879#> operator, or enabling operator is equivalent to the sequencing operator, except that execution stops so long as the previous process terminated via the <#880#> exit <#880#> process. An example of a complex process to make breakfast might be:

#figure881#
Figure: Example of LOTOS