goto_programt program; exprt my_expr = symbol_exprt("x"); program.add_instruction(code_expressiont(my_expr));
instructiont &my_statement = program.instructions[0]; my_statement.type = GOTO;
for (const auto &instruction : program.instructions) { if (instruction.is_assume()) { // do something with assume statements } else if (instruction.is_assert()) { // do something with assert statements } }In this example, we iterate over the instructions in the program and perform different actions depending on whether the instruction is an assume or an assert statement. Overall, the goto_programt class is a powerful tool for working with GOTO programs in C++, and is an essential component of the CBMC library.