172 research outputs found
Relational Parametricity for Computational Effects
According to Strachey, a polymorphic program is parametric if it applies a
uniform algorithm independently of the type instantiations at which it is
applied. The notion of relational parametricity, introduced by Reynolds, is one
possible mathematical formulation of this idea. Relational parametricity
provides a powerful tool for establishing data abstraction properties, proving
equivalences of datatypes, and establishing equalities of programs. Such
properties have been well studied in a pure functional setting. Many programs,
however, exhibit computational effects, and are not accounted for by the
standard theory of relational parametricity. In this paper, we develop a
foundational framework for extending the notion of relational parametricity to
programming languages with effects.Comment: 31 pages, appears in Logical Methods in Computer Scienc
Relational Parametricity and Control
We study the equational theory of Parigot's second-order
λμ-calculus in connection with a call-by-name continuation-passing
style (CPS) translation into a fragment of the second-order λ-calculus.
It is observed that the relational parametricity on the target calculus induces
a natural notion of equivalence on the λμ-terms. On the other hand,
the unconstrained relational parametricity on the λμ-calculus turns
out to be inconsistent with this CPS semantics. Following these facts, we
propose to formulate the relational parametricity on the λμ-calculus
in a constrained way, which might be called ``focal parametricity''.Comment: 22 pages, for Logical Methods in Computer Scienc
Internal Parametricity for Cubical Type Theory
We define a computational type theory combining the contentful equality structure of cartesian cubical type theory with internal parametricity primitives. The combined theory supports both univalence and its relational equivalent, which we call relativity. We demonstrate the use of the theory by analyzing polymorphic functions between higher inductive types, and we give an account of the identity extension lemma for internal parametricity
Dynamic IFC Theorems for Free!
We show that noninterference and transparency, the key soundness theorems for
dynamic IFC libraries, can be obtained "for free", as direct consequences of
the more general parametricity theorem of type abstraction. This allows us to
give very short soundness proofs for dynamic IFC libraries such as faceted
values and LIO. Our proofs stay short even when fully mechanized for Agda
implementations of the libraries in terms of type abstraction.Comment: CSF 2021 final versio
Step-Indexed Relational Reasoning for Countable Nondeterminism
Programming languages with countable nondeterministic choice are
computationally interesting since countable nondeterminism arises when modeling
fairness for concurrent systems. Because countable choice introduces
non-continuous behaviour, it is well-known that developing semantic models for
programming languages with countable nondeterminism is challenging. We present
a step-indexed logical relations model of a higher-order functional programming
language with countable nondeterminism and demonstrate how it can be used to
reason about contextually defined may- and must-equivalence. In earlier
step-indexed models, the indices have been drawn from {\omega}. Here the
step-indexed relations for must-equivalence are indexed over an ordinal greater
than {\omega}
A generic operational metatheory for algebraic effects
We provide a syntactic analysis of contextual preorder and equivalence for a polymorphic programming language with effects. Our approach applies uniformly across a range of algebraic effects, and incorporates, as instances: errors, input/output, global state, nondeterminism, probabilistic choice, and combinations thereof. Our approach is to extend Plotkin and Powerâs structural operational semantics for algebraic effects (FoSSaCS 2001) with a primitive âbasic preorderâ on ground type computation trees. The basic preorder is used to derive notions of contextual preorder and equivalence on program terms. Under mild assumptions on this relation, we prove fundamental properties of contextual preorder (hence equivalence) including extensionality properties and a characterisation via applicative contexts, and we provide machinery for reasoning about polymorphism using relational parametricity
A Family Of Syntactic Logical Relations For The Semantics Of Haskell-Like Languages
Logical relations are a fundamental and powerful tool for reasoning about programs in languages with parametric polymorphism. Logical relations suitable for reasoning about observational behavior in polymorphic calculi supporting various programming language features have been introduced in recent years. Unfortunately, the calculi studied are typically idealized, and the results obtained for them over only partial insight into the impact of such features on observational behavior in implemented languages. In this paper we show how to bring reasoning via logical relations closer to bear on real languages by deriving results that are more pertinent to an intermediate language for the (mostly) lazy functional language Haskell like GHC Core. To provide a more ?ne-grained analysis of program behavior than is possible by reasoning about program equivalence alone, we work with an abstract notion of relating observational behavior of computations which has among its specializations both observational equivalence and observational approximation. We take selective strictness into account, and we consider the impact of different kinds of computational failure, e.g., divergence versus failed pattern matching, because such distinctions are significant in practice. Once distinguished, the relative de?nedness of different failure causes needs to be considered, because different orders here induce different observational relations on programs (including the choice between equivalence and approximation). Our main contribution is the construction of an entire family of logical relations, parameterized over a definedness order on failure causes, each member of which characterizes the corresponding observational relation. Although we deal with properties very much tied to types, we base our results on a type-erasing semantics since this is more faithful to actual implementations
- âŚ