2 research outputs found

    The Negligible and Yet Subtle Cost of Pattern Matching

    Get PDF
    International audienceThe model behind functional programming languages is the closed -calculus, that is, the fragment of the -calculus where evaluation is weak (i.e. out of abstractions) and terms are closed. It is well-known that the number of (i.e. evaluation) steps is a reasonable cost model in this setting, for all natural evaluation strategies (call-by-name / value / need). In this paper we try to close the gap between the closed -calculus and actual languages, by considering an extension of the -calculus with pattern matching. It is straightforward to prove that plus matching steps provide a reasonable cost model. What we do then is finer: we show that steps only, without matching steps, provide a reasonable cost model also in this extended setting鈥攎orally, pattern matching comes for free, complexity-wise. The result is proven for all evaluation strategies (name / value / need), and, while the proof itself is simple, the problem is shown to be subtle. In particular we show that qualitatively equivalent definitions of call-by-need may behave very differently. This work is part of a wider research effort, the COCA HOLA project [3]
    corecore