着色E-Graph:带条件的等式推理
Colored E-Graph: Equality Reasoning with Conditions
AI总结:
本文提出着色E-Graph,通过在单一结构中用颜色编码表示多个粗化同余关系,解决E-graph难以处理多假设情形分裂的问题,实验表明其空间开销降低一个数量级且时间开销相近。
摘要:
E-graph是一种重要的数据结构,近年来因其在各类形式化推理任务中的应用范围不断扩大而日益流行。它们通常用于等式饱和,即通过项重写反复应用全称量化的等式公式来推导结论的过程。E-graph能够处理大规模项空间上的等式推理,但在处理情形分裂和其他类型的逻辑切割方面存在严重局限,尤其是与序贯演算和归结等其他推理技术相比。主要困难在于,当等式推理需要多个不一致的假设才能得出单一结论时。临时解决方案(例如为每个假设复制一份E-graph)虽然可用,但资源消耗显著。我们引入一个关键观察:每个重复的E-graph(加上一个附加假设)都对应于一个粗化的同余关系。基于这一点,我们提出了E-graph的一种扩展,称为着色E-Graph(Colored E-Graphs),用以在单一结构中表示所有粗化的同余关系。着色E-graph是多个E-graph副本的内存高效等价物,开销低得多。这是通过在不同情形之间尽可能多地共享,同时仔细跟踪哪个结论在哪个假设下成立来实现的。对多重关系的支持可以看作是在原始E-graph结构之上添加多个“颜色编码”的层,从而实现很大程度的共享。在我们的实现中,我们引入了对重建(rebuilding)和e-匹配(e-matching)的优化。我们进行了实验,并证明我们的着色E-graph可以支持数百个假设和数百万个项,空间需求降低了一个数量级,而时间需求相似。
英文摘要:
E-graphs are a prominent data structure that has been increasing in popularity in recent years due to their expanding range of applications in various formal reasoning tasks. Often, they are used for equality saturation, a process of deriving consequences through repeatedly applying universally quantified equality formulas via term rewriting. They handle equality reasoning over a large spaces of terms, but are severely limited in their handling of case splitting and other types of logical cuts, especially when compared to other reasoning techniques such as sequent calculi and resolution. The main difficulty is when equality reasoning requires multiple inconsistent assumptions to reach a single conclusion. Ad-hoc solutions, such as duplicating the e-graph for each assumption, are available, but they are notably resource-intensive. We introduce a key observation is that each duplicate e-graph (with an added assumption) corresponds to coarsened congruence relation. Based on that, we present an extension to e-graphs, called Colored E-Graphs, as a way to represent all of the coarsened congruence relations in a single structure. A colored e-graph is a memory-efficient equivalent of multiple copies of an e-graph, with a much lower overhead. This is attained by sharing as much as possible between different cases, while carefully tracking which conclusion is true under which assumption. Support for multiple relations can be thought of as adding multiple "color-coded" layers on top of the original e-graph structure, leading to a large degree of sharing. In our implementation, we introduce optimizations to rebuilding and e-matching. We run experiments and demonstrate that our colored e-graphs can support hundreds of assumptions and millions of terms with space requirements that are an order of magnitude lower, and with similar time requirements.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。