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 条
  • [21] Extracting the Dynamic Current of a Power Delivery Network
    Barnes, Heidi
    Sandler, Steve
    Carrel, Jack
    2020 IEEE 29TH CONFERENCE ON ELECTRICAL PERFORMANCE OF ELECTRONIC PACKAGING AND SYSTEMS (EPEPS 2020), 2020,
  • [22] TYPES OF POWER AND STATUS
    Goldhamer, Herbert
    Shils, Edward A.
    AMERICAN JOURNAL OF SOCIOLOGY, 1939, 45 (02) : 171 - 182
  • [23] The power of media types
    Schewe, KD
    WEB INFORMATION SYSTEMS - WISE 2004, PROCEEDINGS, 2004, 3306 : 53 - 58
  • [24] Extracting the transverse momentum dependent polarizing fragmentation functions
    Callos, Daniel
    Kang, Zhong-Bo
    Terry, John
    PHYSICAL REVIEW D, 2020, 102 (09)
  • [25] Extracting Randomness from Extractor-Dependent Sources
    Dodis, Yevgeniy
    Vaikuntanathan, Vinod
    Wichs, Daniel
    ADVANCES IN CRYPTOLOGY - EUROCRYPT 2020, PT I, 2020, 12105 : 313 - 342
  • [26] QUICK METHOD FOR EXTRACTING PLANT EMBYROS FROM CERTAIN TYPES OF SEED
    GWYNNE, MD
    NATURE, 1959, 184 (4698) : 1588 - 1589
  • [27] CORRELATION BETWEEN EXTRACTING POWER OF ORGANOPHOSPHORIC EXTRACTING AGENTS AND SIGMA CONSTANT OF SUBSTITUENTS AT PHOSPHORUS ATOM
    NIKOLAEV, AV
    GRIBANOV.IN
    YAKOVLEV, NI
    DURASOV, VB
    KHOLKINA, ID
    MIRONOVA, ZN
    TSVETKOV, EN
    KABACHNI.MI
    DOKLADY AKADEMII NAUK SSSR, 1965, 165 (03): : 578 - &
  • [28] Extracting and Interpreting Unknown Factors with Classifier for Foot Strike Types in Running
    Seo, Chanjin
    Sabanai, Masato
    Goto, Yuta
    Tagami, Koji
    Ogata, Hiroyuki
    Kanosue, Kazuyuki
    Ohya, Jun
    2020 25TH INTERNATIONAL CONFERENCE ON PATTERN RECOGNITION (ICPR), 2021, : 3217 - 3224
  • [29] Extracting Shopping Interest-Related Product Types from theWeb
    Li, Yinghao
    Lockard, Colin
    Shiralkar, Prashant
    Zhang, Chao
    FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2023), 2023, : 7509 - 7525
  • [30] Extracting Appropriate Nodal Marginal Prices for All Types of Committed Reserve
    Akbary, Paria
    Ghiasi, Mohammad
    Pourkheranjani, Mohammad Reza Rezaie
    Alipour, Hamidreza
    Ghadimi, Noradin
    COMPUTATIONAL ECONOMICS, 2019, 53 (01) : 1 - 26