Dependent Types from Counterexamples

被引:5
|
作者
Terauchi, Tachio [1 ]
机构
[1] Tohoku Univ, Sendai, Miyagi 980, Japan
关键词
Algorithms; Languages; Theory; Verification; Dependent types; Intersection types; Interpolation; Counterexamples; Type inference;
D O I
10.1145/1707801.1706315
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Motivated by recent research in abstract model checking, we present a new approach to inferring dependent types. Unlike many of the existing approaches, our approach does not rely on programmers to supply the candidate (or the correct) types for the recursive functions and instead does counterexample-guided refinement to automatically generate the set of candidate dependent types. The main idea is to extend the classical fixed-point type inference routine to return a counterexample if the program is found untypable with the current set of candidate types. Then, an interpolating theorem prover is used to validate the counterexample as a real type error or generate additional candidate dependent types to refute the spurious counterexample. The process is repeated until either a real type error is found or sufficient candidates are generated to prove the program typable. Our system makes non-trivial use of "linear" intersection types in the refinement phase. The paper presents the type inference system and reports on the experience with a prototype implementation that infers dependent types for a subset of the Ocaml language. The implementation infers dependent types containing predicates from the quantifier-free theory of linear arithmetic and equality with uninterpreted function symbols.
引用
收藏
页码:119 / 130
页数:12
相关论文
共 50 条
  • [1] Dependent Types from Counterexamples
    Terauchi, Tachio
    POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, : 119 - 130
  • [2] A Category Theoretic View of Contextual Types: From Simple Types to Dependent Types
    Hu, Jason Z. S.
    Pientka, Brigitte
    Schoepp, Ulrich
    ACM TRANSACTIONS ON COMPUTATIONAL LOGIC, 2022, 23 (04)
  • [3] Learning Statistics From Counterexamples
    Berger, James
    SANKHYA-SERIES A-MATHEMATICAL STATISTICS AND PROBABILITY, 2024, 86 (SUPPL 1): : 13 - 42
  • [4] Loop Invariants from Counterexamples
    Greitschus, Marius
    Dietsch, Daniel
    Podelski, Andreas
    STATIC ANALYSIS (SAS 2017), 2017, 10422 : 128 - 147
  • [5] Saving safety from counterexamples
    Grundmann, Thomas
    SYNTHESE, 2020, 197 (12) : 5161 - 5185
  • [6] ON THE COMPLEXITY OF LEARNING FROM COUNTEREXAMPLES
    MAASS, W
    TURAN, G
    30TH ANNUAL SYMPOSIUM ON FOUNDATIONS OF COMPUTER SCIENCE, 1989, : 262 - 267
  • [7] Saving safety from counterexamples
    Thomas Grundmann
    Synthese, 2020, 197 : 5161 - 5185
  • [8] Generating tests from counterexamples
    Beyer, D
    Chlipala, AJ
    Henzinger, TA
    Jhala, R
    Majumdar, R
    ICSE 2004: 26TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, PROCEEDINGS, 2004, : 326 - 335
  • [9] LEARNING REGULAR LANGUAGES FROM COUNTEREXAMPLES
    IBARRA, OH
    TAO, J
    JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1991, 43 (02) : 299 - 316
  • [10] Finding Counterexamples from Parsing Conflicts
    Isradisaikul, Chinawat
    Myers, Andrew C.
    ACM SIGPLAN NOTICES, 2015, 50 (06) : 555 - 564