-
Notifications
You must be signed in to change notification settings - Fork 277
Open
Labels
KaniBugs or features of importance to Kani Rust VerifierBugs or features of importance to Kani Rust VerifierawsBugs or features of importance to AWS CBMC usersBugs or features of importance to AWS CBMC users
Description
RMC is a new Rust front-end for CBMC. Currently, it uses the C
mode in the symbol-table. We propose adding a Rust
mode to symbols. For now, this mode would have the same semantics as C
, but would allow us to distinguish rust code from C code. This is particularly important as Rust support linking C code using a FFI, which we need to support in RMC.
Benefits
- Allows tools which consume CBMC output to know which language the initial source code was in. For example, when giving a failure trace that includes both Rust and C code, it would be valuable to the trace visualizer to know which language the statements originally came from
- Allows the backend to implement different semantics for the different languages. For example (maybe not the best one), one could imagine a case where one language wants unsigned addition to wrap around, while another wants it to saturate.
- Allows the addition of language specific checks. For example, Rust has areas of UB which are not defined as such in C - it may be useful to have checks which are only automatically inserted into the Rust side of a linked Rust/C binary.
Design considerations
Rust is not the only language that would benefit from this. Any new language front-end will likely see the same issues we are, and could benefit from a principled mechanism to alleviate them.
Links and documentation
Line 49 in 1ab5de1
irep_idt mode; |
Currently, CBMC appears to have the following langauges:
cbmc/src/cbmc/cbmc_languages.cpp
Lines 25 to 35 in 4889328
void cbmc_parse_optionst::register_languages() | |
{ | |
register_language(new_ansi_c_language); | |
register_language(new_statement_list_language); | |
register_language(new_cpp_language); | |
register_language(new_json_symtab_language); | |
#ifdef HAVE_JSIL | |
register_language(new_jsil_language); | |
#endif | |
} |
Metadata
Metadata
Assignees
Labels
KaniBugs or features of importance to Kani Rust VerifierBugs or features of importance to Kani Rust VerifierawsBugs or features of importance to AWS CBMC usersBugs or features of importance to AWS CBMC users