Instruction sequence processing operators

Instruction sequence is a key concept in practice, but it has as yet not come prominently into the picture in theoretical circles. This paper concerns instruction sequences, the behaviours produced by them under execution, the interaction between these behaviours and components of the execution environment, and two issues relating to computability theory. Positioning Turing's result regarding the undecidability of the halting problem as a result about programs rather than machines, and taking instruction sequences as programs, we analyse the autosolvability requirement that a program of a certain kind must solve the halting problem for all programs of that kind. We present novel results concerning this autosolvability requirement. The analysis is streamlined by using the notion of a functional unit, which is an abstract state-based model of a machine. In the case where the behaviours exhibited by a component of an execution environment can be viewed as the behaviours of a machine in its different states, the behaviours concerned are completely determined by a functional unit. The above-mentioned analysis involves functional units whose possible states represent the possible contents of the tapes of Turing machines with a particular tape alphabet. We also investigate functional units whose possible states are the natural numbers. This investigation yields a novel computability result, viz. the existence of a universal computable functional unit for natural numbers.


Introduction
We take the view that a sequential program is in essence a sequence of instructions, and that the execution of an instruction sequence involves the processing of instructions by an execution environment offering a family of services and may yield a Boolean value at termination. Interaction with services concerning the processing of instructions is deemed to form part of the behaviour exhibited by the instruction sequence under execution. We introduce a composition operator for families of services and three operators that have a direct bearing on the processing of instructions. Although all terms that can be build by means of these operators denote something, some of them are not really intended to denote anything. Therefore, we propose to comply with conventions that exclude the use of such terms.
A slightly different view on the execution of an instruction sequence was taken in [10]. This resulted in different operators: a composition operator for services instead of service families and two kinds of operators, called use operators and apply operators, that have a direct bearing on the processing of instructions but do not cover the possibility that some value is yielded at termination. In subsequent work, the composition operator for services was not used. Moreover, we experienced the lack of a way to deal with the possibility that some value is yielded at termination of the execution of an instruction sequence. This lack is particularly felt with instruction sequences that implement some test. This state of affairs forms the greater part of our motivation for devising the four operators presented in this paper.
The work presented in this paper belongs to a line of research in which program algebra [2] is the setting used for investigating issues in which sequential programs are involved. The starting-point of program algebra is the perception of a program as a single-pass instruction sequence, i.e. a finite or infinite sequence of instructions of which each instruction is executed at most once and can be dropped after it has been executed or jumped over. This perception is simple, appealing, and links up with practice. Moreover, basic thread algebra [2] is the setting used for modelling the behaviours exhibited by instruction sequences under execution. 1 The three operators that are related to the processing of instructions will be introduced as operators extending basic thread algebra. Because these operators are primarily intended to be used in the setting of program algebra to describe and analyse instruction sequence processing, they are loosely referred to by the term instruction sequence processing operators.
Both thread and service are abstract behavioural concepts. A state space is not inherent in the concept of a service. This is sometimes experienced as a limitation in case the services that are involved in the processing of instructions can be viewed as the behaviours of a machine in its different states. For that reason, we introduce the related but more concrete concept of a functional unit, in which a state space is inherent. The case where the state space is the set of natural numbers is arguably the simplest significant case. Another interesting case is the one where the state space consists of objects that represent the possible contents of the tapes of Turing machines with a particular tape alphabet. Using the instruction sequence processing operators proposed in this paper, we investigate both cases. One of the main result of the investigation is the existence of a universal computable functional unit for natural numbers. Results like this one are outside the scope of the concept of a service. The other main results of the investigation concern the autosolvability requirement inherent in Turing's result regarding the undecidability of the halting problem.
The halting problem is frequently paraphrased as follows: the halting problem is the problem to determine, given a program and an input to the program, whether execution of the program on that input will eventually terminate. However, Turing's result regarding the undecidability of the halting problem is a result about Turing machines rather than programs. It says that there does not exist a single Turing machine that, given the description of an arbitrary Turing machine and input, will determine whether the computation of that Turing machine applied to that input eventually halts (see e.g. [20]). In [11], Turing's result regarding the undecidability of the halting problem is positioned as a result about programs rather than machines. In the case of the unsolvability result regarding the halting problem for programs presented in [11], the mere requirement that a program of a certain kind must solve the halting problem for all programs of that kind leads to a contradiction. This requirement is the autosolvability requirement referred to above.
Some marginal notes are in order. In the investigations concerning functional units, only two of the three instruction sequence processing operators proposed in this paper are used. The unused instruction sequence processing operator generalizes the use operators that are used in [4,9] among others. In this paper, we use an extension of a program notation rooted in program algebra instead of an extension of program algebra itself. The program notation in question has been chosen because it turned out to be appropriate. However, in principle any program notation that is as expressive as the closed terms of program algebra would do.
This paper is organized as follows. First, we give a survey of the program notation used in this paper (Section 2) and define its semantics using basic thread algebra (Section 3). Next, we introduce service families, the composition operator for service families (Section 4), and the three operators that are related to the processing of instructions by service families (Section 5). Then, we propose to comply with conventions that exclude the use of terms that are not really intended to denote anything (Sections 6). After that, we give an example related to the processing of instructions by service families (Section 7). Further, we present an interesting variant of one of the above-mentioned operators related to the processing of instructions (Section 8). Thereafter, we introduce the concept of a functional unit and related concepts (Section 9). Subsequently, we investigate functional units for natural numbers (Section 10). We also make some remarks about functional units for finite state spaces (Section 11). Then, we define autosolvability and related notions in terms of functional units related to Turing machine tapes (Section 12). After that, we discuss the weakness of interpreters when it comes to solving the halting problem (Section 13) and give positive and negative results concerning the autosolvability of the halting problem (Section 14). Finally, we make some concluding remarks (Section 15). This paper consolidates material from [7,6,5].

