Endre søk
Link to record
Permanent link

Direct link
Publikasjoner (10 av 52) Visa alla publikasjoner
Hampus, A. & Nyberg, M. (2025). A Theory of Probabilistic Contracts. In: Leveraging Applications of Formal Methods, Verification and Validation. Specification and Verification - 12th International Symposium, ISoLA 2024, Proceedings: . Paper presented at 12th International Symposium on Leveraging Applications of Formal Methods, Verification and Validation, ISoLA 2024, Crete, Greece, October 27-31, 2024 (pp. 296-319). Springer Nature
Åpne denne publikasjonen i ny fane eller vindu >>A Theory of Probabilistic Contracts
2025 (engelsk)Inngår i: Leveraging Applications of Formal Methods, Verification and Validation. Specification and Verification - 12th International Symposium, ISoLA 2024, Proceedings, Springer Nature , 2025, s. 296-319Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

In industrial-sized cyber-physical systems, ensuring fulfillment of requirements gets increasingly more costly as the number of components increases. To make the task feasible, compositional verification has been suggested as a scalable solution. Such techniques allow verification by divide-and-conquer, often using assume-guarantee contracts. Although previous research has focused mostly on the non-probabilistic setting, in the real world, probabilities often arise due to random hardware failures, stochastic communication delays, sensor ghost objects, machine learning components, rounding errors caused by finite-precision arithmetic, human behavior, and probabilistic algorithms. Therefore, for contract theories to be practically relevant to cyber-physical systems, there is a need to support probabilistic reasoning, for instance regarding safety and reliability. To this end, we propose a completely trace-based probabilistic contract theory, supporting general probability measures, continuous time, and continuous state spaces. To verify decompositions of such contracts, we also present a deductive system, which is illustrated on an industrially inspired automatic emergency braking example.

sted, utgiver, år, opplag, sider
Springer Nature, 2025
Emneord
Compositional verification, Contract theory, Probability
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-356657 (URN)10.1007/978-3-031-75380-0_17 (DOI)001419014500017 ()2-s2.0-85208595091 (Scopus ID)
Konferanse
12th International Symposium on Leveraging Applications of Formal Methods, Verification and Validation, ISoLA 2024, Crete, Greece, October 27-31, 2024
Merknad

Part of ISBN 9783031753794

QC 20241121

Tilgjengelig fra: 2024-11-20 Laget: 2024-11-20 Sist oppdatert: 2025-03-17bibliografisk kontrollert
Sevenhuijsen, M., Ung, G., Suresh Patil, M. & Nyberg, M. (2025). Generating Safety-Critical Automotive C-programs using LLMs with Formal Verification. In: Proceedings of Machine Learning Research - Conference on Neurosymbolic Learning and Reasoning, NeSy 2025: . Paper presented at 19th Conference on Neurosymbolic Learning and Reasoning, NeSy 2025, Santa Cruz, United States of America, September 8-10, 2025 (pp. 353-378). ML Research Press
Åpne denne publikasjonen i ny fane eller vindu >>Generating Safety-Critical Automotive C-programs using LLMs with Formal Verification
2025 (engelsk)Inngår i: Proceedings of Machine Learning Research - Conference on Neurosymbolic Learning and Reasoning, NeSy 2025, ML Research Press , 2025, s. 353-378Konferansepaper, Publicerat paper (Fagfellevurdert)
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.

sted, utgiver, år, opplag, sider
ML Research Press, 2025
Serie
Proceedings of Machine Learning Research ; 284
Emneord
Formal Verification, Large Language Models, Non-Functional Requirements, Prompt Engineering, Safety-Critical Automotive Software
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-372794 (URN)2-s2.0-105020236369 (Scopus ID)
Konferanse
19th Conference on Neurosymbolic Learning and Reasoning, NeSy 2025, Santa Cruz, United States of America, September 8-10, 2025
Merknad

QC 20251119

Tilgjengelig fra: 2025-11-19 Laget: 2025-11-19 Sist oppdatert: 2025-11-19bibliografisk kontrollert
Sevenhuijsen, M., Ung, G., Patil, M. S. & Nyberg, M. (2025). Generating Safety-Critical Automotive C-programs using LLMs with Formal Verification. In: Gilpin, LH Giunchiglia, E Hitzler, P VanKrieken, E (Ed.), Conference On Neurosymbolic Learning And Reasoning: . Paper presented at 19th International Conference on Neural Symbolic Learning and Reasoning-NESY-Annual, SEP 08-10, 2025, Santa Cruz, CA (pp. 353-378). JMLR-JOURNAL MACHINE LEARNING RESEARCH, 284
Åpne denne publikasjonen i ny fane eller vindu >>Generating Safety-Critical Automotive C-programs using LLMs with Formal Verification
2025 (engelsk)Inngår i: Conference On Neurosymbolic Learning And Reasoning / [ed] Gilpin, LH Giunchiglia, E Hitzler, P VanKrieken, E, JMLR-JOURNAL MACHINE LEARNING RESEARCH , 2025, Vol. 284, s. 353-378Konferansepaper, Publicerat paper (Fagfellevurdert)
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 Chain-of-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.

