273 research outputs found
Towards a linear algebra of programming
The Algebra of Programming (AoP) is a discipline for programming from specifications using
relation algebra. Specification vagueness and nondeterminism are captured by relations. (Final) implemen-
tations are functions.
Probabilistic functions are half way between relations and functions: they express the propensity, or like-
lihood of ambiguous, multiple outputs. This paper puts forward a basis for a Linear Algebra of Programming
(LAoP) extending standard AoP towards probabilistic functions. Because of the quantitative essence of these
functions, the allegory of binary relations which supports the AoP has to be extended. We show that, if one
restricts to discrete probability spaces, categories of matrices provide adequate support for the extension,
while preserving the pointfree reasoning style typical of the AoP.Fundação para a Ciência e a Tecnologia (FCT
Alloy meets the algebra of programming: a case study
Relational algebra offers to software engineering the same degree of conciseness and calculational power as linear algebra in other engineering disciplines. Binary relations play the role of matrices with similar emphasis on multiplication and transposition. This matches with Alloy’s lemma “everything is a relation” and with the relational basis of the Algebra of Programming (AoP). Altogether, it provides a simple and coherent approach to checking and calculating programs from abstract models. In this paper, we put Alloy and the Algebra of Programming together in a case study originating from the Verifiable File System mini-challenge put forward by Joshi and Holzmann: verifying the refinement of an abstract file store model into a journaled (FLASH) data model catering to wear leveling and recovery from power loss. Our approach relies on diagrams to graphically express typed assertions. It interweaves model checking (in Alloy) with calculational proofs in a way which offers the best of both worlds. This provides ample evidence of the positive impact in software verification of Alloy’s focus on relations, complemented by induction-free proofs about data structures such as stores and lists.Fundação para a Ciência e a Tecnologia (FCT
Certified Context-Free Parsing: A formalisation of Valiant's Algorithm in Agda
Valiant (1975) has developed an algorithm for recognition of context free
languages. As of today, it remains the algorithm with the best asymptotic
complexity for this purpose. In this paper, we present an algebraic
specification, implementation, and proof of correctness of a generalisation of
Valiant's algorithm. The generalisation can be used for recognition, parsing or
generic calculation of the transitive closure of upper triangular matrices. The
proof is certified by the Agda proof assistant. The certification is
representative of state-of-the-art methods for specification and proofs in
proof assistants based on type-theory. As such, this paper can be read as a
tutorial for the Agda system
Transforming data by calculation
Thispaperaddressesthefoundationsofdata-modeltransformation.A catalog of data mappings is presented which includes abstraction and representa- tion relations and associated constraints. These are justified in an algebraic style via the pointfree-transform, a technique whereby predicates are lifted to binary relation terms (of the algebra of programming) in a two-level style encompassing both data and operations. This approach to data calculation, which also includes transformation of recursive data models into “flat” database schemes, is offered as alternative to standard database design from abstract models. The calculus is also used to establish a link between the proposed transformational style and bidi- rectional lenses developed in the context of the classical view-update problem.Fundação para a Ciência e a Tecnologia (FCT
How functional programming mattered
In 1989 when functional programming was still considered a niche topic, Hughes wrote a visionary paper arguing convincingly ‘why functional programming matters’. More than two decades have passed. Has functional programming really mattered? Our answer is a resounding ‘Yes!’. Functional programming is now at the forefront of a new generation of programming technologies, and enjoying increasing popularity and influence. In this paper, we review the impact of functional programming, focusing on how it has changed the way we may construct programs, the way we may verify programs, and fundamentally the way we may think about programs
High-Level Methods for Quantum Computation and Information
A research programme is set out for developing the use of high-level methods
for quantum computation and information, based on the categorical formulation
of quantum mechanics introduced by the author and Bob Coecke.Comment: 5 page
Calculating fault propagation in functional programs
Techn. Report TR-HASLab:01:2013The production of safety critical software is bound to a number of safety and certification standards in which estimating the risk of failure plays a central role. Yet risk estimation seems to live outside most programmers’ core practice, involving simulation techniques and worst case analysis performed a posteriori.
In this paper we propose that risk be constructively handled in functional programming by writing programs which choose between expected and faulty be- haviour and by reasoning about them in a linear algebra extension to the standard algebra of programming.
In particular, the paper calculates propagation of faults across standard program transformation techniques known as tupling and fusion, enabling the fault of the whole to be expressed in terms of the faults of its parts.Fundação para a Ciência e a Tecnologia (FCT
A study of risk-aware program transformation
In the trend towards tolerating hardware unreliability, accuracy is exchanged for cost
savings. Running on less reliable machines, functionally correct code becomes risky
and one needs to know how risk propagates so as to mitigate it. Risk estimation, however,
seems to live outside the average programmer’s technical competence and core
practice.
In this paper we propose that program design by source-to-source transformation be
risk-aware in the sense of making probabilistic faults visible and supporting equational
reasoning on the probabilistic behaviour of programs caused by faults. This reasoning
is carried out in a linear algebra extension to the standard, `a la Bird-Moor algebra of
programming.
This paper studies, in particular, the propagation of faults across standard program
transformation techniques known as tupling and fusion, enabling the fault of the whole
to be expressed in terms of the faults of its parts.Fundação para a Ciência e a Tecnologia, Portugal, under grant number BI1-2012 PTDC/EIA-CCO/122240/2010 UMINHO
- …