105 research outputs found
Categories of Timed Stochastic Relations
AbstractStochastic behavior—the probabilistic evolution of a system in time—is essential to modeling the complexity of real-world systems. It enables realistic performance modeling, quality-of-service guarantees, and especially simulations for biological systems. Languages like the stochastic pi calculus have emerged as effective tools to describe and reason about systems exhibiting stochastic behavior. These languages essentially denote continuous-time stochastic processes, obtained through an operational semantics in a probabilistic transition system. In this paper we seek a more descriptive foundation for the semantics of stochastic behavior using categories and monads. We model a first-order imperative language with stochastic delay by identifying probabilistic choice and delay as separate effects, modeling each with a monad, and combining the monads to build a model for the stochastic language
Domain Theory for Concurrency
A simple domain theory for concurrency is presented. Based on a categorical model of linear logic and associated comonads, it highlights the role of linearity in concurrent computation. Two choices of comonad yield two expressive metalanguages for higher-order processes, both arising from canonical constructions in the model. Their denotational semantics are fully abstract with respect to contextual equivalence. One language derives from an exponential of linear logic; it supports a straightforward operational semantics with simple proofs of soundness and adequacy. The other choice of comonad yields a model of affine-linear logic, and a process language with a tensor operation to be understood as a parallel composition of independent processes. The domain theory can be generalised to presheaf models, providing a more refined treatment of nondeterministic branching. The article concludes with a discussion of a broader programme of research, towards a fully fledged domain theory for concurrency
Intensional and Extensional Semantics of Bounded and Unbounded Nondeterminism
We give extensional and intensional characterizations of nondeterministic
functional programs: as structure preserving functions between biorders, and as
nondeterministic sequential algorithms on ordered concrete data structures
which compute them. A fundamental result establishes that the extensional and
intensional representations of non-deterministic programs are equivalent, by
showing how to construct a unique sequential algorithm which computes a given
monotone and stable function, and describing the conditions on sequential
algorithms which correspond to continuity with respect to each order.
We illustrate by defining may and must-testing denotational semantics for a
sequential functional language with bounded and unbounded choice operators. We
prove that these are computationally adequate, despite the non-continuity of
the must-testing semantics of unbounded nondeterminism. In the bounded case, we
prove that our continuous models are fully abstract with respect to may and
must-testing by identifying a simple universal type, which may also form the
basis for models of the untyped lambda-calculus. In the unbounded case we
observe that our model contains computable functions which are not denoted by
terms, by identifying a further "weak continuity" property of the definable
elements, and use this to establish that it is not fully abstract
Recommended from our members
Reasoning about effectful programs and evaluation order
Program transformations have various applications, such as in compiler optimizations. These transformations are often effect-dependent: replacing one program with another relies on some restriction on the side-effects of subprograms. For example, we cannot eliminate a dead computation that raises an exception, or a duplicated computation that prints to the screen. Effect-dependent program transformations can be described formally using effect systems, which annotate types with information about the side-effects of expressions.
In this thesis, we extend previous work on effect systems and correctness of effect-dependent transformations in two related directions.
First, we consider evaluation order. Effect systems for call-by-value languages are well-known, but are not sound for other evaluation orders. We describe sound and precise effect systems for various evaluation orders, including call-by-name. We also describe an effect system for Levy's call-by-push-value, and show that this subsumes those for call-by-value and call-by-name. This naturally leads us to consider effect-dependent transformations that replace one evaluation order with another. We show how to use the call-by-push-value effect system to prove the correctness of transformations that replace call-by-value with call-by-name, using an argument based on logical relations. Finally, we extend call-by-push-value to additionally capture call-by-need. We use our extension to show a classic example of a relationship between evaluation orders: if the side-effects are restricted to (at most) nontermination, then call-by-name is equivalent to call-by-need.
The second direction we consider is non-invertible transformations. A program transformation is non-invertible if only one direction is correct. Such transformations arise, for example, when considering undefined behaviour, nondeterminism, or concurrency. We present a general framework for verifying noninvertible effect-dependent transformations, based on our effect system for call-by-push-value. The framework includes a non-symmetric notion of correctness for effect-dependent transformations, and a denotational semantics based on order-enriched category theory that can be used to prove correctness
Combining Effects and Coeffects via Grading
This is the author accepted manuscript. It is currently under an indefinite embargo pending publication by the Association for Computing Machinery. and are two general, complementary aspects of program behaviour. They roughly correspond to computations which change the execution context (effects) versus computations which make demands on the context (coeffects). Effectful features include partiality, non-determinism, input-output, state, and exceptions. Coeffectful features include resource demands, variable access, notions of linearity, and data input requirements.
The effectful or coeffectful behaviour of a program can be captured and described via type-based analyses, with fine grained information provided by monoidal effect annotations and semiring coeffects. Various recent work has proposed models for such typed calculi in terms of for effects and for coeffects.
Effects and coeffects have been studied separately so far, but in practice many computations are both effectful and coeffectful, e.g., possibly throwing exceptions but with resource requirements. To remedy this, we introduce a new general calculus with a combined . This can describe both the and that a program has on its context, as well as interactions between these effectful and coeffectful features of computation. The effect-coeffect system has a denotational model in terms of effect-graded monads and coeffect-graded comonads where interaction is expressed via the novel concept of . This graded semantics unifies the syntactic type theory with the denotational model. We show that our calculus can be instantiated to describe in a natural way various different kinds of interaction between a program and its evaluation context.Orchard was supported by EPSRC grant EP/M026124/1 and EP/K011715/1 (whilst previously at Imperial College London), Katsumata by JSPS KAKENHI grant JP15K00014, Uustalu by Estonian Min. of Educ. and Res. grant IUT33-13 and Estonian Sci. Found. grant 9475. Gaboardi’s work was done in part while at the University of Dundee, UK supported by EPSRC grant EP/M022358/1
- …