Linear Dependent Types and Relative Completeness
A system of linear dependent types for the lambda calculus with full higher-order recursion, called dlPCF, is introduced and proved sound and relatively complete. Completeness holds in a strong sense: dlPCF is not only able to precisely capture the functional behaviour of PCF programs (i.e. how the output relates to the input) but also some of their intensional properties, namely the complexity of evaluating them with Krivine’s Machine. dlPCF is designed around dependent types and linear logic and is parametrized on the underlying language of index terms, which can be tuned so as to sacrifice completeness for tractability.
💡 Research Summary
The paper introduces dlPCF, a linear dependent type system designed for the full higher‑order recursive λ‑calculus (PCF). dlPCF combines the resource‑sensitivity of linear logic with the expressive power of dependent types, allowing types to contain index terms that describe quantitative relationships between inputs, outputs, and evaluation costs. The system is parametrised by an auxiliary language of index terms; by choosing a richer or more restricted index language, one can trade off between theoretical completeness and practical tractability.
The authors first formalise the syntax of dlPCF, extending PCF with linear connectives (⊗, ⊸) and a “!” modality for duplicable resources. Types may be of the form Πx:A. B(x) where B can refer to index terms such as φ(n) ≤ c·n², thereby encoding a bound on the number of Krivine‑Machine steps required to evaluate a term of size n. The operational semantics is given by Krivine’s abstract machine, which evaluates terms in a call‑by‑name fashion while counting reduction steps.
Two fundamental meta‑theoretical results are proved. Soundness is established via preservation and progress lemmas: a well‑typed term never gets stuck, and its evaluation respects the quantitative constraints expressed in its type. Consequently, the index annotation indeed serves as an upper bound on the actual runtime of the term under Krivine’s machine.
The more striking contribution is relative completeness. The authors show that, assuming the index language is expressive enough (e.g., it can define any total recursive function), every PCF program can be assigned a dlPCF type that exactly captures both its functional behaviour (the mapping from inputs to outputs) and its intensional behaviour (the exact cost of evaluation). This is “relative” because the completeness hinges on the power of the chosen index language. If the index language is limited to, say, polynomial functions, the system remains complete for all programs whose runtime is polynomial, while type inference becomes decidable.
A parametric design is emphasized: by selecting different fragments of the index language, one can obtain a spectrum ranging from full theoretical completeness (with undecidable inference) to tractable fragments suitable for implementation. The paper illustrates the approach with several classic PCF examples—factorial, Fibonacci, list sorting—showing how dlPCF types can express O(n), O(φⁿ), and O(n log n) bounds respectively, and how the “!” modality controls memory duplication.
In the related‑work discussion, dlPCF is positioned against pure linear type systems (e.g., Bounded Linear Logic) that lack quantitative annotations, and against dependent type systems (e.g., Liquid Types, Dependent ML) that do not enforce linear resource usage. dlPCF uniquely unifies both aspects, enabling a single static discipline that guarantees functional correctness and resource‑aware complexity guarantees.
The conclusion outlines future directions: developing automated inference algorithms for practical index fragments, extending the framework to other evaluation strategies (e.g., CEK machine), and integrating dlPCF into real programming languages to support certified resource‑bounded computation. Overall, the paper provides a solid theoretical foundation for reasoning about both what a program computes and how much computational effort it requires, opening avenues for static analysis, certified optimization, and safe embedded systems where resource constraints are paramount.
Comments & Academic Discussion
Loading comments...
Leave a Comment