Reactive programming is all about relegating the management of a program's state changes to the realm of the runtime environment. Nevertheless, sometimes it is still necessary to enrich a reactive program with sta...
详细信息
Behavioral contracts are embraced by software engineers because they document module interfaces, detect interface violations, and help identify faulty modules (packages, classes, functions, etc). This paper extends pr...
详细信息
ISBN:
(纸本)9781450308656
Behavioral contracts are embraced by software engineers because they document module interfaces, detect interface violations, and help identify faulty modules (packages, classes, functions, etc). This paper extends prior higher-order contract systems to also express and enforce temporal properties, which are common in software systems with imperative state, but which are mostly left implicit or are at best informally specified. The paper presents both a programmatic contract API as well as a temporal contract language, and reports on experience and performance results from implementing these contracts in Racket. Our development formalizes module behavior as a trace of events such as function calls and returns. Our contract system provides both non-interference (where contracts cannot influence correct executions) and also a notion of completeness (where contracts can enforce any decidable, prefix-closed predicate *** traces).
Behavioral software contracts supplement interface information with logical assertions. A rigorous enforcement of contracts provides useful feedback to developers if it signals contract violations as soon as they occu...
详细信息
ISBN:
(纸本)9781450304900
Behavioral software contracts supplement interface information with logical assertions. A rigorous enforcement of contracts provides useful feedback to developers if it signals contract violations as soon as they occur and if it assigns blame to violators with precise explanations. Correct blame assignment gets programmers started with the debugging process and can significantly decrease the time needed to discover and fix bugs. Sadly the literature on contracts lacks a framework for making statements about the correctness of blame assignment and for validating such statements. This paper fills the gap and uses the framework to demonstrate how one of the proposed semantics for higher-order contracts satisfies this criteria and another semantics occasionally assigns blame to the wrong module. Concretely, the paper applies the framework to the lax enforcement of dependent higher-order contracts and the picky one. A higher-order dependent contract specifies constraints for the domain and range of higher-order functions and also relates arguments and results in auxiliary assertions. The picky semantics ensures that the use of arguments in the auxiliary assertion satisfies the domain contracts ant the lax one does not. While the picky semantics discovers more contract violations than the lax one, it occasionally blames the wrong module. Hence the paper also introduces a third semantic!,, dubbed indy, which fixes the problems of the picky semantics without giving up its advantages.
A behavioral contract in a higher-order language may invoke methods of unknown objects. Although this expressive power allows programmers to formulate sophisticated contracts, it also poses a problem for language desi...
详细信息
ISBN:
(纸本)9783642288685;9783642288692
A behavioral contract in a higher-order language may invoke methods of unknown objects. Although this expressive power allows programmers to formulate sophisticated contracts, it also poses a problem for language designers. Indeed, two distinct semantics have emerged for such method calls, dubbed lax and picky. While lax fails to protect components in certain scenarios, picky may blame an uninvolved party for a contract violation. In this paper, we present complete monitoring as the fundamental correctness criterion for contract systems. It demands correct blame assignment as well as complete monitoring of all channels of communication between components. According to this criterion, lax and picky are indeed incorrect ways to monitor contracts. A third semantics, dubbed indy, emerges as the only correct variant.
We present the design of a Remus, a virtual machine for reactive (RP) programs - signal-based programs that react automatically to changes - that is currently under development. The design of Remus been tailored speci...
详细信息
ISBN:
(纸本)9798400706349
We present the design of a Remus, a virtual machine for reactive (RP) programs - signal-based programs that react automatically to changes - that is currently under development. The design of Remus been tailored specifically for reactive programs: it has a dedicated instruction set and memory model that is compatible with the model of reactive programming. The virtual machine allows reactive programs to be evaluated without needing to compile them to native code, nor by running them on an existing (general-purpose) virtual machine that is not specific to RP. The model of the virtual machine makes it possible to reason over the various behavioural aspects of a reactive program, such as memory consumption, in a language-agnostic way. As an example, we propose a static analysis that aims to eliminate dynamic allocations that occur in dynamic reactive programs: i.e., programs where the dependencies between the signals that make up a program changes at run-time. We show that our virtual machine, supplemented by the results of the analysis, allows for (well-behaved) reactive programs to be evaluated in constant space (i.e. in bounded memory) even when dependencies change or new signals are created programmatically.
We present a generic framework for specifying and implementing offline partial evaluators. The framework provides the infrastructure for specializing higher-order programs with computational effects specified through ...
详细信息
ISBN:
(纸本)3540643028
We present a generic framework for specifying and implementing offline partial evaluators. The framework provides the infrastructure for specializing higher-order programs with computational effects specified through a monad. It performs sound specialization for all monadic instances and is evaluation-order independent. It subsumes most previously published partial evaluators for higher-order functional programming languages in the sense that they are instances of the generic framework with respect to a particular monad.
This paper describes a refinement-based development method for mobile processes. Process mobility is interpreted as the assignment or communication of higher-order variables, whose values are process constants or para...
详细信息
ISBN:
(纸本)3540223800
This paper describes a refinement-based development method for mobile processes. Process mobility is interpreted as the assignment or communication of higher-order variables, whose values are process constants or parameterised processes, in which target variables update their values and source variables lose their values. The mathematical basis for the work is Hoare and He's Unifying Theories of programming (UTP). In this paper, we present a set of algebraic laws to be used for the development of mobile systems. The correctness of these laws is ensured by the UTP semantics of mobile processes. We illustrate our theory through a simple example that can be implemented in both a centralised and a distributed way. First, we present the pi-calculus specification for both systems and demonstrate that they are observationally equivalent. Next, we show how the centralised system may be step-wisely developed into the distributed one using our proposed laws.
The formal definition of any namespace device found in a programming language can be given in terms of transformations on a semantic environment. It is worthwhile, therefore, to consider the implications of incorporat...
详细信息
The formal definition of any namespace device found in a programming language can be given in terms of transformations on a semantic environment. It is worthwhile, therefore, to consider the implications of incorporating environments as bona fide data objects in a programming system. Because of their expressive power, environments can be easily abused. Reifying an environment can entail the capture of unwanted bindings, leading to potentially severe violations of lexical abstraction and locality. Reflecting a data structure into an environment may cause useful program transformations which rely on static scoping (e.g., alpha-conversion) to be no longer applicable. Proposals that have heretofore been suggested for manipulating environments as data objects, however, provide no mechanism to constrain the effect or extent of the reification or reflection process. In this article, we propose a treatment of environments and the mechanism by which they are reified and manipulated, that addresses these concerns. The language described below (Rascal) permits environments to be reified into data structures, and data structures to be reflected into environments, but gives users great flexibility to constrain the extent and scope of these processes. We argue that the techniques and operators developed define a cohesive basis for building large-scale modular systems using reflective programming techniques.
暂无评论