Algebra of programming in agda: Dependent types for relational program derivation

  • Authors:
  • Shin-cheng Mu;Hsiang-shang Ko;Patrik Jansson

  • Affiliations:
  • Institute of information science, academia sinica, taiwan (e-mail: scm@iis.sinica.edu.tw);Department of computer science and information engineering, national taiwan university, taiwan (e-mail: joshs@mail2000.com.tw);Department of computer science and engineering, chalmers university of technology, and university of gothenburg, sweden (e-mail: patrikj@chalmers.se)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Relational program derivation is the technique of stepwise refining a relational specification to a program by algebraic rules. The program thus obtained is correct by construction. Meanwhile, dependent type theory is rich enough to express various correctness properties to be verified by the type checker. We have developed a library, AoPA (Algebra of Programming in Agda), to encode relational derivations in the dependently typed programming language Agda. A program is coupled with an algebraic derivation whose correctness is guaranteed by the type system. Two non-trivial examples are presented: an optimisation problem and a derivation of quicksort in which well-founded recursion is used to model terminating hylomorphisms in a language with inductive types.