Reference. Dependent types in practical programming
Cite
Cited by (7)
Fulls Seldom Differ koch-2025-fulls
Many programs process lists by recursing in a wide variety of sequential and/or divide-and-conquer patterns. Reasoning about the correctness and completeness of these programs requires reasoning about the lengths of the lists, techniques for which are typically undecidable or at least NP-complete. In this paper we show how introducing a relatively simple (sub-)language for expressions describing list lengths, whilst not completely general, covers a great number of these patterns. It includes not only doubling but also exponentiation (iterated doubling), and moreover admits a simple length-checking algorithm that is complete over a predictable problem domain. We prove termination of the algorithm via category-theoretic pullbacks, formalized in Agda, as well as providing a more realistic implementation in Rocq, and a toy language Fulbourn with interpreter in Haskell.
Focusing on Refinement Typing economou-2023-focusing
We present a logically principled foundation for systematizing, in a way that works with any computational effect and evaluation order, SMT constraint generation seen in refinement type systems for functional programming languages. By carefully combining a focalized variant of call-by-push-value, bidirectional typing, and our novel technique of value-determined indexes, our system generates solvable SMT constraints without existential (unification) variables. We design a polarized subtyping relation allowing us to prove our logically focused typing algorithm is sound, complete, and decidable. We prove type soundness of our declarative system with respect to an elementary domain-theoretic denotational semantics. Type soundness implies, relatively simply, the total correctness and logical consistency of our system. The relative ease with which we obtain both algorithmic and semantic results ultimately stems from the proof-theoretic technique of focalization.
Dependent Type Refinements for Futures somayyajula-2023-dependent
Type refinements combine the compositionality of typechecking with the expressivity of program logics, offering a synergistic approach to program verification. In this paper we apply dependent type refinements to SAX, a futures-based process calculus that arises from the Curry-Howard interpretation of the intuitionistic semi-axiomatic sequent calculus and includes unrestricted recursion both at the level of types and processes. With our type refinement system, we can reason about the partial correctness of SAX programs, complementing prior work on sized type refinements that supports reasoning about termination. Our design regime synthesizes the infinitary proof theory of SAX with that of bidirectional typing and Hoare logic, deriving some standard reasoning principles for data and (co)recursion while enabling information hiding for codata. We prove syntactic type soundness, which entails a notion of partial correctness that respects codata encapsulation. We illustrate our language through a few simple examples.
Bidirectional Typing dunfield-2021-bidirectional
Bidirectional typing combines two modes of typing: type checking, which checks that a program satisfies a known type, and type synthesis, which determines a type from the program. Using checking enables bidirectional typing to support features for which inference is undecidable; using synthesis enables bidirectional typing to avoid the large annotation burden of explicitly typed languages. In addition, bidirectional typing improves error locality. We highlight the design principles that underlie bidirectional type systems, survey the development of bidirectional typing from the prehistoric period before Pierce and Turner’s local type inference to the present day, and provide guidance for future investigations.
Algorithmics bird-2021-algorithmics
A Coq Library For Internal Verification of Running-Times mccarthy_etal_2016
Refinement Types as Higher-Order Dependency Pairs roux-2011-refinement
Refinement types are a well-studied manner of performing in-depth analysis on functional programs. The dependency pair method is a very powerful method used to prove termination of rewrite systems; however its extension to higher-order rewrite systems is still the subject of active research. We observe that a variant of refinement types allows us to express a form of higher-order dependency pair method: from the rewrite system labeled with typing information, we build a type-level approximated dependency graph, and describe a type level embedding preorder. We describe a syntactic termination criterion involving the graph and the preorder, which generalizes the simple projection criterion of Middeldorp and Hirokawa, and prove our main result: if the graph passes the criterion, then every well-typed term is strongly normalizing.
Cites 27 works (0 here)
External (27)
- Dead Code Elimination through Dependent Types (1999)
- Cayenne—a language with dependent types (1998)
- The design and implementation of a certifying compiler (1998)
- Local type inference (1998)
- Dependent Types in Practical Programming (1998)
- Eliminating array bound checking through dependent types (1998)
- Functional unparsing (1998)
- A proof environment for the development of group communication systems (1998)
- Proof-carrying code (1997)
- Indexed types (1997)
- Type inference with constrained types (1997)
- Some examples of DML programming (1997)
- Proving the correctness of reactive systems using sized types (1996)
- PVS: Combining specification, proof checking, and model checking (1996)
- Shape checking of array programs (1996)
- Synthesizing proofs from programs in the Calculus of Inductive Constructions (1995)
- The Coq proof assistant user's guide (1993)
- A Framework for Defining Logics (1993)
- Reasoning about programs in continuation-passing style (1993)
- Le langage Caml (1993)
- Report on the programming language Haskell (1992)
- Refinement types for ML (1991)
- The Definition of Standard ML (1990)
- Toward formal development of ML programs: Foundations and methodology (1989)
- Computational lambda-calculus and monads (1989)
- PX: A Computational Logic (1988)
- Implementing Mathematics with The Nuprl Proof Development System (1986)