sted, utgiver, år, opplag, sider
JMLR-JOURNAL MACHINE LEARNING RESEARCH, 2025
Serie
Proceedings of Machine Learning Research, ISSN 2640-3498
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-378979 (URN)001669525800019 ()
Konferanse
19th International Conference on Neural Symbolic Learning and Reasoning-NESY-Annual, SEP 08-10, 2025, Santa Cruz, CA
Merknad

QC 20260409

Tilgjengelig fra: 2026-04-09 Laget: 2026-04-09 Sist oppdatert: 2026-04-09bibliografisk kontrollert
Sevenhuijsen, M., Etemadi, K. & Nyberg, M. (2025). VeCoGen: Automating Generation of Formally Verified C Code With Large Language Models. In: Gwen Salaün and Anastasia Mavridou (Ed.), FormaliSE 2025: ACM/IEEE International Conference on Formal Methods in Software Engineering, Ottawa, Canada, April 27-28, 2025.: . Paper presented at FormaliSE 2025. Ottawa, Ontario, Canada: IEEE Computer Society Digital Library
Åpne denne publikasjonen i ny fane eller vindu >>VeCoGen: Automating Generation of Formally Verified C Code With Large Language Models
2025 (engelsk)Inngår i: FormaliSE 2025: ACM/IEEE International Conference on Formal Methods in Software Engineering, Ottawa, Canada, April 27-28, 2025. / [ed] Gwen Salaün and Anastasia Mavridou, Ottawa, Ontario, Canada: IEEE Computer Society Digital Library, 2025Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

Large language models have demonstrated impressive capabilities in generating code, yet they often produce programs with flaws or deviations from intended behavior, limiting their suitability for safety-critical applications. To address this limitation, this paper introduces VeCoGen, a novel tool that combines large language models with formal verification to automate the generation of formally verified C programs. VeCoGen takes a formal specification in ANSI/ISO C Specification Language, a natural language specification, and a set of test cases to attempt to generate a verified program. This program-generation process consists of two steps. First, VeCoGen generates an initial set of candidate programs. Secondly, the tool iteratively improves on previously generated candidates. If a candidate program meets the formal specification, then we are sure the program is correct. We evaluate VeCoGen on 15 problems presented in Codeforces competitions. On these problems, VeCoGen solves 13 problems. This work shows the potential of combining large language models with formal verification to automate program generation.

sted, utgiver, år, opplag, sider
Ottawa, Ontario, Canada: IEEE Computer Society Digital Library, 2025
Emneord
Codes, Program processors, Limiting, Large language models, Natural languages, Programming, Specification languages, Formal specifications, Formal verification, Software development management
HSV kategori
Forskningsprogram
Datalogi
Identifikatorer
urn:nbn:se:kth:diva-364661 (URN)10.1109/FormaliSE66629.2025.00017 (DOI)001554519900011 ()2-s2.0-105009063103 (Scopus ID)
Konferanse
FormaliSE 2025
Merknad

Part of ISBN 979-8-3315-3794-4

QC 20250617

Tilgjengelig fra: 2025-06-16 Laget: 2025-06-16 Sist oppdatert: 2025-12-20bibliografisk kontrollert
Hampus, A. & Nyberg, M. (2024). A Theory of Probabilistic Contracts (With Proofs).
Åpne denne publikasjonen i ny fane eller vindu >>A Theory of Probabilistic Contracts (With Proofs)
2024 (engelsk)Rapport (Annet vitenskapelig)
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-350235 (URN)
Merknad

QC 20240710

Tilgjengelig fra: 2024-07-10 Laget: 2024-07-10 Sist oppdatert: 2024-10-09bibliografisk kontrollert
Hampus, A. & Nyberg, M. (2024). Formally verifying decompositions of stochastic specifications. International Journal on Software Tools for Technology Transfer, 26(2), 207-228
Åpne denne publikasjonen i ny fane eller vindu >>Formally verifying decompositions of stochastic specifications
2024 (engelsk)Inngår i: International Journal on Software Tools for Technology Transfer, ISSN 1433-2779, E-ISSN 1433-2787, Vol. 26, nr 2, s. 207-228Artikkel i tidsskrift (Fagfellevurdert) Published
Abstract [en]