PGLB with Boolean Termination
In this section, we introduce the program notation PGLB bt (PGLB with Boolean termination). In [2], a hierarchy of program notations rooted in program algebra is presented. One of the program notations that belong to this hierarchy is PGLB (ProGramming Language B). This program notation is close to existing assembly languages and has relative jump instructions. PGLB bt is PGLB extended with two termination instructions that allow for the execution of instruction sequences to yield a Boolean value at termination. In PGLB bt , it is assumed that a fixed but arbitrary non-empty finite set A of basic instructions has been given. The intuition is that the execution of a basic instruction may modify a state and produces t or f at its completion.
PGLB bt has the following primitive instructions: for each a ∈ A, a plain basic instruction a; -for each a ∈ A, a positive test instruction +a; -for each a ∈ A, a negative test instruction −a; -for each l ∈ N, a forward jump instruction #l; -for each l ∈ N, a backward jump instruction \#l; -a plain termination instruction !; -a positive termination instruction !t; -a negative termination instruction !f.
PGLB bt instruction sequences have the form u 1 ; . . . ; u k , where u 1 , . . . , u k are primitive instructions of PGLB bt . On execution of a PGLB bt instruction sequence, these primitive instructions have the following effects: the effect of a positive test instruction +a is that basic instruction a is executed and execution proceeds with the next primitive instruction if t is produced and otherwise the next primitive instruction is skipped and execution proceeds with the primitive instruction following the skipped one -if there is no primitive instructions to proceed with, deadlock occurs; -the effect of a negative test instruction −a is the same as the effect of +a, but with the role of the value produced reversed; -the effect of a plain basic instruction a is the same as the effect of +a, but execution always proceeds as if t is produced; -the effect of a forward jump instruction #l is that execution proceeds with the l-th next primitive instruction -if l equals 0 or there is no primitive instructions to proceed with, deadlock occurs; -the effect of a backward jump instruction \#l is that execution proceeds with the l-th previous primitive instruction -if l equals 0 or there is no primitive instructions to proceed with, deadlock occurs; -the effect of the plain termination instruction ! is that execution terminates and in doing so does not deliver a value; -the effect of the positive termination instruction !t is that execution terminates and in doing so delivers the Boolean value t; -the effect of the negative termination instruction !t is that execution terminates and in doing so delivers the Boolean value f.
From Section 9, we will use a restricted version of PGLB bt called PGLB sbt (PGLB with strict Boolean termination). The primitive instructions of PGLB sbt are the primitive instructions of PGLB bt with the exception of the plain termination instruction. Thus, PGLB sbt instruction sequences are PGLB bt instruction sequences in which the plain termination instruction does not occur.
In Section 7, we will give examples of instruction sequences for which the delivery of a Boolean value at termination of their execution is natural. There, we will write ; n i=1 P i , where P 1 , . . . , P n are PGLB bt instruction sequences, for the PGLB bt instruction sequence P 1 ; . . . ; P n .

Thread Extraction
In this section, we make precise in the setting of BTA bt (Basic Thread Algebra with Boolean termination) which behaviours are exhibited on execution by PGLB bt instruction sequences. We start by introducing BTA bt . In [2], BPPA (Basic Polarized Process Algebra) is introduced as a setting for modelling the behaviours exhibited by instruction sequences under execution. Later, BPPA has been renamed to BTA (Basic Thread Algebra). BTA bt is BTA extended with two constants for termination at which a Boolean value is yielded.
In BTA bt , it is assumed that a fixed but arbitrary non-empty finite set A of basic actions, with tau ∈ A, has been given. We write A tau for A ∪ {tau}. The members of A tau are referred to as actions.
A thread is a behaviour which consists of performing actions in a sequential fashion. Upon each basic action performed, a reply from an execution environment determines how it proceeds. The possible replies are the Boolean values t (standing for true) and f (standing for false). Performing the action tau will always lead to the reply t.
BTA bt has one sort: the sort T of threads. We make this sort explicit because we will extend BTA bt with additional sorts in Section 5. To build terms of sort T, BTA bt has the following constants and operators: the deadlock constant D : T; -the plain termination constant S : T; -the positive termination constant S+ : T; -the negative termination constant S− : T; -for each a ∈ A tau , the binary postconditional composition operator a : We assume that there is a countably infinite set of variables of sort T which includes x, y, z. Terms of sort T are built as usual. We use infix notation for postconditional composition. We introduce action prefixing as an abbreviation: a • p, where p is a term of sort T, abbreviates p a p.
The thread denoted by a closed term of the form p a q will first perform a, and then proceed as the thread denoted by p if the reply from the execution environment is t and proceed as the thread denoted by q if the reply from the execution environment is f. The thread denoted by D will become inactive, the thread denoted by S will terminate without yielding a value, and the threads x tau y = x tau x T1 Table 2. Approximation induction principle πn+1(x a y) = πn(x) a πn(y) P3 denoted by S+ and S− will terminate and with that yield the Boolean values t and f, respectively. BTA bt has only one axiom. This axiom is given in Table 1.
Each closed BTA bt term of sort T denotes a thread that will become inactive or terminate after it has performed finitely many actions. Infinite threads can be described by guarded recursion. A guarded recursive specification over BTA bt is a set of recursion equations E = {x = t x | x ∈ V }, where V is a set of variables of sort T and each t x is a BTA bt term of the form D, S, S+, S− or t a t ′ with t and t ′ that contain only variables from V . We are only interested in models of BTA bt in which guarded recursive specifications have unique solutions, such as the appropriate expansion of the projective limit model of BTA presented in [1]. Regular threads, i.e. threads that can only be in a finite number of states, are solutions of finite guarded recursive specifications.
To reason about infinite threads, we assume the infinitary conditional equation AIP (Approximation Induction Principle). AIP is based on the view that two threads are identical if their approximations up to any finite depth are identical. The approximation up to depth n of a thread is obtained by cutting it off after it has performed n actions. In AIP, the approximation up to depth n is phrased in terms of the unary projection operator π n : T → T. AIP and the axioms for the projection operators are given in Table 2. In this table, a stands for an arbitrary action from A tau and n stands for an arbitrary natural number.
We can prove that the projections of solutions of guarded recursive specifications over BTA bt are representable by closed BTA bt terms of sort T. Lemma 1. Let E be a guarded recursive specification over BTA bt , and let x be a variable occurring in E. Then, for all n ∈ N, there exists a closed BTA bt term p of sort T such that E ⇒ π n (x) = p.
Proof. In the case of BTA, this is proved in [3] as part of the proof of Theorem 1 from that paper. The proof concerned goes through in the case of BTA bt . ⊓ ⊔ Table 3. Defining equations for thread extraction operation The behaviours exhibited on execution by PGLB bt instruction sequences are considered to be regular threads, with the basic instructions taken for basic actions. The thread extraction operation | | defines, for each PGLB bt instruction sequence, the behaviour exhibited on its execution. The thread extraction operation is defined by |u 1 ; . . . ; u k | = |1, u 1 ; . . . ; u k |, where | , | is defined by the equations given in Table 3 (for a ∈ A and l, i ∈ N) and the rule that |i, u 1 ; . . . ; u k | = D if u i is the beginning of an infinite jump chain. 2

