On the Metric Nature of (Differential) Logical Relations

📅 2026-03-01
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work investigates the construction of context-sensitive, fine-grained distance metrics for higher-order programs to precisely characterize the relationship between input and output errors. To this end, it introduces a quasi-quasi-metric framework that provides a metric foundation for differential logical relations and leverages cartesian closed categories to support compositional reasoning about program distances. The main contributions include revealing the intrinsic metric nature of differential logical relations, developing differential pre-logical relations and clarifying their structural distinctions from quantitative pre-logical relations—such as the absence of a coarsest relation—and proving that the quasi-quasi-metric spaces induced by type interpretations satisfy strong transitivity, indistinguishability, and weak symmetry. Furthermore, the paper establishes a principle for compositional reasoning about program distances and elucidates their underlying partial order structure.

Technology Category

Application Category

📝 Abstract
Differential logical relations are methods to measure distances between higher-order programs where distances between functional programs are themselves \emph{functions}, relating errors in inputs with errors in outputs. This way, differential logical relations provide a more fine-grained and contextual information of program distances. This paper aims to clarify the metric nature of differential logical relations. We introduce the notion of quasi-quasi-metrics and observe that the cartesian closed category of quasi-quasi-metric spaces reflects the construction of differential logical relations in the literature. The cartesian closed structure induces a fundamental lemma, which can be seen as a compositional reasoning principle for program distances. Furthermore, we investigate the quasi-quasi-metric spaces arising from the interpretation of types, and we prove that they satisfy variants of the strong transitivity condition and indistancy condition, as well as a weak form of the symmetry condition. In the last part of this paper, we introduce a notion of differential prelogical relations arising as a quantitative counterpart of the framework of prelogical relations. Roughly speaking, differential prelogical relations are quasi-quasi-metrics on the collection of programs. The poset of differential prelogical relations has the finest differential prelogical relation presented as a formal quantitative equational theory, while the poset lacks a coarsest differential prelogical relation. The absence of a coarsest differential prelogical relation contrasts with the situations of typed lambda calculi, where the contextual equivalences serve as the coarsest program equivalences.
Problem

Research questions and friction points this paper is trying to address.

differential logical relations
quasi-quasi-metrics
program distance
metric nature
higher-order programs
Innovation

Methods, ideas, or system contributions that make the work stand out.

differential logical relations
quasi-quasi-metrics
cartesian closed category
compositional reasoning
differential prelogical relations
🔎 Similar Papers
No similar papers found.