2,780 research outputs found
Koka: Programming with Row Polymorphic Effect Types
We propose a programming model where effects are treated in a disciplined
way, and where the potential side-effects of a function are apparent in its
type signature. The type and effect of expressions can also be inferred
automatically, and we describe a polymorphic type inference system based on
Hindley-Milner style inference. A novel feature is that we support polymorphic
effects through row-polymorphism using duplicate labels. Moreover, we show that
our effects are not just syntactic labels but have a deep semantic connection
to the program. For example, if an expression can be typed without an exn
effect, then it will never throw an unhandled exception. Similar to Haskell's
`runST` we show how we can safely encapsulate stateful operations. Through the
state effect, we can also safely combine state with let-polymorphism without
needing either imperative type variables or a syntactic value restriction.
Finally, our system is implemented fully in a new language called Koka and has
been used successfully on various small to medium-sized sample programs ranging
from a Markdown processor to a tier-splitted chat application. You can try out
Koka live at www.rise4fun.com/koka/tutorial.Comment: In Proceedings MSFP 2014, arXiv:1406.153
On Asynchrony and Choreographies
Choreographic Programming is a paradigm for the development of concurrent
software, where deadlocks are prevented syntactically. However, choreography
languages are typically synchronous, whereas many real-world systems have
asynchronous communications. Previous attempts at enriching choreographies with
asynchrony rely on ad-hoc constructions, whose adequacy is only argued
informally. In this work, we formalise the properties that an asynchronous
semantics for choreographies should have: messages can be sent without the
intended receiver being ready, and all sent messages are eventually received.
We explore how out-of-order execution, used in choreographies for modelling
concurrency, can be exploited to endow choreographies with an asynchronous
semantics. Our approach satisfies the properties we identified. We show how our
development yields a pleasant correspondence with FIFO-based asynchronous
messaging, modelled in a process calculus, and discuss how it can be adopted in
more complex choreography models.Comment: In Proceedings ICE 2017, arXiv:1711.1070
Event-Driven Network Programming
Software-defined networking (SDN) programs must simultaneously describe
static forwarding behavior and dynamic updates in response to events.
Event-driven updates are critical to get right, but difficult to implement
correctly due to the high degree of concurrency in networks. Existing SDN
platforms offer weak guarantees that can break application invariants, leading
to problems such as dropped packets, degraded performance, security violations,
etc. This paper introduces EVENT-DRIVEN CONSISTENT UPDATES that are guaranteed
to preserve well-defined behaviors when transitioning between configurations in
response to events. We propose NETWORK EVENT STRUCTURES (NESs) to model
constraints on updates, such as which events can be enabled simultaneously and
causal dependencies between events. We define an extension of the NetKAT
language with mutable state, give semantics to stateful programs using NESs,
and discuss provably-correct strategies for implementing NESs in SDNs. Finally,
we evaluate our approach empirically, demonstrating that it gives well-defined
consistency guarantees while avoiding expensive synchronization and packet
buffering
A Framework to Synergize Partial Order Reduction with State Interpolation
We address the problem of reasoning about interleavings in safety
verification of concurrent programs. In the literature, there are two prominent
techniques for pruning the search space. First, there are well-investigated
trace-based methods, collectively known as "Partial Order Reduction (POR)",
which operate by weakening the concept of a trace by abstracting the total
order of its transitions into a partial order. Second, there is state-based
interpolation where a collection of formulas can be generalized by taking into
account the property to be verified. Our main contribution is a framework that
synergistically combines POR with state interpolation so that the sum is more
than its parts
Unfolding-based Partial Order Reduction
Partial order reduction (POR) and net unfoldings are two alternative methods
to tackle state-space explosion caused by concurrency. In this paper, we
propose the combination of both approaches in an effort to combine their
strengths. We first define, for an abstract execution model, unfolding
semantics parameterized over an arbitrary independence relation. Based on it,
our main contribution is a novel stateless POR algorithm that explores at most
one execution per Mazurkiewicz trace, and in general, can explore exponentially
fewer, thus achieving a form of super-optimality. Furthermore, our
unfolding-based POR copes with non-terminating executions and incorporates
state-caching. Over benchmarks with busy-waits, among others, our experiments
show a dramatic reduction in the number of executions when compared to a
state-of-the-art DPOR.Comment: Long version of a paper with the same title appeared on the
proceedings of CONCUR 201
- …