Persistent queries in the behavioral theory of algorithms

Andreas Blass, Yuri Gurevich
2011 ACM Transactions on Computational Logic  
We propose an extension of the behavioral theory of interactive sequential algorithms to deal with the following situation. A query is issued during a certain step, but the step ends before any reply is received. Later, a reply arrives, and later yet the algorithm makes use of this reply. By a persistent query, we mean a query for which a late reply might be used. Our proposal involves issuing, along with a persistent query, a location where a late reply is to be stored. After presenting our
more » ... r presenting our proposal in general terms, we discuss the modifications that it requires in the existing axiomatics of interactive sequential algorithms and in the existing syntax and semantics of abstract state machines. (To make that discussion self-contained, we include a summary of this material before the modifications.) Fortunately, only rather minor modifications are needed. ible in a suitable, natural programming language. The project has been carried out for small-step (sometimes also called sequential) algorithms in [Gurevich 2000 ]; for parallel algorithms in [Blass and Gurevich 2003]; for a limited but natural class of interactive, small-step algorithms, called ordinary ones, in [Blass and Gurevich 2006-7]; and for general interactive, small-step algorithms in ]. The programming languages used for the second goal have been versions of abstract state machines (ASMs). Thus, the results concerning this goal have provided partial confirmation for the ASM thesis, the thesis that every algorithm can be represented, on its natural level of abstraction, by an ASM. The present paper extends the behavioral theory of interactive, small-step algorithms, which was presented in ]. Previous work on the behavioral theory of algorithms has concentrated on what happens during a single step. In particular, the papers cited above established, for various classes of algorithms, the representation theorem that every algorithm in the class can be matched, step for step, by an ASM. Almost nothing was said there about what happens between steps, because almost nothing can be said; the environment can make essentially arbitrary inter-step changes to the state. Intra-step interaction with the environment, in contrast, was treated in great detail in [Blass and Gurevich 2006-7;]. The key difference from inter-step interaction is that, although the environment can, during a step, give essentially arbitrary replies to the algorithm's queries, the effect of these replies on the state and thus on the future course of the computation is under the algorithm's control. In the present paper, we use inter-step interaction to treat an issue arising out of intra-step interaction, namely the possibility of a query being answered after the completion of the step in which the query was issued. We modify slightly the axioms in ] and we extend the ASM syntax of ] to accommodate such late replies. As in [Gurevich 2000; Blass and Gurevich 2006-7;], we restrict attention to small-step algorithms. The amount of work that a small-step algorithm performs during any one step is bounded independently of the state or input. In the rest of this article, algorithms are by default small-step. In [Blass and Gurevich 2006-7, Part I], we argued that, in principle, the intra-step interaction of an algorithm with the environment reduces to the algorithm querying the environment and the environment answering these queries. In the case of ordinary algorithms [Blass and Gurevich 2006-7], every query issued during a step needs to be answered before the algorithm finishes the step. In the general case , however, the algorithm may finish a step without having all the replies. If, in such a situation, the reply to a query arrives after the algorithm's step has ended, then the question arises how to handle the late reply. It may happen that the algorithm has no use for that late reply; consider for example an algorithm that issues two queries and sets x to 1 when at least one of the two replies arrives. So the step would end when one of the two queries has been answered; the other might be answered later. In such a case, the late reply can simply be ignored or discarded. But suppose that the algorithm eventually, at some later step, needs the late reply. In the framework of where attention is restricted to
doi:10.1145/1877714.1877722 fatcat:bbgc2ctcdbbotny4d3iy4gknmm