首页> 外文会议>Asian symposium on programming languages and systems >The Negligible and Yet Subtle Cost of Pattern Matching
【24h】

The Negligible and Yet Subtle Cost of Pattern Matching

机译:模式匹配的成本微不足道,但微不足道

获取原文

摘要

The 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-byname/valueeed). 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-morally, pattern matching comes for free, complexity-wise. The result is proven for all evaluation strategies (name/valueeed), 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.
机译:函数式编程语言背后的模型是封闭的λ演算,即λ演算的片段,其中评估较弱(即出于抽象概念)并且术语是封闭的。众所周知,对于所有自然评估策略(按姓名/值/需求),在这种情况下,β(即评估)步骤的数量是一个合理的成本模型。在本文中,我们通过考虑带模式匹配的β演算的扩展,试图缩小封闭的β演算与实际语言之间的差距。直接证明β加匹配步骤可提供合理的成本模型。然后我们做的更好:我们证明,在此扩展设置中,仅β步(没有匹配步)也提供了合理的成本模型-道德上,模式匹配是免费的,复杂的。所有评估策略(名称/值/需求)的结果都得到了证明,尽管证明本身很简单,但问题却很细微。特别是,我们表明按需呼叫的定性等效定义可能会表现出很大差异。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号