Services and Service Families
In this section, we introduce service families and a composition operator for service families. We start by introducing services.
It is assumed that a fixed but arbitrary set M of methods has been given. Methods play the role of commands. A service is able to process certain methods. The processing of a method may involve a change of the service. At completion of the processing of a method, the service produces a reply value. The set R of reply values is the set {t, f, d}.
In SF, the algebraic theory of service families introduced below, the following is assumed with respect to services: a set S of services has been given together with: • for each m ∈ M, a total function ∂ ∂m : S → S; • for each m ∈ M, a total function ̺ m : S → R; satisfying the condition that there exists a unique S ∈ S with ∂ ∂m (S) = S and ̺ m (S) = d for all m ∈ M; -a signature Σ S has been given that includes the following sort: • the sort S of services; and the following constant and operators: • the empty service constant δ : S; • for each m ∈ M, the derived service operator ∂ ∂m : S → S; -S and Σ S are such that: • each service in S can be denoted by a closed term of sort S; • the constant δ denotes the unique S ∈ S such that ∂ ∂m (S) = S and ̺ m (S) = d for all m ∈ M; • if closed term t denotes service S, then ∂ ∂m (t) denotes service ∂ ∂m (S). When a request is made to service S to process method m: if ̺ m (S) = d, then S processes m, produces the reply ̺ m (S), and next proceeds as ∂ ∂m (S); -if ̺ m (S) = d, then S rejects the request to process method m.
The unique service S such that ∂ ∂m (S) = S and ̺ m (S) = d for all m ∈ M is called the empty service. It is the service that is unable to process any method.
It is also assumed that a fixed but arbitrary non-empty finite set F of foci has been given. Foci play the role of names of services in the service family offered by an execution environment. A service family is a set of named services where each name occurs only once.
SF has the sorts, constants and operators in Σ S and in addition the following sort: the sort SF of service families; and the following constant and operators: the empty service family constant ∅ : SF; -for each f ∈ F , the unary singleton service family operator f. : S → SF; -the binary service family composition operator ⊕ : SF × SF → SF; -for each F ⊆ F , the unary encapsulation operator ∂ F : SF → SF.
We assume that there is a countably infinite set of variables of sort SF which includes u, v, w. Terms are built as usual in the many-sorted case (see e.g. [16,21]). We use prefix notation for the singleton service family operators and infix notation for the service family composition operator.
The service family denoted by ∅ is the empty service family. The service family denoted by a closed term of the form f.H consists of one named service only, the service concerned is the service denoted by H, and the name of this service is f . The service family denoted by a closed term of the form C ⊕ D consists of all named services that belong to either the service family denoted by C or the service family denoted by D. In the case where a named service from the service family denoted by C and a named service from the service family denoted by D have the same name, they collapse to an empty service with the name concerned. The service family denoted by a closed term of the form ∂ F (C) consists of all named services with a name not in F that belong to the service family denoted by C.
The service family composition operator takes the place of the non-interfering combination operator from [10]. As suggested by the name, service family com- Table 4. Axioms of SF position is composition of service families. Non-interfering combination is composition of services, which has the disadvantage that its usefulness is rather limited without an additional renaming mechanism. The axioms of SF are given in Table 4. In this table, f stands for an arbitrary focus from F and H and H ′ stand for arbitrary closed terms of sort S. The axioms of SF simply formalize the informal explanation given above.
In Section 7, we will give an example of the use of the service family composition operator. There, we will write ⊕ n i=1 C i , where C 1 , . . . , C n are terms of sort SF, for the term C 1 ⊕ . . . ⊕ C n .

