diff --git a/NEWS b/NEWS index 2b74f9c36..3dd1a5272 100644 --- a/NEWS +++ b/NEWS @@ -134,6 +134,12 @@ New in spot 2.3.4.dev (not yet released) SCC) or 'y' (split universal destination by colors) universal edges could be connected to undefined states. + - Using --stats=%s or --stats=%s or --stats=%t could take an + unnecessary long time on automata with many atomic propositions, + due to a typo. Furthermore, %s/%e/%t/%E/%T were printing + a number of reachable states/edges/transitions, but %S was + incorrectly counting all states even unreachable. + Backward-incompatible changes: - spot::acc_cond::mark_t::operator bool() has been marked as diff --git a/bin/common_aoutput.cc b/bin/common_aoutput.cc index 781a02fde..40f4be299 100644 --- a/bin/common_aoutput.cc +++ b/bin/common_aoutput.cc @@ -171,11 +171,11 @@ static const argp_option io_options[] = { "%M, %m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, "name of the automaton", 0 }, { "%S, %s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of states", 0 }, + "number of reachable states", 0 }, { "%E, %e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of edges", 0 }, + "number of reachable edges", 0 }, { "%T, %t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of transitions", 0 }, + "number of reachable transitions", 0 }, { "%A, %a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, "number of acceptance sets", 0 }, { "%G, %g", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, @@ -232,11 +232,11 @@ static const argp_option o_options[] = { "%m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, "name of the automaton", 0 }, { "%s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of states", 0 }, + "number of reachable states", 0 }, { "%e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of edges", 0 }, + "number of reachable edges", 0 }, { "%t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, - "number of transitions", 0 }, + "number of reachable transitions", 0 }, { "%a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, "number of acceptance sets", 0 }, { "%g", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, @@ -427,9 +427,9 @@ hoa_stat_printer::print(const spot::const_parsed_aut_ptr& haut, haut_edges_ = s.edges; haut_trans_ = s.transitions; } - else if (has('E')) + else if (has('E') || has('S')) { - spot::twa_sub_statistics s = sub_stats_reachable(haut->aut); + spot::twa_statistics s = stats_reachable(haut->aut); haut_states_ = s.states; haut_edges_ = s.edges; } @@ -441,8 +441,6 @@ hoa_stat_printer::print(const spot::const_parsed_aut_ptr& haut, else haut_name_.val().clear(); } - if (has('S')) - haut_states_ = haut->aut->num_states(); if (has('A')) haut_acc_ = haut->aut->acc().num_sets(); diff --git a/spot/twaalgos/stats.cc b/spot/twaalgos/stats.cc index e521c7efe..db9c998b7 100644 --- a/spot/twaalgos/stats.cc +++ b/spot/twaalgos/stats.cc @@ -346,7 +346,7 @@ namespace spot } else if (has('s') || has('e')) { - twa_sub_statistics s = sub_stats_reachable(aut); + twa_statistics s = stats_reachable(aut); states_ = s.states; edges_ = s.edges; } diff --git a/tests/core/format.test b/tests/core/format.test index 5b5073241..8f178b3ba 100644 --- a/tests/core/format.test +++ b/tests/core/format.test @@ -74,3 +74,69 @@ test "1,3,1,3,2,1,0" = "$out" ltl2tgba 'a' --stats='%[z]c' 2>stderr && exit 1 cat stderr grep -F "ltl2tgba: unknown option 'z' in '%[z]c'" stderr + + +# From issue #269. +f='!X(FG((a & b) | (a & c) | (a & d) | (a & e) | (a & f) | (g & h) | +(g & i) | (g & j) | (g & k) | (g & l) | (m & n) | (m & o) | (m & p) | +(m & q) | (m & r) | (s & t) | (s & u) | (s & v) | (s & w) | (s & x) | +(y & z) | (ab & y) | (bb & y) | (cb & y) | (db & y) | (eb & g) | (c & +eb) | (d & eb) | (e & eb) | (eb & f) | (b & m) | (b & i) | (b & j) | +(b & k) | (b & l) | (h & s) | (h & o) | (h & p) | (h & q) | (h & r) | +(n & y) | (n & u) | (n & v) | (n & w) | (n & x) | (fb & t) | (ab & t) +| (bb & t) | (cb & t) | (db & t) | (g & gb) | (b & gb) | (d & gb) | +(e & gb) | (f & gb) | (c & m) | (c & h) | (c & j) | (c & k) | (c & l) | +(i & s) | (i & n) | (i & p) | (i & q) | (i & r) | (o & y) | (o & t) | +(o & v) | (o & w) | (o & x) | (fb & u) | (u & z) | (bb & u) | (cb & +u) | (db & u) | (g & hb) | (b & hb) | (c & hb) | (e & hb) | (f & hb) | +(d & m) | (d & h) | (d & i) | (d & k) | (d & l) | (j & s) | (j & n) | +(j & o) | (j & q) | (j & r) | (p & y) | (p & t) | (p & u) | (p & w) | +(p & x) | (fb & v) | (v & z) | (ab & v) | (cb & v) | (db & v) | (g & +ib) | (b & ib) | (c & ib) | (d & ib) | (f & ib) | (e & m) | (e & h) | +(e & i) | (e & j) | (e & l) | (k & s) | (k & n) | (k & o) | (k & p) | +(k & r) | (q & y) | (q & t) | (q & u) | (q & v) | (q & x) | (fb & w) | +(w & z) | (ab & w) | (bb & w) | (db & w) | (g & jb) | (b & jb) | (c & +jb) | (d & jb) | (e & jb) | (f & m) | (f & h) | (f & i) | (f & j) | +(f & k) | (l & s) | (l & n) | (l & o) | (l & p) | (l & q) | (r & y) | +(r & t) | (r & u) | (r & v) | (r & w) | (fb & x) | (x & z) | (ab & x) | +(bb & x) | (cb & x)) U ((a & b) | (a & c) | (a & d) | (a & e) | (a & f) | +(g & h) | (g & i) | (g & j) | (g & k) | (g & l) | (m & n) | (m & o) | +(m & p) | (m & q) | (m & r) | (s & t) | (s & u) | (s & v) | (s & w) | +(s & x) | (y & z) | (ab & y) | (bb & y) | (cb & y) | (db & y) | (eb & +g) | (c & eb) | (d & eb) | (e & eb) | (eb & f) | (b & m) | (b & i) | +(b & j) | (b & k) | (b & l) | (h & s) | (h & o) | (h & p) | (h & q) | +(h & r) | (n & y) | (n & u) | (n & v) | (n & w) | (n & x) | (fb & t) | +(ab & t) | (bb & t) | (cb & t) | (db & t) | (g & gb) | (b & gb) | (d & +gb) | (e & gb) | (f & gb) | (c & m) | (c & h) | (c & j) | (c & k) | +(c & l) | (i & s) | (i & n) | (i & p) | (i & q) | (i & r) | (o & y) | +(o & t) | (o & v) | (o & w) | (o & x) | (fb & u) | (u & z) | (bb & u) +| (cb & u) | (db & u) | (g & hb) | (b & hb) | (c & hb) | (e & hb) | +(f & hb) | (d & m) | (d & h) | (d & i) | (d & k) | (d & l) | (j & s) | +(j & n) | (j & o) | (j & q) | (j & r) | (p & y) | (p & t) | (p & u) | +(p & w) | (p & x) | (fb & v) | (v & z) | (ab & v) | (cb & v) | (db & +v) | (g & ib) | (b & ib) | (c & ib) | (d & ib) | (f & ib) | (e & m) | +(e & h) | (e & i) | (e & j) | (e & l) | (k & s) | (k & n) | (k & o) | +(k & p) | (k & r) | (q & y) | (q & t) | (q & u) | (q & v) | (q & x) | +(fb & w) | (w & z) | (ab & w) | (bb & w) | (db & w) | (g & jb) | (b & +jb) | (c & jb) | (d & jb) | (e & jb) | (f & m) | (f & h) | (f & i) | +(f & j) | (f & k) | (l & s) | (l & n) | (l & o) | (l & p) | (l & q) | +(r & y) | (r & t) | (r & u) | (r & v) | (r & w) | (fb & x) | (x & z) | +(ab & x) | (bb & x) | (cb & x)))' +test 3,5 = `ltl2tgba --low --any --stats=%s,%e "$f"` + +cat >foo <