nullptr cleanup for -Wzero-as-null-pointer-constant

Fixes #106.

* m4/gccwarn.m4: Use -Wzero-as-null-pointer-constant if supported.
* src/bin/autfilt.cc, src/bin/common_aoutput.cc,
src/bin/common_finput.cc, src/bin/common_finput.hh,
src/bin/common_output.cc, src/bin/common_output.hh,
src/bin/common_post.cc, src/bin/common_r.hh, src/bin/common_range.hh,
src/bin/common_setup.cc, src/bin/common_trans.cc, src/bin/dstar2tgba.cc,
src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/ltlfilt.cc,
src/bin/ltlgrind.cc, src/bin/randaut.cc, src/bin/randltl.cc,
src/bin/spot-x.cc, src/kripke/kripkeexplicit.cc, src/ltlast/formula.cc,
src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh,
src/ltlvisit/relabel.cc, src/ltlvisit/relabel.hh,
src/ltlvisit/simplify.cc, src/ltlvisit/snf.hh, src/misc/fixpool.hh,
src/misc/mspool.hh, src/misc/hash.hh, src/misc/optionmap.cc,
src/misc/satsolver.cc, src/misc/tmpfile.cc, src/misc/tmpfile.hh,
src/priv/bddalloc.cc, src/ta/ta.hh, src/ta/taexplicit.cc,
src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/tgtaexplicit.hh,
src/ta/tgtaproduct.cc, src/taalgos/minimize.cc,
src/taalgos/reachiter.cc, src/taalgos/tgba2ta.cc,
src/tests/complementation.cc, src/tests/ikwiad.cc,
src/tests/randtgba.cc, src/tests/reduc.cc, src/twa/bdddict.cc,
src/twa/bddprint.cc, src/twa/taatgba.cc, src/twa/twa.cc,
src/twa/twagraph.hh, src/twa/twaproduct.cc,
src/twa/twasafracomplement.cc, src/twaalgos/bfssteps.cc,
src/twaalgos/compsusp.cc, src/twaalgos/dtgbasat.cc,
src/twaalgos/emptiness.cc, src/twaalgos/gtec/ce.cc,
src/twaalgos/gv04.cc, src/twaalgos/ltl2taa.cc,
src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/ltl2tgba_fm.hh,
src/twaalgos/magic.cc, src/twaalgos/minimize.cc,
src/twaalgos/ndfs_result.hxx, src/twaalgos/postproc.cc,
src/twaalgos/postproc.hh, src/twaalgos/reachiter.cc,
src/twaalgos/reducerun.cc, src/twaalgos/safety.hh,
src/twaalgos/sccfilter.hh, src/twaalgos/se05.cc,
src/twaalgos/simulation.cc, src/twaalgos/tau03.cc,
src/twaalgos/tau03opt.cc, src/twaalgos/translate.cc,
src/twaalgos/translate.hh, utf8/utf8/core.h,
bench/stutter/stutter_invariance_formulas.cc, iface/ltsmin/ltsmin.cc,
iface/ltsmin/modelcheck.cc: Use nullptr to fix the warning.
This commit is contained in:
Alexandre Duret-Lutz 2015-09-26 22:14:27 +02:00
parent 51a3cfcede
commit 1729a79ac7
87 changed files with 755 additions and 717 deletions

View file

@ -34,10 +34,10 @@ const char argp_program_doc[] ="";
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &output_argp, 0, 0, -20 }, { &output_argp, 0, nullptr, -20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
namespace namespace
@ -109,10 +109,10 @@ main(int argc, char** argv)
{ {
setup(argv); setup(argv);
const argp ap = { 0, 0, "[FILENAME[/COL]...]", const argp ap = { nullptr, nullptr, "[FILENAME[/COL]...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
spot::translator trans; spot::translator trans;

View file

@ -376,7 +376,7 @@ namespace spot
char* name = (char*) malloc(str.size() + 1); char* name = (char*) malloc(str.size() + 1);
char* name_p = name; char* name_p = name;
char* lastdot = 0; char* lastdot = nullptr;
while (*s && (*s != '=') && *s != '<' && *s != '!' && *s != '>') while (*s && (*s != '=') && *s != '<' && *s != '!' && *s != '>')
{ {
@ -608,17 +608,18 @@ namespace spot
d_(d), d_(d),
state_size_(d_->get_state_size()), state_size_(d_->get_state_size()),
dict_(dict), ps_(ps), dict_(dict), ps_(ps),
compress_(compress == 0 ? 0 compress_(compress == 0 ? nullptr
: compress == 1 ? int_array_array_compress : compress == 1 ? int_array_array_compress
: int_array_array_compress2), : int_array_array_compress2),
decompress_(compress == 0 ? 0 decompress_(compress == 0 ? nullptr
: compress == 1 ? int_array_array_decompress : compress == 1 ? int_array_array_decompress
: int_array_array_decompress2), : int_array_array_decompress2),
uncompressed_(compress ? new int[state_size_ + 30] : 0), uncompressed_(compress ? new int[state_size_ + 30] : nullptr),
compressed_(compress ? new int[state_size_ * 2] : 0), compressed_(compress ? new int[state_size_ * 2] : nullptr),
statepool_(compress ? sizeof(spins_compressed_state) : statepool_(compress ? sizeof(spins_compressed_state) :
(sizeof(spins_state) + state_size_ * sizeof(int))), (sizeof(spins_state) + state_size_ * sizeof(int))),
state_condition_last_state_(0), state_condition_last_cc_(0) state_condition_last_state_(nullptr),
state_condition_last_cc_(nullptr)
{ {
vname_ = new const char*[state_size_]; vname_ = new const char*[state_size_];
format_filter_ = new bool[state_size_]; format_filter_ = new bool[state_size_];
@ -770,7 +771,7 @@ namespace spot
: static_cast<const void*>(&statepool_)); : static_cast<const void*>(&statepool_));
cc->compress = compress_; cc->compress = compress_;
cc->compressed = compressed_; cc->compressed = compressed_;
t = d_->get_successors(0, const_cast<int*>(vars), t = d_->get_successors(nullptr, const_cast<int*>(vars),
compress_ compress_
? transition_callback_compress ? transition_callback_compress
: transition_callback, : transition_callback,
@ -790,7 +791,7 @@ namespace spot
{ {
state_condition_last_state_->destroy(); state_condition_last_state_->destroy();
delete state_condition_last_cc_; // Might be 0 already. delete state_condition_last_cc_; // Might be 0 already.
state_condition_last_cc_ = 0; state_condition_last_cc_ = nullptr;
} }
const int* vars = get_vars(st); const int* vars = get_vars(st);
@ -853,7 +854,7 @@ namespace spot
if (state_condition_last_cc_) if (state_condition_last_cc_)
{ {
cc = state_condition_last_cc_; cc = state_condition_last_cc_;
state_condition_last_cc_ = 0; // Now owned by the iterator. state_condition_last_cc_ = nullptr; // Now owned by the iterator.
} }
else else
{ {
@ -1032,7 +1033,7 @@ namespace spot
if (verbose) if (verbose)
std::cerr << "Failed to compile `" << file_arg std::cerr << "Failed to compile `" << file_arg
<< "'." << std::endl; << "'." << std::endl;
return 0; return nullptr;
} }
} }
@ -1040,7 +1041,7 @@ namespace spot
{ {
if (verbose) if (verbose)
std::cerr << "Failed to initialize libltdl." << std::endl; std::cerr << "Failed to initialize libltdl." << std::endl;
return 0; return nullptr;
} }
lt_dlhandle h = lt_dlopen(file.c_str()); lt_dlhandle h = lt_dlopen(file.c_str());
@ -1049,7 +1050,7 @@ namespace spot
if (verbose) if (verbose)
std::cerr << "Failed to load `" << file << "'." << std::endl; std::cerr << "Failed to load `" << file << "'." << std::endl;
lt_dlexit(); lt_dlexit();
return 0; return nullptr;
} }
spins_interface* d = new spins_interface; spins_interface* d = new spins_interface;
@ -1117,7 +1118,7 @@ namespace spot
<< file << "'\n"; << file << "'\n";
delete d; delete d;
lt_dlexit(); lt_dlexit();
return 0; return nullptr;
} }
if (d->have_property && d->have_property()) if (d->have_property && d->have_property())
@ -1127,7 +1128,7 @@ namespace spot
<< std::endl; << std::endl;
delete d; delete d;
lt_dlexit(); lt_dlexit();
return 0; return nullptr;
} }
spot::prop_set* ps = new spot::prop_set; spot::prop_set* ps = new spot::prop_set;
@ -1138,7 +1139,7 @@ namespace spot
dict->unregister_all_my_variables(d); dict->unregister_all_my_variables(d);
delete d; delete d;
lt_dlexit(); lt_dlexit();
return 0; return nullptr;
} }
return std::make_shared<spins_kripke>(d, dict, ps, dead, compress); return std::make_shared<spins_kripke>(d, dict, ps, dead, compress);

View file

@ -72,7 +72,7 @@ checked_main(int argc, char **argv)
bool accepting_run = false; bool accepting_run = false;
bool expect_counter_example = false; bool expect_counter_example = false;
bool deterministic = false; bool deterministic = false;
char *dead = 0; char *dead = nullptr;
int compress_states = 0; int compress_states = 0;
const char* echeck_algo = "Cou99"; const char* echeck_algo = "Cou99";

View file

