Skip to content
Snippets Groups Projects
Commit d1f51042 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

allow optional arguments in cpp model checker

parent 3f8f4302
No related branches found
No related tags found
No related merge requests found
Pipeline #155939 passed
...@@ -1732,14 +1732,14 @@ void modelCheckMultiThreaded(boost::asio::thread_pool& workers) { ...@@ -1732,14 +1732,14 @@ void modelCheckMultiThreaded(boost::asio::thread_pool& workers) {
model_check_main_method(machine) ::= << model_check_main_method(machine) ::= <<
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
if(argc != 4) { if(argc > 5) {
cout \<\< "Number of arguments errorneous\n"; cout \<\< "Too many arguments\n";
cout \<\< "Expecting arguments: STRATEGY NR_THREADS CACHING\n"; cout \<\< "Expecting arguments: STRATEGY NR_THREADS CACHING DEBUG\n";
return -1; return -1;
} }
string strategy = argv[1]; string strategy = (argc>=2) ? argv[1] : "mixed";
string numberThreads = argv[2]; string numberThreads = (argc>=3) ? argv[2] : "1";
string caching = argv[3]; string caching = (argc>=4) ? argv[3] :"false";
<machine>::Type type; <machine>::Type type;
...@@ -1780,7 +1780,11 @@ int main(int argc, char *argv[]) { ...@@ -1780,7 +1780,11 @@ int main(int argc, char *argv[]) {
return - 1; return - 1;
} }
bool isDebug = false; bool isDebug = (argc>=5 && std::string("true").compare(argv[4])) ? true : false;
if (isDebug) {
cout \<\< "Model checking with B2Program." \<\< endl;
}
ModelChecker modelchecker(type, threads, isCaching, isDebug); ModelChecker modelchecker(type, threads, isCaching, isDebug);
modelchecker.modelCheck(); modelchecker.modelCheck();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment