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 条
  • [1] Extracting Mutually Dependent Multisets
    Kiyota, Natsuki
    Shimamura, Sho
    Hirata, Kouichi
    DISCOVERY SCIENCE, DS 2017, 2017, 10558 : 267 - 280
  • [2] Algorithms for Extracting Topic across Different Types of Documents
    Nakamura, Shoichi
    Chiba, Saori
    Shirai, Hirokazu
    Kaminaga, Hiroaki
    Yokoyama, Setsuo
    Miyadera, Youzou
    KNOWLEDGE-BASED AND INTELLIGENT INFORMATION AND ENGINEERING SYSTEMS, PT II, PROCEEDINGS, 2009, 5712 : 580 - +
  • [3] MedTable: Extracting Disease Types from Web Tables
    Koutraki, Maria
    Fetahu, Besnik
    SEMANTIC WEB: ESWC 2020 SATELLITE EVENTS, 2020, 12124 : 152 - 157
  • [4] Understanding ownership types with dependent types
    Cameron, Nicholas
    Drossopoulou, Sophia
    Noble, James
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2013, 7850 : 84 - 108
  • [5] EXTRACTING AMERICAN POWER ON GLOBAL TERRAINS
    Dochuk, Darren
    REVIEWS IN AMERICAN HISTORY, 2020, 48 (03) : 439 - 448
  • [6] EXTRACTING POWER FROM THE AMAZON BASIN
    ADAM, JA
    IEEE SPECTRUM, 1988, 25 (08) : 34 - 38
  • [7] POWER TYPES
    ODELL, JJ
    JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1994, 7 (02): : 8 - &
  • [8] Parametricity and Dependent Types
    Bernardy, Jean-Philippe
    Jansson, Patrik
    Paterson, Ross
    ICFP 2010: PROCEEDINGS OF THE 2010 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2010, : 345 - 356
  • [9] Games for Dependent Types
    Abramsky, Samson
    Jagadeesan, Radha
    Vakar, Matthijs
    AUTOMATA, LANGUAGES, AND PROGRAMMING, PT II, 2015, 9135 : 31 - 43
  • [10] Dependent Types at Work
    Bove, Ana
    Dybjer, Peter
    LANGUAGE ENGINEERING AND RIGOROUS SOFTWARE DEVELOPMENT, 2009, 5520 : 57 - 99