首页> 外文期刊>Journal of Automated Reasoning >Type-Based Cost Analysis for Lazy Functional Languages
【24h】

Type-Based Cost Analysis for Lazy Functional Languages

机译:惰性功能语言的基于类型的成本分析

获取原文
获取原文并翻译 | 示例

摘要

We present a static analysis for determining the execution costs of lazily evaluated functional languages, such as Haskell. Time- and space-behaviour of lazy functional languages can be hard to predict, creating a significant barrier to their broader acceptance. This paper applies a type-based analysis employing amortisation and cost effects to statically determine upper bounds on evaluation costs. While amortisation performs well with finite recursive data, we significantly improve the precision of our analysis for co-recursive programs (i.e. dealing with potentially infinite data structures) by tracking self-references. Combining these two approaches gives a fully automatic static analysis for both recursive and co-recursive definitions. The analysis is formally proven correct against an operational semantic that features an exchangeable parametric cost-model. An arbitrary measure can be assigned to all syntactic constructs, allowing to bound, for example, evaluation steps, applications, allocations, etc. Moreover, automatic inference only relies on first-order unification and standard linear programming solving. Our publicly available implementation demonstrates the practicability of our technique on editable non-trivial examples.
机译:我们提出了一种静态分析,用于确定延迟评估的功能语言(例如Haskell)的执行成本。惰性函数语言的时间和空间行为可能难以预测,这为它们被更广泛的接受创造了重大障碍。本文应用基于类型的分析,采用摊销和成本效应来静态确定评估成本的上限。尽管分期付款在有限递归数据上表现良好,但通过跟踪自引用,我们显着提高了对共递归程序(即处理潜在无限数据结构)的分析精度。结合这两种方法,可以对递归和共递归定义进行全自动的静态分析。对于具有可交换参数成本模型特征的操作语义,该分析已被正式证明是正确的。可以将任意量度分配给所有语法结构,从而允许绑定例如评估步骤,应用程序,分配等。此外,自动推断仅依赖于一阶统一和标准线性规划求解。我们可公开获得的实现方法证明了我们的技术在可编辑的非平凡示例中的实用性。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号