Use, Apply and Reply
A thread may interact with the named services from the service family offered by an execution environment. That is, a thread may perform an basic action for the purpose of requesting a named service to process a method and to return a reply value at completion of the processing of the method. In this section, we combine BTA bt with SF and extend the combination with three operators that relate to this kind of interaction between threads and services, resulting in TA tsi bt . The operators in question are called the use operator, the apply operator, and the reply operator. The difference between the use operator and the apply operator is a matter of perspective: the use operator is concerned with the effects of service families on threads and therefore produces threads, whereas the apply operator is concerned with the effects of threads on service families and therefore produces service families. The reply operator is concerned with the effects of service families on the Boolean values that threads possibly deliver at their termination. The reply operator does not only produce Boolean values: it produces special values in cases where no Boolean value is delivered at termination or no termination takes place. The use operator and the apply operator introduced here are mainly adaptations of the use operators and the apply operators introduced in [10] to service families. The reply operator has no counterpart in [10].
For the set A of basic actions, we take the set {f.m | f ∈ F , m ∈ M}. All three operators mentioned above are concerned with the processing of methods by services from a service family in pursuance of basic actions performed by a thread. The service involved in the processing of a method is the service whose name is the focus of the basic action in question.
TA tsi bt has the sorts, constants and operators of both BTA bt and SF and in addition the following sort: the sort R of replies; and the following constants and operators: the reply constants t, f, d, m : R; -the binary use operator / : T × SF → T; -the binary apply operator • : T × SF → SF; -the binary reply operator ! : T × SF → R.
We use infix notation for the use, apply and reply operators.
The thread denoted by a closed term of the form p / C and the service family denoted by a closed term of the form p • C are the thread and service family, respectively, that result from processing the method of each basic action with a focus of the service family denoted by C that the thread denoted by p performs, where the processing is done by the service in that service family with the focus of the basic action as its name. When the method of a basic action performed by a thread is processed by a service, the service changes in accordance with the method concerned, and affects the thread as follows: the basic action turns into the internal action tau and the two ways to proceed reduces to one on the basis of the reply value produced by the service. The value denoted by a closed term of the form p ! C is the Boolean value that the thread denoted by p / C delivers at its termination if it terminates and delivers a Boolean value at termination, the value m (standing for meaningless) if it terminates and does not deliver a Boolean value at termination, and the value d (standing for divergent) if it does not terminate.
The axioms of TA tsi bt are the axioms of BTA bt , the axioms of SF, and the axioms given in Tables 5, 6 and 7. In these tables, f stands for an arbitrary focus from F , m stands for an arbitrary method from M, H stands for an arbitrary term of sort S, and n stands for an arbitrary natural number. The axioms simply formalize the informal explanation given above and in addition stipulate what is the result of use, apply and reply if inappropriate foci or methods are involved. Axioms A10 and R10 allow for reasoning about infinite threads in the contexts of apply and reply, respectively. The counterpart of A10 and R10 for use, i.e. n≥0 π n (x) / u = π n (y) / v ⇒ x / u = y / v , follows from AIP and U10.
We can prove that each closed TA tsi bt term of sort T can be reduced to a closed BTA bt term of sort T.
Lemma 2. For all closed TA tsi bt terms p of sort T, there exists a closed BTA bt term q of sort T such that p = q is derivable from the axioms of TA tsi bt .
Proof. In the special case of singleton service families, this is in fact proved in [3] as part of the proof of Theorem 3 from that paper. The proof of the general case goes essentially the same. ⊓ ⊔ Table 5. Axioms for use operator Table 6. Axioms for apply operator Table 7. Axioms for reply operator In the case of TA tsi bt , the notion of a guarded recursive specification is somewhat adapted. A guarded recursive specification over TA tsi bt is a set of recursion where V is a set of variables of sort T and each t x is a TA tsi bt term of sort T that can be rewritten, using the axioms of TA tsi bt , to a term of the form D, S, S+, S− or t a t ′ with t and t ′ that contain only variables from V . We are only interested in models of TA tsi bt in which guarded recursive specifications have unique solutions.
A thread p in a model A of TA tsi bt in which guarded recursive specifications have unique solutions is definable if it is representable by a closed TA tsi bt term or it is the solution in A of a guarded recursive specification over TA tsi bt . Below, we will formulate a proposition about the use, apply and reply operators using the foci operation foci defined by the equations in Table 8 (for foci f ∈ F and terms H of sort S). The operation foci gives, for each service family, the set of all foci that serve as names of named services belonging to the service family. We will only make use of the following properties of foci in the proof of the proposition: This means that the proposition could be formulated without using the foci operation, but that would make it less intelligible. Proposition 1. If x is a definable thread and foci(u) ∩ foci(v) = ∅, then: Proof. By the definitions of definable thread and guarded recursive specification over TA tsi bt , Lemmas 1 and 2, and axioms AIP, U10, A10 and R10, it is sufficient to prove that the following equations are derivable for each closed BTA bt term p of sort T: This is easy by induction on the structure of p, using the above-mentioned properties of foci.
⊓ ⊔ Let p and C be TA tsi bt terms of sort T and SF, respectively. Then p converges on C, written p ↓ C, is inductively defined by the following clauses: and p diverges on C, written p ↑ C, is defined by p ↑ C iff not p ↓ C. Moreover, p converges on C with Boolean reply, written p ↓ B C, is inductively defined by the clauses 2, . . . , 6 for ↓ with everywhere ↓ replaced by ↓ B .
The following two propositions concern the connection between convergence and the reply operator. Proof. By Lemma 2, it is sufficient to prove it for all closed BTA bt terms p of sort T. This is easy by induction on the structure of p. ⊓ ⊔ Proof. By the definitions of definable thread and guarded recursive specification over TA tsi bt , the last clause of the inductive definition of ↓, Lemmas 1 and 2, and axiom R10, it is sufficient to prove p ↓ u iff p ! u = t or p ! u = f or p ! u = m for each closed BTA bt term p of sort T. This is easy by induction on the structure of p.
⊓ ⊔ Because the use operator, apply operator and reply operator are primarily intended to be used to describe and analyse instruction sequence processing, they are called instruction sequence processing operators.
We introduce the apply operator and reply operator in the setting of PGLB bt by defining: for all PGLB bt instruction sequences P . Similarly, we introduce convergence in the setting of PGLB bt by defining: for all PGLB bt instruction sequences P .

Relevant Use Conventions
In the setting of service families, sets of foci play the role of interfaces. The set of all foci that serve as names of named services in a service family is regarded as the interface of that service family. Unavoidably there are cases in which processing does not halt or, even worse (because it is statically detectable), interfaces do not match. This means that there are cases in which there is nothing that we intend to denote by a term of the form p • C, p ! C or C ⊕ D.
We propose to comply with the following relevant use conventions: The condition found in the first convention is justified by the fact that in the projective limit model of TA tsi bt , for definable threads x, Similar remarks apply to the condition found in the second convention.
The idea of relevant use conventions is taken from [8], where it plays a central role in an account of the way in which mathematicians usually deal with division by zero in mathematical texts. According to [8], mathematicians deal with this issue by complying with the convention that p/q is only used if it is known that q = 0. This approach is justified by the fact that there is nothing that mathematicians intend to denote by p/q if q = 0. It yields simpler mathematical texts than the popular approach in theoretical computer science, which is characterized by complete formality in definitions, statements and proofs. In this computer science approach, division is considered a partial function and some logic of partial functions is used. In [12], deviating from this, division is considered a total function whose value is zero in all cases of division by zero. It may be imagined that this notion of division is the one with which mathematicians make themselves familiar before they start to read and write mathematical texts professionally.
We think that the idea to comply with conventions that exclude the use of terms that are not really intended to denote anything is not only of importance in mathematics, but also in theoretical computer science. For example, the consequence of adapting Proposition 1 to comply with the relevant use conventions described above, by adding appropriate conditions to the three properties, is that we do not have to consider in the proof of the proposition the equality of terms by which we do not intend to denote anything.
In the sequel, we will comply with the relevant use conventions described above.
We can define the use operators introduced earlier in [4,9], 3 the apply operators introduced earlier in [10], and similar counterparts of the reply operator as follows: These definitions give rise to the derived conventions that p • f H is only used if it is known that p ↓ f.H and p ! f H is only used if it is known that p ↓ B f.H.

Example
In this section, we use an implementation of a bounded counter by means of a number of Boolean registers as an example to show that there are cases in which the delivery of a Boolean value at termination of the execution of an instruction sequence is quite natural. We also show in this example that it is easy to compose a number of Boolean register services by means of the service family composition operation. Accomplishing this with the non-interfering service combination operation from [10] is quite involved.
First, we describe services that make up Boolean registers. The Boolean register services are able to process the following methods: the set to true method set:t; -the set to false method set:f; -the get method get.
It is assumed that set:t, set:f, get ∈ M.
The methods that Boolean register services are able to process can be explained as follows: set:t : the contents of the Boolean register becomes t and the reply is t; -set:f : the contents of the Boolean register becomes f and the reply is f; -get : nothing changes and the reply is the contents of the Boolean register.
For the set S of services, we take the set {BR t , BR f , BR d } of Boolean register services. For each m ∈ M, we take the functions ∂ ∂m and ̺ m such that (b ∈ {t, f}): Moreover, we take the names used above to denote the services in S for constants of sort S.
We continue with the implementation of a bounded counter by means of a number of Boolean registers. We consider a counter that can contain a natural number in the interval [0, 2 n − 1] for some n > 0. To implement the counter, we represent its content binary using a collection of n Boolean registers named b:0, . . . , b:n−1. We take t for 0 and f for 1, and we take the bit represented by the content of the Boolean register named b:i for a less significant bit than the bit represented by the content of the Boolean register named b:j if i < j.
The following instruction sequences implement set to zero, increment by one, decrement by one, and test on zero, respectively: Concerning the Boolean values delivered at termination of executions of these instruction sequences, we have that: It is obvious that t is delivered at termination of an execution of SETZERO and that t or f is delivered at termination of an execution of ISZERO depending on whether the content of the counter is zero or not. Increment by one and decrement by one are both modulo 2 n . For that reason, t or f is delivered at termination of an execution of SUCC or PRED depending on whether the content of the counter is really incremented or decremented by one or not.

