kth.sePublications KTH
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Generating Safety-Critical Automotive C-programs using LLMs with Formal Verification
KTH, School of Industrial Engineering and Management (ITM), Engineering Design, Mechatronics and Embedded Control Systems. Scania CV AB, Södertälje, Sweden.ORCID iD: 0009-0002-1114-4395
KTH, School of Electrical Engineering and Computer Science (EECS), Computer Science, Theoretical Computer Science, TCS. Scania CV AB, Södertälje, Sweden.
Scania CV AB, Södertälje, Sweden.
KTH, School of Industrial Engineering and Management (ITM). Scania CV AB, Södertälje, Sweden.ORCID iD: 0000-0001-6667-3783
2025 (English)In: Proceedings of Machine Learning Research - Conference on Neurosymbolic Learning and Reasoning, NeSy 2025, ML Research Press , 2025, p. 353-378Conference paper, Published paper (Refereed)
Abstract [en]

We evaluate the feasibility of generating formally verified C code that adheres to both functional and non-functional requirements using Large Language Models (LLMs) for three real industrial, automotive safety-critical software modules. We explore the capabilities of ten LLMs and four prompting techniques — Zero-Shot, Zero-Shot Chain-of-Thought, One-Shot, and One-Shot Chainof-Thought — to generate C programs for the three modules. Functional correctness of generated programs is assessed through functional verification, and adherence to non-functional requirements is evaluated using an industrial static analyzer, along with human evaluation. The results demonstrate that it is feasible for LLMs to generate functionally correct code, with success rates of 540/800, 59/800, and 46/800 for the three modules. Additionally, the generated programs frequently adhere to the defined non-functional requirements. In the cases where the LLM-generated programs did not adhere to the non-functional requirements, deviations typically involve violations of single-read and single-write access patterns or minimal variable scope constraints. These findings highlight the promise and limitations of using LLMs to generate industrial safety-critical C programs, providing insight into improving automated LLM-based program generation in the automotive safety-critical domain.

Place, publisher, year, edition, pages
ML Research Press , 2025. p. 353-378
Series
Proceedings of Machine Learning Research ; 284
Keywords [en]
Formal Verification, Large Language Models, Non-Functional Requirements, Prompt Engineering, Safety-Critical Automotive Software
National Category
Software Engineering Computer Systems Computer Sciences
Identifiers
URN: urn:nbn:se:kth:diva-372794Scopus ID: 2-s2.0-105020236369OAI: oai:DiVA.org:kth-372794DiVA, id: diva2:2014720
Conference
19th Conference on Neurosymbolic Learning and Reasoning, NeSy 2025, Santa Cruz, United States of America, September 8-10, 2025
Note

QC 20251119

Available from: 2025-11-19 Created: 2025-11-19 Last updated: 2025-11-19Bibliographically approved

Open Access in DiVA

No full text in DiVA

Other links

Scopusfulltext

Authority records

Sevenhuijsen, MerlijnUng, GustavNyberg, Mattias

Search in DiVA

By author/editor
Sevenhuijsen, MerlijnUng, GustavNyberg, Mattias
By organisation
Mechatronics and Embedded Control SystemsTheoretical Computer Science, TCSSchool of Industrial Engineering and Management (ITM)
Software EngineeringComputer SystemsComputer Sciences

Search outside of DiVA

GoogleGoogle Scholar

urn-nbn

Altmetric score

urn-nbn
Total: 59 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf