π€ AI Summary
The metric nature of differential logical relations in higher-order program difference modeling remains poorly understood, hindering principled quantification of program discrepancies.
Method: We systematically characterize the mathematical structure of the distance function induced by such relations, introducing the novel concept of a *quasi-quasimetric*. We rigorously prove that differential logical relations induce quasi-quasimetrics and establish their unified correspondence with quasimetrics and partial metrics. Leveraging this foundation, we derive compositional program-difference inference rules enabling modular analysis of inputβoutput error propagation. Our approach integrates type theory, programming language semantics, metric space theory, and logical relations.
Contribution: This work provides the first formal metric foundation for differential logical relations, clarifies their structural role in program error quantification, and establishes a novel compositional reasoning framework for robustness and difference verification of higher-order programs.
π Abstract
Differential logical relations are a method to measure distances between higher-order programs. They differ from standard methods based on program metrics in that differences between functional programs are themselves functions, relating errors in input with errors in output, this way providing a more fine grained, contextual, information. The aim of this paper is to clarify the metric nature of differential logical relations. While previous work has shown that these do not give rise, in general, to (quasi-)metric spaces nor to partial metric spaces, we show that the distance functions arising from such relations, that we call quasi-quasi-metrics, can be related to both quasi-metrics and partial metrics, the latter being also captured by suitable relational definitions. Moreover, we exploit such connections to deduce some new compositional reasoning principles for program differences.