@ -20,11 +20,12 @@ AC_DEFUN([CF_GXX_WARNINGS],
[ [
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line __oline__ "configure" #line __oline__ "configure"
int main(int argc, char *argv[[]]) { return argv[[argc-1]] == 0; } int main(int argc, char *argv[[]]) { return argv[[argc-1]] == nullptr; }
EOF EOF
cf_save_CXXFLAGS="$CXXFLAGS" cf_save_CXXFLAGS="$CXXFLAGS"
ac_cv_prog_gxx_warn_flags="-W -Wall" ac_cv_prog_gxx_warn_flags="-W -Wall"
for cf_opt in \ for cf_opt in \
Wzero-as-null-pointer-constant \
Wcast-align \ Wcast-align \
Wpointer-arith \ Wpointer-arith \
Wwrite-strings \ Wwrite-strings \

View file

@ -104,29 +104,30 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Input:", 1 }, { nullptr, 0, nullptr, 0, "Input:", 1 },
{ "file", 'F', "FILENAME", 0, { "file", 'F', "FILENAME", 0,
"process the automaton in FILENAME", 0 }, "process the automaton in FILENAME", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output automaton type:", 2 }, { nullptr, 0, nullptr, 0, "Output automaton type:", 2 },
{ "generic", OPT_GENERIC, 0, 0, { "generic", OPT_GENERIC, nullptr, 0,
"Any acceptance is allowed (default)", 0 }, "Any acceptance is allowed (default)", 0 },
{ "tgba", OPT_TGBA, 0, 0, { "tgba", OPT_TGBA, nullptr, 0,
"Transition-based Generalized Büchi Automaton", 0 }, "Transition-based Generalized Büchi Automaton", 0 },
{ "ba", 'B', 0, 0, "Büchi Automaton (with state-based acceptance)", 0 }, { "ba", 'B', nullptr, 0,
{ "monitor", 'M', 0, 0, "Monitor (accepts all finite prefixes " "Büchi Automaton (with state-based acceptance)", 0 },
{ "monitor", 'M', nullptr, 0, "Monitor (accepts all finite prefixes "
"of the given property)", 0 }, "of the given property)", 0 },
/**************************************************/ /**************************************************/
{ "count", 'c', 0, 0, "print only a count of matched automata", 3 }, { "count", 'c', nullptr, 0, "print only a count of matched automata", 3 },
{ "max-count", 'n', "NUM", 0, "output at most NUM automata", 3 }, { "max-count", 'n', "NUM", 0, "output at most NUM automata", 3 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Transformations:", 5 }, { nullptr, 0, nullptr, 0, "Transformations:", 5 },
{ "merge-transitions", OPT_MERGE, 0, 0, { "merge-transitions", OPT_MERGE, nullptr, 0,
"merge transitions with same destination and acceptance", 0 }, "merge transitions with same destination and acceptance", 0 },
{ "product", OPT_PRODUCT_AND, "FILENAME", 0, { "product", OPT_PRODUCT_AND, "FILENAME", 0,
"build the product with the automaton in FILENAME " "build the product with the automaton in FILENAME "
"to intersect languages", 0 }, "to intersect languages", 0 },
{ "product-and", 0, 0, OPTION_ALIAS, 0, 0 }, { "product-and", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
{ "product-or", OPT_PRODUCT_OR, "FILENAME", 0, { "product-or", OPT_PRODUCT_OR, "FILENAME", 0,
"build the product with the automaton in FILENAME " "build the product with the automaton in FILENAME "
"to sum languages", 0 }, "to sum languages", 0 },
@ -135,23 +136,23 @@ static const argp_option options[] =
"randomize only states or transitions)", 0 }, "randomize only states or transitions)", 0 },
{ "instut", OPT_INSTUT, "1|2", OPTION_ARG_OPTIONAL, { "instut", OPT_INSTUT, "1|2", OPTION_ARG_OPTIONAL,
"allow more stuttering (two possible algorithms)", 0 }, "allow more stuttering (two possible algorithms)", 0 },
{ "destut", OPT_DESTUT, 0, 0, "allow less stuttering", 0 }, { "destut", OPT_DESTUT, nullptr, 0, "allow less stuttering", 0 },
{ "mask-acc", OPT_MASK_ACC, "NUM[,NUM...]", 0, { "mask-acc", OPT_MASK_ACC, "NUM[,NUM...]", 0,
"remove all transitions in specified acceptance sets", 0 }, "remove all transitions in specified acceptance sets", 0 },
{ "strip-acceptance", OPT_STRIPACC, 0, 0, { "strip-acceptance", OPT_STRIPACC, nullptr, 0,
"remove the acceptance condition and all acceptance sets", 0 }, "remove the acceptance condition and all acceptance sets", 0 },
{ "keep-states", OPT_KEEP_STATES, "NUM[,NUM...]", 0, { "keep-states", OPT_KEEP_STATES, "NUM[,NUM...]", 0,
"only keep specified states. The first state will be the new "\ "only keep specified states. The first state will be the new "\
"initial state. Implies --remove-unreachable-states.", 0 }, "initial state. Implies --remove-unreachable-states.", 0 },
{ "dnf-acceptance", OPT_DNF_ACC, 0, 0, { "dnf-acceptance", OPT_DNF_ACC, nullptr, 0,
"put the acceptance condition in Disjunctive Normal Form", 0 }, "put the acceptance condition in Disjunctive Normal Form", 0 },
{ "cnf-acceptance", OPT_CNF_ACC, 0, 0, { "cnf-acceptance", OPT_CNF_ACC, nullptr, 0,
"put the acceptance condition in Conjunctive Normal Form", 0 }, "put the acceptance condition in Conjunctive Normal Form", 0 },
{ "remove-fin", OPT_REM_FIN, 0, 0, { "remove-fin", OPT_REM_FIN, nullptr, 0,
"rewrite the automaton without using Fin acceptance", 0 }, "rewrite the automaton without using Fin acceptance", 0 },
{ "cleanup-acceptance", OPT_CLEAN_ACC, 0, 0, { "cleanup-acceptance", OPT_CLEAN_ACC, nullptr, 0,
"remove unused acceptance sets from the automaton", 0 }, "remove unused acceptance sets from the automaton", 0 },
{ "complement-acceptance", OPT_COMPLEMENT_ACC, 0, 0, { "complement-acceptance", OPT_COMPLEMENT_ACC, nullptr, 0,
"complement the acceptance condition (without touching the automaton)", "complement the acceptance condition (without touching the automaton)",
0 }, 0 },
{ "exclusive-ap", OPT_EXCLUSIVE_AP, "AP,AP,...", 0, { "exclusive-ap", OPT_EXCLUSIVE_AP, "AP,AP,...", 0,
@ -159,44 +160,44 @@ static const argp_option options[] =
"ensure two of them may not be true at the same time. Use this option " "ensure two of them may not be true at the same time. Use this option "
"multiple times to declare independent groups of exclusive " "multiple times to declare independent groups of exclusive "
"propositions.", 0 }, "propositions.", 0 },
{ "simplify-exclusive-ap", OPT_SIMPLIFY_EXCLUSIVE_AP, 0, 0, { "simplify-exclusive-ap", OPT_SIMPLIFY_EXCLUSIVE_AP, nullptr, 0,
"if --exclusive-ap is used, assume those AP groups are actually exclusive" "if --exclusive-ap is used, assume those AP groups are actually exclusive"
" in the system to simplify the expression of transition labels (implies " " in the system to simplify the expression of transition labels (implies "
"--merge-transitions)", 0 }, "--merge-transitions)", 0 },
{ "remove-ap", OPT_REM_AP, "AP[=0|=1][,AP...]", 0, { "remove-ap", OPT_REM_AP, "AP[=0|=1][,AP...]", 0,
"remove atomic propositions either by existential quantification, or " "remove atomic propositions either by existential quantification, or "
"by assigning them 0 or 1", 0 }, "by assigning them 0 or 1", 0 },
{ "remove-unreachable-states", OPT_REM_UNREACH, 0, 0, { "remove-unreachable-states", OPT_REM_UNREACH, nullptr, 0,
"remove states that are unreachable from the initial state", 0 }, "remove states that are unreachable from the initial state", 0 },
{ "remove-dead-states", OPT_REM_DEAD, 0, 0, { "remove-dead-states", OPT_REM_DEAD, nullptr, 0,
"remove states that are unreachable, or that cannot belong to an " "remove states that are unreachable, or that cannot belong to an "
"infinite path", 0 }, "infinite path", 0 },
{ "separate-sets", OPT_SEP_SETS, 0, 0, { "separate-sets", OPT_SEP_SETS, nullptr, 0,
"if both Inf(x) and Fin(x) appear in the acceptance condition, replace " "if both Inf(x) and Fin(x) appear in the acceptance condition, replace "
"Fin(x) by a new Fin(y) and adjust the automaton", 0 }, "Fin(x) by a new Fin(y) and adjust the automaton", 0 },
{ "sat-minimize", OPT_SAT_MINIMIZE, "options", OPTION_ARG_OPTIONAL, { "sat-minimize", OPT_SAT_MINIMIZE, "options", OPTION_ARG_OPTIONAL,
"minimize the automaton using a SAT solver (only work for deterministic" "minimize the automaton using a SAT solver (only work for deterministic"
" automata)", 0 }, " automata)", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Filtering options:", 6 }, { nullptr, 0, nullptr, 0, "Filtering options:", 6 },
{ "are-isomorphic", OPT_ARE_ISOMORPHIC, "FILENAME", 0, { "are-isomorphic", OPT_ARE_ISOMORPHIC, "FILENAME", 0,
"keep automata that are isomorphic to the automaton in FILENAME", 0 }, "keep automata that are isomorphic to the automaton in FILENAME", 0 },
{ "isomorphic", 0, 0, OPTION_ALIAS | OPTION_HIDDEN, 0, 0 }, { "isomorphic", 0, nullptr, OPTION_ALIAS | OPTION_HIDDEN, nullptr, 0 },
{ "unique", 'u', 0, 0, { "unique", 'u', nullptr, 0,
"do not output the same automaton twice (same in the sense that they "\ "do not output the same automaton twice (same in the sense that they "\
"are isomorphic)", 0 }, "are isomorphic)", 0 },
{ "is-complete", OPT_IS_COMPLETE, 0, 0, { "is-complete", OPT_IS_COMPLETE, nullptr, 0,
"keep complete automata", 0 }, "keep complete automata", 0 },
{ "is-deterministic", OPT_IS_DETERMINISTIC, 0, 0, { "is-deterministic", OPT_IS_DETERMINISTIC, nullptr, 0,
"keep deterministic automata", 0 }, "keep deterministic automata", 0 },
{ "is-empty", OPT_IS_EMPTY, 0, 0, { "is-empty", OPT_IS_EMPTY, nullptr, 0,
"keep automata with an empty language", 0 }, "keep automata with an empty language", 0 },
{ "is-unambiguous", OPT_IS_UNAMBIGUOUS, 0, 0, { "is-unambiguous", OPT_IS_UNAMBIGUOUS, nullptr, 0,
"keep only unambiguous automata", 0 }, "keep only unambiguous automata", 0 },
{ "intersect", OPT_INTERSECT, "FILENAME", 0, { "intersect", OPT_INTERSECT, "FILENAME", 0,
"keep automata whose languages have an non-empty intersection with" "keep automata whose languages have an non-empty intersection with"
" the automaton from FILENAME", 0 }, " the automaton from FILENAME", 0 },
{ "invert-match", 'v', 0, 0, "select non-matching automata", 0 }, { "invert-match", 'v', nullptr, 0, "select non-matching automata", 0 },
{ "states", OPT_STATES, "RANGE", 0, { "states", OPT_STATES, "RANGE", 0,
"keep automata whose number of states are in RANGE", 0 }, "keep automata whose number of states are in RANGE", 0 },
{ "edges", OPT_EDGES, "RANGE", 0, { "edges", OPT_EDGES, "RANGE", 0,
@ -205,21 +206,21 @@ static const argp_option options[] =
"keep automata whose number of acceptance sets are in RANGE", 0 }, "keep automata whose number of acceptance sets are in RANGE", 0 },
RANGE_DOC_FULL, RANGE_DOC_FULL,
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ "extra-options", 'x', "OPTS", 0, { "extra-options", 'x', "OPTS", 0,
"fine-tuning options (see spot-x (7))", 0 }, "fine-tuning options (see spot-x (7))", 0 },
{ "seed", OPT_SEED, "INT", 0, { "seed", OPT_SEED, "INT", 0,
"seed for the random number generator (0)", 0 }, "seed for the random number generator (0)", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const struct argp_child children[] = static const struct argp_child children[] =
{ {
{ &aoutput_argp, 0, 0, 0 }, { &aoutput_argp, 0, nullptr, 0 },
{ &aoutput_io_format_argp, 0, 0, 4 }, { &aoutput_io_format_argp, 0, nullptr, 4 },
{ &post_argp_disabled, 0, 0, 20 }, { &post_argp_disabled, 0, nullptr, 20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
typedef spot::twa_graph::graph_t::edge_storage_t tr_t; typedef spot::twa_graph::graph_t::edge_storage_t tr_t;
@ -677,7 +678,7 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[FILENAMES...]", const argp ap = { options, parse_opt, "[FILENAMES...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
try try
{ {
@ -690,7 +691,7 @@ main(int argc, char** argv)
level = spot::postprocessor::Low; level = spot::postprocessor::Low;
pref = spot::postprocessor::Any; pref = spot::postprocessor::Any;
type = spot::postprocessor::Generic; type = spot::postprocessor::Generic;
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -55,7 +55,7 @@ static char const *const check_args[] =
"stutter-insensitive", "stuttering-insensitive", "stutter-insensitive", "stuttering-insensitive",
"stutter-sensitive", "stuttering-sensitive", "stutter-sensitive", "stuttering-sensitive",
"all", "all",
0 nullptr
}; };
static check_type const check_types[] = static check_type const check_types[] =
{ {
@ -79,7 +79,7 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output format:", 3 }, { nullptr, 0, nullptr, 0, "Output format:", 3 },
{ "dot", OPT_DOT, "1|a|b|B|c|e|f(FONT)|h|n|N|o|r|R|s|t|v", { "dot", OPT_DOT, "1|a|b|B|c|e|f(FONT)|h|n|N|o|r|R|s|t|v",
OPTION_ARG_OPTIONAL, OPTION_ARG_OPTIONAL,
"GraphViz's format (default). Add letters for " "GraphViz's format (default). Add letters for "
@ -109,11 +109,11 @@ static const argp_option options[] =
"send output to a file named FORMAT instead of standard output. The" "send output to a file named FORMAT instead of standard output. The"
" first automaton sent to a file truncates it unless FORMAT starts" " first automaton sent to a file truncates it unless FORMAT starts"
" with '>>'.", 0 }, " with '>>'.", 0 },
{ "quiet", 'q', 0, 0, "suppress all normal output", 0 }, { "quiet", 'q', nullptr, 0, "suppress all normal output", 0 },
{ "spin", 's', "6|c", OPTION_ARG_OPTIONAL, "Spin neverclaim (implies --ba)." { "spin", 's', "6|c", OPTION_ARG_OPTIONAL, "Spin neverclaim (implies --ba)."
" Add letters to select (6) Spin's 6.2.4 style, (c) comments on states", " Add letters to select (6) Spin's 6.2.4 style, (c) comments on states",
0 }, 0 },
{ "utf8", '8', 0, 0, "enable UTF-8 characters in output " { "utf8", '8', nullptr, 0, "enable UTF-8 characters in output "
"(ignored with --lbtt or --spin)", 0 }, "(ignored with --lbtt or --spin)", 0 },
{ "stats", OPT_STATS, "FORMAT", 0, { "stats", OPT_STATS, "FORMAT", 0,
"output statistics about the automaton", 0 }, "output statistics about the automaton", 0 },
@ -121,10 +121,11 @@ static const argp_option options[] =
"test for the additional property PROP and output the result " "test for the additional property PROP and output the result "
"in the HOA format (implies -H). PROP may be any prefix of " "in the HOA format (implies -H). PROP may be any prefix of "
"'all' (default), 'unambiguous', or 'stutter-invariant'.", 0 }, "'all' (default), 'unambiguous', or 'stutter-invariant'.", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp aoutput_argp = { options, parse_opt_aoutput, 0, 0, 0, 0, 0 }; const struct argp aoutput_argp = { options, parse_opt_aoutput, nullptr, nullptr,
nullptr, nullptr, nullptr };
// Those can be overridden by individual tools. E.g. randaut has no // Those can be overridden by individual tools. E.g. randaut has no
// notion of input file, so %F and %L represent something else. // notion of input file, so %F and %L represent something else.
@ -134,69 +135,83 @@ char L_doc[32] = "location in the input file";
static const argp_option io_options[] = static const argp_option io_options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Any FORMAT string may use "\ { nullptr, 0, nullptr, 0, "Any FORMAT string may use "\
"the following interpreted sequences (capitals for input," "the following interpreted sequences (capitals for input,"
" minuscules for output):", 4 }, " minuscules for output):", 4 },
{ "%F", 0, 0, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 }, { "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 },
{ "%L", 0, 0, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 }, { "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 },
{ "%M, %m", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%M, %m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"name of the automaton", 0 }, "name of the automaton", 0 },
{ "%S, %s", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of states", 0 }, { "%S, %s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ "%E, %e", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of edges", 0 }, "number of states", 0 },
{ "%T, %t", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%E, %e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of edges", 0 },
{ "%T, %t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of transitions", 0 }, "number of transitions", 0 },
{ "%A, %a", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%A, %a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of acceptance sets", 0 }, "number of acceptance sets", 0 },
{ "%G, %g", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%G, %g", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"acceptance condition (in HOA syntax)", 0 }, "acceptance condition (in HOA syntax)", 0 },
{ "%C, %c", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 }, { "%C, %c", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ "%n", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 },
{ "%n", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of nondeterministic states in output", 0 }, "number of nondeterministic states in output", 0 },
{ "%d", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%d", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"1 if the output is deterministic, 0 otherwise", 0 }, "1 if the output is deterministic, 0 otherwise", 0 },
{ "%p", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%p", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"1 if the output is complete, 0 otherwise", 0 }, "1 if the output is complete, 0 otherwise", 0 },
{ "%r", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%r", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"processing time (excluding parsing) in seconds", 0 }, "processing time (excluding parsing) in seconds", 0 },
{ "%w", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%w", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"one word accepted by the output automaton", 0 }, "one word accepted by the output automaton", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "a single %", 0 }, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ 0, 0, 0, 0, 0, 0 } "a single %", 0 },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp aoutput_io_format_argp = { io_options, 0, 0, 0, 0, 0, 0 }; const struct argp aoutput_io_format_argp = { io_options, nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr };
static const argp_option o_options[] = static const argp_option o_options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Any FORMAT string may use "\ { nullptr, 0, nullptr, 0, "Any FORMAT string may use "\
"the following interpreted sequences:", 4 }, "the following interpreted sequences:", 4 },
{ "%F", 0, 0, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 }, { "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 },
{ "%L", 0, 0, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 }, { "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 },
{ "%m", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "name of the automaton", 0 }, { "%m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ "%s", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of states", 0 }, "name of the automaton", 0 },
{ "%e", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of edges", 0 }, { "%s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ "%t", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of transitions", 0 }, "number of states", 0 },
{ "%a", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of edges", 0 },
{ "%t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of transitions", 0 },
{ "%a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of acceptance sets", 0 }, "number of acceptance sets", 0 },
{ "%g", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%g", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"acceptance condition (in HOA syntax)", 0 }, "acceptance condition (in HOA syntax)", 0 },
{ "%c", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 }, { "%c", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ "%n", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 },
{ "%n", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of nondeterministic states in output", 0 }, "number of nondeterministic states in output", 0 },
{ "%d", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%d", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"1 if the output is deterministic, 0 otherwise", 0 }, "1 if the output is deterministic, 0 otherwise", 0 },
{ "%p", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%p", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"1 if the output is complete, 0 otherwise", 0 }, "1 if the output is complete, 0 otherwise", 0 },
{ "%r", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%r", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"processing time (excluding parsing) in seconds", 0 }, "processing time (excluding parsing) in seconds", 0 },
{ "%w", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%w", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"one word accepted by the output automaton", 0 }, "one word accepted by the output automaton", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "a single %", 0 }, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
{ 0, 0, 0, 0, 0, 0 } "a single %", 0 },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp aoutput_o_format_argp = { o_options, 0, 0, 0, 0, 0, 0 }; const struct argp aoutput_o_format_argp = { o_options,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr };
int parse_opt_aoutput(int key, char* arg, struct argp_state*) int parse_opt_aoutput(int key, char* arg, struct argp_state*)
{ {

View file

@ -35,21 +35,23 @@ static bool lenient = false;
static const argp_option options[] = static const argp_option options[] =
{ {
{ 0, 0, 0, 0, "Input options:", 1 }, { nullptr, 0, nullptr, 0, "Input options:", 1 },
{ "formula", 'f', "STRING", 0, "process the formula STRING", 0 }, { "formula", 'f', "STRING", 0, "process the formula STRING", 0 },
{ "file", 'F', "FILENAME[/COL]", 0, { "file", 'F', "FILENAME[/COL]", 0,
"process each line of FILENAME as a formula; if COL is a " "process each line of FILENAME as a formula; if COL is a "
"positive integer, assume a CSV file and read column COL; use " "positive integer, assume a CSV file and read column COL; use "
"a negative COL to drop the first line of the CSV file", 0 }, "a negative COL to drop the first line of the CSV file", 0 },
{ "lbt-input", OPT_LBT, 0, 0, { "lbt-input", OPT_LBT, nullptr, 0,
"read all formulas using LBT's prefix syntax", 0 }, "read all formulas using LBT's prefix syntax", 0 },
{ "lenient", OPT_LENIENT, 0, 0, { "lenient", OPT_LENIENT, nullptr, 0,
"parenthesized blocks that cannot be parsed as subformulas " "parenthesized blocks that cannot be parsed as subformulas "
"are considered as atomic properties", 0 }, "are considered as atomic properties", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp finput_argp = { options, parse_opt_finput, 0, 0, 0, 0, 0 }; const struct argp finput_argp = { options, parse_opt_finput,
nullptr, nullptr, nullptr,
nullptr, nullptr };
int int
parse_opt_finput(int key, char* arg, struct argp_state*) parse_opt_finput(int key, char* arg, struct argp_state*)
@ -86,8 +88,8 @@ parse_formula(const std::string& s, spot::ltl::parse_error_list& pel)
} }
job_processor::job_processor() job_processor::job_processor()
: abort_run(false), real_filename(0), : abort_run(false), real_filename(nullptr),
col_to_read(0), prefix(0), suffix(0) col_to_read(0), prefix(nullptr), suffix(nullptr)
{ {
} }
@ -179,7 +181,7 @@ job_processor::process_stream(std::istream& is,
const char* col1_start = str; const char* col1_start = str;
// Delimiters for the extracted column. // Delimiters for the extracted column.
const char* coln_start = str; const char* coln_start = str;
const char* coln_end = 0; const char* coln_end = nullptr;
// The current column. (1-based) // The current column. (1-based)
int colnum = 1; int colnum = 1;
// Whether we are parsing a double-quoted string. // Whether we are parsing a double-quoted string.
@ -250,8 +252,8 @@ job_processor::process_stream(std::istream& is,
// %< and %> escapes (ignoring the trailing and leading // %< and %> escapes (ignoring the trailing and leading
// commas). // commas).
prefix = (col_to_read != 1) ? prefix = (col_to_read != 1) ?
strndup(col1_start, coln_start - col1_start - 1) : 0; strndup(col1_start, coln_start - col1_start - 1) : nullptr;
suffix = (*coln_end != 0) ? strdup(coln_end + 1) : 0; suffix = (*coln_end != 0) ? strdup(coln_end + 1) : nullptr;
std::string field(coln_start, coln_end); std::string field(coln_start, coln_end);
// Remove double-quotes if any. // Remove double-quotes if any.
if (field.find('"') != std::string::npos) if (field.find('"') != std::string::npos)
@ -275,12 +277,12 @@ job_processor::process_stream(std::istream& is,
if (prefix) if (prefix)
{ {
free(prefix); free(prefix);
prefix = 0; prefix = nullptr;
} }
if (suffix) if (suffix)
{ {
free(suffix); free(suffix);
suffix = 0; suffix = nullptr;
} }
} }
} }

View file

@ -59,11 +59,11 @@ public:
virtual int virtual int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) = 0; const char* filename = nullptr, int linenum = 0) = 0;
virtual int virtual int
process_string(const std::string& str, process_string(const std::string& str,
const char* filename = 0, int linenum = 0); const char* filename = nullptr, int linenum = 0);
virtual int virtual int
process_stream(std::istream& is, const char* filename); process_stream(std::istream& is, const char* filename);

View file

@ -42,29 +42,31 @@ char output_terminator = '\n';
static const argp_option options[] = static const argp_option options[] =
{ {
{ "full-parentheses", 'p', 0, 0, { "full-parentheses", 'p', nullptr, 0,
"output fully-parenthesized formulas", -20 }, "output fully-parenthesized formulas", -20 },
{ "spin", 's', 0, 0, "output in Spin's syntax", -20 }, { "spin", 's', nullptr, 0, "output in Spin's syntax", -20 },
{ "spot", OPT_SPOT, 0, 0, "output in Spot's syntax (default)", -20 }, { "spot", OPT_SPOT, nullptr, 0, "output in Spot's syntax (default)", -20 },
{ "lbt", 'l', 0, 0, "output in LBT's syntax", -20 }, { "lbt", 'l', nullptr, 0, "output in LBT's syntax", -20 },
{ "wring", OPT_WRING, 0, 0, "output in Wring's syntax", -20 }, { "wring", OPT_WRING, nullptr, 0, "output in Wring's syntax", -20 },
{ "utf8", '8', 0, 0, "output using UTF-8 characters", -20 }, { "utf8", '8', nullptr, 0, "output using UTF-8 characters", -20 },
{ "latex", OPT_LATEX, 0, 0, "output using LaTeX macros", -20 }, { "latex", OPT_LATEX, nullptr, 0, "output using LaTeX macros", -20 },
{ "csv-escape", OPT_CSV, 0, 0, "quote the formula for use in a CSV file", { "csv-escape", OPT_CSV, nullptr, 0,
-20 }, "quote the formula for use in a CSV file", -20 },
{ "format", OPT_FORMAT, "FORMAT", 0, { "format", OPT_FORMAT, "FORMAT", 0,
"specify how each line should be output (default: \"%f\")", -20 }, "specify how each line should be output (default: \"%f\")", -20 },
{ "output", 'o', "FORMAT", 0, { "output", 'o', "FORMAT", 0,
"send output to a file named FORMAT instead of standard output. The" "send output to a file named FORMAT instead of standard output. The"
" first formula sent to a file truncates it unless FORMAT starts" " first formula sent to a file truncates it unless FORMAT starts"
" with '>>'.", 0 }, " with '>>'.", 0 },
{ "zero-terminated-output", '0', 0, 0, { "zero-terminated-output", '0', nullptr, 0,
"separate output formulas with \\0 instead of \\n " "separate output formulas with \\0 instead of \\n "
"(for use with xargs -0)", 0 }, "(for use with xargs -0)", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp output_argp = { options, parse_opt_output, 0, 0, 0, 0, 0 }; const struct argp output_argp = { options, parse_opt_output,
nullptr, nullptr, nullptr,
nullptr, nullptr };
static static
void void
@ -204,9 +206,9 @@ namespace
}; };
} }
static formula_printer* format = 0; static formula_printer* format = nullptr;
static std::ostringstream outputname; static std::ostringstream outputname;
static formula_printer* outputnamer = 0; static formula_printer* outputnamer = nullptr;
static std::map<std::string, std::unique_ptr<output_file>> outputfiles; static std::map<std::string, std::unique_ptr<output_file>> outputfiles;
int int

View file

@ -46,8 +46,9 @@ stream_formula(std::ostream& out,
spot::ltl::formula f, const char* filename, int linenum); spot::ltl::formula f, const char* filename, int linenum);
void output_formula_checked(spot::ltl::formula f, void output_formula_checked(spot::ltl::formula f,
const char* filename = 0, int linenum = 0, const char* filename = nullptr, int linenum = 0,
const char* prefix = 0, const char* suffix = 0); const char* prefix = nullptr,
const char* suffix = nullptr);
class printable_formula: class printable_formula:
@ -78,7 +79,7 @@ public:
std::ostream& std::ostream&
print(const spot::const_twa_graph_ptr& aut, print(const spot::const_twa_graph_ptr& aut,
spot::ltl::formula f = 0, spot::ltl::formula f = nullptr,
double run_time = -1.) double run_time = -1.)
{ {
formula_ = f; formula_ = f;

View file

@ -37,45 +37,45 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Translation intent:", 20 }, { nullptr, 0, nullptr, 0, "Translation intent:", 20 },
{ "small", OPT_SMALL, 0, 0, "prefer small automata (default)", 0 }, { "small", OPT_SMALL, nullptr, 0, "prefer small automata (default)", 0 },
{ "deterministic", 'D', 0, 0, "prefer deterministic automata", 0 }, { "deterministic", 'D', nullptr, 0, "prefer deterministic automata", 0 },
{ "any", 'a', 0, 0, "no preference, do not bother making it small " { "any", 'a', nullptr, 0, "no preference, do not bother making it small "
"or deterministic", 0 }, "or deterministic", 0 },
{ "complete", 'C', 0, 0, "output a complete automaton (combine " { "complete", 'C', nullptr, 0, "output a complete automaton (combine "
"with other intents)", 0 }, "with other intents)", 0 },
{ "state-based-acceptance", 'S', 0, 0, { "state-based-acceptance", 'S', nullptr, 0,
"define the acceptance using states", 0 }, "define the acceptance using states", 0 },
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 }, { "sbacc", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Optimization level:", 21 }, { nullptr, 0, nullptr, 0, "Optimization level:", 21 },
{ "low", OPT_LOW, 0, 0, "minimal optimizations (fast)", 0 }, { "low", OPT_LOW, nullptr, 0, "minimal optimizations (fast)", 0 },
{ "medium", OPT_MEDIUM, 0, 0, "moderate optimizations", 0 }, { "medium", OPT_MEDIUM, nullptr, 0, "moderate optimizations", 0 },
{ "high", OPT_HIGH, 0, 0, { "high", OPT_HIGH, nullptr, 0,
"all available optimizations (slow, default)", 0 }, "all available optimizations (slow, default)", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const argp_option options_disabled[] = static const argp_option options_disabled[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Translation intent:", 20 }, { nullptr, 0, nullptr, 0, "Translation intent:", 20 },
{ "small", OPT_SMALL, 0, 0, "prefer small automata", 0 }, { "small", OPT_SMALL, nullptr, 0, "prefer small automata", 0 },
{ "deterministic", 'D', 0, 0, "prefer deterministic automata", 0 }, { "deterministic", 'D', nullptr, 0, "prefer deterministic automata", 0 },
{ "any", 'a', 0, 0, "no preference, do not bother making it small " { "any", 'a', nullptr, 0, "no preference, do not bother making it small "
"or deterministic (default)", 0 }, "or deterministic (default)", 0 },
{ "complete", 'C', 0, 0, "output a complete automaton (combine " { "complete", 'C', nullptr, 0, "output a complete automaton (combine "
"with other intents)", 0 }, "with other intents)", 0 },
{ "state-based-acceptance", 'S', 0, 0, { "state-based-acceptance", 'S', nullptr, 0,
"define the acceptance using states", 0 }, "define the acceptance using states", 0 },
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 }, { "sbacc", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Optimization level:", 21 }, { nullptr, 0, nullptr, 0, "Optimization level:", 21 },
{ "low", OPT_LOW, 0, 0, "minimal optimizations (fast, default)", 0 }, { "low", OPT_LOW, nullptr, 0, "minimal optimizations (fast, default)", 0 },
{ "medium", OPT_MEDIUM, 0, 0, "moderate optimizations", 0 }, { "medium", OPT_MEDIUM, nullptr, 0, "moderate optimizations", 0 },
{ "high", OPT_HIGH, 0, 0, { "high", OPT_HIGH, nullptr, 0,
"all available optimizations (slow)", 0 }, "all available optimizations (slow)", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static int static int
@ -117,7 +117,8 @@ parse_opt_post(int key, char*, struct argp_state*)
return 0; return 0;
} }
const struct argp post_argp = const struct argp post_argp = { options, parse_opt_post,
{ options, parse_opt_post, 0, 0, 0, 0, 0 }; nullptr, nullptr, nullptr, nullptr, nullptr };
const struct argp post_argp_disabled = const struct argp post_argp_disabled = { options_disabled, parse_opt_post,
{ options_disabled, parse_opt_post, 0, 0, 0, 0, 0 }; nullptr, nullptr, nullptr,
nullptr, nullptr };

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement de // Copyright (C) 2012, 2015 Laboratoire de Recherche et Développement
// l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -29,15 +29,16 @@
"simplify formulas according to LEVEL (see below); LEVEL is " \ "simplify formulas according to LEVEL (see below); LEVEL is " \
"set to 3 if omitted", 0 } "set to 3 if omitted", 0 }
#define LEVEL_DOC(g) \ #define LEVEL_DOC(g) \
{ 0, 0, 0, 0, "The simplification LEVEL may be set as follows.", g }, \ { nullptr, 0, nullptr, 0, \
{ " 0", 0, 0, OPTION_DOC | OPTION_NO_USAGE, \ "The simplification LEVEL may be set as follows.", g }, \
"No rewriting", 0 }, \ { " 0", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, \
{ " 1", 0, 0, OPTION_DOC | OPTION_NO_USAGE, \ "No rewriting", 0 }, \
"basic rewritings and eventual/universal rules", 0 }, \ { " 1", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, \
{ " 2", 0, 0, OPTION_DOC | OPTION_NO_USAGE, \ "basic rewritings and eventual/universal rules", 0 }, \
"additional syntactic implication rules", 0 }, \ { " 2", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, \
{ " 3", 0, 0, OPTION_DOC | OPTION_NO_USAGE, \ "additional syntactic implication rules", 0 }, \
{ " 3", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, \
"better implications using containment", 0 } "better implications using containment", 0 }
extern int simplification_level; extern int simplification_level;

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -19,13 +19,15 @@
#pragma once #pragma once
#define RANGE_DOC \ #define RANGE_DOC \
{ 0, 0, 0, 0, "RANGE may have one of the following forms: 'INT', " \ { nullptr, 0, nullptr, 0, \
"RANGE may have one of the following forms: 'INT', " \
"'INT..INT', or '..INT'.\nIn the latter case, the missing number " \ "'INT..INT', or '..INT'.\nIn the latter case, the missing number " \
"is assumed to be 1.", 0 } "is assumed to be 1.", 0 }
#define RANGE_DOC_FULL \ #define RANGE_DOC_FULL \
{ 0, 0, 0, 0, "RANGE may have one of the following forms: 'INT', " \ { nullptr, 0, nullptr, 0, \
"RANGE may have one of the following forms: 'INT', " \
"'INT..INT', '..INT', or 'INT..'", 0 } "'INT..INT', '..INT', or 'INT..'", 0 }
struct range struct range

View file

@ -56,12 +56,12 @@ static void setup_sig_handler()
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESETHAND; sa.sa_flags = SA_RESETHAND;
// Catch termination signals, so we can cleanup temporary files. // Catch termination signals, so we can cleanup temporary files.
sigaction(SIGALRM, &sa, 0); sigaction(SIGALRM, &sa, nullptr);
sigaction(SIGHUP, &sa, 0); sigaction(SIGHUP, &sa, nullptr);
sigaction(SIGINT, &sa, 0); sigaction(SIGINT, &sa, nullptr);
sigaction(SIGPIPE, &sa, 0); sigaction(SIGPIPE, &sa, nullptr);
sigaction(SIGQUIT, &sa, 0); sigaction(SIGQUIT, &sa, nullptr);
sigaction(SIGTERM, &sa, 0); sigaction(SIGTERM, &sa, nullptr);
} }
#else #else
# define setup_sig_handler() while (0); # define setup_sig_handler() while (0);
@ -97,20 +97,21 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
{ "version", OPT_VERSION, 0, 0, "print program version", -1 }, { "version", OPT_VERSION, nullptr, 0, "print program version", -1 },
{ "help", OPT_HELP, 0, 0, "print this help", -1 }, { "help", OPT_HELP, nullptr, 0, "print this help", -1 },
// We support this option just in case, but we don't advertise it. // We support this option just in case, but we don't advertise it.
{ "usage", OPT_USAGE, 0, OPTION_HIDDEN, "show short usage", -1 }, { "usage", OPT_USAGE, nullptr, OPTION_HIDDEN, "show short usage", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const argp_option options_hidden[] = static const argp_option options_hidden[] =
{ {
{ "version", OPT_VERSION, 0, OPTION_HIDDEN, "print program version", -1 }, { "version", OPT_VERSION, nullptr, OPTION_HIDDEN,
{ "help", OPT_HELP, 0, OPTION_HIDDEN, "print this help", -1 }, "print program version", -1 },
{ "help", OPT_HELP, nullptr, OPTION_HIDDEN, "print this help", -1 },
// We support this option just in case, but we don't advertise it. // We support this option just in case, but we don't advertise it.
{ "usage", OPT_USAGE, 0, OPTION_HIDDEN, "show short usage", -1 }, { "usage", OPT_USAGE, nullptr, OPTION_HIDDEN, "show short usage", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static int static int
@ -137,7 +138,9 @@ parse_opt_misc(int key, char*, struct argp_state* state)
} }
const struct argp misc_argp = { options, parse_opt_misc, 0, 0, 0, 0, 0 }; const struct argp misc_argp = { options, parse_opt_misc,
nullptr, nullptr, nullptr, nullptr, nullptr };
const struct argp misc_argp_hidden = { options_hidden, parse_opt_misc, const struct argp misc_argp_hidden = { options_hidden, parse_opt_misc,
0, 0, 0, 0, 0 }; nullptr, nullptr, nullptr,
nullptr, nullptr };

View file

@ -361,12 +361,12 @@ setup_sig_handler()
sa.sa_handler = sig_handler; sa.sa_handler = sig_handler;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART; // So that wait() doesn't get aborted by SIGALRM. sa.sa_flags = SA_RESTART; // So that wait() doesn't get aborted by SIGALRM.
sigaction(SIGALRM, &sa, 0); sigaction(SIGALRM, &sa, nullptr);
// Catch termination signals, so we can kill the subprocess. // Catch termination signals, so we can kill the subprocess.
sigaction(SIGHUP, &sa, 0); sigaction(SIGHUP, &sa, nullptr);
sigaction(SIGINT, &sa, 0); sigaction(SIGINT, &sa, nullptr);
sigaction(SIGQUIT, &sa, 0); sigaction(SIGQUIT, &sa, nullptr);
sigaction(SIGTERM, &sa, 0); sigaction(SIGTERM, &sa, nullptr);
} }
int int
@ -383,7 +383,7 @@ exec_with_timeout(const char* cmd)
if (child_pid == 0) if (child_pid == 0)
{ {
setpgid(0, 0); setpgid(0, 0);
execlp("sh", "sh", "-c", cmd, (char*)0); execlp("sh", "sh", "-c", cmd, nullptr);
error(2, errno, "failed to run 'sh'"); error(2, errno, "failed to run 'sh'");
// never reached // never reached
return -1; return -1;
@ -412,33 +412,33 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Specifying translators to call:", 2 }, { nullptr, 0, nullptr, 0, "Specifying translators to call:", 2 },
{ "translator", 't', "COMMANDFMT", 0, { "translator", 't', "COMMANDFMT", 0,
"register one translator to call", 0 }, "register one translator to call", 0 },
{ "timeout", 'T', "NUMBER", 0, "kill translators after NUMBER seconds", 0 }, { "timeout", 'T', "NUMBER", 0, "kill translators after NUMBER seconds", 0 },
{ "list-shorthands", OPT_LIST, 0 , 0, { "list-shorthands", OPT_LIST, nullptr, 0,
"list availabled shorthands to use in COMMANDFMT", 0}, "list availabled shorthands to use in COMMANDFMT", 0},
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, { nullptr, 0, nullptr, 0,
"COMMANDFMT should specify input and output arguments using the " "COMMANDFMT should specify input and output arguments using the "
"following character sequences:", 3 }, "following character sequences:", 3 },
{ "%f,%s,%l,%w", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f,%s,%l,%w", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula as a (quoted) string in Spot, Spin, LBT, or Wring's syntax", "the formula as a (quoted) string in Spot, Spin, LBT, or Wring's syntax",
0 }, 0 },
{ "%F,%S,%L,%W", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%F,%S,%L,%W", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula as a file in Spot, Spin, LBT, or Wring's syntax", 0 }, "the formula as a file in Spot, Spin, LBT, or Wring's syntax", 0 },
{ "%O", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%O", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the automaton is output in HOA, never claim, LBTT, or ltl2dstar's " "the automaton is output in HOA, never claim, LBTT, or ltl2dstar's "
"format", 0 }, "format", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "a single %", 0 }, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, "a single %", 0 },
{ 0, 0, 0, 0, { nullptr, 0, nullptr, 0,
"If either %l, %L, or %T are used, any input formula that does " "If either %l, %L, or %T are used, any input formula that does "
"not use LBT-style atomic propositions (i.e. p0, p1, ...) will be " "not use LBT-style atomic propositions (i.e. p0, p1, ...) will be "
"relabeled automatically.\n" "relabeled automatically.\n"
"Furthermore, if COMMANDFMT has the form \"{NAME}CMD\", then only CMD " "Furthermore, if COMMANDFMT has the form \"{NAME}CMD\", then only CMD "
"will be passed to the shell, and NAME will be used to name the tool " "will be passed to the shell, and NAME will be used to name the tool "
"in the output.", 4 }, "in the output.", 4 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static int parse_opt_trans(int key, char* arg, struct argp_state*) static int parse_opt_trans(int key, char* arg, struct argp_state*)
@ -464,4 +464,5 @@ static int parse_opt_trans(int key, char* arg, struct argp_state*)
return 0; return 0;
} }
const struct argp trans_argp = { options, parse_opt_trans, 0, 0, 0, 0, 0 }; const struct argp trans_argp = { options, parse_opt_trans, nullptr, nullptr,
nullptr, nullptr, nullptr };

View file

@ -59,30 +59,31 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Input:", 1 }, { nullptr, 0, nullptr, 0, "Input:", 1 },
{ "file", 'F', "FILENAME", 0, { "file", 'F', "FILENAME", 0,
"process the automaton in FILENAME", 0 }, "process the automaton in FILENAME", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output automaton type:", 2 }, { nullptr, 0, nullptr, 0, "Output automaton type:", 2 },
{ "tgba", OPT_TGBA, 0, 0, { "tgba", OPT_TGBA, nullptr, 0,
"Transition-based Generalized Büchi Automaton (default)", 0 }, "Transition-based Generalized Büchi Automaton (default)", 0 },
{ "ba", 'B', 0, 0, "Büchi Automaton (with state-based acceptance)", 0 }, { "ba", 'B', nullptr, 0,
{ "monitor", 'M', 0, 0, "Monitor (accepts all finite prefixes " "Büchi Automaton (with state-based acceptance)", 0 },
{ "monitor", 'M', nullptr, 0, "Monitor (accepts all finite prefixes "
"of the given property)", 0 }, "of the given property)", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ "extra-options", 'x', "OPTS", 0, { "extra-options", 'x', "OPTS", 0,
"fine-tuning options (see spot-x (7))", 0 }, "fine-tuning options (see spot-x (7))", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const struct argp_child children[] = static const struct argp_child children[] =
{ {
{ &aoutput_argp, 0, 0, 0 }, { &aoutput_argp, 0, nullptr, 0 },
{ &aoutput_io_format_argp, 0, 0, 4 }, { &aoutput_io_format_argp, 0, nullptr, 4 },
{ &post_argp, 0, 0, 20 }, { &post_argp, 0, nullptr, 20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static spot::option_map extra_options; static spot::option_map extra_options;
@ -150,7 +151,7 @@ namespace
spot::stopwatch sw; spot::stopwatch sw;
sw.start(); sw.start();
auto nba = spot::to_generalized_buchi(haut->aut); auto nba = spot::to_generalized_buchi(haut->aut);
auto aut = post.run(nba, 0); auto aut = post.run(nba, nullptr);
const double conversion_time = sw.stop(); const double conversion_time = sw.stop();
printer.print(aut, nullptr, filename, -1, conversion_time, haut); printer.print(aut, nullptr, filename, -1, conversion_time, haut);
@ -200,9 +201,9 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[FILENAMES...]", const argp ap = { options, parse_opt, "[FILENAMES...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -144,13 +144,13 @@ const char* const class_name[LAST_CLASS] =
}; };
#define OPT_ALIAS(o) { #o, 0, 0, OPTION_ALIAS, 0, 0 } #define OPT_ALIAS(o) { #o, 0, nullptr, OPTION_ALIAS, nullptr, 0 }
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
// Keep this alphabetically sorted (expect for aliases). // Keep this alphabetically sorted (expect for aliases).
{ 0, 0, 0, 0, "Pattern selection:", 1}, { nullptr, 0, nullptr, 0, "Pattern selection:", 1},
// J. Geldenhuys and H. Hansen (Spin'06): Larger automata and less // J. Geldenhuys and H. Hansen (Spin'06): Larger automata and less
// work for LTL model checking. // work for LTL model checking.
{ "and-f", OPT_AND_F, "RANGE", 0, "F(p1)&F(p2)&...&F(pn)", 0 }, { "and-f", OPT_AND_F, "RANGE", 0, "F(p1)&F(p2)&...&F(pn)", 0 },
@ -194,19 +194,19 @@ static const argp_option options[] =
OPT_ALIAS(go-phi), OPT_ALIAS(go-phi),
RANGE_DOC, RANGE_DOC,
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output options:", -20 }, { nullptr, 0, nullptr, 0, "Output options:", -20 },
{ 0, 0, 0, 0, "The FORMAT string passed to --format may use "\ { nullptr, 0, nullptr, 0, "The FORMAT string passed to --format may use "
"the following interpreted sequences:", -19 }, "the following interpreted sequences:", -19 },
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula (in the selected syntax)", 0 }, "the formula (in the selected syntax)", 0 },
{ "%F", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the name of the pattern", 0 }, "the name of the pattern", 0 },
{ "%L", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the argument of the pattern", 0 }, "the argument of the pattern", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"a single %", 0 }, "a single %", 0 },
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
struct job struct job
@ -221,9 +221,9 @@ static jobs_t jobs;
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &output_argp, 0, 0, -20 }, { &output_argp, 0, nullptr, -20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static void static void
@ -819,10 +819,10 @@ main(int argc, char** argv)
{ {
setup(argv); setup(argv);
const argp ap = { options, parse_opt, 0, argp_program_doc, const argp ap = { options, parse_opt, nullptr, argp_program_doc,
children, 0, 0 }; children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -54,32 +54,33 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output automaton type:", 2 }, { nullptr, 0, nullptr, 0, "Output automaton type:", 2 },
{ "tgba", OPT_TGBA, 0, 0, { "tgba", OPT_TGBA, nullptr, 0,
"Transition-based Generalized Büchi Automaton (default)", 0 }, "Transition-based Generalized Büchi Automaton (default)", 0 },
{ "ba", 'B', 0, 0, "Büchi Automaton (with state-based acceptance)", 0 }, { "ba", 'B', nullptr, 0,
{ "monitor", 'M', 0, 0, "Monitor (accepts all finite prefixes " "Büchi Automaton (with state-based acceptance)", 0 },
{ "monitor", 'M', nullptr, 0, "Monitor (accepts all finite prefixes "
"of the given formula)", 0 }, "of the given formula)", 0 },
/**************************************************/ /**************************************************/
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula, in Spot's syntax", 4 }, "the formula, in Spot's syntax", 4 },
/**************************************************/ /**************************************************/
{ "unambiguous", 'U', 0, 0, "output unambiguous automata " { "unambiguous", 'U', nullptr, 0, "output unambiguous automata "
"(combine with other intents)", 20 }, "(combine with other intents)", 20 },
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ "extra-options", 'x', "OPTS", 0, { "extra-options", 'x', "OPTS", 0,
"fine-tuning options (see spot-x (7))", 0 }, "fine-tuning options (see spot-x (7))", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &aoutput_argp, 0, 0, 0 }, { &aoutput_argp, 0, nullptr, 0 },
{ &aoutput_o_format_argp, 0, 0, 0 }, { &aoutput_o_format_argp, 0, nullptr, 0 },
{ &post_argp, 0, 0, 0 }, { &post_argp, 0, nullptr, 0 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static spot::option_map extra_options; static spot::option_map extra_options;
@ -139,7 +140,7 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
// This should not happen, because the parser we use can only // This should not happen, because the parser we use can only
// read PSL/LTL formula, but since our ltl::formula type can // read PSL/LTL formula, but since our ltl::formula type can
@ -173,11 +174,11 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[FORMULA...]", const argp ap = { options, parse_opt, "[FORMULA...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
simplification_level = 3; simplification_level = 3;
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -64,35 +64,35 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Automaton type:", 1 }, { nullptr, 0, nullptr, 0, "Automaton type:", 1 },
{ "tgta", OPT_TGTA, 0, 0, { "tgta", OPT_TGTA, nullptr, 0,
"Transition-based Generalized Testing Automaton (default)", 0 }, "Transition-based Generalized Testing Automaton (default)", 0 },
{ "ta", OPT_TA, 0, 0, "Testing Automaton", 0 }, { "ta", OPT_TA, nullptr, 0, "Testing Automaton", 0 },
{ "gta", OPT_GTA, 0, 0, "Generalized Testing Automaton", 0 }, { "gta", OPT_GTA, nullptr, 0, "Generalized Testing Automaton", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Options for TA and GTA creation:", 3 }, { nullptr, 0, nullptr, 0, "Options for TA and GTA creation:", 3 },
{ "single-pass-lv", OPT_SPLV, 0, 0, { "single-pass-lv", OPT_SPLV, nullptr, 0,
"add an artificial livelock state to obtain a single-pass (G)TA", 0 }, "add an artificial livelock state to obtain a single-pass (G)TA", 0 },
{ "single-pass", OPT_SPNO, 0, 0, { "single-pass", OPT_SPNO, nullptr, 0,
"create a single-pass (G)TA without artificial livelock state", 0 }, "create a single-pass (G)TA without artificial livelock state", 0 },
{ "multiple-init", OPT_INIT, 0, 0, { "multiple-init", OPT_INIT, nullptr, 0,
"do not create the fake initial state", 0 }, "do not create the fake initial state", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output options:", 4 }, { nullptr, 0, nullptr, 0, "Output options:", 4 },
{ "utf8", '8', 0, 0, "enable UTF-8 characters in output", 0 }, { "utf8", '8', nullptr, 0, "enable UTF-8 characters in output", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ "extra-options", 'x', "OPTS", 0, { "extra-options", 'x', "OPTS", 0,
"fine-tuning options (see spot-x (7))", 0 }, "fine-tuning options (see spot-x (7))", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &post_argp, 0, 0, 20 }, { &post_argp, 0, nullptr, 20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
enum ta_types { TGTA, GTA, TA }; enum ta_types { TGTA, GTA, TA };
@ -171,7 +171,7 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
auto aut = trans.run(&f); auto aut = trans.run(&f);
@ -219,11 +219,11 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[FORMULA...]", const argp ap = { options, parse_opt, "[FORMULA...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
simplification_level = 3; simplification_level = 3;
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -99,22 +99,22 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "ltlcross behavior:", 5 }, { nullptr, 0, nullptr, 0, "ltlcross behavior:", 5 },
{ "allow-dups", OPT_DUPS, 0, 0, { "allow-dups", OPT_DUPS, nullptr, 0,
"translate duplicate formulas in input", 0 }, "translate duplicate formulas in input", 0 },
{ "no-checks", OPT_NOCHECKS, 0, 0, { "no-checks", OPT_NOCHECKS, nullptr, 0,
"do not perform any sanity checks (negated formulas " "do not perform any sanity checks (negated formulas "
"will not be translated)", 0 }, "will not be translated)", 0 },
{ "no-complement", OPT_NOCOMP, 0, 0, { "no-complement", OPT_NOCOMP, nullptr, 0,
"do not complement deterministic automata to perform extra checks", 0 }, "do not complement deterministic automata to perform extra checks", 0 },
{ "stop-on-error", OPT_STOP_ERR, 0, 0, { "stop-on-error", OPT_STOP_ERR, nullptr, 0,
"stop on first execution error or failure to pass" "stop on first execution error or failure to pass"
" sanity checks (timeouts are OK)", 0 }, " sanity checks (timeouts are OK)", 0 },
{ "ignore-execution-failures", OPT_IGNORE_EXEC_FAIL, 0, 0, { "ignore-execution-failures", OPT_IGNORE_EXEC_FAIL, nullptr, 0,
"ignore automata from translators that return with a non-zero exit code," "ignore automata from translators that return with a non-zero exit code,"
" but do not flag this as an error", 0 }, " but do not flag this as an error", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "State-space generation:", 6 }, { nullptr, 0, nullptr, 0, "State-space generation:", 6 },
{ "states", OPT_STATES, "INT", 0, { "states", OPT_STATES, "INT", 0,
"number of the states in the state-spaces (200 by default)", 0 }, "number of the states in the state-spaces (200 by default)", 0 },
{ "density", OPT_DENSITY, "FLOAT", 0, { "density", OPT_DENSITY, "FLOAT", 0,
@ -126,19 +126,19 @@ static const argp_option options[] =
"number of products to perform (1 by default), statistics will be " "number of products to perform (1 by default), statistics will be "
"averaged unless the number is prefixed with '+'", 0 }, "averaged unless the number is prefixed with '+'", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Statistics output:", 7 }, { nullptr, 0, nullptr, 0, "Statistics output:", 7 },
{ "json", OPT_JSON, "[>>]FILENAME", OPTION_ARG_OPTIONAL, { "json", OPT_JSON, "[>>]FILENAME", OPTION_ARG_OPTIONAL,
"output statistics as JSON in FILENAME or on standard output", 0 }, "output statistics as JSON in FILENAME or on standard output", 0 },
{ "csv", OPT_CSV, "[>>]FILENAME", OPTION_ARG_OPTIONAL, { "csv", OPT_CSV, "[>>]FILENAME", OPTION_ARG_OPTIONAL,
"output statistics as CSV in FILENAME or on standard output " "output statistics as CSV in FILENAME or on standard output "
"(if '>>' is used to request append mode, the header line is " "(if '>>' is used to request append mode, the header line is "
"not output)", 0 }, "not output)", 0 },
{ "omit-missing", OPT_OMIT, 0, 0, { "omit-missing", OPT_OMIT, nullptr, 0,
"do not output statistics for timeouts or failed translations", 0 }, "do not output statistics for timeouts or failed translations", 0 },
{ "automata", OPT_AUTOMATA, 0, 0, { "automata", OPT_AUTOMATA, nullptr, 0,
"store automata (in the HOA format) into the CSV or JSON output", 0 }, "store automata (in the HOA format) into the CSV or JSON output", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -2 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -2 },
{ "color", OPT_COLOR, "WHEN", OPTION_ARG_OPTIONAL, { "color", OPT_COLOR, "WHEN", OPTION_ARG_OPTIONAL,
"colorize output; WHEN can be 'never', 'always' (the default if " "colorize output; WHEN can be 'never', 'always' (the default if "
"--color is used without argument), or " "--color is used without argument), or "
@ -148,19 +148,20 @@ static const argp_option options[] =
"formula that fails on the same test in FILENAME", 0 }, "formula that fails on the same test in FILENAME", 0 },
{ "save-bogus", OPT_BOGUS, "[>>]FILENAME", 0, { "save-bogus", OPT_BOGUS, "[>>]FILENAME", 0,
"save formulas for which problems were detected in FILENAME", 0 }, "save formulas for which problems were detected in FILENAME", 0 },
{ "verbose", OPT_VERBOSE, 0, 0, { "verbose", OPT_VERBOSE, nullptr, 0,
"print what is being done, for debugging", 0 }, "print what is being done, for debugging", 0 },
{ 0, 0, 0, 0, "If an output FILENAME is prefixed with '>>', is it open " { nullptr, 0, nullptr, 0,
"If an output FILENAME is prefixed with '>>', is it open "
"in append mode instead of being truncated.", -1 }, "in append mode instead of being truncated.", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &trans_argp, 0, 0, 0 }, { &trans_argp, 0, nullptr, 0 },
{ &misc_argp, 0, 0, -2 }, { &misc_argp, 0, nullptr, -2 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
enum color_type { color_never, color_always, color_if_tty }; enum color_type { color_never, color_always, color_if_tty };
@ -169,7 +170,7 @@ static char const *const color_args[] =
{ {
"always", "yes", "force", "always", "yes", "force",
"never", "no", "none", "never", "no", "none",
"auto", "tty", "if-tty", 0 "auto", "tty", "if-tty", nullptr
}; };
static color_type const color_types[] = static color_type const color_types[] =
{ {
@ -187,8 +188,8 @@ static const char* reset_color = "\033[m";
static unsigned states = 200; static unsigned states = 200;
static float density = 0.1; static float density = 0.1;
static const char* json_output = 0; static const char* json_output = nullptr;
static const char* csv_output = 0; static const char* csv_output = nullptr;
static bool want_stats = false; static bool want_stats = false;
static bool allow_dups = false; static bool allow_dups = false;
static bool no_checks = false; static bool no_checks = false;
@ -198,9 +199,9 @@ static int seed = 0;
static unsigned products = 1; static unsigned products = 1;
static bool products_avg = true; static bool products_avg = true;
static bool opt_omit = false; static bool opt_omit = false;
static const char* bogus_output_filename = 0; static const char* bogus_output_filename = nullptr;
static output_file* bogus_output = 0; static output_file* bogus_output = nullptr;
static output_file* grind_output = 0; static output_file* grind_output = nullptr;
static bool verbose = false; static bool verbose = false;
static bool ignore_exec_fail = false; static bool ignore_exec_fail = false;
static unsigned ignored_exec_fail = 0; static unsigned ignored_exec_fail = 0;
@ -239,7 +240,7 @@ struct statistics
{ {
statistics() statistics()
: ok(false), : ok(false),
status_str(0), status_str(nullptr),
status_code(0), status_code(0),
time(0), time(0),
states(0), states(0),
@ -499,9 +500,9 @@ namespace
int es = exec_with_timeout(cmd.c_str()); int es = exec_with_timeout(cmd.c_str());
double duration = sw.stop(); double duration = sw.stop();
const char* status_str = 0; const char* status_str = nullptr;
spot::twa_graph_ptr res = 0; spot::twa_graph_ptr res = nullptr;
if (timed_out) if (timed_out)
{ {
// This is not considered to be a global error. // This is not considered to be a global error.
@ -938,7 +939,7 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
static unsigned round = 0; static unsigned round = 0;
@ -998,7 +999,7 @@ namespace
unsigned n = vstats.size(); unsigned n = vstats.size();
vstats.resize(n + (no_checks ? 1 : 2)); vstats.resize(n + (no_checks ? 1 : 2));
statistics_formula* pstats = &vstats[n]; statistics_formula* pstats = &vstats[n];
statistics_formula* nstats = 0; statistics_formula* nstats = nullptr;
pstats->resize(m); pstats->resize(m);
formulas.push_back(fstr); formulas.push_back(fstr);
@ -1380,9 +1381,9 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[COMMANDFMT...]", const argp ap = { options, parse_opt, "[COMMANDFMT...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -49,20 +49,20 @@ of input and output as required.";
static const argp_option options[] = static const argp_option options[] =
{ {
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const argp_option more_o_format[] = static const argp_option more_o_format[] =
{ {
{ "%R", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%R", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"serial number of the formula translated", 0 }, "serial number of the formula translated", 0 },
{ "%T", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%T", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"tool used for translation", 0 }, "tool used for translation", 0 },
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"formula translated", 0 }, "formula translated", 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
// This is not very elegant, but we need to add the above %-escape // This is not very elegant, but we need to add the above %-escape
@ -87,18 +87,18 @@ build_percent_list()
memcpy(d + count, more_o_format, sizeof(more_o_format)); memcpy(d + count, more_o_format, sizeof(more_o_format));
static const struct argp more_o_format_argp = static const struct argp more_o_format_argp =
{ d, 0, 0, 0, 0, 0, 0 }; { d, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
return &more_o_format_argp; return &more_o_format_argp;
} }
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &trans_argp, 0, 0, 3 }, { &trans_argp, 0, nullptr, 3 },
{ &aoutput_argp, 0, 0, 4 }, { &aoutput_argp, 0, nullptr, 4 },
{ build_percent_list(), 0, 0, 5 }, { build_percent_list(), 0, nullptr, 5 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static int static int
@ -256,7 +256,7 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
std::unique_ptr<spot::ltl::relabeling_map> relmap; std::unique_ptr<spot::ltl::relabeling_map> relmap;
@ -306,13 +306,13 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[COMMANDFMT...]", const argp ap = { options, parse_opt, "[COMMANDFMT...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
// Disable post-processing as much as possible by default. // Disable post-processing as much as possible by default.
level = spot::postprocessor::Low; level = spot::postprocessor::Low;
pref = spot::postprocessor::Any; pref = spot::postprocessor::Any;
type = spot::postprocessor::Generic; type = spot::postprocessor::Generic;
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -96,17 +96,18 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Error handling:", 2 }, { nullptr, 0, nullptr, 0, "Error handling:", 2 },
{ "skip-errors", OPT_SKIP_ERRORS, 0, 0, { "skip-errors", OPT_SKIP_ERRORS, nullptr, 0,
"output erroneous lines as-is without processing", 0 }, "output erroneous lines as-is without processing", 0 },
{ "drop-errors", OPT_DROP_ERRORS, 0, 0, { "drop-errors", OPT_DROP_ERRORS, nullptr, 0,
"discard erroneous lines (default)", 0 }, "discard erroneous lines (default)", 0 },
{ "ignore-errors", OPT_IGNORE_ERRORS, 0, 0, { "ignore-errors", OPT_IGNORE_ERRORS, nullptr, 0,
"do not report syntax errors", 0 }, "do not report syntax errors", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Transformation options:", 3 }, { nullptr, 0, nullptr, 0, "Transformation options:", 3 },
{ "negate", OPT_NEGATE, 0, 0, "negate each formula", 0 }, { "negate", OPT_NEGATE, nullptr, 0, "negate each formula", 0 },
{ "nnf", OPT_NNF, 0, 0, "rewrite formulas in negative normal form", 0 }, { "nnf", OPT_NNF, nullptr, 0,
"rewrite formulas in negative normal form", 0 },
{ "relabel", OPT_RELABEL, "abc|pnn", OPTION_ARG_OPTIONAL, { "relabel", OPT_RELABEL, "abc|pnn", OPTION_ARG_OPTIONAL,
"relabel all atomic propositions, alphabetically unless " \ "relabel all atomic propositions, alphabetically unless " \
"specified otherwise", 0 }, "specified otherwise", 0 },
@ -116,13 +117,13 @@ static const argp_option options[] =
{ "define", OPT_DEFINE, "FILENAME", OPTION_ARG_OPTIONAL, { "define", OPT_DEFINE, "FILENAME", OPTION_ARG_OPTIONAL,
"when used with --relabel or --relabel-bool, output the relabeling map " "when used with --relabel or --relabel-bool, output the relabeling map "
"using #define statements", 0 }, "using #define statements", 0 },
{ "remove-wm", OPT_REMOVE_WM, 0, 0, { "remove-wm", OPT_REMOVE_WM, nullptr, 0,
"rewrite operators W and M using U and R (this is an alias for " "rewrite operators W and M using U and R (this is an alias for "
"--unabbreviate=WM)", 0 }, "--unabbreviate=WM)", 0 },
{ "boolean-to-isop", OPT_BOOLEAN_TO_ISOP, 0, 0, { "boolean-to-isop", OPT_BOOLEAN_TO_ISOP, nullptr, 0,
"rewrite Boolean subformulas as irredundant sum of products " "rewrite Boolean subformulas as irredundant sum of products "
"(implies at least -r1)", 0 }, "(implies at least -r1)", 0 },
{ "remove-x", OPT_REMOVE_X, 0, 0, { "remove-x", OPT_REMOVE_X, nullptr, 0,
"remove X operators (valid only for stutter-insensitive properties)", "remove X operators (valid only for stutter-insensitive properties)",
0 }, 0 },
{ "unabbreviate", OPT_UNABBREVIATE, "STR", OPTION_ARG_OPTIONAL, { "unabbreviate", OPT_UNABBREVIATE, "STR", OPTION_ARG_OPTIONAL,
@ -138,30 +139,32 @@ static const argp_option options[] =
DECLARE_OPT_R, DECLARE_OPT_R,
LEVEL_DOC(4), LEVEL_DOC(4),
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, { nullptr, 0, nullptr, 0,
"Filtering options (matching is done after transformation):", 5 }, "Filtering options (matching is done after transformation):", 5 },
{ "ltl", OPT_LTL, 0, 0, "match only LTL formulas (no PSL operator)", 0 }, { "ltl", OPT_LTL, nullptr, 0,
{ "boolean", OPT_BOOLEAN, 0, 0, "match Boolean formulas", 0 }, "match only LTL formulas (no PSL operator)", 0 },
{ "eventual", OPT_EVENTUAL, 0, 0, "match pure eventualities", 0 }, { "boolean", OPT_BOOLEAN, nullptr, 0, "match Boolean formulas", 0 },
{ "universal", OPT_UNIVERSAL, 0, 0, "match purely universal formulas", 0 }, { "eventual", OPT_EVENTUAL, nullptr, 0, "match pure eventualities", 0 },
{ "syntactic-safety", OPT_SYNTACTIC_SAFETY, 0, 0, { "universal", OPT_UNIVERSAL, nullptr, 0,
"match purely universal formulas", 0 },
{ "syntactic-safety", OPT_SYNTACTIC_SAFETY, nullptr, 0,
"match syntactic-safety formulas", 0 }, "match syntactic-safety formulas", 0 },
{ "syntactic-guarantee", OPT_SYNTACTIC_GUARANTEE, 0, 0, { "syntactic-guarantee", OPT_SYNTACTIC_GUARANTEE, nullptr, 0,
"match syntactic-guarantee formulas", 0 }, "match syntactic-guarantee formulas", 0 },
{ "syntactic-obligation", OPT_SYNTACTIC_OBLIGATION, 0, 0, { "syntactic-obligation", OPT_SYNTACTIC_OBLIGATION, nullptr, 0,
"match syntactic-obligation formulas", 0 }, "match syntactic-obligation formulas", 0 },
{ "syntactic-recurrence", OPT_SYNTACTIC_RECURRENCE, 0, 0, { "syntactic-recurrence", OPT_SYNTACTIC_RECURRENCE, nullptr, 0,
"match syntactic-recurrence formulas", 0 }, "match syntactic-recurrence formulas", 0 },
{ "syntactic-persistence", OPT_SYNTACTIC_PERSISTENCE, 0, 0, { "syntactic-persistence", OPT_SYNTACTIC_PERSISTENCE, nullptr, 0,
"match syntactic-persistence formulas", 0 }, "match syntactic-persistence formulas", 0 },
{ "syntactic-stutter-invariant", OPT_SYNTACTIC_SI, 0, 0, { "syntactic-stutter-invariant", OPT_SYNTACTIC_SI, nullptr, 0,
"match stutter-invariant formulas syntactically (LTL-X or siPSL)", 0 }, "match stutter-invariant formulas syntactically (LTL-X or siPSL)", 0 },
{ "nox", 0, 0, OPTION_ALIAS, 0, 0 }, { "nox", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
{ "safety", OPT_SAFETY, 0, 0, { "safety", OPT_SAFETY, nullptr, 0,
"match safety formulas (even pathological)", 0 }, "match safety formulas (even pathological)", 0 },
{ "guarantee", OPT_GUARANTEE, 0, 0, { "guarantee", OPT_GUARANTEE, nullptr, 0,
"match guarantee formulas (even pathological)", 0 }, "match guarantee formulas (even pathological)", 0 },
{ "obligation", OPT_OBLIGATION, 0, 0, { "obligation", OPT_OBLIGATION, nullptr, 0,
"match obligation formulas (even pathological)", 0 }, "match obligation formulas (even pathological)", 0 },
{ "size-max", OPT_SIZE_MAX, "INT", 0, { "size-max", OPT_SIZE_MAX, "INT", 0,
"match formulas with size <= INT", 0 }, "match formulas with size <= INT", 0 },
@ -177,45 +180,45 @@ static const argp_option options[] =
"match formulas implying FORMULA", 0 }, "match formulas implying FORMULA", 0 },
{ "equivalent-to", OPT_EQUIVALENT_TO, "FORMULA", 0, { "equivalent-to", OPT_EQUIVALENT_TO, "FORMULA", 0,
"match formulas equivalent to FORMULA", 0 }, "match formulas equivalent to FORMULA", 0 },
{ "stutter-insensitive", OPT_STUTTER_INSENSITIVE, 0, 0, { "stutter-insensitive", OPT_STUTTER_INSENSITIVE, nullptr, 0,
"match stutter-insensitive LTL formulas", 0 }, "match stutter-insensitive LTL formulas", 0 },
{ "stutter-invariant", 0, 0, OPTION_ALIAS, 0, 0 }, { "stutter-invariant", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
{ "ap", OPT_AP_N, "N", 0, { "ap", OPT_AP_N, "N", 0,
"match formulas which use exactly N atomic propositions", 0 }, "match formulas which use exactly N atomic propositions", 0 },
{ "invert-match", 'v', 0, 0, "select non-matching formulas", 0}, { "invert-match", 'v', nullptr, 0, "select non-matching formulas", 0},
{ "unique", 'u', 0, 0, { "unique", 'u', nullptr, 0,
"drop formulas that have already been output (not affected by -v)", 0 }, "drop formulas that have already been output (not affected by -v)", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output options:", -20 }, { nullptr, 0, nullptr, 0, "Output options:", -20 },
{ "count", 'c', 0, 0, "print only a count of matched formulas", 0 }, { "count", 'c', nullptr, 0, "print only a count of matched formulas", 0 },
{ "quiet", 'q', 0, 0, "suppress all normal output", 0 }, { "quiet", 'q', nullptr, 0, "suppress all normal output", 0 },
{ "max-count", 'n', "NUM", 0, "output at most NUM formulas", 0 }, { "max-count", 'n', "NUM", 0, "output at most NUM formulas", 0 },
{ 0, 0, 0, 0, "The FORMAT string passed to --format may use "\ { nullptr, 0, nullptr, 0, "The FORMAT string passed to --format may use "\
"the following interpreted sequences:", -19 }, "the following interpreted sequences:", -19 },
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula (in the selected syntax)", 0 }, "the formula (in the selected syntax)", 0 },
{ "%F", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the name of the input file", 0 }, "the name of the input file", 0 },
{ "%L", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the original line number in the input file", 0 }, "the original line number in the input file", 0 },
{ "%<", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%<", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the part of the line before the formula if it " "the part of the line before the formula if it "
"comes from a column extracted from a CSV file", 0 }, "comes from a column extracted from a CSV file", 0 },
{ "%>", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%>", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the part of the line after the formula if it " "the part of the line after the formula if it "
"comes from a column extracted from a CSV file", 0 }, "comes from a column extracted from a CSV file", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"a single %", 0 }, "a single %", 0 },
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &finput_argp, 0, 0, 1 }, { &finput_argp, 0, nullptr, 1 },
{ &output_argp, 0, 0, -20 }, { &output_argp, 0, nullptr, -20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static bool one_match = false; static bool one_match = false;
@ -453,7 +456,7 @@ namespace
int int
process_string(const std::string& input, process_string(const std::string& input,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
spot::ltl::parse_error_list pel; spot::ltl::parse_error_list pel;
spot::ltl::formula f = parse_formula(input, pel); spot::ltl::formula f = parse_formula(input, pel);
@ -487,7 +490,7 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::ltl::formula f,
const char* filename = 0, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
if (opt_max_count >= 0 && match_count >= opt_max_count) if (opt_max_count >= 0 && match_count >= opt_max_count)
{ {
@ -626,11 +629,11 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "[FILENAME[/COL]...]", const argp ap = { options, parse_opt, "[FILENAME[/COL]...]",
argp_program_doc, children, 0, 0 }; argp_program_doc, children, nullptr, nullptr };
try try
{ {
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())

View file

@ -51,43 +51,43 @@ static const char * argp_program_doc =
"List formulas that are similar to but simpler than a given formula."; "List formulas that are similar to but simpler than a given formula.";
static const argp_option options[] = { static const argp_option options[] = {
{0, 0, 0, 0, "Mutation rules (all enabled unless those options are used):", {nullptr, 0, nullptr, 0,
15}, "Mutation rules (all enabled unless those options are used):", 15},
{"ap-to-const", OPT_AP2CONST, 0, 0, {"ap-to-const", OPT_AP2CONST, nullptr, 0,
"atomic propositions are replaced with true/false", 15}, "atomic propositions are replaced with true/false", 15},
{"remove-one-ap", OPT_REMOVE_ONE_AP, 0, 0, {"remove-one-ap", OPT_REMOVE_ONE_AP, nullptr, 0,
"all occurrences of an atomic proposition are replaced with another " \ "all occurrences of an atomic proposition are replaced with another " \
"atomic proposition used in the formula", 15}, "atomic proposition used in the formula", 15},
{"remove-multop-operands", OPT_REMOVE_MULTOP_OPERANDS, 0, 0, {"remove-multop-operands", OPT_REMOVE_MULTOP_OPERANDS, nullptr, 0,
"remove one operand from multops", 15}, "remove one operand from multops", 15},
{"remove-ops", OPT_REMOVE_OPS, 0, 0, {"remove-ops", OPT_REMOVE_OPS, nullptr, 0,
"replace unary/binary operators with one of their operands", "replace unary/binary operators with one of their operands",
15}, 15},
{"split-ops", OPT_SPLIT_OPS, 0, 0, {"split-ops", OPT_SPLIT_OPS, nullptr, 0,
"when an operator can be expressed as a conjunction/disjunction using " \ "when an operator can be expressed as a conjunction/disjunction using " \
"simpler operators, each term of the conjunction/disjunction is a " \ "simpler operators, each term of the conjunction/disjunction is a " \
"mutation. e.g. a <-> b can be written as ((a & b) | (!a & !b)) or as " \ "mutation. e.g. a <-> b can be written as ((a & b) | (!a & !b)) or as " \
"((a -> b) & (b -> a)) so those four terms can be a mutation of a <-> b", 0}, "((a -> b) & (b -> a)) so those four terms can be a mutation of a <-> b", 0},
{"rewrite-ops", OPT_REWRITE_OPS, 0, 0, {"rewrite-ops", OPT_REWRITE_OPS, nullptr, 0,
"rewrite operators that have a semantically simpler form: a U b becomes " \ "rewrite operators that have a semantically simpler form: a U b becomes " \
"a W b, etc.", 0}, "a W b, etc.", 0},
{"simplify-bounds", OPT_SIMPLIFY_BOUNDS, 0, 0, {"simplify-bounds", OPT_SIMPLIFY_BOUNDS, nullptr, 0,
"on a bounded unary operator, decrement one of the bounds, or set min to " \ "on a bounded unary operator, decrement one of the bounds, or set min to " \
"0 or max to unbounded", 15}, "0 or max to unbounded", 15},
{0, 0, 0, 0, "Output options:", 20}, {nullptr, 0, nullptr, 0, "Output options:", 20},
{"max-count", 'n', "NUM", 0, "maximum number of mutations to output", 20}, {"max-count", 'n', "NUM", 0, "maximum number of mutations to output", 20},
{"mutations", 'm', "NUM", 0, "number of mutations to apply to the " \ {"mutations", 'm', "NUM", 0, "number of mutations to apply to the " \
"formulae (default: 1)", 0}, "formulae (default: 1)", 0},
{"sort", OPT_SORT, 0, 0, "sort the result by formula size", 0}, {"sort", OPT_SORT, nullptr, 0, "sort the result by formula size", 0},
{0, 0, 0, 0, "Miscellaneous options:", -1}, {nullptr, 0, nullptr, 0, "Miscellaneous options:", -1},
{0, 0, 0, 0, 0, 0} {nullptr, 0, nullptr, 0, nullptr, 0}
}; };
static const argp_child children[] = { static const argp_child children[] = {
{&finput_argp, 0, 0, 10}, {&finput_argp, 0, nullptr, 10},
{&output_argp, 0, 0, 20}, {&output_argp, 0, nullptr, 20},
{&misc_argp, 0, 0, -1}, {&misc_argp, 0, nullptr, -1},
{0, 0, 0, 0} {nullptr, 0, nullptr, 0}
}; };
namespace namespace
@ -96,7 +96,7 @@ namespace
{ {
public: public:
int int
process_formula(spot::ltl::formula f, const char *filename = 0, process_formula(spot::ltl::formula f, const char* filename = nullptr,
int linenum = 0) int linenum = 0)
{ {
auto mutations = auto mutations =
@ -161,9 +161,10 @@ main(int argc, char* argv[])
{ {
setup(argv); setup(argv);
const argp ap = { options, parse_opt, 0, argp_program_doc, children, 0, 0 }; const argp ap = { options, parse_opt, nullptr, argp_program_doc, children,
nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
mut_opts |= opt_all; mut_opts |= opt_all;

View file

@ -74,31 +74,32 @@ enum {
static const argp_option options[] = static const argp_option options[] =
{ {
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Generation:", 1 }, { nullptr, 0, nullptr, 0, "Generation:", 1 },
{ "acceptance", 'A', "ACCEPTANCE", 0, { "acceptance", 'A', "ACCEPTANCE", 0,
"specify the acceptance type of the automaton", 0 }, "specify the acceptance type of the automaton", 0 },
{ "acc-probability", 'a', "FLOAT", 0, { "acc-probability", 'a', "FLOAT", 0,
"probability that an edge belongs to one acceptance set (0.2)", 0 }, "probability that an edge belongs to one acceptance set (0.2)", 0 },
{ "automata", 'n', "INT", 0, "number of automata to output (1)\n"\ { "automata", 'n', "INT", 0, "number of automata to output (1)\n"\
"use a negative value for unbounded generation", 0 }, "use a negative value for unbounded generation", 0 },
{ "ba", 'B', 0, 0, { "ba", 'B', nullptr, 0,
"build a Buchi automaton (implies --acceptance=Buchi --state-acc)", 0 }, "build a Buchi automaton (implies --acceptance=Buchi --state-acc)", 0 },
{ "colored", OPT_COLORED, 0, 0, { "colored", OPT_COLORED, nullptr, 0,
"build an automaton in which each edge (or state if combined with " "build an automaton in which each edge (or state if combined with "
"-S) belong to a single acceptance set", 0 }, "-S) belong to a single acceptance set", 0 },
{ "density", 'd', "FLOAT", 0, "density of the edges (0.2)", 0 }, { "density", 'd', "FLOAT", 0, "density of the edges (0.2)", 0 },
{ "deterministic", 'D', 0, 0, "build a complete, deterministic automaton ", { "deterministic", 'D', nullptr, 0,
0 }, "build a complete, deterministic automaton ", 0 },
{ "unique", 'u', 0, 0, { "unique", 'u', nullptr, 0,
"do not output the same automaton twice (same in the sense that they "\ "do not output the same automaton twice (same in the sense that they "\
"are isomorphic)", 0 }, "are isomorphic)", 0 },
{ "seed", OPT_SEED, "INT", 0, { "seed", OPT_SEED, "INT", 0,
"seed for the random number generator (0)", 0 }, "seed for the random number generator (0)", 0 },
{ "states", 'Q', "RANGE", 0, "number of states to output (10)", 0 }, { "states", 'Q', "RANGE", 0, "number of states to output (10)", 0 },
{ "state-based-acceptance", 'S', 0, 0, "used state-based acceptance", 0 }, { "state-based-acceptance", 'S', nullptr, 0,
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 }, "used state-based acceptance", 0 },
{ "sbacc", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
RANGE_DOC, RANGE_DOC,
{ 0, 0, 0, 0, "ACCEPTANCE may be either a RANGE (in which case " { nullptr, 0, nullptr, 0, "ACCEPTANCE may be either a RANGE (in which case "
"generalized Büchi is assumed), or an arbitrary acceptance formula " "generalized Büchi is assumed), or an arbitrary acceptance formula "
"such as 'Fin(0)|Inf(1)&Fin(2)' in the same syntax as in the HOA " "such as 'Fin(0)|Inf(1)&Fin(2)' in the same syntax as in the HOA "
"format, or one of the following patterns:\n" "format, or one of the following patterns:\n"
@ -118,17 +119,17 @@ static const argp_option options[] =
"unless a probability (to reuse the set again every time it is used) " "unless a probability (to reuse the set again every time it is used) "
"is given.", 2 }, "is given.", 2 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
static const struct argp_child children[] = static const struct argp_child children[] =
{ {
{ &aoutput_argp, 0, 0, 3 }, { &aoutput_argp, 0, nullptr, 3 },
{ &aoutput_o_format_argp, 0, 0, 4 }, { &aoutput_o_format_argp, 0, nullptr, 4 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
static const char* opt_acceptance = nullptr; static const char* opt_acceptance = nullptr;
@ -269,9 +270,9 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "N|PROP...", argp_program_doc, const argp ap = { options, parse_opt, "N|PROP...", argp_program_doc,
children, 0, 0 }; children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
// running 'randaut 0' is one way to generate automata using no // running 'randaut 0' is one way to generate automata using no

View file

@ -74,14 +74,14 @@ static const argp_option options[] =
{ {
// Keep this alphabetically sorted (expect for aliases). // Keep this alphabetically sorted (expect for aliases).
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Type of formula to generate:", 1 }, { nullptr, 0, nullptr, 0, "Type of formula to generate:", 1 },
{ "boolean", 'B', 0, 0, "generate Boolean formulas", 0 }, { "boolean", 'B', nullptr, 0, "generate Boolean formulas", 0 },
{ "ltl", 'L', 0, 0, "generate LTL formulas (default)", 0 }, { "ltl", 'L', nullptr, 0, "generate LTL formulas (default)", 0 },
{ "sere", 'S', 0, 0, "generate SERE", 0 }, { "sere", 'S', nullptr, 0, "generate SERE", 0 },
{ "psl", 'P', 0, 0, "generate PSL formulas", 0 }, { "psl", 'P', nullptr, 0, "generate PSL formulas", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Generation:", 2 }, { nullptr, 0, nullptr, 0, "Generation:", 2 },
{ "weak-fairness", OPT_WF, 0, 0, { "weak-fairness", OPT_WF, nullptr, 0,
"append some weak-fairness conditions", 0 }, "append some weak-fairness conditions", 0 },
{ "formulas", 'n', "INT", 0, "number of formulas to output (1)\n"\ { "formulas", 'n', "INT", 0, "number of formulas to output (1)\n"\
"use a negative value for unbounded generation", 0 }, "use a negative value for unbounded generation", 0 },
@ -90,14 +90,14 @@ static const argp_option options[] =
{ "tree-size", OPT_TREE_SIZE, "RANGE", 0, { "tree-size", OPT_TREE_SIZE, "RANGE", 0,
"tree size of the formulas generated, before mandatory "\ "tree size of the formulas generated, before mandatory "\
"trivial simplifications (15)", 0 }, "trivial simplifications (15)", 0 },
{ "allow-dups", OPT_DUPS, 0, 0, { "allow-dups", OPT_DUPS, nullptr, 0,
"allow duplicate formulas to be output", 0 }, "allow duplicate formulas to be output", 0 },
DECLARE_OPT_R, DECLARE_OPT_R,
RANGE_DOC, RANGE_DOC,
LEVEL_DOC(3), LEVEL_DOC(3),
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Adjusting probabilities:", 4 }, { nullptr, 0, nullptr, 0, "Adjusting probabilities:", 4 },
{ "dump-priorities", OPT_DUMP_PRIORITIES, 0, 0, { "dump-priorities", OPT_DUMP_PRIORITIES, nullptr, 0,
"show current priorities, do not generate any formula", 0 }, "show current priorities, do not generate any formula", 0 },
{ "ltl-priorities", OPT_LTL_PRIORITIES, "STRING", 0, { "ltl-priorities", OPT_LTL_PRIORITIES, "STRING", 0,
"set priorities for LTL formulas", 0 }, "set priorities for LTL formulas", 0 },
@ -105,36 +105,36 @@ static const argp_option options[] =
"set priorities for SERE formulas", 0 }, "set priorities for SERE formulas", 0 },
{ "boolean-priorities", OPT_BOOLEAN_PRIORITIES, "STRING", 0, { "boolean-priorities", OPT_BOOLEAN_PRIORITIES, "STRING", 0,
"set priorities for Boolean formulas", 0 }, "set priorities for Boolean formulas", 0 },
{ 0, 0, 0, 0, "STRING should be a comma-separated list of " { nullptr, 0, nullptr, 0, "STRING should be a comma-separated list of "
"assignments, assigning integer priorities to the tokens " "assignments, assigning integer priorities to the tokens "
"listed by --dump-priorities.", 0 }, "listed by --dump-priorities.", 0 },
/**************************************************/ /**************************************************/
{ 0, 0, 0, 0, "Output options:", -20 }, { nullptr, 0, nullptr, 0, "Output options:", -20 },
{ 0, 0, 0, 0, "The FORMAT string passed to --format may use "\ { nullptr, 0, nullptr, 0, "The FORMAT string passed to --format may use "
"the following interpreted sequences:", -19 }, "the following interpreted sequences:", -19 },
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula (in the selected syntax)", 0 }, "the formula (in the selected syntax)", 0 },
{ "%L", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the (serial) number of the formula", 0 }, "the (serial) number of the formula", 0 },
{ "%%", 0, 0, OPTION_DOC | OPTION_NO_USAGE, { "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"a single %", 0 }, "a single %", 0 },
{ 0, 0, 0, 0, "Miscellaneous options:", -1 }, { nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &output_argp, 0, 0, -20 }, { &output_argp, 0, nullptr, -20 },
{ &misc_argp, 0, 0, -1 }, { &misc_argp, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
spot::ltl::atomic_prop_set aprops; spot::ltl::atomic_prop_set aprops;
static int output = OUTPUTLTL; static int output = OUTPUTLTL;
static char* opt_pL = 0; static char* opt_pL = nullptr;
static char* opt_pS = 0; static char* opt_pS = nullptr;
static char* opt_pB = 0; static char* opt_pB = nullptr;
static bool opt_dump_priorities = false; static bool opt_dump_priorities = false;
static int opt_formulas = 1; static int opt_formulas = 1;
static int opt_seed = 0; static int opt_seed = 0;
@ -227,9 +227,9 @@ main(int argc, char** argv)
setup(argv); setup(argv);
const argp ap = { options, parse_opt, "N|PROP...", argp_program_doc, const argp ap = { options, parse_opt, "N|PROP...", argp_program_doc,
children, 0, 0 }; children, nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
// running 'randltl 0' is one way to generate formulas using no // running 'randltl 0' is one way to generate formulas using no
@ -300,7 +300,7 @@ main(int argc, char** argv)
} }
else else
{ {
output_formula_checked(f, 0, ++count); output_formula_checked(f, nullptr, ++count);
} }
}; };
} }

View file

@ -33,11 +33,11 @@ be passed to other algorithms in the future). These options are \
mostly used for benchmarking and debugging purpose. KEYR (without any \ mostly used for benchmarking and debugging purpose. KEYR (without any \
value) is a shorthand for KEY=1, while !KEY is a shorthand for KEY=0."; value) is a shorthand for KEY=1, while !KEY is a shorthand for KEY=0.";
#define DOC(NAME, TXT) NAME, 0, 0, OPTION_DOC | OPTION_NO_USAGE, TXT, 0 #define DOC(NAME, TXT) NAME, 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, TXT, 0
static const argp_option options[] = static const argp_option options[] =
{ {
{ 0, 0, 0, 0, "Translation options:", 0 }, { nullptr, 0, nullptr, 0, "Translation options:", 0 },
{ DOC("comp-susp", "Set to 1 to enable compositional suspension, \ { DOC("comp-susp", "Set to 1 to enable compositional suspension, \
as described in our SPIN'13 paper (see Bibliography below). Set to 2, \ as described in our SPIN'13 paper (see Bibliography below). Set to 2, \
to build only the skeleton TGBA without composing it. Set to 0 (the \ to build only the skeleton TGBA without composing it. Set to 0 (the \
@ -55,7 +55,7 @@ Set to 1 always WDBA-minimize the skeleton . Set to 2 to keep the WDBA \
only if it is smaller than the original skeleton. This option is only \ only if it is smaller than the original skeleton. This option is only \
used when comp-susp=1 and default to 1 or 2 depending on whether --small \ used when comp-susp=1 and default to 1 or 2 depending on whether --small \
or --deterministic is specified.") }, or --deterministic is specified.") },
{ 0, 0, 0, 0, "Postprocessing options:", 0 }, { nullptr, 0, nullptr, 0, "Postprocessing options:", 0 },
{ DOC("scc-filter", "Set to 1 (the default) to enable \ { DOC("scc-filter", "Set to 1 (the default) to enable \
SCC-pruning and acceptance simplification at the beginning of \ SCC-pruning and acceptance simplification at the beginning of \
post-processing. Transitions that are outside of accepting SCC are \ post-processing. Transitions that are outside of accepting SCC are \
@ -134,13 +134,13 @@ sets sat-minimize to 1 if not set differently.") },
"Set to 1 to instruct the SAT-minimization procedure to produce \ "Set to 1 to instruct the SAT-minimization procedure to produce \
a TGBA where all outgoing transition of a state have the same acceptance \ a TGBA where all outgoing transition of a state have the same acceptance \
sets. By default this is only enabled when option -B is used.") }, sets. By default this is only enabled when option -B is used.") },
{ 0, 0, 0, 0, 0, 0 } { nullptr, 0, nullptr, 0, nullptr, 0 }
}; };
const struct argp_child children[] = const struct argp_child children[] =
{ {
{ &misc_argp_hidden, 0, 0, -1 }, { &misc_argp_hidden, 0, nullptr, -1 },
{ 0, 0, 0, 0 } { nullptr, 0, nullptr, 0 }
}; };
int int
@ -148,9 +148,10 @@ main(int argc, char** argv)
{ {
setup(argv); setup(argv);
const argp ap = { options, 0, 0, argp_program_doc, children, 0, 0 }; const argp ap = { options, nullptr, nullptr, argp_program_doc, children,
nullptr, nullptr };
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, 0, 0)) if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err); exit(err);
std::cerr << "This binary serves no purpose other than generating" std::cerr << "This binary serves no purpose other than generating"

View file

@ -58,7 +58,7 @@ namespace spot
state_kripke::hash() const state_kripke::hash() const
{ {
return return
reinterpret_cast<const char*>(this) - static_cast<const char*>(0); reinterpret_cast<const char*>(this) - static_cast<const char*>(nullptr);
} }
state_kripke* state_kripke*

View file

@ -405,7 +405,7 @@ namespace spot
// std::unique(), because we must destroy() any formula we drop. // std::unique(), because we must destroy() any formula we drop.
// Also ignore neutral elements and handle absorbent elements. // Also ignore neutral elements and handle absorbent elements.
{ {
const fnode* last = 0; const fnode* last = nullptr;
vec::iterator i = v.begin(); vec::iterator i = v.begin();
bool weak_abs_seen = false; bool weak_abs_seen = false;
while (i != v.end()) while (i != v.end())

View file

@ -273,8 +273,8 @@ namespace spot
char* key = strtok(options, "=\t, :;"); char* key = strtok(options, "=\t, :;");
while (key) while (key)
{ {
char* value = strtok(0, "=\t, :;"); char* value = strtok(nullptr, "=\t, :;");
if (value == 0) if (!value)
return key; return key;
char* endptr; char* endptr;
@ -296,10 +296,10 @@ namespace spot
if (i == proba_size_) if (i == proba_size_)
return key; return key;
key = strtok(0, "=\t, :;"); key = strtok(nullptr, "=\t, :;");
} }
update_sums(); update_sums();
return 0; return nullptr;
} }
std::ostream& std::ostream&
@ -418,9 +418,9 @@ namespace spot
opt_wf_ = opts.get("wf", false); opt_wf_ = opts.get("wf", false);
opt_simpl_level_ = opts.get("simplification_level", 3); opt_simpl_level_ = opts.get("simplification_level", 3);
const char* tok_pL = 0; const char* tok_pL = nullptr;
const char* tok_pS = 0; const char* tok_pS = nullptr;
const char* tok_pB = 0; const char* tok_pB = nullptr;
switch (output_) switch (output_)
{ {

View file

@ -345,9 +345,9 @@ namespace spot
int output_; int output_;
random_formula* rf_ = 0; random_formula* rf_ = nullptr;
random_psl* rp_ = 0; random_psl* rp_ = nullptr;
random_sere* rs_ = 0; random_sere* rs_ = nullptr;
}; };
} }
} }

View file

@ -138,7 +138,7 @@ namespace spot
formula formula
relabel(formula f, relabeling_style style, relabeling_map* m) relabel(formula f, relabeling_style style, relabeling_map* m)
{ {
ap_generator* gen = 0; ap_generator* gen = nullptr;
switch (style) switch (style)
{ {
case Pnn: case Pnn:
@ -470,7 +470,7 @@ namespace spot
// Relabel the formula recursively, stopping // Relabel the formula recursively, stopping
// at cut-points or atomic propositions. // at cut-points or atomic propositions.
ap_generator* gen = 0; ap_generator* gen = nullptr;
switch (style) switch (style)
{ {
case Pnn: case Pnn:

View file

@ -38,7 +38,7 @@ namespace spot
/// between the new names (keys) and the old names (values). /// between the new names (keys) and the old names (values).
SPOT_API SPOT_API
formula relabel(formula f, relabeling_style style, formula relabel(formula f, relabeling_style style,
relabeling_map* m = 0); relabeling_map* m = nullptr);
/// \ingroup ltl_rewriting /// \ingroup ltl_rewriting
@ -49,6 +49,6 @@ namespace spot
/// between the new names (keys) and the old names (values). /// between the new names (keys) and the old names (values).
SPOT_API SPOT_API
formula relabel_bse(formula f, relabeling_style style, formula relabel_bse(formula f, relabeling_style style,
relabeling_map* m = 0); relabeling_map* m = nullptr);
} }
} }

View file

@ -265,7 +265,7 @@ namespace spot
{ {
f2f_map::const_iterator i = simplified_.find(f); f2f_map::const_iterator i = simplified_.find(f);
if (i == simplified_.end()) if (i == simplified_.end())
return 0; return nullptr;
return i->second; return i->second;
} }
@ -1985,7 +1985,7 @@ namespace spot
{ {
xset.insert(c); xset.insert(c);
} }
res[n] = 0; res[n] = nullptr;
} }
// Make a second pass to check if the "a" // Make a second pass to check if the "a"
// terms can be used to simplify "Xa W b", // terms can be used to simplify "Xa W b",
@ -2044,7 +2044,7 @@ namespace spot
} }
else if (tokill[n]) else if (tokill[n])
{ {
res[n] = 0; res[n] = nullptr;
} }
} }

View file

@ -49,10 +49,10 @@ namespace spot
/// \param sere the SERE to rewrite /// \param sere the SERE to rewrite
/// \param cache an optional cache /// \param cache an optional cache
SPOT_API formula SPOT_API formula
star_normal_form(formula sere, snf_cache* cache = 0); star_normal_form(formula sere, snf_cache* cache = nullptr);
/// A variant of star_normal_form() for r[*0..j] where j < ω. /// A variant of star_normal_form() for r[*0..j] where j < ω.
SPOT_API formula SPOT_API formula
star_normal_form_bounded(formula sere, snf_cache* cache = 0); star_normal_form_bounded(formula sere, snf_cache* cache = nullptr);
} }
} }

View file

@ -33,7 +33,8 @@ namespace spot
public: public:
/// Create a pool allocating objects of \a size bytes. /// Create a pool allocating objects of \a size bytes.
fixed_size_pool(size_t size) fixed_size_pool(size_t size)
: freelist_(0), free_start_(0), free_end_(0), chunklist_(0) : freelist_(nullptr), free_start_(nullptr),
free_end_(nullptr), chunklist_(nullptr)
{ {
const size_t alignement = 2 * sizeof(size_t); const size_t alignement = 2 * sizeof(size_t);
size_ = ((size >= sizeof(block_) ? size : sizeof(block_)) size_ = ((size >= sizeof(block_) ? size : sizeof(block_))

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2008, 2011, 2014 Laboratoire de Recherche et // Copyright (C) 2008, 2011, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
@ -49,7 +49,7 @@ namespace spot
size_t operator()(const T* p) const size_t operator()(const T* p) const
{ {
return knuth32_hash(reinterpret_cast<const char*>(p) return knuth32_hash(reinterpret_cast<const char*>(p)
- static_cast<const char*>(0)); - static_cast<const char*>(nullptr));
} }
}; };

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013 Laboratoire de Recherche et Developpement // Copyright (C) 2011, 2013, 2015 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE) // de l'Epita (LRDE)
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -35,7 +35,7 @@ namespace spot
public: public:
/// Create a pool. /// Create a pool.
multiple_size_pool() multiple_size_pool()
: free_start_(0), free_end_(0), chunklist_(0) : free_start_(nullptr), free_end_(nullptr), chunklist_(nullptr)
{ {
} }

View file

@ -38,7 +38,7 @@ namespace spot
++options; ++options;
// `!foo' is a shorthand for `foo=0'. // `!foo' is a shorthand for `foo=0'.
const char* negated = 0; const char* negated = nullptr;
if (*options == '!') if (*options == '!')
{ {
// Skip spaces. // Skip spaces.
@ -124,7 +124,7 @@ namespace spot
} }
} }
} }
return 0; return nullptr;
} }
int int

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et Développement
// de l'Epita. // de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -123,7 +123,7 @@ namespace spot
} }
satsolver::satsolver() satsolver::satsolver()
: cnf_tmp_(0), cnf_stream_(0) : cnf_tmp_(nullptr), cnf_stream_(nullptr)
{ {
start(); start();
} }
@ -151,7 +151,7 @@ namespace spot
satsolver::get_solution() satsolver::get_solution()
{ {
delete cnf_stream_; // Close the file. delete cnf_stream_; // Close the file.
cnf_stream_ = 0; cnf_stream_ = nullptr;
temporary_file* output = create_tmpfile("sat-", ".out"); temporary_file* output = create_tmpfile("sat-", ".out");
solution_pair p; solution_pair p;

View file

@ -122,7 +122,7 @@ namespace spot
int fd = create_temporary_file(prefix, suffix, &name); int fd = create_temporary_file(prefix, suffix, &name);
if (close(fd)) if (close(fd))
throw std::runtime_error(std::string("failed to close ") + name); throw std::runtime_error(std::string("failed to close ") + name);
temporary_file::cleanpos_t cp = to_clean.insert(to_clean.end(), 0); auto cp = to_clean.insert(to_clean.end(), nullptr);
*cp = new temporary_file(name, cp); *cp = new temporary_file(name, cp);
return *cp; return *cp;
} }
@ -133,7 +133,7 @@ namespace spot
{ {
char* name; char* name;
int fd = create_temporary_file(prefix, suffix, &name); int fd = create_temporary_file(prefix, suffix, &name);
open_temporary_file::cleanpos_t cp = to_clean.insert(to_clean.end(), 0); auto cp = to_clean.insert(to_clean.end(), nullptr);
open_temporary_file* otf = new open_temporary_file(name, cp, fd); open_temporary_file* otf = new open_temporary_file(name, cp, fd);
*cp = otf; *cp = otf;
return otf; return otf;

View file

@ -109,7 +109,7 @@ namespace spot
/// The temporary file is created and left empty. If you need /// The temporary file is created and left empty. If you need
/// to fill it, consider using create_open_tmpfile() instead. /// to fill it, consider using create_open_tmpfile() instead.
SPOT_API temporary_file* SPOT_API temporary_file*
create_tmpfile(const char* prefix, const char* suffix = 0) create_tmpfile(const char* prefix, const char* suffix = nullptr)
throw(std::bad_alloc, std::runtime_error); throw(std::bad_alloc, std::runtime_error);
/// \brief Create a temporary file and leave it open for writing. /// \brief Create a temporary file and leave it open for writing.
@ -117,7 +117,7 @@ namespace spot
/// Same as create_tmpfile, be leave the file open for writing. The /// Same as create_tmpfile, be leave the file open for writing. The
/// open_temporary_file::fd() method returns the file descriptor. /// open_temporary_file::fd() method returns the file descriptor.
SPOT_API open_temporary_file* SPOT_API open_temporary_file*
create_open_tmpfile(const char* prefix, const char* suffix = 0) create_open_tmpfile(const char* prefix, const char* suffix = nullptr)
throw(std::bad_alloc, std::runtime_error); throw(std::bad_alloc, std::runtime_error);
/// \brief Delete all temporary files. /// \brief Delete all temporary files.

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2007, 2011, 2014 Laboratoire de Recherche et // Copyright (C) 2007, 2011, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de // Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
@ -54,7 +54,7 @@ namespace spot
// Disable the default GC handler. (Note that this will only be // Disable the default GC handler. (Note that this will only be
// done if Buddy is initialized by Spot. Otherwise we prefer not // done if Buddy is initialized by Spot. Otherwise we prefer not
// to overwrite a handler that might have been set by the user.) // to overwrite a handler that might have been set by the user.)
bdd_gbc_hook(0); bdd_gbc_hook(nullptr);
// When the node time is full, add 500000 nodes, i.e., 10MB. // When the node time is full, add 500000 nodes, i.e., 10MB.
bdd_setmaxincrease(500000); bdd_setmaxincrease(500000);
} }

View file

@ -105,7 +105,7 @@ namespace spot
virtual spot::state* virtual spot::state*
get_artificial_initial_state() const get_artificial_initial_state() const
{ {
return 0; return nullptr;
} }
/// \brief Get an iterator over the successors of \a state. /// \brief Get an iterator over the successors of \a state.

View file

@ -117,26 +117,21 @@ namespace spot
transitions_by_condition.find(condition.id()); transitions_by_condition.find(condition.id());
if (i == transitions_by_condition.end()) if (i == transitions_by_condition.end())
{ return nullptr;
return 0;
}
else else
{ return i->second;
return i->second;
}
} }
void void
state_ta_explicit::add_transition(state_ta_explicit::transition* t, state_ta_explicit::add_transition(state_ta_explicit::transition* t,
bool add_at_beginning) bool add_at_beginning)
{ {
if (transitions_ == 0) if (!transitions_)
transitions_ = new transitions; transitions_ = new transitions;
transitions* trans_by_condition = get_transitions(t->condition); transitions* trans_by_condition = get_transitions(t->condition);
if (trans_by_condition == 0) if (!trans_by_condition)
{ {
trans_by_condition = new transitions; trans_by_condition = new transitions;
transitions_by_condition[(t->condition).id()] = trans_by_condition; transitions_by_condition[(t->condition).id()] = trans_by_condition;
@ -229,7 +224,7 @@ namespace spot
state_ta_explicit::is_hole_state() const state_ta_explicit::is_hole_state() const
{ {
state_ta_explicit::transitions* trans = get_transitions(); state_ta_explicit::transitions* trans = get_transitions();
return trans == 0 || trans->empty(); return !trans || trans->empty();
} }
int int
@ -240,7 +235,7 @@ namespace spot
int compare_value = tgba_state_->compare(o->tgba_state_); int compare_value = tgba_state_->compare(o->tgba_state_);
if (compare_value != 0) if (compare_value)
return compare_value; return compare_value;
compare_value = tgba_condition_.id() - o->tgba_condition_.id(); compare_value = tgba_condition_.id() - o->tgba_condition_.id();
@ -275,7 +270,7 @@ namespace spot
state_ta_explicit::transitions* trans = get_transitions(); state_ta_explicit::transitions* trans = get_transitions();
state_ta_explicit::transitions::iterator it_trans; state_ta_explicit::transitions::iterator it_trans;
if (trans != 0) if (trans)
for (it_trans = trans->begin(); it_trans != trans->end();) for (it_trans = trans->begin(); it_trans != trans->end();)
{ {
state_ta_explicit* dest = (*it_trans)->dest; state_ta_explicit* dest = (*it_trans)->dest;
@ -301,7 +296,7 @@ namespace spot
//remove hole successors states //remove hole successors states
state_ta_explicit::transitions* dest_trans = state_ta_explicit::transitions* dest_trans =
(dest)->get_transitions(); (dest)->get_transitions();
bool dest_trans_empty = dest_trans == 0 || dest_trans->empty(); bool dest_trans_empty = !dest_trans || dest_trans->empty();
if (is_stuttering_transition || (dest_trans_empty if (is_stuttering_transition || (dest_trans_empty
&& (!dest_is_livelock_accepting))) && (!dest_is_livelock_accepting)))
{ {
@ -324,7 +319,7 @@ namespace spot
state_ta_explicit::transitions::iterator it_trans; state_ta_explicit::transitions::iterator it_trans;
// We don't destroy the transitions in the state's destructor because // We don't destroy the transitions in the state's destructor because
// they are not cloned. // they are not cloned.
if (trans != 0) if (trans)
for (it_trans = trans->begin(); it_trans != trans->end(); ++it_trans) for (it_trans = trans->begin(); it_trans != trans->end(); ++it_trans)
{ {
delete *it_trans; delete *it_trans;
@ -339,7 +334,7 @@ namespace spot
++i; ++i;
} }
transitions_ = 0; transitions_ = nullptr;
} }
//////////////////////////////////////// ////////////////////////////////////////
@ -356,7 +351,7 @@ namespace spot
get_dict()->register_all_variables_of(&tgba_, this); get_dict()->register_all_variables_of(&tgba_, this);
acc().add_sets(n_acc); acc().add_sets(n_acc);
acc().set_generalized_buchi(); acc().set_generalized_buchi();
if (artificial_initial_state != 0) if (artificial_initial_state)
{ {
state_ta_explicit* is = add_state(artificial_initial_state); state_ta_explicit* is = add_state(artificial_initial_state);
assert(is == artificial_initial_state); assert(is == artificial_initial_state);
@ -396,7 +391,7 @@ namespace spot
condition = get_state_condition(s); condition = get_state_condition(s);
std::pair<ta::states_set_t::iterator, bool> add_state = std::pair<ta::states_set_t::iterator, bool> add_state =
initial_states_set_.insert(s); initial_states_set_.insert(s);
if (get_artificial_initial_state() != 0) if (get_artificial_initial_state())
if (add_state.second) if (add_state.second)
{ {
state_ta_explicit* i = state_ta_explicit* i =
@ -524,7 +519,7 @@ namespace spot
state_ta_explicit::transitions* trans = source->get_transitions(); state_ta_explicit::transitions* trans = source->get_transitions();
state_ta_explicit::transitions::iterator it_trans; state_ta_explicit::transitions::iterator it_trans;
if (trans != 0) if (trans)
for (it_trans = trans->begin(); it_trans != trans->end();) for (it_trans = trans->begin(); it_trans != trans->end();)
{ {
if (source->get_tgba_condition() if (source->get_tgba_condition()

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// et Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -42,7 +42,7 @@ namespace spot
public: public:
ta_explicit(const const_twa_ptr& tgba, ta_explicit(const const_twa_ptr& tgba,
unsigned n_acc, unsigned n_acc,
state_ta_explicit* artificial_initial_state = 0); state_ta_explicit* artificial_initial_state = nullptr);
const_twa_ptr const_twa_ptr
get_tgba() const; get_tgba() const;
@ -145,8 +145,10 @@ namespace spot
typedef std::list<transition*> transitions; typedef std::list<transition*> transitions;
state_ta_explicit(const state* tgba_state, const bdd tgba_condition, state_ta_explicit(const state* tgba_state, const bdd tgba_condition,
bool is_initial_state = false, bool is_accepting_state = false, bool is_initial_state = false,
bool is_livelock_accepting_state = false, transitions* trans = 0) : bool is_accepting_state = false,
bool is_livelock_accepting_state = false,
transitions* trans = nullptr) :
tgba_state_(tgba_state), tgba_condition_(tgba_condition), tgba_state_(tgba_state), tgba_condition_(tgba_condition),
is_initial_state_(is_initial_state), is_accepting_state_( is_initial_state_(is_initial_state), is_accepting_state_(
is_accepting_state), is_livelock_accepting_state_( is_accepting_state), is_livelock_accepting_state_(
@ -252,10 +254,10 @@ namespace spot
typedef std::shared_ptr<ta_explicit> ta_explicit_ptr; typedef std::shared_ptr<ta_explicit> ta_explicit_ptr;
typedef std::shared_ptr<const ta_explicit> const_ta_explicit_ptr; typedef std::shared_ptr<const ta_explicit> const_ta_explicit_ptr;
inline ta_explicit_ptr make_ta_explicit(const const_twa_ptr& tgba, inline ta_explicit_ptr
unsigned n_acc, make_ta_explicit(const const_twa_ptr& tgba,
state_ta_explicit* unsigned n_acc,
artificial_initial_state = 0) state_ta_explicit* artificial_initial_state = nullptr)
{ {
return std::make_shared<ta_explicit>(tgba, n_acc, artificial_initial_state); return std::make_shared<ta_explicit>(tgba, n_acc, artificial_initial_state);
} }

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2011, 2012, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -74,18 +74,18 @@ namespace spot
kripke_source_condition = kripke_->state_condition(s->get_kripke_state()); kripke_source_condition = kripke_->state_condition(s->get_kripke_state());
kripke_succ_it_ = kripke_->succ_iter(s->get_kripke_state()); kripke_succ_it_ = kripke_->succ_iter(s->get_kripke_state());
kripke_current_dest_state = 0; kripke_current_dest_state = nullptr;
ta_succ_it_ = 0; ta_succ_it_ = nullptr;
current_state_ = 0; current_state_ = nullptr;
} }
ta_succ_iterator_product::~ta_succ_iterator_product() ta_succ_iterator_product::~ta_succ_iterator_product()
{ {
delete current_state_; delete current_state_;
current_state_ = 0; current_state_ = nullptr;
delete ta_succ_it_; delete ta_succ_it_;
delete kripke_succ_it_; delete kripke_succ_it_;
if (kripke_current_dest_state != 0) if (kripke_current_dest_state)
kripke_current_dest_state->destroy(); kripke_current_dest_state->destroy();
} }
@ -97,7 +97,7 @@ namespace spot
if (ta_succ_it_->done()) if (ta_succ_it_->done())
{ {
delete ta_succ_it_; delete ta_succ_it_;
ta_succ_it_ = 0; ta_succ_it_ = nullptr;
next_kripke_dest(); next_kripke_dest();
} }
} }
@ -108,14 +108,14 @@ namespace spot
if (!kripke_succ_it_) if (!kripke_succ_it_)
return; return;
if (kripke_current_dest_state == 0) if (!kripke_current_dest_state)
{ {
kripke_succ_it_->first(); kripke_succ_it_->first();
} }
else else
{ {
kripke_current_dest_state->destroy(); kripke_current_dest_state->destroy();
kripke_current_dest_state = 0; kripke_current_dest_state = nullptr;
kripke_succ_it_->next(); kripke_succ_it_->next();
} }
@ -126,7 +126,7 @@ namespace spot
if (kripke_succ_it_->done()) if (kripke_succ_it_->done())
{ {
delete kripke_succ_it_; delete kripke_succ_it_;
kripke_succ_it_ = 0; kripke_succ_it_ = nullptr;
return; return;
} }
@ -165,7 +165,7 @@ namespace spot
ta_succ_iterator_product::next() ta_succ_iterator_product::next()
{ {
delete current_state_; delete current_state_;
current_state_ = 0; current_state_ = nullptr;
if (is_stuttering_transition()) if (is_stuttering_transition())
{ {
next_kripke_dest(); next_kripke_dest();
@ -275,7 +275,7 @@ namespace spot
spot::state* artificial_initial_state = spot::state* artificial_initial_state =
ta_->get_artificial_initial_state(); ta_->get_artificial_initial_state();
if (artificial_initial_state != 0) if (artificial_initial_state)
{ {
ta_succ_iterator* ta_init_it_ = ta_->succ_iter( ta_succ_iterator* ta_init_it_ = ta_->succ_iter(
artificial_initial_state, kripke_init_state_condition); artificial_initial_state, kripke_init_state_condition);
@ -294,8 +294,8 @@ namespace spot
for (it = ta_init_states_set.begin(); it != ta_init_states_set.end(); ++it) for (it = ta_init_states_set.begin(); it != ta_init_states_set.end(); ++it)
{ {
if ((artificial_initial_state != 0) || (kripke_init_state_condition if (artificial_initial_state ||
== ta_->get_state_condition(*it))) (kripke_init_state_condition == ta_->get_state_condition(*it)))
{ {
state_ta_product* stp = new state_ta_product((*it), state_ta_product* stp = new state_ta_product((*it),
kripke_init_state->clone()); kripke_init_state->clone());
@ -422,14 +422,14 @@ namespace spot
if (!kripke_succ_it_) if (!kripke_succ_it_)
return; return;
if (kripke_current_dest_state == 0) if (!kripke_current_dest_state)
{ {
kripke_succ_it_->first(); kripke_succ_it_->first();
} }
else else
{ {
kripke_current_dest_state->destroy(); kripke_current_dest_state->destroy();
kripke_current_dest_state = 0; kripke_current_dest_state = nullptr;
kripke_succ_it_->next(); kripke_succ_it_->next();
} }
@ -440,7 +440,7 @@ namespace spot
if (kripke_succ_it_->done()) if (kripke_succ_it_->done())
{ {
delete kripke_succ_it_; delete kripke_succ_it_;
kripke_succ_it_ = 0; kripke_succ_it_ = nullptr;
return; return;
} }

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
// et Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -66,10 +66,9 @@ namespace spot
typedef std::shared_ptr<tgta_explicit> tgta_explicit_ptr; typedef std::shared_ptr<tgta_explicit> tgta_explicit_ptr;
typedef std::shared_ptr<const tgta_explicit> const_tgta_explicit_ptr; typedef std::shared_ptr<const tgta_explicit> const_tgta_explicit_ptr;
inline tgta_explicit_ptr make_tgta_explicit(const const_twa_ptr& tgba, inline tgta_explicit_ptr
unsigned n_acc, make_tgta_explicit(const const_twa_ptr& tgba, unsigned n_acc,
state_ta_explicit* state_ta_explicit* artificial_initial_state = nullptr)
artificial_initial_state = 0)
{ {
return std::make_shared<tgta_explicit>(tgba, n_acc, return std::make_shared<tgta_explicit>(tgba, n_acc,
artificial_initial_state); artificial_initial_state);

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et
// de l Epita (LRDE). // Développement de l Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -81,11 +81,11 @@ namespace spot
state * tgta_init_state = tgta_->get_init_state(); state * tgta_init_state = tgta_->get_init_state();
if ((s->right())->compare(tgta_init_state) == 0) if ((s->right())->compare(tgta_init_state) == 0)
source_ = 0; source_ = nullptr;
if (source_ == 0) if (!source_)
{ {
kripke_succ_it_ = 0; kripke_succ_it_ = nullptr;
kripke_current_dest_state = kripke_->get_init_state(); kripke_current_dest_state = kripke_->get_init_state();
current_condition_ current_condition_
= kripke_->state_condition(kripke_current_dest_state); = kripke_->state_condition(kripke_current_dest_state);
@ -101,23 +101,23 @@ namespace spot
{ {
kripke_source_condition = kripke_->state_condition(s->left()); kripke_source_condition = kripke_->state_condition(s->left());
kripke_succ_it_ = kripke_->succ_iter(s->left()); kripke_succ_it_ = kripke_->succ_iter(s->left());
kripke_current_dest_state = 0; kripke_current_dest_state = nullptr;
tgta_succ_it_ = 0; tgta_succ_it_ = nullptr;
} }
tgta_init_state->destroy(); tgta_init_state->destroy();
current_state_ = 0; current_state_ = nullptr;
} }
tgta_succ_iterator_product::~tgta_succ_iterator_product() tgta_succ_iterator_product::~tgta_succ_iterator_product()
{ {
// ta_->free_state(current_state_); // ta_->free_state(current_state_);
if (current_state_ != 0) if (current_state_)
current_state_->destroy(); current_state_->destroy();
current_state_ = 0; current_state_ = nullptr;
delete tgta_succ_it_; delete tgta_succ_it_;
delete kripke_succ_it_; delete kripke_succ_it_;
if (kripke_current_dest_state != 0) if (kripke_current_dest_state)
kripke_current_dest_state->destroy(); kripke_current_dest_state->destroy();
} }
@ -129,7 +129,7 @@ namespace spot
if (tgta_succ_it_->done()) if (tgta_succ_it_->done())
{ {
delete tgta_succ_it_; delete tgta_succ_it_;
tgta_succ_it_ = 0; tgta_succ_it_ = nullptr;
next_kripke_dest(); next_kripke_dest();
} }
} }
@ -140,14 +140,14 @@ namespace spot
if (!kripke_succ_it_) if (!kripke_succ_it_)
return; return;
if (kripke_current_dest_state == 0) if (!kripke_current_dest_state)
{ {
kripke_succ_it_->first(); kripke_succ_it_->first();
} }
else else
{ {
kripke_current_dest_state->destroy(); kripke_current_dest_state->destroy();
kripke_current_dest_state = 0; kripke_current_dest_state = nullptr;
kripke_succ_it_->next(); kripke_succ_it_->next();
} }
@ -158,7 +158,7 @@ namespace spot
if (kripke_succ_it_->done()) if (kripke_succ_it_->done())
{ {
delete kripke_succ_it_; delete kripke_succ_it_;
kripke_succ_it_ = 0; kripke_succ_it_ = nullptr;
return; return;
} }
@ -187,7 +187,7 @@ namespace spot
tgta_succ_iterator_product::next() tgta_succ_iterator_product::next()
{ {
current_state_->destroy(); current_state_->destroy();
current_state_ = 0; current_state_ = nullptr;
step_(); step_();
@ -219,7 +219,7 @@ namespace spot
bool bool
tgta_succ_iterator_product::done() const tgta_succ_iterator_product::done() const
{ {
if (source_ == 0) if (!source_)
{ {
return !tgta_succ_it_ || tgta_succ_it_->done(); return !tgta_succ_it_ || tgta_succ_it_->done();
} }

View file

@ -106,7 +106,7 @@ namespace spot
bdd tgba_condition = bddtrue; bdd tgba_condition = bddtrue;
bool is_initial_state = a->is_initial_state(src); bool is_initial_state = a->is_initial_state(src);
if ((a->get_artificial_initial_state() == 0) && is_initial_state) if (!a->get_artificial_initial_state() && is_initial_state)
tgba_condition = a->get_state_condition(src); tgba_condition = a->get_state_condition(src);
bool is_accepting_state = a->is_accepting_state(src); bool is_accepting_state = a->is_accepting_state(src);
bool is_livelock_accepting_state = bool is_livelock_accepting_state =
@ -124,7 +124,7 @@ namespace spot
{ {
delete new_src; delete new_src;
} }
else if (a->get_artificial_initial_state() != 0) else if (a->get_artificial_initial_state())
{ {
if (a->get_artificial_initial_state() == src) if (a->get_artificial_initial_state() == src)
result->set_artificial_initial_state(new_src); result->set_artificial_initial_state(new_src);
@ -146,7 +146,7 @@ namespace spot
bdd tgba_condition = bddtrue; bdd tgba_condition = bddtrue;
is_initial_state = a->is_initial_state(dst); is_initial_state = a->is_initial_state(dst);
if ((a->get_artificial_initial_state() == 0) && is_initial_state) if (!a->get_artificial_initial_state() && is_initial_state)
tgba_condition = a->get_state_condition(dst); tgba_condition = a->get_state_condition(dst);
bool is_accepting_state = a->is_accepting_state(dst); bool is_accepting_state = a->is_accepting_state(dst);
bool is_livelock_accepting_state = bool is_livelock_accepting_state =
@ -165,7 +165,7 @@ namespace spot
{ {
delete new_dst; delete new_dst;
} }
else if (a->get_artificial_initial_state() != 0) else if (a->get_artificial_initial_state())
{ {
if (a->get_artificial_initial_state() == dst) if (a->get_artificial_initial_state() == dst)
result->set_artificial_initial_state(new_dst); result->set_artificial_initial_state(new_dst);
@ -238,7 +238,7 @@ namespace spot
const state* s = *it; const state* s = *it;
if (s == artificial_initial_state) if (s == artificial_initial_state)
I->insert(s); I->insert(s);
else if (artificial_initial_state == 0 && ta_->is_initial_state(s)) else if (!artificial_initial_state && ta_->is_initial_state(s))
I->insert(s); I->insert(s);
else if (ta_->is_livelock_accepting_state(s) else if (ta_->is_livelock_accepting_state(s)
&& ta_->is_accepting_state(s)) && ta_->is_accepting_state(s))
@ -508,7 +508,7 @@ namespace spot
{ {
auto tgba = make_twa_graph(ta_->get_dict()); auto tgba = make_twa_graph(ta_->get_dict());
auto res = make_ta_explicit(tgba, ta_->acc().num_sets(), 0); auto res = make_ta_explicit(tgba, ta_->acc().num_sets(), nullptr);
partition_t partition = build_partition(ta_); partition_t partition = build_partition(ta_);
@ -528,7 +528,7 @@ namespace spot
{ {
auto tgba = make_twa_graph(tgta_->get_dict()); auto tgba = make_twa_graph(tgta_->get_dict());
auto res = make_tgta_explicit(tgba, tgta_->acc().num_sets(), 0); auto res = make_tgta_explicit(tgba, tgta_->acc().num_sets(), nullptr);
auto ta = tgta_->get_ta(); auto ta = tgta_->get_ta();

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2012, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2010, 2012, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -57,7 +57,7 @@ namespace spot
ta::states_set_t::const_iterator it; ta::states_set_t::const_iterator it;
if (artificial_initial_state != 0) if (artificial_initial_state)
{ {
init_states_set.insert(artificial_initial_state); init_states_set.insert(artificial_initial_state);
} }
@ -153,7 +153,7 @@ namespace spot
ta_reachable_iterator_depth_first::next_state() ta_reachable_iterator_depth_first::next_state()
{ {
if (todo.empty()) if (todo.empty())
return 0; return nullptr;
const state* s = todo.top(); const state* s = todo.top();
todo.pop(); todo.pop();
return s; return s;
@ -178,7 +178,7 @@ namespace spot
ta_reachable_iterator_breadth_first::next_state() ta_reachable_iterator_breadth_first::next_state()
{ {
if (todo.empty()) if (todo.empty())
return 0; return nullptr;
const state* s = todo.front(); const state* s = todo.front();
todo.pop_front(); todo.pop_front();
return s; return s;

View file

@ -47,10 +47,10 @@ namespace spot
static void static void
transform_to_single_pass_automaton transform_to_single_pass_automaton
(const ta_explicit_ptr& testing_automata, (const ta_explicit_ptr& testing_automata,
state_ta_explicit* artificial_livelock_acc_state = 0) state_ta_explicit* artificial_livelock_acc_state = nullptr)
{ {
if (artificial_livelock_acc_state != 0) if (artificial_livelock_acc_state)
{ {
state_ta_explicit* artificial_livelock_acc_state_added = state_ta_explicit* artificial_livelock_acc_state_added =
testing_automata->add_state(artificial_livelock_acc_state); testing_automata->add_state(artificial_livelock_acc_state);
@ -78,14 +78,14 @@ namespace spot
state_ta_explicit::transitions* trans = source->get_transitions(); state_ta_explicit::transitions* trans = source->get_transitions();
state_ta_explicit::transitions::iterator it_trans; state_ta_explicit::transitions::iterator it_trans;
if (trans != 0) if (trans)
for (it_trans = trans->begin(); it_trans != trans->end();) for (it_trans = trans->begin(); it_trans != trans->end();)
{ {
state_ta_explicit* dest = (*it_trans)->dest; state_ta_explicit* dest = (*it_trans)->dest;
state_ta_explicit::transitions* dest_trans = state_ta_explicit::transitions* dest_trans =
(dest)->get_transitions(); (dest)->get_transitions();
bool dest_trans_empty = dest_trans == 0 || dest_trans->empty(); bool dest_trans_empty = !dest_trans || dest_trans->empty();
//select transitions where a destination is a livelock state //select transitions where a destination is a livelock state
// which isn't a Buchi accepting state and has successors // which isn't a Buchi accepting state and has successors
@ -101,7 +101,7 @@ namespace spot
++it_trans; ++it_trans;
} }
if (transitions_to_livelock_states != 0) if (transitions_to_livelock_states)
{ {
state_ta_explicit::transitions::iterator it_trans; state_ta_explicit::transitions::iterator it_trans;
@ -109,7 +109,7 @@ namespace spot
it_trans != transitions_to_livelock_states->end(); it_trans != transitions_to_livelock_states->end();
++it_trans) ++it_trans)
{ {
if (artificial_livelock_acc_state != 0) if (artificial_livelock_acc_state)
{ {
testing_automata->create_transition testing_automata->create_transition
(source, (source,
@ -136,7 +136,7 @@ namespace spot
state_ta_explicit* state = static_cast<state_ta_explicit*> (*it); state_ta_explicit* state = static_cast<state_ta_explicit*> (*it);
state_ta_explicit::transitions* state_trans = state_ta_explicit::transitions* state_trans =
(state)->get_transitions(); (state)->get_transitions();
bool state_trans_empty = state_trans == 0 || state_trans->empty(); bool state_trans_empty = !state_trans || state_trans->empty();
if (state->is_livelock_accepting_state() if (state->is_livelock_accepting_state()
&& (!state->is_accepting_state()) && (!state_trans_empty)) && (!state->is_accepting_state()) && (!state_trans_empty))
@ -274,7 +274,6 @@ namespace spot
assert(!arc.empty()); assert(!arc.empty());
sscc.pop(); sscc.pop();
arc.pop(); arc.pop();
} }
// automata reduction // automata reduction
@ -396,8 +395,7 @@ namespace spot
} }
if ((artificial_livelock_acc_state != 0) if (artificial_livelock_acc_state || single_pass_emptiness_check)
|| single_pass_emptiness_check)
transform_to_single_pass_automaton(testing_aut, transform_to_single_pass_automaton(testing_aut,
artificial_livelock_acc_state); artificial_livelock_acc_state);
} }
@ -517,7 +515,7 @@ namespace spot
if (no_livelock) if (no_livelock)
return ta; return ta;
state_ta_explicit* artificial_livelock_acc_state = 0; state_ta_explicit* artificial_livelock_acc_state = nullptr;
trace << "*** build_ta: artificial_livelock_acc_state_mode = ***" trace << "*** build_ta: artificial_livelock_acc_state_mode = ***"
<< artificial_livelock_state_mode << std::endl; << artificial_livelock_state_mode << std::endl;
@ -527,7 +525,7 @@ namespace spot
single_pass_emptiness_check = true; single_pass_emptiness_check = true;
artificial_livelock_acc_state = artificial_livelock_acc_state =
new state_ta_explicit(ta->get_tgba()->get_init_state(), bddtrue, new state_ta_explicit(ta->get_tgba()->get_init_state(), bddtrue,
false, false, true, 0); false, false, true, nullptr);
trace trace
<< "*** build_ta: artificial_livelock_acc_state = ***" << "*** build_ta: artificial_livelock_acc_state = ***"
<< artificial_livelock_acc_state << std::endl; << artificial_livelock_acc_state << std::endl;
@ -638,7 +636,7 @@ namespace spot
state_ta_explicit::transitions* trans = state->get_transitions(); state_ta_explicit::transitions* trans = state->get_transitions();
if (state->is_livelock_accepting_state()) if (state->is_livelock_accepting_state())
{ {
bool trans_empty = (trans == 0 || trans->empty()); bool trans_empty = !trans || trans->empty();
if (trans_empty || state->is_accepting_state()) if (trans_empty || state->is_accepting_state())
{ {
ta->create_transition(state, bdd_stutering_transition, ta->create_transition(state, bdd_stutering_transition,

View file

@ -49,7 +49,7 @@ void usage(const char* prog)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
char *file = 0; char *file = nullptr;
bool print_safra = false; bool print_safra = false;
bool print_automaton = false; bool print_automaton = false;
//bool check = false; //bool check = false;
@ -110,7 +110,7 @@ int main(int argc, char* argv[])
file = argv[i]; file = argv[i];
} }
if (file == 0) if (!file)
{ {
usage(argv[0]); usage(argv[0]);
return 1; return 1;
@ -126,7 +126,7 @@ int main(int argc, char* argv[])
return 2; return 2;
spot::twa_graph_ptr a = h->aut; spot::twa_graph_ptr a = h->aut;
spot::twa_ptr complement = 0; spot::twa_ptr complement = nullptr;
complement = spot::make_safra_complement(a); complement = spot::make_safra_complement(a);
@ -154,7 +154,7 @@ int main(int argc, char* argv[])
return 2; return 2;
auto a = spot::ltl_to_tgba_fm(f1, dict); auto a = spot::ltl_to_tgba_fm(f1, dict);
spot::twa_ptr complement = 0; spot::twa_ptr complement = nullptr;
complement = spot::make_safra_complement(a); complement = spot::make_safra_complement(a);
spot::print_dot(std::cout, complement); spot::print_dot(std::cout, complement);

View file

@ -332,8 +332,8 @@ checked_main(int argc, char** argv)
bool degen_cache = true; bool degen_cache = true;
int output = 0; int output = 0;
int formula_index = 0; int formula_index = 0;
const char* echeck_algo = 0; const char* echeck_algo = nullptr;
spot::emptiness_check_instantiator_ptr echeck_inst = 0; spot::emptiness_check_instantiator_ptr echeck_inst = nullptr;
enum { NoneDup, BFS, DFS } dupexp = NoneDup; enum { NoneDup, BFS, DFS } dupexp = NoneDup;
bool expect_counter_example = false; bool expect_counter_example = false;
bool accepting_run = false; bool accepting_run = false;
@ -364,8 +364,8 @@ checked_main(int argc, char** argv)
const char* opt_never = nullptr; const char* opt_never = nullptr;
const char* hoa_opt = nullptr; const char* hoa_opt = nullptr;
auto& env = spot::ltl::default_environment::instance(); auto& env = spot::ltl::default_environment::instance();
spot::ltl::atomic_prop_set* unobservables = 0; spot::ltl::atomic_prop_set* unobservables = nullptr;
spot::twa_ptr system_aut = 0; spot::twa_ptr system_aut = nullptr;
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
spot::timer_map tm; spot::timer_map tm;
bool use_timer = false; bool use_timer = false;
@ -797,7 +797,7 @@ checked_main(int argc, char** argv)
while (tok) while (tok)
{ {
unobservables->insert(env.require(tok)); unobservables->insert(env.require(tok));
tok = strtok(0, ", \t;"); tok = strtok(nullptr, ", \t;");
} }
} }
else if (!strncmp(argv[formula_index], "-u", 2)) else if (!strncmp(argv[formula_index], "-u", 2))
@ -944,7 +944,7 @@ checked_main(int argc, char** argv)
if (f || from_file) if (f || from_file)
{ {
spot::twa_ptr a = 0; spot::twa_ptr a = nullptr;
bool assume_sba = false; bool assume_sba = false;
if (from_file) if (from_file)
@ -964,7 +964,7 @@ checked_main(int argc, char** argv)
} }
else else
{ {
spot::ltl::ltl_simplifier* simp = 0; spot::ltl::ltl_simplifier* simp = nullptr;
if (simpltl) if (simpltl)
simp = new spot::ltl::ltl_simplifier(redopt, dict); simp = new spot::ltl::ltl_simplifier(redopt, dict);
@ -1004,7 +1004,7 @@ checked_main(int argc, char** argv)
post_branching, post_branching,
fair_loop_approx, fair_loop_approx,
unobservables, unobservables,
fm_red ? simp : 0, fm_red ? simp : nullptr,
fm_unambiguous); fm_unambiguous);
break; break;
case TransCompo: case TransCompo:
@ -1061,8 +1061,7 @@ checked_main(int argc, char** argv)
{ {
auto aa = ensure_digraph(a); auto aa = ensure_digraph(a);
tm.start("obligation minimization"); tm.start("obligation minimization");
auto minimized = minimize_obligation(aa, auto minimized = minimize_obligation(aa, f, nullptr, reject_bigger);
f, 0, reject_bigger);
tm.stop("obligation minimization"); tm.stop("obligation minimization");
if (!minimized) if (!minimized)
@ -1318,7 +1317,7 @@ checked_main(int argc, char** argv)
} }
tm.stop("producing output"); tm.stop("producing output");
} }
a = 0; a = nullptr;
output = -1; output = -1;
} }
if (tgta_opt) if (tgta_opt)
@ -1457,8 +1456,9 @@ checked_main(int argc, char** argv)
{ {
std::cout << "this is not an obligation property"; std::cout << "this is not an obligation property";
auto tmp = tba_determinize_check(ensure_digraph(a), auto tmp = tba_determinize_check(ensure_digraph(a),
0, opt_o_threshold, f, 0); 0, opt_o_threshold,
if (tmp != 0 && tmp != a) f, nullptr);
if (tmp && tmp != a)
std::cout << ", but it is a recurrence property"; std::cout << ", but it is a recurrence property";
} }
else else

View file

@ -77,7 +77,7 @@ const char* default_algos[] = {
"Tau03_opt(condstack)", "Tau03_opt(condstack)",
"Tau03_opt(condstack ordering)", "Tau03_opt(condstack ordering)",
"Tau03_opt(condstack ordering !weights)", "Tau03_opt(condstack ordering !weights)",
0 nullptr
}; };
std::vector<ec_algo> ec_algos; std::vector<ec_algo> ec_algos;
@ -520,7 +520,7 @@ generate_formula(const spot::ltl::random_ltl& rl,
assert(opt_l); assert(opt_l);
std::cerr << "Failed to generate non-reducible formula " std::cerr << "Failed to generate non-reducible formula "
<< "of size " << opt_l << " or more." << std::endl; << "of size " << opt_l << " or more." << std::endl;
return 0; return nullptr;
} }
std::string txt = spot::ltl::str_psl(f); std::string txt = spot::ltl::str_psl(f);
if (!opt_u || unique.insert(txt).second) if (!opt_u || unique.insert(txt).second)
@ -529,7 +529,7 @@ generate_formula(const spot::ltl::random_ltl& rl,
assert(opt_u); assert(opt_u);
std::cerr << "Failed to generate another unique formula." std::cerr << "Failed to generate another unique formula."
<< std::endl; << std::endl;
return 0; return nullptr;
} }
int int
@ -539,9 +539,9 @@ main(int argc, char** argv)
bool opt_dp = false; bool opt_dp = false;
int opt_f = 15; int opt_f = 15;
int opt_F = 0; int opt_F = 0;
char* opt_p = 0; char* opt_p = nullptr;
char* opt_i = 0; char* opt_i = nullptr;
std::istream *formula_file = 0; std::istream *formula_file = nullptr;
int opt_l = 0; int opt_l = 0;
bool opt_u = false; bool opt_u = false;
int opt_S = 0; int opt_S = 0;
@ -633,7 +633,7 @@ main(int argc, char** argv)
break; break;
else if (input == "") else if (input == "")
break; break;
ec_algo a = { input, 0 }; ec_algo a = { input, nullptr };
ec_algos.push_back(a); ec_algos.push_back(a);
} }
@ -815,7 +815,7 @@ main(int argc, char** argv)
const char** i = default_algos; const char** i = default_algos;
while (*i) while (*i)
{ {
ec_algo a = { *(i++), 0 }; ec_algo a = { *(i++), nullptr };
ec_algos.push_back(a); ec_algos.push_back(a);
} }
} }
@ -834,7 +834,7 @@ main(int argc, char** argv)
ec_algos[i].inst = ec_algos[i].inst =
spot::make_emptiness_check_instantiator(ec_algos[i].name.c_str(), spot::make_emptiness_check_instantiator(ec_algos[i].name.c_str(),
&err); &err);
if (ec_algos[i].inst == 0) if (!ec_algos[i].inst)
{ {
std::cerr << "Parse error after `" << err << '\'' << std::endl; std::cerr << "Parse error after `" << err << '\'' << std::endl;
exit(1); exit(1);

View file

@ -154,7 +154,7 @@ main(int argc, char** argv)
spot::ltl::formula f1 = nullptr; spot::ltl::formula f1 = nullptr;
spot::ltl::formula f2 = nullptr; spot::ltl::formula f2 = nullptr;
std::ifstream* fin = 0; std::ifstream* fin = nullptr;
if (readfile) if (readfile)
{ {

View file

@ -49,7 +49,7 @@ namespace spot
// WARNING: We need a default constructor so this can be used in // WARNING: We need a default constructor so this can be used in
// a hash; but we should ensure that no object in the hash is // a hash; but we should ensure that no object in the hash is
// constructed with p==0. // constructed with p==0.
anon_free_list(bdd_dict_priv* p = 0) anon_free_list(bdd_dict_priv* p = nullptr)
: priv_(p) : priv_(p)
{ {
} }
@ -73,7 +73,7 @@ namespace spot
bdd_dict_priv() bdd_dict_priv()
{ {
free_anonymous_list_of[0] = anon_free_list(this); free_anonymous_list_of[nullptr] = anon_free_list(this);
} }
/// List of unused anonymous variable number for each automaton. /// List of unused anonymous variable number for each automaton.
@ -202,7 +202,7 @@ namespace spot
{ {
i = (priv_->free_anonymous_list_of.insert i = (priv_->free_anonymous_list_of.insert
(fal::value_type(for_me, (fal::value_type(for_me,
priv_->free_anonymous_list_of[0]))).first; priv_->free_anonymous_list_of[nullptr]))).first;
} }
int res = i->second.register_n(n); int res = i->second.register_n(n);

View file

@ -157,7 +157,7 @@ namespace spot
want_acc = true; want_acc = true;
bdd_strm_hook(print_handler); bdd_strm_hook(print_handler);
os << bddset << b; os << bddset << b;
bdd_strm_hook(0); bdd_strm_hook(nullptr);
return os; return os;
} }

View file

@ -33,7 +33,7 @@ namespace spot
taa_tgba::taa_tgba(const bdd_dict_ptr& dict) taa_tgba::taa_tgba(const bdd_dict_ptr& dict)
: twa(dict), : twa(dict),
init_(0), state_set_vec_() init_(nullptr), state_set_vec_()
{ {
} }
@ -122,7 +122,7 @@ namespace spot
taa_tgba::state_set::const_iterator it = s_->begin(); taa_tgba::state_set::const_iterator it = s_->begin();
while (it != s_->end()) while (it != s_->end())
{ {
res ^= reinterpret_cast<const char*>(*it++) - static_cast<char*>(0); res ^= reinterpret_cast<const char*>(*it++) - static_cast<char*>(nullptr);
res = wang32_hash(res); res = wang32_hash(res);
} }
return res; return res;

View file

@ -31,7 +31,7 @@ namespace spot
twa::twa(const bdd_dict_ptr& d) twa::twa(const bdd_dict_ptr& d)
: iter_cache_(nullptr), : iter_cache_(nullptr),
dict_(d), dict_(d),
last_support_conditions_input_(0) last_support_conditions_input_(nullptr)
{ {
props = 0U; props = 0U;
bddaps_ = bddtrue; bddaps_ = bddtrue;
@ -65,7 +65,7 @@ namespace spot
{ {
if (t.get() == this) if (t.get() == this)
return s->clone(); return s->clone();
return 0; return nullptr;
} }
std::string std::string

View file

@ -201,7 +201,7 @@ namespace spot
get_dict()->unregister_all_my_variables(this); get_dict()->unregister_all_my_variables(this);
// Prevent this state from being destroyed by ~twa(), // Prevent this state from being destroyed by ~twa(),
// as the state will be destroyed when g_ is destroyed. // as the state will be destroyed when g_ is destroyed.
last_support_conditions_input_ = 0; last_support_conditions_input_ = nullptr;
} }
#ifndef SWIG #ifndef SWIG

View file

@ -119,7 +119,7 @@ namespace spot
if (!(left_->first() && right_->first())) if (!(left_->first() && right_->first()))
{ {
delete right_; delete right_;
right_ = 0; right_ = nullptr;
return false; return false;
} }
return next_non_false_(); return next_non_false_();
@ -326,7 +326,7 @@ namespace spot
if (last_support_conditions_input_) if (last_support_conditions_input_)
{ {
last_support_conditions_input_->destroy(); last_support_conditions_input_->destroy();
last_support_conditions_input_ = 0; last_support_conditions_input_ = nullptr;
} }
} }

View file

@ -124,7 +124,7 @@ namespace spot
/// \brief Is this node the root of the tree? /// \brief Is this node the root of the tree?
bool is_root() const bool is_root() const
{ {
return parent == 0; return parent == nullptr;
} }
bool marked; bool marked;
@ -141,14 +141,14 @@ namespace spot
safra_tree::safra_tree() safra_tree::safra_tree()
: marked(false), name(0) : marked(false), name(0)
{ {
parent = 0; parent = nullptr;
} }
/// \brief Copy the tree \a other, and set \c marked to false. /// \brief Copy the tree \a other, and set \c marked to false.
safra_tree::safra_tree(const safra_tree& other) safra_tree::safra_tree(const safra_tree& other)
: marked(false), name(other.name), nodes(other.nodes) : marked(false), name(other.name), nodes(other.nodes)
{ {
parent = 0; parent = nullptr;
for (auto i: other.children) for (auto i: other.children)
{ {
safra_tree* c = new safra_tree(*i); safra_tree* c = new safra_tree(*i);
@ -254,7 +254,7 @@ namespace spot
int int
safra_tree::get_new_name() const safra_tree::get_new_name() const
{ {
if (parent == 0) if (parent == nullptr)
{ {
if (free_names_.empty()) if (free_names_.empty())
{ {
@ -1014,7 +1014,7 @@ namespace spot
//////////////////////// ////////////////////////
safra_tree_automaton::safra_tree_automaton(const const_twa_graph_ptr& a) safra_tree_automaton::safra_tree_automaton(const const_twa_graph_ptr& a)
: max_nb_pairs_(-1), initial_state(0), a_(a) : max_nb_pairs_(-1), initial_state(nullptr), a_(a)
{ {
a->get_dict()->register_all_variables_of(a, this); a->get_dict()->register_all_variables_of(a, this);
} }

View file

@ -102,7 +102,7 @@ namespace spot
} }
} }
} }
return 0; return nullptr;
} }
} }

View file

@ -177,7 +177,7 @@ namespace spot
pair_map seen; pair_map seen;
pair_queue todo; pair_queue todo;
state_pair p(left->get_init_state(), 0); state_pair p(left->get_init_state(), nullptr);
state* ris = right->get_init_state(); state* ris = right->get_init_state();
p.second = ris; p.second = ris;
unsigned i = res->new_state(); unsigned i = res->new_state();
@ -198,7 +198,7 @@ namespace spot
state_pair d(li->current_state(), ris); state_pair d(li->current_state(), ris);
bdd lc = li->current_condition(); bdd lc = li->current_condition();
twa_succ_iterator* ri = 0; twa_succ_iterator* ri = nullptr;
// Should we reset the right automaton? // Should we reset the right automaton?
if ((lc & v) == lc) if ((lc & v) == lc)
{ {
@ -278,12 +278,14 @@ namespace spot
// Translate the patched formula, and remove useless SCCs. // Translate the patched formula, and remove useless SCCs.
twa_graph_ptr res = twa_graph_ptr res =
scc_filter(ltl_to_tgba_fm(g, dict, true, true, false, false, 0, 0), scc_filter(ltl_to_tgba_fm(g, dict, true, true, false, false,
nullptr, nullptr),
false); false);
if (!no_wdba) if (!no_wdba)
{ {
twa_graph_ptr min = minimize_obligation(res, g, 0, wdba_smaller); twa_graph_ptr min = minimize_obligation(res, g,
nullptr, wdba_smaller);
if (min != res) if (min != res)
{ {
res = min; res = min;

View file

@ -62,9 +62,9 @@ namespace spot
{ {
namespace namespace
{ {
static bdd_dict_ptr debug_dict = 0; static bdd_dict_ptr debug_dict = nullptr;
static const acc_cond* debug_ref_acc = 0; static const acc_cond* debug_ref_acc = nullptr;
static const acc_cond* debug_cand_acc = 0; static const acc_cond* debug_cand_acc = nullptr;
struct transition struct transition
{ {

View file

@ -39,10 +39,10 @@ namespace spot
tgba_run::~tgba_run() tgba_run::~tgba_run()
{ {
for (steps::const_iterator i = prefix.begin(); i != prefix.end(); ++i) for (auto i : prefix)
i->s->destroy(); i.s->destroy();
for (steps::const_iterator i = cycle.begin(); i != cycle.end(); ++i) for (auto i : cycle)
i->s->destroy(); i.s->destroy();
} }
tgba_run::tgba_run(const tgba_run& run) tgba_run::tgba_run(const tgba_run& run)
@ -246,7 +246,7 @@ namespace spot
if (!opt_end) if (!opt_end)
{ {
*err = opt_start; *err = opt_start;
return 0; return nullptr;
} }
std::string opt(opt_start, opt_end); std::string opt(opt_start, opt_end);
@ -254,7 +254,7 @@ namespace spot
if (res) if (res)
{ {
*err = opt.c_str() - res + opt_start; *err = opt.c_str() - res + opt_start;
return 0; return nullptr;
} }
} }
@ -271,7 +271,7 @@ namespace spot
for (unsigned i = 0; i < sizeof(ec_algos)/sizeof(*ec_algos); ++i, ++info) for (unsigned i = 0; i < sizeof(ec_algos)/sizeof(*ec_algos); ++i, ++info)
if (n == info->name) if (n == info->name)
{ {
*err = 0; *err = nullptr;
struct emptiness_check_instantiator_aux: struct emptiness_check_instantiator_aux:
public emptiness_check_instantiator public emptiness_check_instantiator

View file

@ -192,10 +192,10 @@ namespace spot
s->destroy(); s->destroy();
// Ignore unknown states. // Ignore unknown states.
if (i == ecs->h.end()) if (i == ecs->h.end())
return 0; return nullptr;
// Stay in the final SCC. // Stay in the final SCC.
if (i->second < scc_root) if (i->second < scc_root)
return 0; return nullptr;
r->inc_ars_cycle_states(); r->inc_ars_cycle_states();
return i->first; return i->first;
} }

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2008, 2010, 2011, 2013, 2014 Laboratoire de recherche // Copyright (C) 2008, 2010, 2011, 2013, 2014, 2015 Laboratoire de
// et développement de l'Epita (LRDE). // recherche et développement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université // (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie. // Pierre et Marie Curie.
@ -160,7 +160,7 @@ namespace spot
} }
if (violation) if (violation)
return std::make_shared<result>(*this); return std::make_shared<result>(*this);
return 0; return nullptr;
} }
void void
@ -171,7 +171,7 @@ namespace spot
h[s] = ++top; h[s] = ++top;
stack_entry ss = { s, 0, top, dftop, 0 }; stack_entry ss = { s, nullptr, top, dftop, 0 };
if (accepting) if (accepting)
ss.acc = top - 1; // This differs from GV04 to support TBA. ss.acc = top - 1; // This differs from GV04 to support TBA.
@ -352,7 +352,7 @@ namespace spot
|| data.stack[j->second].lowlink < scc_root) || data.stack[j->second].lowlink < scc_root)
{ {
s->destroy(); s->destroy();
return 0; return nullptr;
} }
r->inc_ars_cycle_states(); r->inc_ars_cycle_states();
s->destroy(); s->destroy();

View file

@ -148,7 +148,7 @@ namespace spot
std::vector<succ_state>::iterator i1; std::vector<succ_state>::iterator i1;
std::vector<succ_state>::iterator i2; std::vector<succ_state>::iterator i2;
taa_tgba::transition* t = 0; taa_tgba::transition* t = nullptr;
bool contained = false; bool contained = false;
bool strong = false; bool strong = false;
@ -250,7 +250,7 @@ namespace spot
} }
std::vector<succ_state>::iterator i; std::vector<succ_state>::iterator i;
taa_tgba::transition* t = 0; taa_tgba::transition* t = nullptr;
switch (f.kind()) switch (f.kind())
{ {
case op::And: case op::And:

View file

@ -1700,7 +1700,7 @@ namespace spot
// In case the formula contains SERE operators, we need to decide // In case the formula contains SERE operators, we need to decide
// if we have to mark unmarked operators, and more // if we have to mark unmarked operators, and more
const translate_dict::translated& const translate_dict::translated&
translate(formula f, bool* new_flag = 0) translate(formula f, bool* new_flag = nullptr)
{ {
// Use the cached result if available. // Use the cached result if available.
formula_to_bdd_map::const_iterator i = f2b_.find(f); formula_to_bdd_map::const_iterator i = f2b_.find(f);

View file

@ -144,7 +144,7 @@ namespace spot
bool exprop = false, bool symb_merge = true, bool exprop = false, bool symb_merge = true,
bool branching_postponement = false, bool branching_postponement = false,
bool fair_loop_approx = false, bool fair_loop_approx = false,
const ltl::atomic_prop_set* unobs = 0, const ltl::atomic_prop_set* unobs = nullptr,
ltl::ltl_simplifier* simplifier = 0, ltl::ltl_simplifier* simplifier = nullptr,
bool unambiguous = false); bool unambiguous = false);
} }

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de recherche et
// développement de l'Epita (LRDE). // développement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -433,21 +433,21 @@ namespace spot
{ {
public: public:
color_ref(color* c) :p(c) color_ref(color* c) :p(c)
{ {
} }
color get_color() const color get_color() const
{ {
return *p; return *p;
} }
void set_color(color c) void set_color(color c)
{ {
assert(!is_white()); assert(!is_white());
*p=c; *p=c;
} }
bool is_white() const bool is_white() const
{ {
return p == 0; return !p;
} }
private: private:
color *p; color *p;
}; };
@ -472,7 +472,7 @@ namespace spot
{ {
hash_type::iterator it = h.find(s); hash_type::iterator it = h.find(s);
if (it == h.end()) if (it == h.end())
return color_ref(0); return color_ref(nullptr);
if (s != it->first) if (s != it->first)
{ {
s->destroy(); s->destroy();

View file

@ -194,7 +194,7 @@ namespace spot
s = seen(s); s = seen(s);
if (sm.scc_of(std::static_pointer_cast<const twa_graph>(a_) if (sm.scc_of(std::static_pointer_cast<const twa_graph>(a_)
->state_number(s)) != scc_n) ->state_number(s)) != scc_n)
return 0; return nullptr;
return s; return s;
} }

View file

@ -1,9 +1,9 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de recherche et
// développement de l'Epita (LRDE). // développement de l'Epita (LRDE).
// Copyright (C) 2004, 2005, 2006 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005, 2006 Laboratoire d'Informatique de Paris
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// et Marie Curie. // Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -395,7 +395,7 @@ namespace spot
if (s) if (s)
return this->bfs_steps::search(s, l); return this->bfs_steps::search(s, l);
else else
return 0; return nullptr;
} }
const state* filter(const state* s) const state* filter(const state* s)
@ -405,7 +405,7 @@ namespace spot
|| dead.find(s) != dead.end()) || dead.find(s) != dead.end())
{ {
s->destroy(); s->destroy();
return 0; return nullptr;
} }
ars->inc_ars_cycle_states(); ars->inc_ars_cycle_states();
seen.insert(s); seen.insert(s);
@ -490,7 +490,7 @@ namespace spot
if (s) if (s)
return this->bfs_steps::search(s, l); return this->bfs_steps::search(s, l);
else else
return 0; return nullptr;
} }
const state* filter(const state* s) const state* filter(const state* s)
@ -503,7 +503,7 @@ namespace spot
else else
ndfsr_trace << " already seen" << std::endl; ndfsr_trace << " already seen" << std::endl;
s->destroy(); s->destroy();
return 0; return nullptr;
} }
ndfsr_trace << " OK" << std::endl; ndfsr_trace << " OK" << std::endl;
if (cycle) if (cycle)
@ -605,7 +605,8 @@ namespace spot
<< a_->format_state(current.dest) << " to " << a_->format_state(current.dest) << " to "
<< a_->format_state(begin) << std::endl; << a_->format_state(begin) << std::endl;
transition tmp; transition tmp;
tmp.source = tmp.dest = 0; // Initialize to please GCC 4.0.1 (Darwin). // Initialize to please GCC 4.0.1 (Darwin).
tmp.source = tmp.dest = nullptr;
tmp.acc = 0U; tmp.acc = 0U;
target.emplace(begin, tmp); target.emplace(begin, tmp);
min_path<true> s(this, a_, target, h_); min_path<true> s(this, a_, target, h_);
@ -620,7 +621,7 @@ namespace spot
{ {
m_source_trans target; m_source_trans target;
transition tmp; transition tmp;
tmp.source = tmp.dest = 0; // Initialize to please GCC 4.0. tmp.source = tmp.dest = nullptr; // Initialize to please GCC 4.0.
tmp.acc = 0U; tmp.acc = 0U;
// Register all states from the cycle as target of the BFS. // Register all states from the cycle as target of the BFS.

View file

@ -224,15 +224,15 @@ namespace spot
bool dba_is_wdba = false; bool dba_is_wdba = false;
bool dba_is_minimal = false; bool dba_is_minimal = false;
twa_graph_ptr dba = 0; twa_graph_ptr dba = nullptr;
twa_graph_ptr sim = 0; twa_graph_ptr sim = nullptr;
// (Small,Low) is the only configuration where we do not run // (Small,Low) is the only configuration where we do not run
// WDBA-minimization. // WDBA-minimization.
if ((PREF_ != Small || level_ != Low) && wdba_minimize_) if ((PREF_ != Small || level_ != Low) && wdba_minimize_)
{ {
bool reject_bigger = (PREF_ == Small) && (level_ == Medium); bool reject_bigger = (PREF_ == Small) && (level_ == Medium);
dba = minimize_obligation(a, f, 0, reject_bigger); dba = minimize_obligation(a, f, nullptr, reject_bigger);
if (dba && dba->is_inherently_weak() && dba->is_deterministic()) if (dba && dba->is_inherently_weak() && dba->is_deterministic())
{ {
// The WDBA is a BA, so no degeneralization is required. // The WDBA is a BA, so no degeneralization is required.
@ -362,7 +362,7 @@ namespace spot
// is at least 1. // is at least 1.
target_acc = original_acc > 0 ? original_acc : 1; target_acc = original_acc > 0 ? original_acc : 1;
const_twa_graph_ptr in = 0; const_twa_graph_ptr in = nullptr;
if (target_acc == 1) if (target_acc == 1)
{ {
// If we are seeking a minimal DBA with unknown number of // If we are seeking a minimal DBA with unknown number of

View file

@ -62,7 +62,7 @@ namespace spot
/// ///
/// The \a opt argument can be used to pass extra fine-tuning /// The \a opt argument can be used to pass extra fine-tuning
/// options used for debugging or benchmarking. /// options used for debugging or benchmarking.
postprocessor(const option_map* opt = 0); postprocessor(const option_map* opt = nullptr);
enum output_type { TGBA, BA, Monitor, Generic }; enum output_type { TGBA, BA, Monitor, Generic };
void void

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2011, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2009, 2011, 2013, 2014, 2015 Laboratoire de Recherche
// Développement de l'Epita (LRDE). // et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
@ -137,7 +137,7 @@ namespace spot
tgba_reachable_iterator_breadth_first::next_state() tgba_reachable_iterator_breadth_first::next_state()
{ {
if (todo.empty()) if (todo.empty())
return 0; return nullptr;
const state* s = todo.front(); const state* s = todo.front();
todo.pop_front(); todo.pop_front();
return s; return s;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -34,7 +34,7 @@ namespace spot
{ {
public: public:
shortest_path(const const_twa_ptr& a) shortest_path(const const_twa_ptr& a)
: bfs_steps(a), target(0) : bfs_steps(a), target(nullptr)
{ {
} }

View file

@ -46,7 +46,7 @@ namespace spot
/// will be built otherwise). /// will be built otherwise).
SPOT_API bool SPOT_API bool
is_guarantee_automaton(const const_twa_graph_ptr& aut, is_guarantee_automaton(const const_twa_graph_ptr& aut,
scc_info* sm = 0); scc_info* sm = nullptr);
/// \brief Whether a minimized WDBA represents a safety property. /// \brief Whether a minimized WDBA represents a safety property.
/// ///

View file

@ -59,7 +59,7 @@ namespace spot
/// instead. /// instead.
SPOT_API twa_graph_ptr SPOT_API twa_graph_ptr
scc_filter(const const_twa_graph_ptr& aut, bool remove_all_useless = false, scc_filter(const const_twa_graph_ptr& aut, bool remove_all_useless = false,
scc_info* given_si = 0); scc_info* given_si = nullptr);
/// \brief Prune unaccepting SCCs. /// \brief Prune unaccepting SCCs.
/// ///
@ -70,7 +70,8 @@ namespace spot
/// transitions leaving accepting states are all marked as /// transitions leaving accepting states are all marked as
/// accepting), then the output TGBA will also have that property. /// accepting), then the output TGBA will also have that property.
SPOT_API twa_graph_ptr SPOT_API twa_graph_ptr
scc_filter_states(const const_twa_graph_ptr& aut, scc_info* given_si = 0); scc_filter_states(const const_twa_graph_ptr& aut,
scc_info* given_si = nullptr);
/// \brief Prune unaccepting SCCs, superfluous acceptance /// \brief Prune unaccepting SCCs, superfluous acceptance
/// sets, and suspension variables. /// sets, and suspension variables.
@ -85,5 +86,5 @@ namespace spot
SPOT_API twa_graph_ptr SPOT_API twa_graph_ptr
scc_filter_susp(const const_twa_graph_ptr& aut, bool remove_all_useless, scc_filter_susp(const const_twa_graph_ptr& aut, bool remove_all_useless,
bdd suspvars, bdd ignoredvars, bool early_susp, bdd suspvars, bdd ignoredvars, bool early_susp,
scc_info* given_si = 0); scc_info* given_si = nullptr);
} }

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -111,7 +111,7 @@ namespace spot
if (dfs_blue()) if (dfs_blue())
return std::make_shared<se05_result>(t, options()); return std::make_shared<se05_result>(t, options());
} }
return 0; return nullptr;
} }
virtual std::ostream& print_stats(std::ostream &os) const virtual std::ostream& print_stats(std::ostream &os) const
@ -449,11 +449,11 @@ namespace spot
{ {
public: public:
color_ref(hash_type* h, hcyan_type* hc, const state* s) color_ref(hash_type* h, hcyan_type* hc, const state* s)
: is_cyan(true), ph(h), phc(hc), ps(s), pc(0) : is_cyan(true), ph(h), phc(hc), ps(s), pc(nullptr)
{ {
} }
color_ref(color* c) color_ref(color* c)
: is_cyan(false), ph(0), phc(0), ps(0), pc(c) : is_cyan(false), ph(nullptr), phc(nullptr), ps(nullptr), pc(c)
{ {
} }
color get_color() const color get_color() const
@ -480,7 +480,7 @@ namespace spot
} }
bool is_white() const bool is_white() const
{ {
return !is_cyan && pc == 0; return !is_cyan && !pc;
} }
private: private:
bool is_cyan; bool is_cyan;
@ -519,7 +519,7 @@ namespace spot
{ {
hash_type::iterator it = h.find(s); hash_type::iterator it = h.find(s);
if (it == h.end()) if (it == h.end())
return color_ref(0); // white state return color_ref(nullptr); // white state
if (s != it->first) if (s != it->first)
{ {
s->destroy(); s->destroy();
@ -588,7 +588,7 @@ namespace spot
{ {
} }
color_ref(unsigned char *base, unsigned char offset) color_ref(unsigned char *base, unsigned char offset)
: is_cyan(false), phc(0), ps(0), b(base), o(offset*2) : is_cyan(false), phc(nullptr), ps(nullptr), b(base), o(offset*2)
{ {
} }
color get_color() const color get_color() const

View file

@ -761,7 +761,7 @@ namespace spot
twa_graph_ptr twa_graph_ptr
iterated_simulations_(const const_twa_graph_ptr& t) iterated_simulations_(const const_twa_graph_ptr& t)
{ {
twa_graph_ptr res = 0; twa_graph_ptr res = nullptr;
automaton_size prev; automaton_size prev;
automaton_size next; automaton_size next;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE). // Developpement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -306,7 +306,7 @@ namespace spot
} }
bool is_white() const bool is_white() const
{ {
return p == 0; return !p;
} }
private: private:
color *p; color *p;
@ -333,7 +333,7 @@ namespace spot
{ {
hash_type::iterator it = h.find(s); hash_type::iterator it = h.find(s);
if (it == h.end()) if (it == h.end())
return color_ref(0, 0); return color_ref(nullptr, nullptr);
if (s != it->first) if (s != it->first)
{ {
s->destroy(); s->destroy();

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -458,7 +458,7 @@ namespace spot
} }
bool is_white() const bool is_white() const
{ {
return !is_cyan && pc == 0; return !is_cyan && !pc;
} }
private: private:
bool is_cyan; bool is_cyan;
@ -501,7 +501,7 @@ namespace spot
hash_type::iterator it = h.find(s); hash_type::iterator it = h.find(s);
if (it == h.end()) if (it == h.end())
// white state // white state
return color_ref(0, 0); return color_ref(nullptr, nullptr);
if (s != it->first) if (s != it->first)
{ {
s->destroy(); s->destroy();

View file

@ -95,7 +95,8 @@ namespace spot
{ {
bool exprop = unambiguous || level_ == postprocessor::High; bool exprop = unambiguous || level_ == postprocessor::High;
aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop, aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop,
true, false, false, 0, 0, unambiguous); true, false, false, nullptr, nullptr,
unambiguous);
} }
aut = this->postprocessor::run(aut, r); aut = this->postprocessor::run(aut, r);
return aut; return aut;

View file

@ -47,21 +47,21 @@ namespace spot
class SPOT_API translator: protected postprocessor class SPOT_API translator: protected postprocessor
{ {
public: public:
translator(ltl::ltl_simplifier* simpl, const option_map* opt = 0) translator(ltl::ltl_simplifier* simpl, const option_map* opt = nullptr)
: postprocessor(opt), simpl_(simpl), simpl_owned_(0) : postprocessor(opt), simpl_(simpl), simpl_owned_(nullptr)
{ {
assert(simpl); assert(simpl);
setup_opt(opt); setup_opt(opt);
} }
translator(const bdd_dict_ptr& dict, const option_map* opt = 0) translator(const bdd_dict_ptr& dict, const option_map* opt = nullptr)
: postprocessor(opt) : postprocessor(opt)
{ {
build_simplifier(dict); build_simplifier(dict);
setup_opt(opt); setup_opt(opt);
} }
translator(const option_map* opt = 0) translator(const option_map* opt = nullptr)
: postprocessor(opt) : postprocessor(opt)
{ {
build_simplifier(make_bdd_dict()); build_simplifier(make_bdd_dict());

View file

@ -303,7 +303,7 @@ namespace internal
template <typename octet_iterator> template <typename octet_iterator>
inline utf_error validate_next(octet_iterator& it, octet_iterator end) { inline utf_error validate_next(octet_iterator& it, octet_iterator end) {
return validate_next(it, end, 0); return validate_next(it, end, nullptr);
} }
} // namespace internal } // namespace internal
@ -354,5 +354,3 @@ namespace internal
} // namespace utf8 } // namespace utf8
#endif // header guard #endif // header guard