### Abstract

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.

Original language | English |
---|---|

Title of host publication | POPL'10 - Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages |

Pages | 119-130 |

Number of pages | 12 |

DOIs | |

Publication status | Published - 2010 Apr 20 |

Externally published | Yes |

Event | 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL'10 - Madrid, Spain Duration: 2010 Jan 17 → 2010 Jan 23 |

### Publication series

Name | Conference Record of the Annual ACM Symposium on Principles of Programming Languages |
---|---|

ISSN (Print) | 0730-8566 |

### Other

Other | 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL'10 |
---|---|

Country | Spain |

City | Madrid |

Period | 10/1/17 → 10/1/23 |

### Keywords

- Counterexamples
- Dependent types
- Interpolation
- Intersection types
- Type inference

### ASJC Scopus subject areas

- Software

## Fingerprint Dive into the research topics of 'Dependent types from counterexamples'. Together they form a unique fingerprint.

## Cite this

*POPL'10 - Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages*(pp. 119-130). (Conference Record of the Annual ACM Symposium on Principles of Programming Languages). https://doi.org/10.1145/1706299.1706315