Cost-sensitive computational adequacy of higher-order recursion in synthetic domain theory

Yue Niu,Jonathan Sterling,Robert Harper
2024-06-11
Abstract:We study a cost-aware programming language for higher-order recursion dubbed $\textbf{PCF}_\mathsf{cost}$ in the setting of synthetic domain theory (SDT). Our main contribution relates the denotational cost semantics of $\textbf{PCF}_\mathsf{cost}$ to its computational cost semantics, a new kind of dynamic semantics for program execution that serves as a mathematically natural alternative to operational semantics in SDT. In particular we prove an internal, cost-sensitive version of Plotkin's computational adequacy theorem, giving a precise correspondence between the denotational and computational semantics for complete programs at base type. The constructions and proofs of this paper take place in the internal dependent type theory of an SDT topos extended by a phase distinction in the sense of Sterling and Harper. By controlling the interpretation of cost structure via the phase distinction in the denotational semantics, we show that $\textbf{PCF}_\mathsf{cost}$ programs also evince a noninterference property of cost and behavior. We verify the axioms of the type theory by means of a model construction based on relative sheaf models of SDT.
Programming Languages
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to study the semantics of the cost - sensitive higher - order recursive programming language PCF cost within the framework of Synthetic Domain Theory (SDT). Specifically, the authors hope to establish a type theory that can handle both cost and behavior in the internal logic of SDT, and prove the cost - sensitive computational adequacy theorem of this language. This will provide a new and more precise method for program verification, especially when cost analysis is involved. ### Main Problem Decomposition 1. **Design of Cost - Sensitive Programming Languages** - The author introduced a programming language PCF cost with a cost structure, aiming to study its interpretation and behavior in SDT. - This language needs to be able to track and analyze the cost of program execution at runtime. 2. **Semantic Consistency** - The author hopes to prove that there is an exact correspondence between the denotational semantics and the computational semantics of PCF cost. - Specifically, they attempt to prove an internal, cost - sensitive version of Plotkin's computational adequacy theorem to ensure complete consistency between the two semantics on basic types. 3. **Non - interference Property** - Research shows that PCF cost programs also exhibit the non - interference property between cost and behavior, that is, cost information does not affect the behavior of the program, and vice versa. - This property is crucial for ensuring the security and correctness of the program. 4. **Model Construction** - To verify the proposed type theory, the author uses relative sheaf models to construct a model of SDT. - These models not only support the structure of synthetic domain theory but also can handle phase distinction, thereby achieving accurate cost modeling. ### Core Contributions - **Axiomatization of Type Theory**: Proposed an axiomatization framework of type theory that combines phase distinction and pre - domain sub - universes. - **Cost - Sensitive Denotational Semantics**: Provided denotational semantics for PCF cost that exhibits the non - interference characteristics between cost and behavior. - **Dynamic Semantics**: Defined a dynamic semantics that directly simulates program execution. - **Internal Cost - Sensitive Adequacy Theorem**: Proved the consistency between denotational semantics and computational semantics on basic types. - **Relative Sheaf Model**: Constructed a relative sheaf model to verify the axioms of type theory. Through these works, the authors have provided a solid theoretical basis for cost - sensitivity analysis of higher - order recursive programs and demonstrated how to conduct such an analysis in synthetic domain theory.