Synthesizing Efficient Memoization Algorithms

Author:

Sun Yican1ORCID,Peng Xuanyu1ORCID,Xiong Yingfei1ORCID

Affiliation:

1. Peking University, Beijing, China

Abstract

In this paper, we propose an automated approach to finding correct and efficient memoization algorithms from a given declarative specification. This problem has two major challenges: (i) a memoization algorithm is too large to be handled by conventional program synthesizers; (ii) we need to guarantee the efficiency of the memoization algorithm. To address this challenge, we structure the synthesis of memoization algorithms by introducing the local objective function and the memoization partition function and reduce the synthesis task to two smaller independent program synthesis tasks. Moreover, the number of distinct outputs of the function synthesized in the second synthesis task also decides the efficiency of the synthesized memoization algorithm, and we only need to minimize the number of different output values of the synthesized function. However, the generated synthesis task is still too complex for existing synthesizers. Thus, we propose a novel synthesis algorithm that combines the deductive and inductive methods to solve these tasks. To evaluate our algorithm, we collect 42 real-world benchmarks from Leetcode, the National Olympiad in Informatics in Provinces-Junior (a national-wide algorithmic programming contest in China), and previous approaches. Our approach successfully synhesizes 39/42 problems in a reasonable time, outperforming the baselines.

Funder

National Key Research and Development Program of China

National Natural Science Foundation of China

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference56 articles.

1. [n. d.]. Full version of this paper. https://boyvolcano.github.io/publication/oopsla-23/oopsla23.pdf [n. d.]. Full version of this paper. https://boyvolcano.github.io/publication/oopsla-23/oopsla23.pdf

2. [n. d.]. National Olympiad in Informatics in Provinces-Junior. https://noi.ccf.org.cn/zxzy/lnzl/index.shtml [n. d.]. National Olympiad in Informatics in Provinces-Junior. https://noi.ccf.org.cn/zxzy/lnzl/index.shtml

3. [n. d.]. The world’s leading online programming learning platform. https://leetcode.com/ [n. d.]. The world’s leading online programming learning platform. https://leetcode.com/

4. Selective memoization

5. Prolog Programming Language

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3