arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.01249cs.PL
收藏

在纯 egglog 中折叠 e-graph

Folding an e-graph in pure egglog

EPFL(洛桑联邦理工学院);MIT(麻省理工学院)

Zeng Ren, Maddy Bowers

AI总结:

本文提出在纯 egglog 中定义并实现 e-graph 上的 catamorphism(折叠),通过分阶段推理规则避免值重复传播,实现高效计算。

摘要:

在递归数据结构上进行折叠(也称为“catamorphism”)是函数式编程中的基本操作。它允许人们通过关注子问题的解如何组合成父问题的解来声明式地定义递归计算。在 e-graph 的上下文中进行折叠可以带来若干好处。我们不仅免费获得了记忆化,而且由于子问题是在 e-class 上定义的,而不是具体的子项,计算量也大大减少。这篇简短报告介绍了我们在纯 egglog 中定义和实现 catamorphism(一种通用的折叠概念)的初步尝试。我们讨论了一种可重用的实现技巧,用于分阶段推理规则,从而避免更新值的重新传播。

英文摘要:

Folding over a recursive data structure (also known as "catamorphism") is an essential operation in functional programming. It allows one to declaratively define a recursive computation by focusing on how solutions of subproblems are combined into the solution of the parent problem. Folding in the context of e-graphs can have several benefits. Not only do we get memoization for free, but also computation is drastically reduced since the subproblems are defined over e-classes as opposed to concrete sub-terms. This short report presents our initial attempt at defining and implementing catamorphism, a general notion of a fold, in pure egglog. We discuss a reusable implementation trick to stage the inference rules so that there is no re-propagation of updated values.

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

↑