{"title":"Higher-Order Specificationsfor Deductive Synthesis of Programs with Pointers (Extended version)","authors":"David Young, Ziyi Yang, Ilya Sergey, Alex Potanin","doi":"arxiv-2407.09143","DOIUrl":null,"url":null,"abstract":"Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, the\nstate-of-the-art approach for the deductive synthesis of provably-correct\nprograms in C-like languages that manipulate Heap-based linked data structures.\nDespite its expressivity, SSL suffers from two shortcomings that hinder its\nutility. First, its main specification component, inductive predicates, only\nadmits \\emph{first-order} definitions of data structure shapes, which leads to\nthe proliferation of ``boiler-plate'' predicates for specifying common\npatterns. Second, SSL requires \\emph{concrete} definitions of data structures\nto synthesise programs that manipulate them, which results in the need to\nchange a specification for a synthesis task every time changes are introduced\ninto the layout of the involved structures. We propose to significantly lift the level of abstraction used in writing\nSeparation Logic specifications for synthesis -- both simplifying the approach\nand making the specifications more usable and easy to read and follow. We avoid\nthe need to repetitively re-state low-level representation details throughout\nthe specifications -- allowing the reuse of different implementations of the\nsame data structure by abstracting away the details of a specific layout used\nin memory. Our novel \\textit{high-level front-end language} called Pika\nsignificantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enabling\npush-button synthesis of C programs with in-place memory updates, along with\nthe accompanying full proofs that they meet Separation Logic-style\nspecifications, from high-level specifications that resemble ordinary\nfunctional programs. Our experiments show that our tool can produce C code that\nis comparable in its performance characteristics and is sometimes faster than\nHaskell.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2407.09143","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, the
state-of-the-art approach for the deductive synthesis of provably-correct
programs in C-like languages that manipulate Heap-based linked data structures.
Despite its expressivity, SSL suffers from two shortcomings that hinder its
utility. First, its main specification component, inductive predicates, only
admits \emph{first-order} definitions of data structure shapes, which leads to
the proliferation of ``boiler-plate'' predicates for specifying common
patterns. Second, SSL requires \emph{concrete} definitions of data structures
to synthesise programs that manipulate them, which results in the need to
change a specification for a synthesis task every time changes are introduced
into the layout of the involved structures. We propose to significantly lift the level of abstraction used in writing
Separation Logic specifications for synthesis -- both simplifying the approach
and making the specifications more usable and easy to read and follow. We avoid
the need to repetitively re-state low-level representation details throughout
the specifications -- allowing the reuse of different implementations of the
same data structure by abstracting away the details of a specific layout used
in memory. Our novel \textit{high-level front-end language} called Pika
significantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enabling
push-button synthesis of C programs with in-place memory updates, along with
the accompanying full proofs that they meet Separation Logic-style
specifications, from high-level specifications that resemble ordinary
functional programs. Our experiments show that our tool can produce C code that
is comparable in its performance characteristics and is sometimes faster than
Haskell.