Cargando…

Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs

We present an original approach to sound program extraction in a proof assistant, using syntax-driven automation to derive correct-by-construction imperative programs from nondeterministic functional source code. Our approach does not require committing to a single inflexible compilation strategy an...

Descripción completa

Detalles Bibliográficos
Autores principales: Pit-Claudel, Clément, Wang, Peng, Delaware, Benjamin, Gross, Jason, Chlipala, Adam
Formato: Online Artículo Texto
Lenguaje:English
Publicado: 2020
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7324049/
http://dx.doi.org/10.1007/978-3-030-51054-1_7
_version_ 1783551870761959424
author Pit-Claudel, Clément
Wang, Peng
Delaware, Benjamin
Gross, Jason
Chlipala, Adam
author_facet Pit-Claudel, Clément
Wang, Peng
Delaware, Benjamin
Gross, Jason
Chlipala, Adam
author_sort Pit-Claudel, Clément
collection PubMed
description We present an original approach to sound program extraction in a proof assistant, using syntax-driven automation to derive correct-by-construction imperative programs from nondeterministic functional source code. Our approach does not require committing to a single inflexible compilation strategy and instead makes it straightforward to create domain-specific code translators. In addition to a small set of core definitions, our framework is a large, user-extensible collection of compilation rules each phrased to handle specific language constructs, code patterns, or data manipulations. By mixing and matching these pieces of logic, users can easily tailor extraction to their own domains and programs, getting maximum performance and ensuring correctness of the resulting assembly code. Using this approach, we complete the first proof-generating pipeline that goes automatically from high-level specifications to assembly code. In our main case study, the original specifications are phrased to resemble SQL-style queries, while the final assembly code does manual memory management, calls out to foreign data structures and functions, and is suitable to deploy on resource-constrained platforms. The pipeline runs entirely within the Coq proof assistant, leading to final, linked assembly code with overall full-functional-correctness proofs in separation logic.
format Online
Article
Text
id pubmed-7324049
institution National Center for Biotechnology Information
language English
publishDate 2020
record_format MEDLINE/PubMed
spelling pubmed-73240492020-06-30 Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs Pit-Claudel, Clément Wang, Peng Delaware, Benjamin Gross, Jason Chlipala, Adam Automated Reasoning Article We present an original approach to sound program extraction in a proof assistant, using syntax-driven automation to derive correct-by-construction imperative programs from nondeterministic functional source code. Our approach does not require committing to a single inflexible compilation strategy and instead makes it straightforward to create domain-specific code translators. In addition to a small set of core definitions, our framework is a large, user-extensible collection of compilation rules each phrased to handle specific language constructs, code patterns, or data manipulations. By mixing and matching these pieces of logic, users can easily tailor extraction to their own domains and programs, getting maximum performance and ensuring correctness of the resulting assembly code. Using this approach, we complete the first proof-generating pipeline that goes automatically from high-level specifications to assembly code. In our main case study, the original specifications are phrased to resemble SQL-style queries, while the final assembly code does manual memory management, calls out to foreign data structures and functions, and is suitable to deploy on resource-constrained platforms. The pipeline runs entirely within the Coq proof assistant, leading to final, linked assembly code with overall full-functional-correctness proofs in separation logic. 2020-06-06 /pmc/articles/PMC7324049/ http://dx.doi.org/10.1007/978-3-030-51054-1_7 Text en © Springer Nature Switzerland AG 2020 This article is made available via the PMC Open Access Subset for unrestricted research re-use and secondary analysis in any form or by any means with acknowledgement of the original source. These permissions are granted for the duration of the World Health Organization (WHO) declaration of COVID-19 as a global pandemic.
spellingShingle Article
Pit-Claudel, Clément
Wang, Peng
Delaware, Benjamin
Gross, Jason
Chlipala, Adam
Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title_full Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title_fullStr Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title_full_unstemmed Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title_short Extensible Extraction of Efficient Imperative Programs with Foreign Functions, Manually Managed Memory, and Proofs
title_sort extensible extraction of efficient imperative programs with foreign functions, manually managed memory, and proofs
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7324049/
http://dx.doi.org/10.1007/978-3-030-51054-1_7
work_keys_str_mv AT pitclaudelclement extensibleextractionofefficientimperativeprogramswithforeignfunctionsmanuallymanagedmemoryandproofs
AT wangpeng extensibleextractionofefficientimperativeprogramswithforeignfunctionsmanuallymanagedmemoryandproofs
AT delawarebenjamin extensibleextractionofefficientimperativeprogramswithforeignfunctionsmanuallymanagedmemoryandproofs
AT grossjason extensibleextractionofefficientimperativeprogramswithforeignfunctionsmanuallymanagedmemoryandproofs
AT chlipalaadam extensibleextractionofefficientimperativeprogramswithforeignfunctionsmanuallymanagedmemoryandproofs