MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / main

Function main

tools/alive.cpp:43–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42
43int main(int argc, char **argv) {
44 bool verbose = false;
45 bool show_smt_stats = false;
46 bool root_only = false;
47
48 int argc_i = 1;
49 for (; argc_i < argc; ++argc_i) {
50 if (argv[argc_i][0] != '-')
51 break;
52
53 string_view arg(argv[argc_i]);
54 if (arg == "-root-only")
55 root_only = true;
56 else if (arg == "-v")
57 verbose = true;
58 else if (arg == "-smt-stats")
59 show_smt_stats = true;
60 else if (arg.compare(0, 8, "-smt-to:") == 0 && arg.size() > 8)
61 smt::set_query_timeout(arg.substr(8).data());
62 else if (arg.compare(0, 17, "-smt-random-seed:") == 0 && arg.size() > 17)
63 smt::set_random_seed(arg.substr(17).data());
64 else if (arg.compare(0, 9, "-max-mem:") == 0 && arg.size() > 9)
65 smt::set_memory_limit(strtoul(arg.substr(9).data(), nullptr, 10) *
66 1024 * 1024);
67 else if (arg == "-smt-verbose")
68 smt::solver_print_queries(true);
69 else if (arg == "-tactic-verbose")
70 smt::solver_tactic_verbose(true);
71 else if (arg == "-smt-log")
72 smt::start_logging();
73 else if (arg == "-skip-smt")
74 config::skip_smt = true;
75 else if (arg == "-disable-undef-input")
76 config::disable_undef_input = true;
77 else if (arg == "-disable-poison-input")
78 config::disable_poison_input = true;
79 else if (arg == "-h" || arg == "--help" || arg == "-v" ||
80 arg == "--version") {
81 show_help();
82 return 0;
83 } else {
84 cerr << "Unknown argument: " << arg << "\n\n";
85 show_help();
86 return -1;
87 }
88 }
89
90 if (argc_i >= argc) {
91 show_help();
92 return -1;
93 }
94
95 if (verbose) {
96 config::symexec_print_each_value = true;
97 }
98
99 smt::smt_initializer smt_init;
100 parser_initializer parser_init;

Callers

nothing calls this directly

Calls 15

set_query_timeoutFunction · 0.85
set_random_seedFunction · 0.85
set_memory_limitFunction · 0.85
solver_print_queriesFunction · 0.85
solver_tactic_verboseFunction · 0.85
start_loggingFunction · 0.85
show_helpFunction · 0.85
file_readerClass · 0.85
solver_print_statsFunction · 0.85
hasReturnMethod · 0.80
getTypingsMethod · 0.80
printWarningsMethod · 0.80

Tested by

no test coverage detected