On stratified regions

Reading time: 5 minute
...

📝 Abstract

Type and effect systems are a tool to analyse statically the behaviour of programs with effects. We present a proof based on the so called reducibility candidates that a suitable stratification of the type and effect system entails the termination of the typable programs. The proof technique covers a simply typed, multi-threaded, call-by-value lambda-calculus, equipped with a variety of scheduling (preemptive, cooperative) and interaction mechanisms (references, channels, signals).

💡 Analysis

Type and effect systems are a tool to analyse statically the behaviour of programs with effects. We present a proof based on the so called reducibility candidates that a suitable stratification of the type and effect system entails the termination of the typable programs. The proof technique covers a simply typed, multi-threaded, call-by-value lambda-calculus, equipped with a variety of scheduling (preemptive, cooperative) and interaction mechanisms (references, channels, signals).

📄 Content

arXiv:0904.2076v2 [cs.LO] 9 Jun 2009 On stratified regions Roberto M. Amadio Universit´e Paris Diderot (Paris 7)∗ November 12, 2018 Abstract Type and effect systems are a tool to analyse statically the behaviour of programs with effects. We present a proof based on the so called reducibility candidates that a suitable stratification of the type and effect system entails the termination of the typable programs. The proof technique covers a simply typed, multi-threaded, call-by-value lambda-calculus, equipped with a variety of scheduling (preemptive, cooperative) and interaction mecha- nisms (references, channels, signals). Keywords Types and effects. Termination. Reducibility candidates. 1 Introduction In the framework of functional programs, the relationship between type systems and termi- nation has been extensively studied through the Curry-Howard correspondence. It would be interesting to extend these techniques to programs with effects. By effect we mean the possibility of executing operations that modify the state of a system such as reading/writing a reference or sending/receiving a message. Usual type systems as available, e.g., in various dialects of the ML programming language, are too poor to account for the behaviour of programs with effects. A better approximation is possible if one abstracts the state of a system in a certain number of regions and if the types account for the way programs act on such regions. So-called type and effect systems [8] are an interesting formalisation of this idea and have been successfully used to analyse stati- cally the problem of heap-memory deallocation [10]. On the other hand, the proof-theoretic foundations of such systems are largely unexplored. Only recently, it has been shown [3] that a stratification of the regions entails termination in a certain higher-order language with cooperative threads and references. Our purpose here is to revisit this result trying to clarify and extend both its scope and its proof technique (a more technical comparison is delayed to section 4). We refer to [3] for a tentative list of papers referring to a notion of stratification for programs with side effects. Perhaps the closest works in spirit are those that have adapted the reducibility candidates techniques to the π-calculus [11, 9]. Those works exhibit type systems for the π-calculus that guarantee the termination of the usual continuation passing style translations of typed functional languages into the π-calculus. However, as pointed out by one of the authors of op.cit in [5], they are not very successful in handling state sensitive programs. The approach here is a bit different: one starts with a higher-order typed func- tional language which is known to be terminating and then one determines to what extent ∗PPS, UMR-CNRS 7126. Work partially supported by ANR-06-SETI-010-02. 1 side-effects can be added while preserving termination. Yet in another direction, we notice that a notion of region stratification has been used in [2] to guarantee the polynomial time reactivity of a first-order timed/synchronous language. We outline the contents of the paper. In section 2, we introduce a λ-calculus with regions. Regions are an abstraction of dynamically generated values such as references, channels, and signals, and the reduction rules of the calculus are given in such a way that the reduction rules for references, channels, and signals can be simulated by those given for regions. In section 3, we describe a simple type and effect system along the lines of [8]. In this discipline, types carry information on the regions on which the evaluated expressions may read or write. The discipline allows to write in a region r values that have an effect on the region r itself. In turn, this allows to simulate recursive definitions and thus to produce non terminating behaviours. In section 4, following [3], we describe a stratification of the regions. The idea is that regions are ordered and that a value written in a region may only produce effects in smaller regions. We then propose a new reducibility candidates interpretation (see, e.g., [6] for a good survey) entailing the termination of typable programs. In section 5, we enrich the language with the possibility to generate new threads and to react to the termination of the computation. The language we consider is then timed/synchronous in the sense that a computation is regarded as a possibly infinite sequence of instants. An instant ends when the calculus cannot progress anymore (cf. timed/synchronous languages such as Timed CCS [7] and Esterel [4]). We extend the stratified typing rules to this language and show by means of a translation into the core language that typable programs terminate. We also show that a fixed-point combinator can be defined and typed so that recursive calls are allowed as long as they arise at a later instant. This differs from [3] where a fixed-point combinator is added to the language potentially compromising the termination propert

This content is AI-processed based on ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut