11 research outputs found
Applied Type System: An Approach to Practical Programming with Theorem-Proving
The framework Pure Type System (PTS) offers a simple and general approach to
designing and formalizing type systems. However, in the presence of dependent
types, there often exist certain acute problems that make it difficult for PTS
to directly accommodate many common realistic programming features such as
general recursion, recursive types, effects (e.g., exceptions, references,
input/output), etc. In this paper, Applied Type System (ATS) is presented as a
framework for designing and formalizing type systems in support of practical
programming with advanced types (including dependent types). In particular, it
is demonstrated that ATS can readily accommodate a paradigm referred to as
programming with theorem-proving (PwTP) in which programs and proofs are
constructed in a syntactically intertwined manner, yielding a practical
approach to internalizing constraint-solving needed during type-checking. The
key salient feature of ATS lies in a complete separation between statics, where
types are formed and reasoned about, and dynamics, where programs are
constructed and evaluated. With this separation, it is no longer possible for a
program to occur in a type as is otherwise allowed in PTS. The paper contains
not only a formal development of ATS but also some examples taken from
ats-lang.org, a programming language with a type system rooted in ATS, in
support of employing ATS as a framework to formulate advanced type systems for
practical programming
Basic Action Theory
Action semantics is a semantic description framework with very goodpragmatic properties but until now a rather weak theory for reasoningabout programs. A strong action theory would have a great practicalpotential, as it would facilitate reasoning about the large class ofprogramming languages that can be described in action semantics.This report develops the foundations for a richer action theory, bybringing together concepts and techniques from process theory andfrom work on operational reasoning about functional programs. Semanticpreorders and equivalences in the action semantics setting arestudied and useful operational techniques for establishing contextualequivalences are presented. These techniques are applied to establishequational and inequational action laws and an induction rule
Parametricity and Local Variables
We propose that the phenomenon of local state may be understood in terms of Strachey\u27s concept of parametric (i.e., uniform) polymorphism. The intuitive basis for our proposal is the following analogy: a non-local procedure is independent of locally-declared variables in the same way that a parametrically polymorphic function is independent of types to which it is instantiated. A connection between parametricity and representational abstraction was first suggested by J. C. Reynolds. Reynolds used logical relations to formalize this connection in languages with type variables and user-defined types. We use relational parametricity to construct a model for an Algol-like language in which interactions between local and non-local entities satisfy certain relational criteria. Reasoning about local variables essentially involves proving properties of polymorphic functions. The new model supports straightforward validations of all the test equivalences that have been proposed in the literature for local-variable semantics, and encompasses standard methods of reasoning about data representations. It is not known whether our techniques yield fully abstract semantics. A model based on partial equivalence relations on the natural numbers is also briefly examined
Compilation and Equivalence of Imperative Objects (Revised Report)
We adopt the untyped imperative object calculus of Abadi andCardelli as a minimal setting in which to study problems of compilationand program equivalence that arise when compiling object orientedlanguages. We present both a big-step and a small-stepsubstitution-based operational semantics for the calculus. Our firsttwo results are theorems asserting the equivalence of our substitution based semantics with a closure-based semantics like that given by Abadi and Cardelli. Our third result is a direct proof of the correctness of compilation to a stack-based abstract machine via a small-step decompilation algorithm. Our fourth result is that contextual equivalence of objects coincides with a form of Mason and Talcott's CIUequivalence; the latter provides a tractable means of establishing operational equivalences. Finally, we prove correct an algorithm, used inour prototype compiler, for statically resolving method offsets. This isthe first study of correctness of an object-oriented abstract machine,and of operational equivalence for the imperative object calculus
Logical Reasoning for Higher-Order Functions with Local State
We introduce an extension of Hoare logic for call-by-value higher-order
functions with ML-like local reference generation. Local references may be
generated dynamically and exported outside their scope, may store higher-order
functions and may be used to construct complex mutable data structures. This
primitive is captured logically using a predicate asserting reachability of a
reference name from a possibly higher-order datum and quantifiers over hidden
references. We explore the logic's descriptive and reasoning power with
non-trivial programming examples combining higher-order procedures and
dynamically generated local state. Axioms for reachability and local invariant
play a central role for reasoning about the examples.Comment: 68 page
Complete trace models of state and control
We consider a hierarchy of four typed call-by-value languages with either higher-order or ground-type references and with either callcc or no control operator.Our first result is a fully abstract trace model for the most expressive setting, featuring both higher-order references and callcc, constructed in the spirit of operational game semantics. Next we examine the impact of suppressing higher-order references and callcc in contexts and provide an operational explanation for the game-semantic conditions known as visibility and bracketing respectively.This allows us to refine the original model to provide fully abstract trace models of interaction with contexts that need not use higher-order references or callcc. Along the way, we discuss the relationship between error- and termination-based contextual testing in each case, and relate the two to trace and complete trace equivalence respectively.Overall, the paper provides a systematic development of operational game semantics for all four cases, which represent the state-based face of the so-called semantic cube
Recommended from our members
Names and higher-order functions.
Many functional programming languages rely on the elimination of 'impure' features: assignment to variables, exceptions and even input/output. But some of these are genuinely useful, and it is of real interest to establish how they can be reintroducted in a controlled way. This dissertation looks in detail at one example of this: the addition to a functional language of dynamically generated names. Names are created fresh, they can be compared with each other and passed around, but that is all. As a very basic example of state, they capture the graduation between private and public, local and global, by their interaction with higher-order functions. The vehicle for this study is the nu-calculus, an extension of the simply-typed lambdacalculus. The nu-calculus is equivalent to a certain fragment of Standard ML, omitting side-effects, exceptions, datatypes and recursion. Even without all these features, the interaction of name creation with higher-order functions can be complex and subtle. Various operational and denotational methods for reasoning about the nu-calculus are developed. These include a computational metalanguage in the style of Moggi, which distinguishes in the type system between values and computations. This leads to categorical models that use a strong monad, and examples are devised based on functor categories. The idea of logical relations is used to derive powerful reasoning methods that capture some of the distinction between private and public names. These techniques are shown to be complete for establishing contextual equivalence between first-order expressions; they are also used to construct a correspondingly abstract categorical model. All the work with the nu-calculus extends cleanly to Reduced ML, a larger language that introduces integer references: mutable storage cells that are dynamically allocated. It turns out that the step up is quite simple, and both the computational metalanguage and the sample categorical models can be reused
A Variable Typed Logic of Effects
4In this paper we introduce a variable typed logic of effects inspired by the variable type systems of Feferman for purely functional languages. VTLoE (Variable Typed Logic of Effects) is introduced in two stages. The first stage is the first-order theory of individuals built on assertions of equality (operational equivalence à la Plotkin), and contextual assertions. The second stage extends the logic to include classes and class membership. The logic we present provides an expressive language for defining and studying properties of programs including program equivalences, in a uniform framework. The logic combines the features and benefits of equational calculi as well as program and specification logics. In addition to the usual first-order formula constructions, we add contextual assertions. Contextual assertions generalize Hoare′s triples in that they can be nested, they can be used as assumptions, and their free variables can be quantified. They are similar in spirit to program modalities in dynamic logic. We use the logic to establish the validity of the Meyer Sieber examples in an operational setting. The theory allows for the construction of inductively defined sets and derivation of the corresponding induction principles. We hope that classes may serve as a starting point for studying semantic notions of type. Naive attempts to represent ML types as classes fail in the sense that ML inference rules are not valid.reservedmixedHONSELL F; I.MASON; S.SMITH; C.TALCOTTHonsell, Furio; I., Mason; S., Smith; C., Talcot
A Variable Typed Logic of Effects
In this paper we introduce a variable typed logic of effects inspired by the variable type systems of Feferman for purely functional languages. VTLoE (Variable Typed Logic of Effects) is introduced in two stages. The first stage is the first-order theory of individuals built on assertions of equality (operational equivalence `a la Plotkin), and contextual assertions. The second stage extends the logic to include classes and class membership. The logic we present provides an expressive language for defining and studying properties of programs including program equivalences, in a uniform framework. The logic combines the features and benefits of equational calculi as well as program and specification logics. In addition to the usual first-order formula constructions, we add contextual assertions. Contextual assertions generalize Hoare's triples in that they can be nested, used as assumptions, and their free variables may be quantified. They are similar in spirit to program modalities in ..