Many problem domains, including program synthesis and rewrite-based optimization, require searching astronomically large spaces of programs. Existing approaches often rely on building specialized data structures -- version-space algebras, finite tree automata, or e-graphs -- to compactly represent these programs. To find a compact representation, existing data structures exploit independence of subterms; they blow up when the choices of subterms are entangled. We introduce equality-constrained tree automata (ECTAs), a generalization of the three aforementioned data structures that can efficiently represent large spaces of programs with entangled subterms. We present efficient algorithms for extracting programs from ECTAs, implemented in a performant Haskell library, \texttt{ecta}. Using \texttt{ecta} we construct \textsc{Hectare}, a type-driven program synthesizer for Haskell. \textsc{Hectare} significantly outperforms a state-of-the-art synthesizer Hoogle+ -- providing an average speedup of 8x -- despite its implementation being an order of magnitude smaller.
翻译:包括程序合成和重写优化在内的很多问题领域都需要搜索天文化的大型程序空间。 现有的方法往往依靠建立专门的数据结构 -- -- 版本空间代数、 有限的树自动成像仪或电子绘图 -- -- 来代表这些程序。 要找到一个缩略图, 现有的数据结构会利用子术语的独立性; 当子术语的选择被缠绕时, 它们就会爆炸。 我们引入了平等限制的树自动成像( ECTAs ), 对上述三个数据结构的概括化可以有效地代表与子术语缠绕的大型程序空间。 我们提出高效的算法, 用于从执行者Haskell 库、\ textt{ecta} 中提取程序。 使用\ textt{ { 直线} 我们为 Haskeell 构建一个类型驱动的程序合成器。\ textsc{hec{hetare} 大大超越了一个州- 艺术合成器 Hoogle+ -- 提供平均速度8x 。