Abstracting Use
With the use operator introduced in Section 5, the action tau is left as a trace of a basic action that has led to the processing of a method, like with the use operators on services introduced in e.g. [4,9]. However, with the use operators on services introduced in [10], nothing is left as a trace of a basic action that has led to the processing of a method. Thus, these use operators abstract fully Table 9. Axioms for abstracting use operator from internal activity. In other words, they are abstracting use operators. For completeness, we introduce an abstracting variant of the use operator introduced in Section 5.
That is, we introduce the following additional operator: the binary abstracting use operator // : T × SF → T.
We use infix notation for the abstracting use operator.
The axioms for the abstracting use operator are given in Table 9. Owing to the possible concealment of actions by abstracting use, π n (x // u) = π n (x) // u is not a plausible axiom. However, axiom AU10 allows for reasoning about infinite threads in the context of abstracting use.

Functional Units
In this section, we introduce the concept of a functional unit and related concepts.
It is assumed that a non-empty set S of states has been given. As before, it is assumed that a non-empty finite set M of methods has been given. However, in the setting of functional units, methods serve as names of operations on a state space. For that reason, the members of M will henceforth be called method names.
A method operation on S is a total function from S to B×S . A partial method operation on S is a partial function from S to B × S . We We look upon the set I(H), where H ∈ F U (S ), as the interface of H. It looks to be convenient to have a notation for the restriction of a functional unit to a subset of its interface. We write (I, H), where H ∈ F U(S ) and I ⊆ I(H), for the functional unit {(m, M ) ∈ H | m ∈ I}.
Let H ∈ F U(S ). Then an extension of H is an H ′ ∈ F U (S ) such that H ⊆ H ′ .
The following is a simple illustration of the use of functional units. An unbounded counter can be modelled by a functional unit for N with method operations for set to zero, increment by one, decrement by one, and test on zero.
According to the definition of a functional unit, ∅ ∈ F U(S ). By that we have a unique functional unit with an empty interface, which is not very interesting in itself. However, when considering services that behave according to functional units, ∅ is exactly the functional unit according to which the empty service δ (the service that is not able to process any method) behaves.
The method names attached to method operations in functional units should not be confused with the names used to denote specific method operations in describing functional units. Therefore, we will comply with the convention to use names beginning with a lower-case letter in the former case and names beginning with an upper-case letter in the latter case.
We will use PGLB sbt instruction sequences to derive partial method operations from the method operations of a functional unit. We write L(f.I), where I ⊆ M, for the set of all PGLB sbt instruction sequences, taking the set {f.m | m ∈ I} as the set A of basic instructions.
The derivation of partial method operations from the method operations of a functional unit involves services whose processing of methods amounts to replies and service changes according to corresponding method operations of the functional unit concerned. These services can be viewed as the behaviours of a machine, on which the processing in question takes place, in its different states. We take the set F U(S ) × S as the set S of services. We write H(s), where H ∈ F U(S ) and s ∈ S , for the service (H, s). The functions ∂ ∂m and ̺ m are defined as follows: where s ′ is a fixed but arbitrary state in S. We assume that each H(s) ∈ S can be denoted by a closed term of sort S. In this connection, we use the following notational convention: for each H(s) ∈ S, we write H(s) for an arbitrary closed term of sort T that denotes H(s). The ambiguity thus introduced could be obviated by decorating H(s) wherever it stands for a closed term. However, in this paper, it is always immediately clear from the context whether it stands for a closed term. Moreover, we believe that the decorations are more often than not distracting. Therefore, we leave it to the reader to make the decorations mentally wherever appropriate. Let H ∈ F U(S ), and let I ⊆ I(H). Then an instruction sequence x ∈ L(f.I) produces a partial method operation |x| H as follows: If |x| H is total, then it is called a derived method operation of H.

Functional Units for Natural Numbers
In this section, we investigate functional units for natural numbers. The main consequences of considering the special case where the state space is N are the following: (i) N is infinite, (ii) there is a notion of computability known which can be used without further preparations.
An example of a functional unit in F U(N) is an unbounded counter. The method names involved are setzero, succ, pred, and iszero. The method operations involved are the functions Setzero, Succ, Pred , Iszero : N → B × N defined as follows: The functional unit Counter is defined as follows: Proposition 4. There are infinitely many functional unit degrees below ({pred, iszero}, Counter).
Proof. For each n ∈ N, we define a functional unit H n ∈ F U(N) such that H n ≤ ({pred, iszero}, Counter) as follows: Let n, m ∈ N be such that n < m.
Proof. We will show that all derived method operations of H ′ are computable.
Take an arbitrary P ∈ L(f.I(H ′ )) such that |P | H ′ is a derived method operations of H ′ . It follows immediately from the definition of thread extraction that |P | is the solution of a finite linear recursive specification over BTA bt , i.e. a finite guarded recursive specification over BTA bt in which the right-hand side of each equation is a BTA bt term of the form D, S+, S− or x a y where x and y are variables of sort T. Let E be a finite linear recursive specification over BTA bt of which the solution for x 1 is |P |. Because |P | H ′ is total, it may be assumed without loss of generality that D does not occur as the right-hand side of an equation in E. Suppose that From this set of equations, using the relevant axioms and definitions, we obtain a set of equations of which the solution for F 1 is |P | e H ′ : where, for every i ∈ [1, n], the function χ i : N → N is such that for all s ∈ N: It follows from the way in which this set of equations is obtained from E, the fact that m i e H ′ and χ i are computable for each i ∈ [1, n], and the fact that sg and sg are computable, that this set of equations is equivalent to a set of equations by which |P | e H ′ is defined recursively in the sense of Kleene (see [13]). This means that |P | e H ′ is general recursive, and hence computable. In a similar way, it is proved that |P | r H ′ is computable.

⊓ ⊔
A computable H ∈ F U(N) is universal if for each computable L ∈ F U(N), we have L ≤ H. There exists a universal computable functional unit for natural numbers.
Theorem 3. There exists a computable H ∈ F U(N) that is universal.
Proof. We will show that there exists a computable H ∈ F U(N) with the property that each computable M ∈ MO(N) is a derived method operation of H.
As a corollary of Theorem 10.3 from [17], 4 we have that each computable M ∈ MO(N) can be computed by means of a register machine with six registers, say r0, r1, r2, r3, r4, and r5. The registers are used as follows: r0 as input register; r1 as output register for the output in B; r2 as output register for the output in N; r3, r4 and r5 as auxiliary registers. The content of r1 represents the Boolean output as follows: 0 represents t and all other natural numbers represent f. For each i ∈ [0, 5], register ri can be incremented by one, decremented by one, and tested for zero by means of instructions ri.succ, ri.pred and ri.iszero, respectively. We write L(RM 6 ) for the set of all PGLB sbt instruction sequences, taking the set {ri.succ, ri.pred, ri.iszero | i ∈ [0, 5]} as the set A of basic instructions. Clearly, L(RM 6 ) is adequate to represent all register machine programs using six registers.
We define a computable functional unit U ∈ F U(N) whose method operations can simulate the effects of the register machine instructions by encoding the register machine states by natural numbers such that the contents of the registers can reconstructed by prime factorization. This functional unit is defined as follows: where the method operations are defined as follows: and, for each i ∈ [0, 5]: 5 where p i is the (i+1)th prime number, i.e. p 0 = 2, p 1 = 3, p 2 = 5, . . . . We define a function rml2ful from L(RM 6 ) to L(f.I(U)), which gives, for each instruction sequence P in L(RM 6 ), the instruction sequence in L(f.I(U)) by which the effect produced by P on a register machine with six registers can be simulated on U. This function is defined as follows: ψ(ri.succ) = f.ri:succ , ψ(ri.pred) = f.ri:pred , ψ(ri.iszero) = f.ri:iszero .
Take an arbitrary computable M ∈ MO(N). Then there exist an instruction sequence in L(RM 6 ) that computes M . Take an arbitrary P ∈ L(RM 6 ) that computes M . Then |rml2ful(P )| U = M . Hence, M is a derived method operation of U.
⊓ ⊔ The universal computable functional unit U defined in the proof of Theorem 3 has 20 method operations. However, three method operations suffice.
Theorem 4. There exists a computable H ∈ F U(N) with only three method operations that is universal.
Proof. We know from the proof of Theorem 3 that there exists a computable H ∈ F U(N) with 20 method operations, say M 0 , . . . , M 19 . We will show that there exists a computable H ′ ∈ F U(N) with only three method operations such that H ≤ H ′ . We define a computable functional unit U ′ ∈ F U(N) with only three method operations such that U ≤ U ′ as follows: where the method operations are defined as follows: We have that, for each i ∈ [0, 19], |f.g1 ; f.g2 i ; +f.g3 ; !t ; !f| U ′ = M i . 6 Hence, M 0 , . . . , M 19 are derived method operations of U ′ .

⊓ ⊔
The universal computable functional unit U ′ defined in the proof of Theorem 4 has three method operations. We can show that one method operation does not suffice.
Theorem 5. There does not exist a computable H ∈ F U (N) with only one method operation that is universal.
Proof. We will show that there does not exist a computable H ∈ F U(N) with one method operation such that Counter ≤ H. Here, Counter is the functional unit introduced at the beginning of this section. Assume that there exists a computable H ∈ F U(N) with one method operation such that Counter ≤ H. Let H ′ ∈ F U(N) be such that H ′ has one method operation and Counter ≤ H ′ , and let m be the unique method name such that I(H ′ ) = {m}. Take arbitrary P 1 , P 2 ∈ L(f.I(H ′ )) such that |P 1 | H ′ = Succ and |P 2 | H ′ = Pred . Then |P 1 | H ′ (0) = (t, 1) and |P 2 | H ′ (1) = (t, 0). Instruction f.m is processed at least once if P 1 is applied to H ′ (0) or P 2 is applied to H ′ (1). Let k 0 be the number of times that instruction f.m is processed on application of P 1 to H ′ (0) and let k 1 be the number of times that instruction f.m is processed on application of P 2 to H ′ (1) (irrespective of replies). Then, from state 0, state 0 is reached again after f.m is processed k 0 +k 1 times. Thus, by repeated application of P 1 to H ′ (0) at most k 0 + k 1 different states can be reached. This contradicts with |P 1 | H ′ = Succ. Hence, there does not exist a computable H ∈ F U(N) with one method operation such that Counter ≤ H. ⊓ ⊔ It is an open problem whether two method operations suffice.

Functional Units for Finite State Spaces
In this short section, we make some remarks about functional units for finite state spaces.
In the special case where the state space is B, the state space consists of only two states. Because there are four possible unary functions on B, there are precisely 16 method operations in MO(B). There are in principle 2 16 different functional units in F U(B), for it is useless to include the same method operation more than once under different names in a functional unit. This means that 2 16 is an upper bound of the number of functional unit degrees in F U(B)/≡. However, it is straightforward to show that F U(B)/≡ has only 12 different functional unit degrees.
In the more general case of a finite state space consisting of k states, say S k , there are in principle 2 2 k ·k k different functional units in F U(S k ). Already with k = 3, it becomes unclear whether the number of functional unit degrees in F U(S k ) can be determined manually. Actually, we do not know at the moment whether it can be determined with computer support either.

Functional Units Relating to Turing Machine Tapes
In this section, we define some notions that have a bearing on the halting problem in the setting of PGLB sbt and functional units. The notions in question are defined in terms of functional units for the following state space: The states from V resemble the possible contents of the tape of a Turing machine whose tape alphabet is {0, 1, :}. Consider a state vˆw ∈ V . Then v corresponds to the content of the tape to the left of the position of the tape head and w corresponds to the content of the tape from the position of the tape head to the right -the indefinite numbers of padding blanks at both ends are left out. The colon serves as a seperator of bit sequences. This is for instance useful if the input of a program consists of another program and an input to the latter program, both encoded as a bit sequences.
A method operation M ∈ MO(V ) is computable if there exist computable functions F, G : N → N such that M (v) = (β(F (α(v))), α −1 (G(α(v)))) for all v ∈ V , where α : V → N is a bijection and β : N → B is inductively defined by β(0) = t and β(n It is assumed that, for each H ∈ F U(V ), an injective function from L(f.I(H)) to {0, 1} * has been given that yields for each x ∈ L(f.I(H)), an encoding of x as a bit sequence. We use the notation x to denote the encoding of x as a bit sequence.
Let H ∈ F U(V ), and let I ⊆ I(H). Then: x ∈ L(f.I(H)) produces a solution of the halting problem for L(f.I) with respect to H if: These definitions make clear that each combination of an H ∈ F U(V ) and an I ⊆ I(H) gives rise to a halting problem instance.
In Section 13 and 14, we will make use of a method operation Dup ∈ MO(V ) for duplicating bit sequences. This method operation is defined as follows: Proposition 5. Let H ∈ F U(V ) be such that (dup, Dup) ∈ H, let I ⊆ I(H) be such that dup ∈ I, let x ∈ L(f.I), and let v ∈ {0, 1} * and w ∈ {0, 1, :} * be such Proof. This follows immediately from the definition of Dup and the axioms for !.
⊓ ⊔ In Sections 13 and 14, we will make use of two simple transformations of PGLB sbt instruction sequences that affect only their termination behaviour on execution and the Boolean value yielded at termination in the case of termination. Here, we introduce notations for those transformations.
Let x be a PGLB sbt instruction sequence. Then we write swap(x) for x with each occurrence of !t replaced by !f and each occurrence of !f replaced by !t, and we write f2d (x) for x with each occurrence of !f replaced by #0. In the following proposition, the most important properties relating to these transformations are stated.
Proposition 6. Let x be a PGLB sbt instruction sequence. Then: Proof. Let p be a closed BTA bt term of sort T. Then we write swap ′ (p) for p with each occurrence of S+ replaced by S− and each occurrence of S− replaced by S+, and we write f2d ′ (p) for p with each occurrence of S− replaced by D. It is easy to prove by induction on i that |i, swap(x)| = swap ′ (|i, x|) and |i, f2d (x)| = f2d ′ (|i, x|) for all i ∈ N. By this result, Lemma 1, and axiom R10, it is sufficient to prove the following for each closed BTA bt term p of sort T: This is easy by induction on the structure of p.
⊓ ⊔ By the use of foci and the introduction of apply and reply operators on service families, we make it possible to deal with cases that remind of multi-tape Turing machines, Turing machines that has random access memory, etc. However, in this paper, we will only consider the case that reminds of single-tape Turing machines. This means that we will use only one focus (f ) and only singleton service families.

Interpreters
It is often mentioned that an interpreter, which is a program for simulating the execution of programs that it is given as input, cannot solve the halting problem because the execution of the interpreter will not terminate if the execution of its input program does not terminate. In this section, we have a look upon the termination behaviour of interpreters in the setting of PGLB sbt and functional units.
Let Moreover, x ∈ L(f.I) is a reflexive interpreter for L(f.I ′ ) with respect to H if x is an interpreter for L(f.I ′ ) with respect to H and x ∈ L(f.I ′ ).
The following theorem states that a reflexive interpreter that always terminates is impossible in the presence of the method operation Dup. In the proof of Theorem 6, the presence of the method operation Dup is essential. It is easy to see that the theorem goes through for all functional units for V of which Dup is a derived method operation. An example of such a functional unit is the one whose method operations correspond to the basic steps that can be performed on the tape of a Turing machine.
For each H ∈ F U(V ), m ∈ I(H), and v ∈ V , we have (f.m ; !t ; !f) ↓ f.H(v). This leads us to the following corollary of Theorem 6.

Autosolvability of the Halting Problem
Because a reflexive interpreter that always terminates is impossible in the presence of the method operation Dup, we must conclude that solving the halting problem by means of a reflexive interpreter is out of the question in the presence of the method operation Dup. The question arises whether the proviso "by means of a reflexive interpreter" can be dropped. In this section, we answer this question in the affirmative. Before we present this negative result concerning autosolvability of the halting problem, we present a positive result.  Proof. It is sufficient to prove for an arbitrary x ∈ L(f.I(H ′ )) that, for all v ∈ V , x ↓ f.H ′ (v) is decidable. We will prove this by induction on the number of colons in v.
The basis step. Because the number of colons in v equals 0, x with each occurrence of f.halting and +f.halting replaced by #2 and each occurrence of −f.halting replaced by #1. Because The inductive step. Because the number of colons in v is greater than 0, either each occurrence of f.halting and +f.halting replaced by #1 if the occurrence leads to the first application of Halting and Halting r (v) = t, and by #2 otherwise; each occurrence of −f.halting replaced by #2 if the occurrence leads to the first application of Halting and Halting r (v) = t, and by #1 otherwise.
An occurrence of f.halting, +f.halting or −f.halting in x leads to the first application of Halting iff |1, x| = |i, x|, where i is its position in x. Because x is finite, it is decidable whether an occurrence of f.halting, +f.halting or −f.halting leads to the first processing of halting. Moreover, by the induction hypothesis, it is decidable whether Theorems 7 and 8 together tell us that there exists a functional unit H ∈ F U(V ), viz. ∅, with the property that the halting problem is potentially recursively autosolvable for L(f.I(H)) with respect to H. Let H ∈ F U(V ) be such that all derived method operations of H are computable and do not increase the number of colons. Then the halting problem is potentially autosolvable for L(f.I(H)) with respect to H. However, the halting problem is not always potentially recursively autosolvable for L(f.I(H)) with respect to H because otherwise the halting problem would always be decidable.
⊓ ⊔ Below, we will give an alternative proof of Theorem 9. A case distinction is needed in both proofs, but in the alternative proof it concerns a minor issue. The issue in question is covered by the following lemma. Proof. Let x ∈ L(f.{dup}), and let x ′ be x with each occurrence of f.dup and +f.dup replaced by #1 and each occurrence of −f.dup replaced by #2. For all v ∈ V , Dup r (v) = t. Therefore, x ↓ f.H(v) ⇔ x ′ ↓ ∅ for all v ∈ V . Because x ′ is finite, x ′ ↓ ∅ is decidable.
⊓ ⊔ Both proofs of Theorem 9 given above are diagonalization proofs in disguise. Theorem 10 indicates that diagonalization and decidability are independent so to speak.

Concluding Remarks
We have taken the view that the execution of an instruction sequence involves the processing of instructions by an execution environment that offers a service family and may yield a Boolean value at termination. We have proposed the service family composition operator, the use operator, the apply operator and the reply operator. The latter three operators are directly related to the processing in question. Notice that the apply operator fits in with the viewpoint that programs are state transformers that can be modelled by partial functions. This viewpoint was first taken in the early days of denotational semantics, see e.g. [15,18,19]. Pursuant to [8], we have also proposed to comply with conventions that exclude the use of terms that can be build by means of the proposed operators, but are not really intended to denote anything. The idea to comply with such conventions looks to be wider applicable in theoretical computer science. A state space is not inherent in the abstract behavioural concept of a service. We have introduced the related but more concrete concept of a functional unit, in which a state space is inherent. Using the instruction sequence processing operators proposed in this paper, we have investigated functional units whose state space is the set of natural numbers and functional units whose state space consists of objects that represent the possible contents of the tapes of Turing machines with a particular tape alphabet. We have established the existence of a universal computable functional unit for natural numbers and results concerning the autosolvability requirement inherent in Turing's result regarding the undecidability of the halting problem.
The latter results extend and strengthen the results regarding the halting problem for programs given in [11] in a setting which looks to be more adequate to describe and analyse issues regarding the halting problem for programs. It happens that decidability depends on the halting problem instance considered. This is different in the case of the on-line halting problem for programs, i.e. the problem to forecast during its execution whether a program will eventually terminate (see [11]). An interesting option for future work is to investigate the bounded halting problem for programs, i.e. the problem to determine, given a program and an input to the program, whether execution of the program on that input will terminate after the execution of no more than a fixed number of basic instructions.