首页> 外文会议>European symposium on programming;European joint conferences on theory and practice of software >Overlapping and Order-Independent Patterns Definitional Equality for All
【24h】

Overlapping and Order-Independent Patterns Definitional Equality for All

机译:所有人的重叠和顺序无关的模式定义平等

获取原文

摘要

Dependent pattern matching is a safe and efficient way to write programs and proofs in dependently typed languages. Current languages with dependent pattern matching treat overlapping patterns on a first-match basis, hence the order of the patterns can matter. Perhaps surprisingly, this order-dependence can even occur when the patterns do not overlap. To fix this confusing behavior, we developed a new semantics of pattern matching which treats all clauses as definitional equalities, even when the patterns overlap. A confluence check guarantees correctness in the presence of overlapping patterns. Our new semantics has two advantages. Firstly, it removes the order-dependence and thus makes the meaning of definitions clearer. Secondly, it allows the extension of existing definitions with new (consistent) evaluation rules. Unfortunately it also makes pattern matching harder to understand theoretically, but we give a theorem that helps to bridge this gap. An experimental implementation in Agda shows that our approach is feasible in practice too.
机译:从属模式匹配是一种以从属类型的语言编写程序和证明的安全有效的方法。具有依赖性模式匹配的当前语言会在首次匹配的基础上处理重叠的模式,因此模式的顺序可能很重要。也许令人惊讶的是,当模式不重叠时,甚至可能发生这种顺序依赖性。为了解决这种令人困惑的行为,我们开发了一种模式匹配的新语义,即使模式重叠,也可以将所有子句视为定义相等性。汇合检查可确保在重叠样式存在的情况下的正确性。我们的新语义有两个优点。首先,它消除了顺序依赖性,从而使定义的含义更清晰。其次,它允许使用新的(一致的)评估规则扩展现有定义。不幸的是,这也使得模式匹配在理论上更难以理解,但是我们给出了一个定理,可以帮助弥合这种差距。在Agda中进行的实验性实施表明,我们的方法在实践中也是可行的。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号