15 research outputs found

    Stratégies Efficaces et ModÚles d'Implantation pour les Langages Fonctionnels.

    No full text
    In functional languages, efficiency heavily relies on the choice of an evaluation strategy and an implementation model.! We first develop a λ-calculus with explicit substitution! s which avoids the usual problems of substitution and α-conversion, where we can define the usual strategies, as well as some strategies with more sharing of computations. We then develop an efficient implementation model for this calculus. To this end, we propose an innovative representation of free variables, first in the very general setting of higher-order rewriting, then with more details in our particular case. We thus obtain a λ-calculus with explicit substitutions without names nor indices, in which terms are annotated with information about how substitutions should be propagated, which is a suitable implementation model for our strategies. Abstract machines are then defined, implemented, and experimentally compared to the best known evaluators. Finally, we study the relationship between traditional abstract machines and interaction nets, two common but very different implementation models. More precisely, we show how some strategies can be implemented in interaction nets in a very natural way, thus bridging the gap between two models used to implement efficient strategies.Dans les langages fonctionnels, l'efficacitĂ© dĂ©pend crucialement du choix de la stratĂ©gie d'Ă©valuation et d'un modĂšle d'implantation adaptĂ©. Nous dĂ©veloppons d'abord un λ-calcul avec substitutions explicites qui Ă©vite les problĂšmes habituels liĂ©s Ă  la substitution et Ă  l'α-conversion, dans lequel on peut dĂ©finir les stratĂ©gies usuelles, mais aussi des stratĂ©gies avec un meilleur partage de calcul. Ensuite, nous dĂ©veloppons un modĂšle d'implantation efficace pour ce calcul. Pour cela, nous proposons une reprĂ©sentation innnovante des variables libres, d'abord dans le cadre trĂšs gĂ©nĂ©ral de la rĂ©criture d'ordre supĂ©rieur, puis avec plus de dĂ©tails dans notre cas particulier. Nous obtenons ainsi un λ-calcul avec substitutions explicites sans noms ni indices, dans lequel les te! rmes sont annotĂ©s avec de l'information qui indique comment les substitutions doivent ĂȘtre propagĂ©es, et qui constitue un modĂšle d'implantation efficace pour nos stratĂ©gies. Des machines abstraites sont alors dĂ©finies, implantĂ©es et comparĂ©es expĂ©rimentalement aux meilleurs Ă©valuateurs connus. Finalement, nous Ă©tudions les relations entre machines abstraites traditionnelles et rĂ©seaux d'interaction, deux modĂšles d'implantation courants mais trĂšs diffĂ©rents. Plus prĂ©cisĂ©ment, nous montrons comment certaines stratĂ©gies peuvent ĂȘtre implantĂ©es dans les rĂ©seaux d'interaction d'une façon trĂšs naturelle, rapprochant ainsi deux modĂšles utilisĂ©s pour l'implantation de stratĂ©gies efficaces

    Token-Passing Nets: Call-by-Need for Free

    No full text
    Recently, encodings in interaction nets of the call-by-name and call-by-value strategies of the λ-calculus have been proposed. The purpose of these encodings was to bridge the gap between interaction nets and traditional abstract machines, which are both used to provide lower-level specifications of strategies of the λ-calculus, but in radically different ways. The strength of these encodings is their simplicity, which comes from the simple idea of introducing an explicit syntactic object to represent the flow of evaluation. In particular, no artifact to represent boxes is needed. However, these encodings purposefully follow as closely as possible the implemented strategies, call-by-name and call-by-value, hence do not benefit from the ability of interaction nets to easily represent sharing. The aim of this note is to show that sharing can indeed be achieved without adding any structure. We thus present the call-by-need strategy following the same philosophy, which is indeed not any more complicated than call-by-name. This continues the task of bridging the gap between interaction nets and abstract machines, thus pushing forward a more uniform framework for implementations of the λ-calculus

    A Natural Semantics for Completely Lazy Evaluation

    No full text
    Abstract. Lazy evaluation (or call-by-need) is widely used and well understood, partly thanks to a clear operational semantics given by Launchbury. However, modern non-strict functional languages do not use plain call-by-need evaluation: they also use optimisations like fully lazy λ-lifting or partial evaluation. To ease reasoning, it would be nice to have all these features in a uniform setting. In this paper, we generalise Launchbury’s semantics in order to capture “complete laziness”, as coined by Holst and Gomard in 1991, which is slightly more than fully lazy sharing, and closer to on-the-fly needed partial evaluation. This gives a clear, formal and implementation-independent operational semantics to completely lazy evaluation, in a natural (or big-step) style similar to Launchbury’s. Surprisingly, this requires to share not only terms, but also contexts, a property which was thought to characterise optimal reduction.

    Rule-Based Operational Semantics for an Imperative Language

    Get PDF
    Abstract. Operational semantics for programming languages usually come in two flavours: big-step and small-step. Both are defined using deduction rules with a congruence rule allowing reduction in certain contexts. For a description based on rewrite rules, known approaches consist in deriving an abstract machine, which is very close to implementation. In this paper, we describe the operational semantics of an imperative language in a rule-based style, arguably as abstract as the other kinds of semantics. Moreover, we combine the approach with the store-based semantics, which puts the focus on memory states rather than values, which is more appropriate for imperative languages.

    Macros for Interaction Nets: A Conservative Extension of Interaction Nets

    Get PDF
    AbstractWe propose a conservative extension of interaction nets which offers enriched pattern-matching facilities. The extension is conservative in the sense that it can be implemented inside standard interaction nets, and thus can be seen as a system of macros. Consequently, we are guaranteed to keep all the good properties of interaction nets, in particular strong confluence. We see this extension as a crucial step towards using interaction nets as a programming language, which remains a relatively unexplored area. One significant feature of the extension presented here is that, in contrast to other extensions presented previously, we essentially follow the syntax and spirit of interaction nets, and moreover the extension lives at the same level

    Interaction Nets vs. the ρ-calculus: Introducing Bigraphical Nets

    No full text
    The ρ-calculus generalises both term rewriting and the λ-calculus in a uniform framework. Interaction nets are a form of graph rewriting which proved most successful in understanding the dynamics of the λ-calculus, the prime example being the implementation of optimal ÎČ-reduction. It is thus natural to study interaction net encodings of the ρ-calculus as a first step towards the definition of efficient reduction strategies. We give two interaction net encodings which bring a new understanding to the operational semantics of the ρ-calculus; however, these encodings have some drawbacks and to overcome them we introduce bigraphical nets—a new paradigm of computation inspired by Lafont’s interactions nets and Milner’s bigraphs

    Efficient Reductions with Director Strings

    No full text
    We present a name free λ-calculus with explicit substitutions based on a generalized notion of director strings: we annotate a term with information about how each substitution should be propagated through the term. We first present a calculus where we can simulate arbitrary ÎČ-reduction steps, and then simplify the rules to model the evaluation of functional programs (reduction to weak head normal form). We also show that we can derive the closed reduction strategy (a weak strategy which, in contrast with standard weak strategies allows certain reductions to take place inside λ-abstractions thus offering more sharing). Our experimental results confirm that, for large combinator based terms, our weak evaluation strategies out-perform standard evaluators. Moreover, we derive two abstract machines for strong reduction which inherit the efficiency of the weak evaluators

    Lambda-Calculus with Director Strings

    No full text
    No description supplie
    corecore