skip to main content
10.1145/3441296.3441394acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Coq to C translation with partial evaluation

Published: 17 January 2021 Publication History

Abstract

Coq proof assistant can be used to prove various properties of programs written in the Gallina language. It is also possible to translate Gallina programs to OCaml programs. However, OCaml is not suitable for low-level programs. Therefore, we are developing a Coq plugin for Gallina to C translation. This plugin transforms functions written in Gallina into a form as close to C as possible within Gallina. This transformation includes partial evaluation, which improves execution efficiency and eliminates polymorphism and dependent types. We can easily verify in Coq that this transformation does not change the execution result, and thus it is highly reliable. And Gallina functions after this transformation can be easily translated to C.

Supplementary Material

MP4 File (3441296.3441394.mp4)
Video Presentation

References

[1]
Abhishek Anand, Andrew Appel, Greg Morrisett, Zoe Paraskevopoulou, Randy Pollack, Olivier Savary Belanger, Matthieu Sozeau, and Matthew Weaver. 2017. CertiCoq: A verified compiler for Coq. In The Third International Workshop on Coq for Programming Languages (CoqPL).
[2]
Lars Birkedal, Mads Tofte, and Magnus Vejlstrup. 1996. From region inference to von Neumann machines via region representation inference. In Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 171-183. htps: //doi.org/10.1145/237721.237771
[3]
Olivier Danvy and Lasse R Nielsen. 2005. CPS transformation of betaredexes. Inform. Process. Lett. 94, 5 ( 2005 ), 217-224. htps://doi.org/10. 1016/j.ipl. 2005. 02.002
[4]
Cormac Flanagan, Amr Sabry, Bruce F Duba, and Matthias Felleisen. 1993. The essence of compiling with continuations. In Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation. 237-247. htps://doi.org/10.1145/155090.155113
[5]
Xavier Leroy. 2009. Formal verification of a realistic compiler. Commun. ACM 52, 7 ( 2009 ), 107-115. htps://doi.org/10.1145/1538788.1538814
[6]
Pierre Letouzey. 2003. A New Extraction for Coq. In Types for Proofs and Programs, Second International Workshop, TYPES 2002, Berg en Dal, The Netherlands, April 24-28, 2002 (Lecture Notes in Computer Science, Vol. 2646 ), Herman Geuvers and Freek Wiedijk (Eds.). Springer-Verlag. htps://doi.org/10.1007/3-540-39185-1_12
[7]
Eric Mullen, Stuart Pernsteiner, James R Wilcox, Zachary Tatlock, and Dan Grossman. 2018. Œuf: minimizing the Coq extraction TCB. In Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs. 172-185. htps://doi.org/10.1145/3167089
[8]
Gonzalo Navarro. 2016. Compact data structures: A practical approach. Cambridge University Press. htps://doi.org/10.1017/ CBO9781316588284
[9]
Akira Tanaka, Reynald Afeldt, and Jacques Garrigue. 2018. Safe lowlevel code generation in Coq using monomorphization and monadification. Journal of Information Processing 26 ( 2018 ), 54-72. htps: //doi.org/10.2197/ipsjjip.26.54
[10]
The Coq Development Team. 2020. The Coq Proof Assistant. htps: //coq.inria.fr/.
[11]
The Coq Development Team. 2020. The Coq reference manual: Release 8. 12.0. ( 2020 ).

Cited By

View all
  • (2024)End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTComputer Aided Verification10.1007/978-3-031-65627-9_16(325-347)Online publication date: 26-Jul-2024
  • (2022)Extracting functional programs from Coq, in CoqJournal of Functional Programming10.1017/S095679682200007732Online publication date: 22-Aug-2022
  • (2022)End-to-End Mechanized Proof of an eBPF Virtual Machine for Micro-controllersComputer Aided Verification10.1007/978-3-031-13188-2_15(293-316)Online publication date: 6-Aug-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PEPM 2021: Proceedings of the 2021 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation
January 2021
89 pages
ISBN:9781450383059
DOI:10.1145/3441296
Publication rights licensed to ACM. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 January 2021

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. C
  2. Coq
  3. Gallina
  4. compiler
  5. partial evaluation
  6. tail recursion
  7. translator
  8. verification

Qualifiers

  • Research-article

Funding Sources

Conference

POPL '21
Sponsor:

Acceptance Rates

Overall Acceptance Rate 66 of 120 submissions, 55%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)27
  • Downloads (Last 6 weeks)0
Reflects downloads up to 17 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTComputer Aided Verification10.1007/978-3-031-65627-9_16(325-347)Online publication date: 26-Jul-2024
  • (2022)Extracting functional programs from Coq, in CoqJournal of Functional Programming10.1017/S095679682200007732Online publication date: 22-Aug-2022
  • (2022)End-to-End Mechanized Proof of an eBPF Virtual Machine for Micro-controllersComputer Aided Verification10.1007/978-3-031-13188-2_15(293-316)Online publication date: 6-Aug-2022
  • (2021)The JaSpe specializer: BT-objects and the interprocedural aspect of the binding-time analysis algorithmProgram Systems: Theory and ApplicationsПрограммные системы: теория и приложения10.25209/2079-3316-2021-12-4-3-3212:4(3-32)Online publication date: 2021

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media