45 research outputs found
Proofs for free - parametricity for dependent types
Reynolds' abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for pure type systems: for any PTS used as a programming language, there is a PTS that can be used as a logic for parametricity. Types in the source PTS are translated to relations (expressed as types) in the target. Similarly, values of a given type are translated to proofs that the values satisfy the relational interpretation. We extend the result to inductive families. We also show that the assumption that every term satisfies the parametricity condition generated by its type is consistent with the generated logic
Parametricity and Dependent Types
Reynolds' abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We (in second order predicate logic) about inhabitants of the type. We obtain a similar result for a single lambda calculus (a pure type system), in which terms, types and their relations are expressed. Working within a single system dispenses with the need for an interpretation layer, allowing for an unusually simple presentation. While the unification puts some constraints on the type system (which we spell out), the result applies to many interesting cases, including dependently-typed ones
Generic refinements for behavioral specifications
This thesis investigates the properties of generic refinements of behavioral specifications.
At the base of this investigation stands the view from algebraic specification that
abstract data types can be modeled as algebras. A specification of a data type is formed
from a syntactic part, i.e. a signature detailing the interface of the data type, and a
semantic part, i.e. a class of algebras (called its models) that contains the valid implementations
of that data type.
Typically, the class of algebras that constitutes the semantics of a specification is
defined as the class of algebras that satisfy some given set of axioms. The behavioral
aspect of a specification comes from relaxing the requirements imposed by axioms, i.e.
by allowing in the semantics of a specification not only the algebras that literally satisfy
the given axioms, but also those algebras that appear to behave according to those
axioms. Several frameworks have been developed to express the adequate notions of
what it means to be a behavioral model of a set of axioms, and our choice as the setting
for this thesis will be Bidoit and Hennickerās Constructor-based Observational Logic,
abbreviated COL.
Using specifications that rely on the behavioral aspects defined by COL we study
the properties of generic refinements between specifications. Refinement is a relation
between specifications. The refinement of a target specification by a source specification
is given by a function that constructs models of the target specification from
the models of the source specification. These functions are called constructions and
the source and target specifications that they relate are called the context of the refinement.
The theory of refinements between algebraic specifications, with or without the
behavioral aspect, has been well studied in the literature. Our analysis starts from those
studies and adapts them to COL, which is a relatively new framework, and for which
refinement has been studied only briefly.
The main part of this thesis is formed by the analysis of generic refinements.
Generic refinements are represented by constructions that can be used in various contexts,
not just in the context of their definition. These constructions provide the basis
for modular refinements, i.e. one can use a locally defined construction in a global context
in order to refine just a part of a source specification. The ability to use a refinement
outside its original context imposes additional requirements on the construction
that represents it. An implementer writing such a construction must not use details of
the source models that can be contradicted by potential global context requirements.
This means, roughly speaking, that he must use only the information available in the
source signature and also any a priori assumption that was made about the contexts of
use.
We look at the basic case of generic refinements that are reusable in every global
context, and then we treat a couple of variations, i.e. generic refinements for which
an a priori assumption it is made about the nature of their usage contexts. In each
of these cases we follow the same pattern of investigation. First we characterize the
constructions that ensure reusability by means of preservation of relations, and then, in
most cases, we show that such constructions must be definable in terms of their source
signature.
Throughout the thesis we use an informal analogy between generic (i.e. polymorphic)
functions that appear in second order lambda calculus and the generic refinements
that we are studying. This connection will enable us to describe some properties
of generic refinements that correspond to the properties of polymorphic functions inferred
from their types and named ātheorems for freeā by Wadler.
The definability results, the connection between the assumptions made about the
usage contexts and the characterizing relations, and the ātheorems for freeā for behavioral
specifications constitute the main contributions of this thesis