According to the principles of compositional verification, verifying that lower-level components satisfy their specification ensures that the whole system satisfies its top-level specification. The key step is to ensure that the lower-level specifications constitute a correct decomposition of the top-level specification. In a non-stochastic context, such decomposition can be analyzed using techniques of theorem proving. In industrial applications, especially in safety-critical systems, specifications are often of stochastic nature, for example, giving a bound on the probability that a system failure will occur before a given time. A decomposition of such a specification requires techniques beyond traditional theorem proving. The first contribution of the paper is a theoretical framework that allows the representation of, and reasoning about, stochastic and timed behavior of systems as well as specifications for such behavior. The framework is based on traces that describe the continuous-time evolution of a system, and specifications are formulated using timed automata combined with probabilistic acceptance conditions. The second contribution is a novel approach to verifying decompositions of such specifications by reducing the problem to checking emptiness of the solution space for a system of linear inequalities.

sted, utgiver, år, opplag, sider
Springer Nature, 2024
Emneord
Automata, Contracts, Refinement, Specification theory
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-367078 (URN)10.1007/s10009-024-00742-5 (DOI)001168918400001 ()2-s2.0-85185288333 (Scopus ID)
Merknad

QC 20250715

Tilgjengelig fra: 2025-07-15 Laget: 2025-07-15 Sist oppdatert: 2025-07-15bibliografisk kontrollert
Kaalen, S., Nyberg, M., Strandberg, T., Warg, F. & Westerberg, A. (2024). Probabilistic Approach Using SMP Tool For Systems Safety Of Road Vehicles. In: Kolowrocki, K Dabrowska, E (Ed.), Advances In Reliability, Safety And Security, Esrel 2024, Pt 3: . Paper presented at 34th European Safety and Reliability Conference, JUN 23-27, 2024, Krakow, POLAND (pp. 87-96). INST QUALITY ASSURANCE
Åpne denne publikasjonen i ny fane eller vindu >>Probabilistic Approach Using SMP Tool For Systems Safety Of Road Vehicles
Vise andre…
2024 (engelsk)Inngår i: Advances In Reliability, Safety And Security, Esrel 2024, Pt 3 / [ed] Kolowrocki, K Dabrowska, E, INST QUALITY ASSURANCE , 2024, s. 87-96Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

Safety analysis on the level of a complete road vehicle can be an intricate task. Several methods and tools for safety analysis have been developed by the research community. One such tool developed to bridge the gap between research and industry is Semi-Markov Process (SMP) Tool. In this paper, two approaches for safety analysis utilizing SMP Tool are presented. The holistic approach starts out with a quantitative safety target on a vehicle level to then finally argue whether a proposed system design is safe enough. In the segmented approach, the idea is to follow the development steps of industrial standards, while utilizing SMP Tool for specific tasks within the standard. Specifically the standard ISO 26262 will be under most consideration. Both approaches are applied to a case study of a battery management system for an electrified truck. The segmented approach can avoid some difficulties arising when following ISO 26262 conventionally while keeping the advantage that the standard is utilized to find what qualitative tasks should be performed. The holistic approach has an advantage in that it considers the safety from a vehicle perspective. Moreover, all ambiguity issues in ISO 26262 are avoided.

sted, utgiver, år, opplag, sider
INST QUALITY ASSURANCE, 2024
Emneord
safety, ISO 26262, probability, SMP Tool, quantitative, road vehicles
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-374129 (URN)001542494800009 ()
Konferanse
34th European Safety and Reliability Conference, JUN 23-27, 2024, Krakow, POLAND
Merknad

Part of ISBN 978-83-68136-02-9

QC 20251215

Tilgjengelig fra: 2025-12-15 Laget: 2025-12-15 Sist oppdatert: 2025-12-15bibliografisk kontrollert
Hampus, A. & Nyberg, M. (2023). Verifying Refinement of Probabilistic Contracts Using Timed Automata (With Proofs).
Åpne denne publikasjonen i ny fane eller vindu >>Verifying Refinement of Probabilistic Contracts Using Timed Automata (With Proofs)
2023 (engelsk)Rapport (Fagfellevurdert)
Abstract [en]

Compositional verification allows a system to be verified indirectly by verifying the individual components of the system. The keystep is to ensure that the decomposition of the system specification intocomponent specifications is correct. That is, it needs to be verified thatthe composition of the component specifications refines the system specification. In many cyber-physical systems, specifications are probabilisticin nature. For instance, a specification might state that the probabilityof reaching an unsafe state within 10.000 hours shall be less than 0.05.Verifying refinement under such assumptions requires techniques beyondtraditional theorem proving. This paper presents a solution where specifications are built up by probabilistic contracts based upon timed automata. In particular, the main contribution is an algorithm for verifyingrefinement between such specifications. The algorithm utilizes a reduction to the language emptiness problem, making the algorithm terminateafter a finite number of computations

Publisher
s. 21
Serie
TRITA-ITM-RP ; 2023:6
Emneord
Probabilistic Contracts, Automata, Algorithm
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-325814 (URN)
Merknad

QC 20230807

Tilgjengelig fra: 2023-04-16 Laget: 2023-04-16 Sist oppdatert: 2023-08-07bibliografisk kontrollert
Hampus, A. & Nyberg, M. (2023). Verifying Refinement of Probabilistic Contracts Using Timed Automata. In: Theoretical Aspects of Software Engineering - 17th International Symposium, TASE 2023, Proceedings: . Paper presented at 17th International Symposium on Theoretical Aspects of Software Engineering, TASE 2023, Bristol, United Kingdom of Great Britain and Northern Ireland, July 4-6, 2023 (pp. 95-113). Springer Nature
Åpne denne publikasjonen i ny fane eller vindu >>Verifying Refinement of Probabilistic Contracts Using Timed Automata
2023 (engelsk)Inngår i: Theoretical Aspects of Software Engineering - 17th International Symposium, TASE 2023, Proceedings, Springer Nature , 2023, s. 95-113Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

Compositional verification allows a system to be verified indirectly by verifying the individual components of the system. The key step is to ensure that the decomposition of the system specification into component specifications is correct. That is, it needs to be verified that the composition of the component specifications refines the system specification. In many cyber-physical systems, specifications are probabilistic in nature. For instance, a specification might state that the probability of reaching an unsafe state within 10.000 h shall be less than 0.05. Verifying refinement under such assumptions requires techniques beyond traditional theorem proving. This paper presents a solution where specifications are built up by probabilistic contracts based upon timed automata. In particular, the main contribution is an algorithm for verifying refinement between such specifications. The algorithm utilizes a reduction to the language emptiness problem, making the algorithm terminate after a finite number of computations.

sted, utgiver, år, opplag, sider
Springer Nature, 2023
Emneord
Algorithms, Automata, Probabilistic Contracts
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-334441 (URN)10.1007/978-3-031-35257-7_6 (DOI)001330380200006 ()2-s2.0-85164938598 (Scopus ID)
Konferanse
17th International Symposium on Theoretical Aspects of Software Engineering, TASE 2023, Bristol, United Kingdom of Great Britain and Northern Ireland, July 4-6, 2023
Merknad

Part of ISBN 9783031352560

QC 20241203

Tilgjengelig fra: 2023-08-21 Laget: 2023-08-21 Sist oppdatert: 2024-12-03bibliografisk kontrollert
Kaalen, S., Hampus, A., Nyberg, M. & Mattsson, O. (2022). A Stochastic Extension of Stateflow. In: Association for Computing Machinery, New York, NY, United States (Ed.), ICPE 22: Proceedings of the 2022 ACM/SPEC on International Conference on Performance Engineering: . Paper presented at 13th ACM/SPEC International Conference on Performance Engineering (pp. 211-222). Association for Computing Machinery (ACM)
Åpne denne publikasjonen i ny fane eller vindu >>A Stochastic Extension of Stateflow
2022 (engelsk)Inngår i: ICPE 22: Proceedings of the 2022 ACM/SPEC on International Conference on Performance Engineering / [ed] Association for Computing Machinery, New York, NY, United States, Association for Computing Machinery (ACM) , 2022, s. 211-222Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

Although commonly used in industry, a major drawback of Stateflow is that it lacks support for stochastic properties; properties that are often needed to build accurate models of real-world systems. In order to solve this problem, as the first contribution, Stochastic Stateflow (SSF) is presented as a stochastic extension of a subset of Stateflow models. As the second contribution, the tool SMP-tool is updated with support for SSF models specified in Stateflow. Finally, as the third contribution, an industrial case study is presented.  

 

sted, utgiver, år, opplag, sider
Association for Computing Machinery (ACM), 2022
Emneord
Stateflow, SSF, SMP-tool, Stochastic, Model-based
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-313247 (URN)10.1145/3489525.3511679 (DOI)000883411400023 ()2-s2.0-85128682345 (Scopus ID)
Konferanse
13th ACM/SPEC International Conference on Performance Engineering
Prosjekter
SafeDim
Forskningsfinansiär
Vinnova, 2020-05131
Merknad

Part of proceedings: ISBN 978-1-4503-9143-6

QC 20220621

Tilgjengelig fra: 2022-06-01 Laget: 2022-06-01 Sist oppdatert: 2026-05-19bibliografisk kontrollert
Organisasjoner
Identifikatorer
ORCID-id: ORCID iD iconorcid.org/0000-0001-6667-3783