A Multi-target Code Generator for High-Level B

被引:6
作者
Vu, Fabian [1 ]
Hansen, Dominik [1 ]
Koerner, Philipp [1 ]
Leuschel, Michael [1 ]
机构
[1] Univ Dusseldorf, Inst Informat, Univ Str 1, D-40225 Dusseldorf, Germany
来源
INTEGRATED FORMAL METHODS, IFM 2019 | 2019年 / 11918卷
关键词
D O I
10.1007/978-3-030-34968-4_25
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Within high-level specification languages such as B, code is refined in many steps until a small "implementable" subset of the language is reached. Then, code generators are used, targeting programming languages such as C or Ada. We aim to diminish the number of refinement steps needed, by providing an improved code generator. Indeed, many high-level operations and data types, such as sets, can be dealt with in programming languages such as Java and C++. We present a code generator for B named B2Program with two distinct features. Firstly, it targets multiple (high-level) languages via a template-based approach to compilation. In addition to flexibility, this also enables one to safeguard against errors in the individual compilers and standard libraries, by generating multiple implementations of the same formal model. Secondly, it supports higher-level constructs compared to existing code generators. This enables new uses of formal models, as prototypes, demonstrators or simply as very high-level programming languages, by directly embedding formal models as components into software systems. In the article, we discuss the implementation of our code generator, evaluate it using B models taken from literature and compare its performance with simulation in ProB.
引用
收藏
页码:456 / 473
页数:18
相关论文
共 33 条
[1]  
[Anonymous], 2005, B BOOK ASSIGNING PRO
[2]  
Backhouse R., 2003, GENERIC PROGRAMMING
[3]  
Bagwell P., 2001, Ideal Hash Trees, P1195
[4]  
Baier C, 2008, PRINCIPLES OF MODEL CHECKING, P1
[5]   Asm2C++: A Tool for Code Generation from Abstract State Machines to Arduino [J].
Bonfanti, Silvia ;
Carissoni, Marco ;
Gargantini, Angelo ;
Mashkoor, Atif .
NASA FORMAL METHODS (NFM 2017), 2017, 10227 :295-301
[6]  
Bonichon R, 2015, LECT NOTES COMPUT SC, V8941, P1, DOI [10.1007/978-3-319-15075-8_1, 10.1007/978-3-319-15075-8-1]
[7]   EventB2Java']Java: A Code Generator for Event-B [J].
Catano, Nestor ;
Rivera, Victor .
NASA FORMAL METHODS, NFM 2016, 2016, 9690 :166-171
[8]  
ClearSy, 2016, AT B US REF MAN
[9]  
Dolle D., 2003, Technique et Science Informatiques, V22, P11, DOI 10.3166/tsi.22.11-32
[10]  
Edmunds A, 2014, LECT NOTES COMPUT SC, V8477, P284, DOI 10.1007/978-3-662-43652-3_25