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

被引:23
|
作者
Mu, Shin-Cheng [1 ]
Ko, Hsiang-Shang [2 ]
Jansson, Patrik [3 ,4 ]
机构
[1] Acad Sinica, Inst Informat Sci, Taipei, Taiwan
[2] Natl Taiwan Univ, Dept Comp Sci & Informat Engn, Taipei, Taiwan
[3] Chalmers Univ Technol, Dept Comp Sci & Engn, Gothenburg, Sweden
[4] Univ Gothenburg, Gothenburg, Sweden
关键词
D O I
10.1017/S0956796809007345
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:545 / 579
页数:35
相关论文
共 50 条
  • [2] Algebra of programming using dependent types6
    Mu, Shin-Cheng
    Ko, Hsiang-Shang
    Jansson, Patrik
    MATHEMATICS OF PROGRAM CONSTRUCTION, PROCEEDINGS, 2008, 5133 : 268 - +
  • [3] Reflective programming in the relational algebra
    VandenBussche, J
    vanGucht, D
    Vossen, G
    JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1996, 52 (03) : 537 - 549
  • [4] A Brief Overview of Agda - A Functional Language with Dependent Types
    Bove, Ana
    Dybjer, Peter
    Norell, Ulf
    THEOREM PROVING IN HIGHER ORDER LOGICS, PROCEEDINGS, 2009, 5674 : 73 - 78
  • [5] Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types
    Vezzosi, Andrea
    Mortberg, Anders
    Abel, Andreas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (ICFP):
  • [6] Combining relational algebra, SQL, and constraint programming
    Cadoli, M
    Mancini, T
    FRONTIERS OF COMBINING SYSTEMS, 2002, 2309 : 147 - 161
  • [7] Cubical Agda: A dependently typed programming language with univalence and higher inductive types
    Vezzosi, Andrea
    Mortberg, Anders
    Abel, Andreas
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2021, 31
  • [8] Experience Report: Types for a Relational Algebra Library
    Augustsson, Lennart
    Agren, Marten
    ACM SIGPLAN NOTICES, 2016, 51 (12) : 127 - 132
  • [9] INCLUDING SCALARS IN A PROGRAMMING LANGUAGE BASED ON THE RELATIONAL ALGEBRA
    MERRETT, TH
    LALIBERTE, N
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1989, 15 (11) : 1437 - 1443
  • [10] Generic programming with dependent types
    Altenkirch, Thorsten
    McBride, Conor
    Morris, Peter
    DATATYPE-GENERIC PROGRAMMING, 2007, 4719 : 209 - 257