arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1904.07415cs.PLcs.LO
收藏

资源引导的程序合成

Resource-Guided Program Synthesis

Tristan Knoth, Di Wang, Nadia Polikarpova, Jan Hoffmann

摘要:

本文介绍了资源引导合成,一种用于合成既满足功能规范又满足符号资源约束的递归程序的技术。该技术是类型导向的,并依赖于一个新的类型系统,结合多态细化类型与自动摊销资源分析的潜在注释。类型系统支持有效的基于约束的类型检查,并可以表达精确的基于细化的资源边界。类型可靠性证明表明,合成程序是正确的。通过紧密集成程序探索和类型检查,合成器可以利用用户提供的资源绑定来指导搜索,急切地拒绝消耗太多资源的不完整程序。在资源引导合成器ReSyn的实现是用来评估递归数据结构操作的范围内的技术。实验表明,ReSyn合成的程序比由资源不可知的合成器生成的程序更有效。此外,使用ReSyn的合成比合成和资源分析的简单组合更快。ReSyn还能够生成对于固定输入大小具有恒定资源消耗的实现,这可用于减轻侧信道攻击。

英文摘要:

This article presents resource-guided synthesis, a technique for synthesizing recursive programs that satisfy both a functional specification and a symbolic resource bound. The technique is type-directed and rests upon a novel type system that combines polymorphic refinement types with potential annotations of automatic amortized resource analysis. The type system enables efficient constraint-based type checking and can express precise refinement-based resource bounds. The proof of type soundness shows that synthesized programs are correct by construction. By tightly integrating program exploration and type checking, the synthesizer can leverage the user-provided resource bound to guide the search, eagerly rejecting incomplete programs that consume too many resources. An implementation in the resource-guided synthesizer ReSyn is used to evaluate the technique on a range of recursive data structure manipulations. The experiments show that ReSyn synthesizes programs that are asymptotically more efficient than those generated by a resource-agnostic synthesizer. Moreover, synthesis with ReSyn is faster than a naive combination of synthesis and resource analysis. ReSyn is also able to generate implementations that have a constant resource consumption for fixed input sizes, which can be used to mitigate side-channel attacks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