110,855 research outputs found
Decorated proofs for computational effects: Exceptions
We define a proof system for exceptions which is close to the syntax for
exceptions, in the sense that the exceptions do not appear explicitly in the
type of any expression. This proof system is sound with respect to the intended
denotational semantics of exceptions. With this inference system we prove
several properties of exceptions.Comment: 11 page
Adjunctions for exceptions
An algebraic method is used to study the semantics of exceptions in computer
languages. The exceptions form a computational effect, in the sense that there
is an apparent mismatch between the syntax of exceptions and their intended
semantics. We solve this apparent contradiction by efining a logic for
exceptions with a proof system which is close to their syntax and where their
intended semantics can be seen as a model. This requires a robust framework for
logics and their morphisms, which is provided by categorical tools relying on
adjunctions, fractions and limit sketches.Comment: In this Version 2, minor improvements are made to Version
A duality between exceptions and states
In this short note we study the semantics of two basic computational effects,
exceptions and states, from a new point of view. In the handling of exceptions
we dissociate the control from the elementary operation which recovers from the
exception. In this way it becomes apparent that there is a duality, in the
categorical sense, between exceptions and states
States and exceptions considered as dual effects
In this paper we consider the two major computational effects of states and
exceptions, from the point of view of diagrammatic logics. We get a surprising
result: there exists a symmetry between these two effects, based on the
well-known categorical duality between products and coproducts. More precisely,
the lookup and update operations for states are respectively dual to the throw
and catch operations for exceptions. This symmetry is deeply hidden in the
programming languages; in order to unveil it, we start from the monoidal
equational logic and we add progressively the logical features which are
necessary for dealing with either effect. This approach gives rise to a new
point of view on states and exceptions, which bypasses the problems due to the
non-algebraicity of handling exceptions
Breaking a monad-comonad symmetry between computational effects
Computational effects may often be interpreted in the Kleisli category of a
monad or in the coKleisli category of a comonad. The duality between monads and
comonads corresponds, in general, to a symmetry between construction and
observation, for instance between raising an exception and looking up a state.
Thanks to the properties of adjunction one may go one step further: the
coKleisli-on-Kleisli category of a monad provides a kind of observation with
respect to a given construction, while dually the Kleisli-on-coKleisli category
of a comonad provides a kind of construction with respect to a given
observation. In the previous examples this gives rise to catching an exception
and updating a state. However, the interpretation of computational effects is
usually based on a category which is not self-dual, like the category of sets.
This leads to a breaking of the monad-comonad duality. For instance, in a
distributive category the state effect has much better properties than the
exception effect. This remark provides a novel point of view on the usual
mechanism for handling exceptions. The aim of this paper is to build an
equational semantics for handling exceptions based on the coKleisli-on-Kleisli
category of the monad of exceptions. We focus on n-ary functions and
conditionals. We propose a programmer's language for exceptions and we prove
that it has the required behaviour with respect to n-ary functions and
conditionals.Comment: arXiv admin note: substantial text overlap with arXiv:1310.060
Scalability using effects
This note is about using computational effects for scalability. With this
method, the specification gets more and more complex while its semantics gets
more and more correct. We show, from two fundamental examples, that it is
possible to design a deduction system for a specification involving an effect
without expliciting this effect
Combining and Relating Control Effects and their Semantics
Combining local exceptions and first class continuations leads to programs
with complex control flow, as well as the possibility of expressing powerful
constructs such as resumable exceptions. We describe and compare games models
for a programming language which includes these features, as well as
higher-order references. They are obtained by contrasting methodologies: by
annotating sequences of moves with "control pointers" indicating where
exceptions are thrown and caught, and by composing the exceptions and
continuations monads.
The former approach allows an explicit representation of control flow in
games for exceptions, and hence a straightforward proof of definability (full
abstraction) by factorization, as well as offering the possibility of a
semantic approach to control flow analysis of exception-handling. However,
establishing soundness of such a concrete and complex model is a non-trivial
problem. It may be resolved by establishing a correspondence with the monad
semantics, based on erasing explicit exception moves and replacing them with
control pointers.Comment: In Proceedings COS 2013, arXiv:1309.092
A Type System For Call-By-Name Exceptions
We present an extension of System F with call-by-name exceptions. The type
system is enriched with two syntactic constructs: a union type for programs
whose execution may raise an exception at top level, and a corruption type for
programs that may raise an exception in any evaluation context (not necessarily
at top level). We present the syntax and reduction rules of the system, as well
as its typing and subtyping rules. We then study its properties, such as
confluence. Finally, we construct a realizability model using orthogonality
techniques, from which we deduce that well-typed programs are weakly
normalizing and that the ones who have the type of natural numbers really
compute a natural number, without raising exceptions.Comment: 25 page
- …