Formally Verified C Code Generation from Hybrid Communicating Sequential Processes

被引:0
|
作者
Wang, Shuling [1 ]
Ji, Zekun [1 ,2 ]
Xu, Xiong [1 ]
Zhan, Bohua [1 ,2 ]
Gao, Qiang [1 ,2 ]
Zhan, Naijun [1 ,2 ]
机构
[1] Chinese Acad Sci, Inst Software, State Key Lab Comp Sci, Beijing, Peoples R China
[2] Univ Chinese Acad Sci, Beijing, Peoples R China
基金
国家重点研发计划;
关键词
D O I
10.1109/ICCPS61052.2024.00018
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Hybrid Communicating Sequential Processes (HCSP) is a formal model for hybrid systems, including primitives for evolution along an ordinary differential equation (ODE), communication, and parallel composition. Code generation is needed to convert HCSP models into code that can be executed in practice, and the correctness of this conversion is essential to ensure that the generated code accurately reflects the formal model. In this paper, we propose a code generation algorithm from HCSP to C with POSIX library for concurrency. The main difficulties include how to bridge the gap between the synchronized communication model in HCSP and the use of mutexes for synchronization in C, and how to discretize evolution along ODEs and support interrupt of ODE evolution by communication. To prove the correctness of code generation, we define a formal semantics for POSIX C, and build transition system models for both HCSP and C programs. We then define an approximate bisimulation relation between traces of transition systems, and show that under certain robustness conditions for HCSP, the generated C program is approximately bisimilar to the original model. Finally, we evaluate the code generation algorithm on a detailed model for automatic cruise control, showing its utility on real-world examples.
引用
收藏
页码:123 / 134
页数:12
相关论文
共 39 条
  • [1] Formally Verified Native Code Generation in an Effectful JIT
    Barriere, Aurele
    Blazy, Sandrine
    Pichardie, David
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (POPL):
  • [2] Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler
    Barrière A.
    Blazy S.
    Pichardie D.
    Proceedings of the ACM on Programming Languages, 2023, 7
  • [3] ON PROCESSES, SYNCHRONIZATION AND REDUNDANT CODE IN COMMUNICATING SEQUENTIAL PROCESSES
    DONNAN, G
    HULL, MEC
    COMPUTER LANGUAGES, 1986, 11 (3-4): : 155 - 160
  • [4] Sound code generation from communicating hybrid models
    Hur, Y
    Kim, J
    Lee, I
    Choi, JY
    HYBRID SYSTEMS: COMPUTATION AND CONTROL, PROCEEDINGS, 2004, 2993 : 432 - 447
  • [5] Formally verified software countermeasures for control-flow integrity of smart card C code
    Heydemann, Karine
    Lalande, Jean-Francois
    Berthome, Pascal
    COMPUTERS & SECURITY, 2019, 85 : 202 - 224
  • [6] A formally verified hybrid system for safe advisories in the next-generation airborne collision avoidance system
    Jean-Baptiste Jeannin
    Khalil Ghorbal
    Yanni Kouskoulas
    Aurora Schmidt
    Ryan Gardner
    Stefan Mitsch
    André Platzer
    International Journal on Software Tools for Technology Transfer, 2017, 19 : 717 - 741
  • [7] A formally verified hybrid system for safe advisories in the next-generation airborne collision avoidance system
    Jeannin, Jean-Baptiste
    Ghorbal, Khalil
    Kouskoulas, Yanni
    Schmidt, Aurora
    Gardner, Ryan
    Mitsch, Stefan
    Platzer, Andre
    INTERNATIONAL JOURNAL ON SOFTWARE TOOLS FOR TECHNOLOGY TRANSFER, 2017, 19 (06) : 717 - 741
  • [8] Parallelism in C plus plus using Sequential Communicating Processes
    Paduraru, Ciprian
    Melemciuc, Marius-Constantin
    2018 17TH INTERNATIONAL SYMPOSIUM ON PARALLEL AND DISTRIBUTED COMPUTING (ISPDC), 2018, : 157 - 163
  • [9] Automatic generation of the C# code for security protocols verified with casper/FDR
    Jeon, CW
    Kim, IG
    Choi, JY
    AINA 2005: 19th International Conference on Advanced Information Networking and Applications, Vol 2, 2005, : 507 - 510
  • [10] EXCEPTION HANDLING FOR A COMMUNICATING-SEQUENTIAL-PROCESSES-BASED EXTENSION OF C++
    ADAMO, JM
    CONCURRENCY-PRACTICE AND EXPERIENCE, 1991, 3 (01): : 15 - 41