Jiaxin Liu , Yiwei Li , Jianhua Dai , Rongjia Xu , Yating Zhang , Wei Dong
{"title":"Iterative program synthesis with code knowledge","authors":"Jiaxin Liu , Yiwei Li , Jianhua Dai , Rongjia Xu , Yating Zhang , Wei Dong","doi":"10.1016/j.ins.2025.122156","DOIUrl":null,"url":null,"abstract":"<div><div>Component-based synthesis aims to automatically synthesize programs from a collection of components, such as Java programs composed of application programming interfaces (APIs). However, synthesizing complex tasks remains inefficient due to the intractability of program space, which grows exponentially with the length of code. When faced with unfamiliar and complex tasks, programmers often turn to the code available online, reusing existing code knowledge to solve them. Inspired by this, we propose <span>Itas</span>, an explainable iterative program synthesis framework that incorporates code knowledge to reduce the complexity of program space and leverages modular encapsulation to synthesize more functions. Specifically, <span>Itas</span> narrows the program space externally with API knowledge, expands the program space internally with an iterative strategy to improve synthesis efficiency, and encapsulates non-API elements as general APIs to enhance modularity. To evaluate the effectiveness of <span>Itas</span>, we collect a benchmark of real programming tasks and conduct experiments on the conventional program synthesizers <span>SyPet</span> and <span>FrAngel</span>. The experimental results demonstrate that integrating with <span>Itas</span> substantially enhances synthesis efficiency, reducing the synthesis time by 97.02% compared to <span>SyPet</span> and 48.43% compared to <span>FrAngel</span>. Furthermore, comparisons with large language models show that <span>Itas</span> outperforms them in pass rate, successfully solving all tasks.</div></div>","PeriodicalId":51063,"journal":{"name":"Information Sciences","volume":"712 ","pages":"Article 122156"},"PeriodicalIF":8.1000,"publicationDate":"2025-04-02","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information Sciences","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0020025525002889","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"0","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
Abstract
Component-based synthesis aims to automatically synthesize programs from a collection of components, such as Java programs composed of application programming interfaces (APIs). However, synthesizing complex tasks remains inefficient due to the intractability of program space, which grows exponentially with the length of code. When faced with unfamiliar and complex tasks, programmers often turn to the code available online, reusing existing code knowledge to solve them. Inspired by this, we propose Itas, an explainable iterative program synthesis framework that incorporates code knowledge to reduce the complexity of program space and leverages modular encapsulation to synthesize more functions. Specifically, Itas narrows the program space externally with API knowledge, expands the program space internally with an iterative strategy to improve synthesis efficiency, and encapsulates non-API elements as general APIs to enhance modularity. To evaluate the effectiveness of Itas, we collect a benchmark of real programming tasks and conduct experiments on the conventional program synthesizers SyPet and FrAngel. The experimental results demonstrate that integrating with Itas substantially enhances synthesis efficiency, reducing the synthesis time by 97.02% compared to SyPet and 48.43% compared to FrAngel. Furthermore, comparisons with large language models show that Itas outperforms them in pass rate, successfully solving all tasks.
期刊介绍:
Informatics and Computer Science Intelligent Systems Applications is an esteemed international journal that focuses on publishing original and creative research findings in the field of information sciences. We also feature a limited number of timely tutorial and surveying contributions.
Our journal aims to cater to a diverse audience, including researchers, developers, managers, strategic planners, graduate students, and anyone interested in staying up-to-date with cutting-edge research in information science, knowledge engineering, and intelligent systems. While readers are expected to share a common interest in information science, they come from varying backgrounds such as engineering, mathematics, statistics, physics, computer science, cell biology, molecular biology, management science, cognitive science, neurobiology, behavioral sciences, and biochemistry.