Abstract

This paper establishes a finite axiomatization of possibly non-halting computer programs and tests, with the if-then-else operation. The model is a two-sorted algebra, with one sort being the programs and the other being the tests. The main operation on programs is composition, and 1 and 0 represent the programs skip and loop (i.e. never halts) respectively. Programs are modeled as partial functions on some state space [Formula: see text], with tests modeled as partial predicates on [Formula: see text]. The operations on the tests are the usual logical connectives ∧, ∨, [Formula: see text], [Formula: see text] and [Formula: see text]. In addition, there is the hybrid operation of if-then-else, and the test-valued operation [Formula: see text] on programs which is true when a program halts, and undefined otherwise. The halting operation [Formula: see text] implies that operations of domain [Formula: see text] and domain join ∨ may also be expressed. When tests are assumed to be possibly non-halting, the evaluation strategy of the logical connectives affects the result. Here we model parallel evaluation, as opposed to the common sequential (or short-circuit) evaluation strategy. For example, we view [Formula: see text] as false if either [Formula: see text] or [Formula: see text] is false, even if the other does not halt.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call