Algorithmic paradigms such as divide-and-conquer (D&C) are proposed to guide the design of efficient algorithms, but applying them to optimize existing programs is difficult. Therefore, many research efforts have been devoted to the automatic application of algorithmic paradigms. However, most existing approaches to this problem are based on deductive methods and thus put significant restrictions on how the original program is implemented. To overcome this limitation, we study the automatic application of paradigms as an oracle-guided inductive synthesis problem, where the synthesizer only invokes the original program as a black-box oracle or uses a given verifier to verify the correctness of candidate programs. Such a synthesizer puts no restriction on the original program and thus overcomes the limitation of deductive approaches. We notice that the application tasks of various paradigms have a similar form as that of D&C. We denote these paradigms as D&C-like paradigms, unify their application tasks into a novel type of synthesis problems, named lifting problems, and propose an efficient inductive synthesizer AutoLifter for lifting problems. The main challenge of solving lifting problems is from the usually large scale of efficient algorithms. To overcome this challenge, we divide and conquer lifting problems. We devise two novel decomposition methods, component elimination and variable elimination, to soundly divide a lifting problem into simpler subtasks, each tractable with existing inductive synthesizers. We evaluate AutoLifter on 96 programming tasks related to 6 different algorithmic paradigms. AutoLifter solves 82/96 tasks with an average time cost of 6.53 seconds, significantly outperforming existing approaches.
翻译:摘要:算法范式如分而治之(D&C)被提出来指导高效算法的设计,但将它们应用于优化现有程序很困难。因此,许多研究工作致力于自动应用算法范式。然而,大多数现有方法都基于演绎方法,因此对原始程序实现的方式施加了重要限制。为了克服这种限制,我们将算法范式的自动应用研究为一个有oracle指导的归纳综合问题,其中综合器仅将原始程序调用为黑箱oracle或使用给定的验证器来验证候选程序的正确性。这样的综合器对原始程序没有任何限制,从而克服了演绎方法的限制。我们注意到各种算法范式的应用任务与D&C具有类似的形式。我们将这些范式称为D&C-like范式,将它们的应用任务统一为一种新类型的综合问题,称为lifting问题,并提出一种针对lifting问题的高效归纳综合器AutoLifter。解决lifting问题的主要挑战来自于通常庞大的高效算法规模。为了克服这个挑战,我们采用两种新的分解方法——组件消除和变量消除——来将lifting问题安全地分解成更简单的子任务,每个子任务都可用现有的归纳综合器解决。我们在与6种不同算法范式相关的96个编程任务上评估了AutoLifter。AutoLifter解决了82/96个任务,平均时间成本为6.53秒,显著优于现有方法。