Skip to content

Commit cc955f1

Browse files
committed
Validate goto models in goto-analyzer (if enabled via command line flag)
1 parent f61e4e9 commit cc955f1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ 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+
goto_model.validate(validation_modet::INVARIANT);
412+
}
413+
409414
// show it?
410415
if(cmdline.isset("show-symbol-table"))
411416
{
@@ -875,6 +880,7 @@ void goto_analyzer_parse_optionst::help()
875880
HELP_GOTO_CHECK
876881
"\n"
877882
"Other options:\n"
883+
HELP_VALIDATE
878884
" --version show version and exit\n"
879885
HELP_FLUSH
880886
HELP_TIMESTAMP

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ Author: Daniel Kroening, kroening@kroening.com
101101
#ifndef CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H
102102
#define CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H
103103

104-
#include <util/ui_message.h>
105104
#include <util/parse_options.h>
106105
#include <util/timestamper.h>
106+
#include <util/ui_message.h>
107+
#include <util/validation_interface.h>
107108

108109
#include <langapi/language.h>
109110

@@ -148,6 +149,7 @@ class optionst;
148149
"(show)(verify)(simplify):" \
149150
"(location-sensitive)(concurrent)" \
150151
"(no-simplify-slicing)" \
152+
OPT_VALIDATE \
151153
// clang-format on
152154

153155
class goto_analyzer_parse_optionst:

0 commit comments

Comments
 (0)