J. Michael Spivey
University of Oxford
Network
Latest external collaboration on country level. Dive into details by clicking on the dots.
Publication
Featured researches published by J. Michael Spivey.
Science of Computer Programming | 1990
J. Michael Spivey
Abstract Exceptions are a feature often provided by programming languages to deal with computations which may fail. This paper argues that lazy functional programming not only makes a built-in exception mechanism unnecessary, but provides a powerful tool for developing and transforming programs that use exceptions. The basic idea is the simple one of augmenting each type with a distinguished error value; this idea is made practical for writing programs and reasoning about them through the use of higher-order functions. An advantage is that simple equational arguments can be used to reason about the programs. Throughout the paper, the problem of simplifying algebraic expressions using rewriting rules is used as a source of motivation and examples.
mathematics of program construction | 1989
J. Michael Spivey
Many of the laws in Birds ‘theory of lists’ [1, 2] are precisely the conditions for various constructions to be functors, natural transformations, adjunctions, and so on. In this paper, I explore this categorical background to the theory, and — by generalizing one law and adding another — establish a completeness result for part of the theory. In the final section of the paper, I indicate how a theory of expression trees could be compiled along similar lines.
formal methods | 1990
J. Michael Spivey; Bernard Sufrin
Generic definitions provide an important part of the power of the Z notation, allowing the standard toolkit of mathematical notation to be built up from a very small set of primitives, and permitting application-oriented theories to be constructed with an appropriate degree of abstraction and generality. Although there is a notation for supplying explicitly the actual generic parameters when a generic constant is used, it greatly improves the readability of a Z document if the actual parameters are left to be inferred from the context, especially since every symbol from the basic mathematical toolkit would otherwise need explicit generic type parameters. In this paper we present and justify a method by which a type-checking program can carry out this inference of implicit generic parameters and check that the context determines them unambiguously. In the appendix we show the text of a type-checker for Z written in standard ML.
Journal of Functional Programming | 2009
J. Michael Spivey
Combinatorial search strategies including depth-first, breadth-first and depth-bounded search are shown to be different implementations of a common algebraic specification that emphasizes the compositionality of the strategies. This specification is placed in a categorical setting that combines algebraic specifications and monads.
Formal Aspects of Computing | 1996
J. Michael Spivey
The formal specification language Z is strongly typed, but has a rather inexpressive type system in which essentially the only type constructors are power set and Cartesian product. This paper explores the possibility of using a richer type system for extracting information about a Z specification, so that properties like being a function or a sequence become part of the type of an expression. This richer type system adds further type constructors to the sparse set contained in the language definition, and uses properties of Zs library functions to infer information about complex expressions from information about their simpler parts.
logic based program synthesis and transformation | 2000
Silvija Seres; J. Michael Spivey
It has earlier been assumed that a compositional approach to algorithm design and program transformation is somehow unique to functional programming. Elegant theoretical results codify the basic laws of algorithmics within the functional paradigm and with this paper we hope to demonstrate that some of the same techniques and results are applicable to logic programming as well.
Formal Aspects of Computing | 1996
J. Michael Spivey
Successive editions of the authors reference manual for the Z specification language [ZRM89, ZRM92] gave different sufficient conditions for the consistency of free type definitions. Both were expressed in terms of the settheoretic constructions present in the type definition. Whilst the first edition specified that these constructions should becontinuous, in the sense that they preserve limits of ascending chains of sets, the second edition specified that they should befinitary, i.e., that the result of each construction should be the union of a set of finite approximations. This short note clarifies the relationship between these two conditions.
Proceedings of the ACM on Programming Languages | 2017
J. Michael Spivey
Coroutine pipelines provide an attractive structuring mechanism for complex programs that process streams of data, with the advantage over lazy streams that both ends of a pipeline may interact with the I/O system, as may processes in the middle. Two popular Haskell libraries, Pipes and Conduit, support such pipelines. In both libraries, pipelines are implemented in a direct style by combining a free monad of communication events with an interpreter for (pseudo-)parallel composition that interleaves the events of its argument processes. These implementations both suffer from a slow-down when processes are deeply nested in sequence or in parallel. We propose an alternative implementation of pipelines based on continuations that does not suffer from this slow-down. What is more, the implementation is significantly faster on small, communication-intensive examples even where they do not suffer from the slow-down, and comparable in speed with similar programs based on lazy streams. We also show that the continuation-based implementation may be derived from the direct-style implementation by algebraic reasoning.
international conference on functional programming | 2007
Olivier Danvy; J. Michael Spivey
Over forty years ago, David Barron and Christopher Strachey published a startlingly elegant program for the Cartesian product of a list of lists, expressing it with a three nested occurrences of the function we now call foldr. This program is remarkable for its time because of its masterful display of higher-order functions and lexical scope, and we put it forward as possibly the first ever functional pearl. We first characterize it as the result of a sequence of program transformations, and then apply similar transformations to a program for the classical power set example. We also show that using a higher-order representation of lists allows a definition of the Cartesian product function where foldr is nested only twice.
ZB '00 Proceedings of the First International Conference of B and Z Users on Formal Specification and Development in Z and B | 2000
J. Michael Spivey
Object-oriented programming allows programs to be built from components, and makes it possible, with care, to produce libraries of components that can be used in many programs. In this talk, I will review some of the forms of composition and patterns of interaction that are used in OOP, and examine the question of whether mathematical specifications can be given to the interfaces between components.