Resource-Guided Program Synthesis

04/16/2019
by   Tristan Knoth, et al.
0

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.

READ FULL TEXT
research
06/29/2020

Liquid Resource Types

This article presents liquid resource types, a technique for automatical...
research
03/06/2021

Synthesis with Asymptotic Resource Bounds

We present a method for synthesizing recursive functions that satisfy bo...
research
02/18/2021

Refinement Type Directed Search for Meta-Interpretive-Learning of Higher-Order Logic Programs

The program synthesis problem within the Inductive Logic Programming (IL...
research
03/30/2022

Type-Directed Program Synthesis for RESTful APIs

With the rise of software-as-a-service and microservice architectures, R...
research
02/12/2021

Data-Driven Synthesis of Provably Sound Side Channel Analyses

We propose a data-driven method for synthesizing a static analyzer to de...
research
04/26/2023

Automatic Amortized Resource Analysis with Regular Recursive Types

The goal of automatic resource bound analysis is to statically infer sym...
research
01/05/2018

Verifying and Synthesizing Constant-Resource Implementations with Types

We propose a novel type system for verifying that programs correctly imp...

Please sign up or login with your details

Forgot password? Click here to reset