Skip to content

Commit 97b4e52

Browse files
committed
Validate goto models in goto-analyzer (if enabled via command line flag)
1 parent 79dd091 commit 97b4e52

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/goto-analyzer/goto_analyzer_parse_options.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ int goto_analyzer_parse_optionst::doit()
406406
if(process_goto_program(options))
407407
return CPROVER_EXIT_INTERNAL_ERROR;
408408

409+
if(cmdline.isset("validate-goto-model"))
410+
{
411+
const namespacet ns(goto_model.symbol_table);
412+
goto_model.validate(ns, validation_modet::INVARIANT);
413+
}
414+
409415
// show it?
410416
if(cmdline.isset("show-symbol-table"))
411417
{
@@ -875,6 +881,9 @@ void goto_analyzer_parse_optionst::help()
875881
HELP_GOTO_CHECK
876882
"\n"
877883
"Other options:\n"
884+
// NOLINTNEXTLINE(whitespace/line_length)
885+
" --validate-goto-model enable additional well-formedness checks on the\n"
886+
" goto program\n"
878887
" --version show version and exit\n"
879888
HELP_FLUSH
880889
HELP_TIMESTAMP

src/goto-analyzer/goto_analyzer_parse_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class optionst;
148148
"(show)(verify)(simplify):" \
149149
"(location-sensitive)(concurrent)" \
150150
"(no-simplify-slicing)" \
151+
"(validate-goto-model)" \
151152
// clang-format on
152153

153154
class goto_analyzer_parse_optionst:

0 commit comments

Comments
 (0)