6#ifndef STAMINA_STAMINAARGPARSE_H
7#define STAMINA_STAMINAARGPARSE_H
18 , RE_EXPLORING_METHOD = 2
23static char doc[] =
"STAMINA -- truncates infinite CTMC state space and passes into STORM";
25static char args_doc[] =
"MODEL_FILE PROPERTIES_FILE";
30static struct argp_option options[] = {
31 {
"kappa",
'k',
"double", 0,
32 "Reachability threshold for the first iteration (default: 1.0)"}
33 , {
"reduceKappa",
'r',
"double", 0,
34 "Reduction factor for Reachability Threshold (kappa) during the refinement step (default 2.0)"}
35 , {
"approxFactor",
'f',
"double", 0,
36 "Factor to estimate how far off our reachability predictions will be (default: 2.0)"}
37 , {
"probWin",
'w',
"double", 0,
38 "Probability window between lower and upperbound for termination (default: 1.0e-3)"}
39 , {
"maxApproxCount",
'n',
"int", 0,
40 "Maximum number of iterations in the approximation (default 10)"}
41 , {
"noPropRefine",
'R', 0, 0,
42 "Do not use property based refinement. If given, the model exploration method will reduce kappa and do property independent definement (default: off)"}
43 , {
"cuddMaxMem",
'C',
"memory", 0,
44 "Maximum CUDD memory, in the same format as PRISM (default: 1g)"}
45 , {
"export",
'e',
"filename", 0,
46 "Export model to a (text) file"}
47 , {
"exportPerimeterStates",
'S',
"filename", 0,
48 "Export perimeter states to a file. Please provide a filename. This will append to the file if it is existing"}
49 , {
"import",
'i',
"filename", 0,
50 "Import model to a (text) file"}
51 , {
"property",
'p',
"propname", 0,
52 "Specify a certain property to check in a model file that contains many"}
53 , {
"const",
'c',
"\"C1=VAL,C2=VAL,C3=VAL\"", 0,
54 "Comma separated values for constants"}
55 , {
"exportTrans",
't',
"filename", 0,
56 "Export the list of transitions and actions to a specified file name, or to trans.txt if no file name is specified.\nTransitions are exported in the format <Source State Index> <Destination State Index> <Action Label>"}
58 , {
"rankTransitions",
'T', 0, 0,
59 "Rank transitions before expanding (default: false)"}
60 , {
"maxIterations",
'M',
"int", 0,
61 "Maximum iteration for solution (default: 10000)"}
62 , {
"maxStates",
'V',
"integer", 0,
63 "The maximum number of states to explore in an iteration (default 2000000)"}
64 , {
"iterative",
'I', 0, 0,
65 "Use the STAMINA 2.5 method (iterative)"}
66 , {
"priority",
'P', 0, 0,
67 "Use the STAMINA 3.0 method (priority)"}
68 , {
"reExploring",
'J', 0, 0,
69 "Use the STAMINA 2.0 method (the method in STAMINA/PRISM)"}
70 , {
"threads",
'j',
"int", 0,
71 "Number of threads to use for state exploration (default 1)"}
79 std::string model_file;
80 std::string properties_file;
85 uint64_t max_approx_count;
87 std::string cudd_max_mem;
88 std::string export_filename;
89 std::string export_perimeter_states;
90 std::string import_filename;
93 std::string export_trans;
94 bool rank_transitions;
95 uint64_t max_iterations;
105parse_opt(
int key,
char * arg,
struct argp_state * state) {
115 arguments->reduce_kappa = (double) atof(arg);
119 arguments->approx_factor = (double) atof(arg);
123 arguments->prob_win = (double) atof(arg);
127 arguments->max_approx_count = (uint64_t) atoi(arg);
135 arguments->cudd_max_mem = std::string(arg);
139 arguments->export_filename = std::string(arg);
143 arguments->export_perimeter_states =
true;
147 arguments->import_filename = std::string(arg);
159 arguments->export_trans = std::string(arg);
167 arguments->max_iterations = (uint64_t) atoi(arg);
170 arguments->max_states = (uint64_t) atoi(arg);
173 arguments->method = STAMINA_METHODS::ITERATIVE_METHOD;
176 arguments->method = STAMINA_METHODS::PRIORITY_METHOD;
179 arguments->method = STAMINA_METHODS::RE_EXPLORING_METHOD;
184 if (state->arg_num == 0) {
185 arguments->model_file = std::string(arg);
188 else if (state->arg_num == 1) {
189 arguments->properties_file = std::string(arg);
197 if (state->arg_num < 2) {
203 return ARGP_ERR_UNKNOWN;
212static struct argp argp = {options, parse_opt, args_doc, doc};
Definition: StaminaArgParse.h:78