Program synthesis methods, whether formal or neural-based, lack fine-grained control and flexible modularity, which limits their adaptation to complex software development. These limitations stem from rigid Domain-Specific Language (DSL) frameworks and neural network incorrect predictions. To this end, we propose the Chain of Logic (CoL), which organizes synthesis stages into a chain and provides precise heuristic control to guide the synthesis process. Furthermore, by integrating neural networks with libraries and introducing a Neural Network Feedback Control (NNFC) mechanism, our approach modularizes synthesis and mitigates the impact of neural network mispredictions. Experiments on relational and symbolic synthesis tasks show that CoL significantly enhances the efficiency and reliability of DSL program synthesis across multiple metrics. Specifically, CoL improves accuracy by 70% while reducing tree operations by 91% and time by 95%. Additionally, NNFC further boosts accuracy by 6%, with a 64% reduction in tree operations under challenging conditions such as insufficient training data, increased difficulty, and multidomain synthesis. These improvements confirm COOL as a highly efficient and reliable program synthesis framework.
翻译:无论是基于形式化方法还是神经网络的程序合成技术,均因缺乏细粒度控制和灵活模块化能力,难以适应复杂软件开发需求。这些局限性源于僵化的领域特定语言(DSL)框架与神经网络错误预测。为此,我们提出链式逻辑(CoL)框架,将合成阶段组织为逻辑链,并通过精确启发式控制引导合成过程。进一步地,通过将神经网络与程序库集成并引入神经网络反馈控制(NNFC)机制,本方法实现了合成过程的模块化,有效缓解神经网络误判的影响。在关系型与符号型合成任务上的实验表明,CoL在多维度指标上显著提升了DSL程序合成的效率与可靠性。具体而言,CoL在保持准确率提升70%的同时,将树操作量减少91%,时间消耗降低95%。此外,在训练数据不足、任务难度提升及多领域合成等挑战性条件下,NNFC机制可进一步将准确率提升6%,并使树操作量减少64%。这些改进证实COOL是一个高效可靠的程序合成框架。