List or set comprehensions are a wonderful means to define nondeterministic or relational programs. Despite their beauty, comprehensions are somewhat underused in program calculation. The purpose of this paper is to remind the program-calculation community that comprehensions provide a convenient language for specifying and deriving nondeterministic programs in a pointwise manner. We illustrate the style of reasoning by re-solving the well-known problem of constructing tournament representations: Given a sequence x of integers, construct a heap whose inorder traversal is x itself.
CITATION STYLE
Hinze, R. (2002). Constructing tournament representations: An exercise in pointwise relational programming. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 2386, pp. 131–147). Springer Verlag. https://doi.org/10.1007/3-540-45442-X_9
Mendeley helps you to discover research relevant for your work.