arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1912.01914cs.LOcs.PL
收藏

对模式匹配的定量理解

A Quantitative Understanding of Pattern Matching

Sandra Alves, Delia Kesner, Daniel Ventura

摘要:

本文表明,最近的方法定量分类系统的程序设计语言可以扩展到模式匹配功能。事实上,我们定义了两个资源感知类型系统,命名为U和E,一个带对的模式和术语配备了一个可编程演算。我们的打字系统借用了[BKRDR15]的一些基本思想,它以定性的方式描述了(头部)规范化,在这个意义上,可打字性和规范化是一致的。但与[BKRDR15]相反,我们的(静态)系统还提供了有关微积分动力学的定量信息。实际上,系统U提供了归一化序列的长度加上它们相应的范式的大小的上界,而系统E,可以被看作是系统U的细化,为它们中的每一个产生精确的界限。这是通过配备有不同技术工具的非幂等相交类型系统来实现的。首先,我们使用乘积类型来对配对进行分类,而不是[BKRDR15]中的不相交联合,从而避免了“成为一对”和“可复制”之间的重叠,从而成为一个重要的工具来推理数量性。其次,系统E中的类型序列用整数元组装饰,其提供关于归一化序列的定量信息,特别是时间(参见图1)。长度)和空间(c.f.尺寸)。系统E的另一个关键工具是类型系统区分消费(贡献时间)和持久(贡献空间)构造函数。此外,时间资源信息被显著地细化,因为它区分在评估期间执行的不同种类的约简步骤,使得β约简、替换和匹配步骤被单独地计数。

英文摘要:

This paper shows that the recent approach to quantitative typing systems for programming languages can be extended to pattern matching features. Indeed, we define two resource aware type systems, named U and E, for a lambda-calculus equipped with pairs for both patterns and terms. Our typing systems borrow some basic ideas from [BKRDR15], which characterises (head) normalisation in a qualitative way, in the sense that typability and normalisation coincide. But in contrast to [BKRDR15], our (static) systems also provides quantitative information about the dynamics of the calculus. Indeed, system U provides upper bounds for the length of normalisation sequences plus the size of their corresponding normal forms, while system E, which can be seen as a refinement of system U, produces exact bounds for each of them. This is achieved by means of a non-idempotent intersection type system equipped with different technical tools. First of all, we use product types to type pairs, instead of the disjoint unions in [BKRDR15], thus avoiding an overlap between "being a pair" and "being duplicable", resulting in an essential tool to reason about quantitativity. Secondly, typing sequents in system E are decorated with tuples of integers, which provide quantitative information about normalisation sequences, notably time (c.f. length) and space (c.f. size). Another key tool of system E is that the type system distinguishes between consuming (contributing to time) and persistent (contributing to space) constructors. Moreover, the time resource information is remarkably refined, because it discriminates between different kinds of reduction steps performed during evaluation, so that beta reduction, substitution and matching steps are counted separately.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