Extracting the Power of Dependent Types

被引:1
|
作者
Sinkarovs, Artjoms [1 ]
Cockx, Jesper [2 ]
机构
[1] Heriot Watt Univ, Edinburgh, Midlothian, Scotland
[2] Delft Univ Technol, Delft, Netherlands
基金
英国工程与自然科学研究理事会; 荷兰研究理事会;
关键词
embedded languages; program extraction; program verification; dependent types; reflection; Agda; DESIGN;
D O I
10.1145/3486609.3487201
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Most existing programming languages provide little support to formally state and prove properties about programs. Adding such capabilities is far from trivial, as it requires significant re-engineering of the existing compilers and tools. This paper proposes a novel technique to write correct-by-construction programs in languages without built-in verification capabilities, while maintaining the ability to use existing tools. This is achieved in three steps. Firstly, we give a shallow embedding of the language (or a subset) into a dependently typed language. Secondly, we write a program in that embedding, and we use dependent types to guarantee correctness properties of interest within the embedding. Thirdly, we extract a program written in the original language, so it can be used with existing compilers and tools. Our main insight is that it is possible to express all three steps in a single language that supports both dependent types and reflection. Essentially, this allows us to express a program, its formal properties, and a compiler for it hand-in-hand, offering a lot of flexibility to programmers. We demonstrate this three-step approach by embedding a subset of the PostScript language in Agda, and illustrating it with several short examples. Thus we use the power of reflection to bring the benefits of dependent types to languages that had to go without them so far.
引用
收藏
页码:83 / 95
页数:13
相关论文
共 50 条
  • [31] Disambiguation of semantic types in complex noun phrases for extracting candidate terms
    Department of Software Technologies and Information Systems, LIRE Laboratory, University of Constantine, 2-Abdelhamid Mehri, Constantine
    25000, Algeria
    Int. J. Metadata Semant. Ontol., 2 (112-122):
  • [32] Wavelet Types Comparison for Extracting Iris Feature Based on Energy Compaction
    Isnanto, R. Rizal
    3RD INTERNATIONAL CONFERENCE ON SCIENCE & ENGINEERING IN MATHEMATICS, CHEMISTRY AND PHYSICS 2015 (SCITECH 2015), 2015, 622
  • [33] Extracting Appropriate Nodal Marginal Prices for All Types of Committed Reserve
    Paria Akbary
    Mohammad Ghiasi
    Mohammad Reza Rezaie Pourkheranjani
    Hamidreza Alipour
    Noradin Ghadimi
    Computational Economics, 2019, 53 : 1 - 26
  • [34] Why dependent types matter
    McKinna, J
    ACM SIGPLAN NOTICES, 2006, 41 (01) : 1 - 1
  • [35] Modeling Contexts with Dependent Types
    Dapoigny, Richard
    Barlatier, Patrick
    FUNDAMENTA INFORMATICAE, 2010, 104 (04) : 293 - 327
  • [36] Random generators for dependent types
    Dybjer, P
    Qiao, HY
    Takeyama, M
    THEORETICAL ASPECTS OF COMPUTING - ICTAC 2004, 2005, 3407 : 341 - 355
  • [37] Partiality, State and Dependent Types
    Svendsen, Kasper
    Birkedal, Lars
    Nanevski, Aleksandar
    TYPED LAMBDA CALCULI AND APPLICATIONS, (TLCA 2011), 2011, 6690 : 198 - 212
  • [38] Dynamic typing with dependent types
    Ou, XM
    Tan, G
    Mandelbaum, Y
    Walker, D
    EXPLORING NEW FRONTIERS OF THEORETICAL INFORMATICS, 2004, 155 : 437 - 450
  • [39] Game semantics for dependent types
    Vakar, Matthijs
    Jagadeesan, Radha
    Abramsky, Samson
    INFORMATION AND COMPUTATION, 2018, 261 : 401 - 431
  • [40] ΠΣ: Dependent Types without the Sugar
    Altenkirch, Thorsten
    Danielsson, Nils Anders
    Loh, Andres
    Oury, Nicolas
    FUNCTIONAL AND LOGIC PROGRAMMING, PROCEEDINGS, 2010, 6009 : 40 - +