On the Versatility of Open Logical Relations: Continuity, Automatic Differentiation, and a Containment Theorem

02/19/2020
by   Gilles Barthe, et al.
0

Logical relations are one of the most powerful techniques in the theory of programming languages, and have been used extensively for proving properties of a variety of higher-order calculi. However, there are properties that cannot be immediately proved by means of logical relations, for instance program continuity and differentiability in higher-order languages extended with real-valued functions. Informally, the problem stems from the fact that these properties are naturally expressed on terms of non-ground type (or, equivalently, on open terms of base type), and there is no apparent good definition for a base case (i.e. for closed terms of ground types). To overcome this issue, we study a generalization of the concept of a logical relation, called open logical relation, and prove that it can be fruitfully applied in several contexts in which the property of interest is about expressions of first-order type. Our setting is a simply-typed λ-calculus enriched with real numbers and real-valued first-order functions from a given set, such as the one of continuous or differentiable functions. We first prove a containment theorem stating that for any such a collection of functions including projection functions and closed under function composition, any well-typed term of first-order type denotes a function belonging to that collection. Then, we show by way of open logical relations the correctness of the core of a recently published algorithm for forward automatic differentiation. Finally, we define a refinement-based type system for local continuity in an extension of our calculus with conditionals, and prove the soundness of the type system using open logical relations.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/16/2022

Logical Relations for Partial Features and Automatic Differentiation Correctness

We present a simple technique for semantic, open logical relations argum...
research
04/27/2019

Differential Logical Relations, Part I: The Simply-Typed Case (Long Version)

We introduce a new form of logical relation which, in the spirit of metr...
research
09/15/2023

Graph IRs for Impure Higher-Order Languages (Technical Report)

This is a companion report for the OOPSLA 2023 paper of the same title, ...
research
06/30/2020

Frege's theory of types

There is a widespread assumption in type theory that the discipline begi...
research
04/22/2019

A syntactic approach to continuity of T-definable functionals

We give a new proof of the well-known fact that all functions (N→N) →N w...
research
06/25/2019

A unifying framework for continuity and complexity in higher types

We set up a parametrised monadic translation for a class of call-by-valu...
research
10/12/2022

A language for evaluating derivatives of functionals using automatic differentiation

We present a simple functional programming language, called Dual PCF, th...

Please sign up or login with your details

Forgot password? Click here to reset