Co-Synthesis of Code and Formal Models Using Large Language Models and Functors

Large Language Models (LLMs) have demonstrated remarkable capabilities in generating code from natural language descriptions, including code for parallel systems. However, ensuring that this code is free of errors, particularly in concurrent and synchronization-heavy contexts, remains a significant challenge. In this paper, we introduce a new approach that employs LLMs to co-synthesize the code, its formal model and the functor that establishes the mapping between the code and its formal model. The formal models are then verified against temporal logic specifications using model checking. The functors serve as human-auditable artifacts that help establish equivalence between the code and its formal model. Our methodology is demonstrated through experiments involving the co-synthesis of C code and its formal model for the dining philosophers problem. Our experimental results using models from OpenAI, Anthropic, and Meta evaluate the effectiveness of our approach.

Authors

Institutions

Publication Details

Published
2024-10-28
DOI
https://doi.org/10.1109/milcom61039.2024.10773930
Citations
2
Primary Topic
Model-Driven Software Engineering Techniques
Type
article
Field-Weighted Citation Impact
0.97
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Co-Synthesis of Code and Formal Models Using Large Language Models and Functors

Rickard Ewetz, Susmit Jha, Alvaro Velasquez, Sumit Kumar Jha
2 citations
Model-Driven Software Engineering Techniques
0.97
article

Co-Synthesis of Code and Formal Models Using Large Language Models and Functors

Rickard Ewetz, Susmit Jha, Alvaro Velasquez, Sumit Kumar Jha
article en
2 citations

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in generating code from natural language descriptions, including code for parallel systems. However, ensuring that this code is free of errors, particularly in concurrent and synchronization-heavy contexts, remains a significant challenge. In this paper, we introduce a new approach that employs LLMs to co-synthesize the code, its formal model and the functor that establishes the mapping between the code and its formal model. The formal models are then verified against temporal logic specifications using model checking. The functors serve as human-auditable artifacts that help establish equivalence between the code and its formal model. Our methodology is demonstrated through experiments involving the co-synthesis of C code and its formal model for the dining philosophers problem. Our experimental results using models from OpenAI, Anthropic, and Meta evaluate the effectiveness of our approach.

SRI International (US), University of Colorado Boulder (US), Florida International University (US), University of Florida (US), Menlo School (US)
Quality Education
Openalex Percentile: Top 20%
Model-Driven Software Engineering Techniques
0.97
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.