rename SPOT_NB_ACC to SPOT_MAX_ACCSETS

* NEWS, bin/autcross.cc, bin/autfilt.cc, bin/ltlcross.cc,
configure.ac, spot/parseaut/parseaut.yy, spot/twa/acc.cc,
spot/twa/acc.hh, tests/core/acc.cc, .gitlab-ci.yml: Here.
This commit is contained in:
Alexandre Duret-Lutz 2018-05-24 17:52:42 +02:00
parent cc2c4615d0
commit 2e165f188d
10 changed files with 33 additions and 30 deletions

View file

@ -11,7 +11,7 @@ debian-stable-gcc:
image: registry.lrde.epita.fr/spot-debuild:stable image: registry.lrde.epita.fr/spot-debuild:stable
script: script:
- autoreconf -vfi - autoreconf -vfi
- ./configure --enable-nb-acc=256 - ./configure --enable-max-accsets=256
- make - make
- make distcheck - make distcheck
artifacts: artifacts:

4
NEWS
View file

@ -26,8 +26,8 @@ New in spot 2.5.3.dev (not yet released)
- You can now specify to Spot the number of acceptance marks you - You can now specify to Spot the number of acceptance marks you
wish to use. This is a compile-time option, accessible through wish to use. This is a compile-time option, accessible through
option --with-nb-acc of the configure script. The default is option --enable-max-accsets of the configure script. The default
still 32, but this limit is no longer hardcoded. is still 32, but this limit is no longer hardcoded.
- Option "a" of print_dot(), for printing the acceptance condition, - Option "a" of print_dot(), for printing the acceptance condition,
is now enabled by default. Option "A", introduced in Spot 2.4, is now enabled by default. Option "A", introduced in Spot 2.4,

View file

@ -509,7 +509,7 @@ namespace
const spot::const_twa_graph_ptr& aut_j, const spot::const_twa_graph_ptr& aut_j,
size_t i, size_t j) size_t i, size_t j)
{ {
if (aut_i->num_sets() + aut_j->num_sets() > SPOT_NB_ACC) if (aut_i->num_sets() + aut_j->num_sets() > SPOT_MAX_ACCSETS)
{ {
std::cerr << "info: building " << autname(i) std::cerr << "info: building " << autname(i)
<< '*' << autname(j, true) << '*' << autname(j, true)

View file

@ -649,7 +649,7 @@ static spot::twa_graph_ptr
product(spot::twa_graph_ptr left, spot::twa_graph_ptr right) product(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
{ {
if ((type == spot::postprocessor::BA) if ((type == spot::postprocessor::BA)
&& (left->num_sets() + right->num_sets() > SPOT_NB_ACC)) && (left->num_sets() + right->num_sets() > SPOT_MAX_ACCSETS))
{ {
left = ensure_tba(left); left = ensure_tba(left);
right = ensure_tba(right); right = ensure_tba(right);
@ -661,7 +661,7 @@ static spot::twa_graph_ptr
product_or(spot::twa_graph_ptr left, spot::twa_graph_ptr right) product_or(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
{ {
if ((type == spot::postprocessor::BA) if ((type == spot::postprocessor::BA)
&& (left->num_sets() + right->num_sets() > SPOT_NB_ACC)) && (left->num_sets() + right->num_sets() > SPOT_MAX_ACCSETS))
{ {
left = ensure_tba(left); left = ensure_tba(left);
right = ensure_tba(right); right = ensure_tba(right);
@ -965,7 +965,7 @@ parse_opt(int key, char* arg, struct argp_state*)
if (res < 0) if (res < 0)
error(2, 0, "acceptance sets should be non-negative:" error(2, 0, "acceptance sets should be non-negative:"
" --mask-acc=%ld", res); " --mask-acc=%ld", res);
if (static_cast<unsigned long>(res) > SPOT_NB_ACC) if (static_cast<unsigned long>(res) > SPOT_MAX_ACCSETS)
error(2, 0, "this implementation does not support that many" error(2, 0, "this implementation does not support that many"
" acceptance sets: --mask-acc=%ld", res); " acceptance sets: --mask-acc=%ld", res);
opt_mask_acc.set(res); opt_mask_acc.set(res);

View file

@ -691,7 +691,7 @@ namespace
const spot::const_twa_graph_ptr& aut_j, const spot::const_twa_graph_ptr& aut_j,
size_t i, size_t j, bool icomp, bool jcomp) size_t i, size_t j, bool icomp, bool jcomp)
{ {
if (aut_i->num_sets() + aut_j->num_sets() > SPOT_NB_ACC) if (aut_i->num_sets() + aut_j->num_sets() > SPOT_MAX_ACCSETS)
{ {
// Report the skipped test if both automata are not // Report the skipped test if both automata are not
// complemented, or the --verbose option is used, // complemented, or the --verbose option is used,

View file

@ -60,16 +60,18 @@ AC_ARG_ENABLE([doxygen],
AM_CONDITIONAL([ENABLE_DOXYGEN], [test "x${enable_doxygen:-no}" = xyes]) AM_CONDITIONAL([ENABLE_DOXYGEN], [test "x${enable_doxygen:-no}" = xyes])
# Option to indicate the maximal number of acceptance marks # Option to indicate the maximal number of acceptance marks
AC_COMPUTE_INT([default_nb_acc], [8*sizeof(unsigned)]) AC_COMPUTE_INT([default_max_accsets], [8*sizeof(unsigned)])
AC_ARG_ENABLE([nb-acc], AC_ARG_ENABLE([max-accsets],
[AC_HELP_STRING([--enable-nb-acc=N], [AC_HELP_STRING([--enable-max-accsets=N],
[Use up to N acceptance marks])], [Support up to N acceptance sets])],
[enable_nb_acc=$enableval], [enable_nb_acc=$default_nb_acc]) [enable_max_accsets=$enableval],
if test 0 = `expr $enable_nb_acc % $default_nb_acc` [enable_max_accsets=$default_max_accsets])
if test 0 -eq `expr $enable_max_accsets % $default_max_accsets`
then then
AC_DEFINE_UNQUOTED([NB_ACC], [$enable_nb_acc], [The number of acceptance marks]) AC_DEFINE_UNQUOTED([MAX_ACCSETS], [$enable_max_accsets],
[The maximal number of acceptance sets supported (also known as acceptance marks)])
else else
AC_ERROR([The argument of --enable-nb-acc must be a multiple of $default_nb_acc]) AC_ERROR([The argument of --enable-max-accsets must be a multiple of $default_nb_acc])
fi fi
# Activate C11 for gnulib tests # Activate C11 for gnulib tests

View file

@ -772,7 +772,7 @@ header-item: "States:" INT
"acceptance condition..."); "acceptance condition...");
error(res.accset_loc, "... previously defined here."); error(res.accset_loc, "... previously defined here.");
} }
else if ($2 > SPOT_NB_ACC) else if ($2 > SPOT_MAX_ACCSETS)
{ {
error(@1 + @2, error(@1 + @2,
"this implementation cannot support such a large " "this implementation cannot support such a large "

View file

@ -37,7 +37,7 @@ namespace spot
#define STR(x) #x #define STR(x) #x
#define VALUESTR(x) STR(x) #define VALUESTR(x) STR(x)
throw std::runtime_error("Too many acceptance sets used. " throw std::runtime_error("Too many acceptance sets used. "
"The limit is " VALUESTR(SPOT_NB_ACC) "."); "The limit is " VALUESTR(SPOT_MAX_ACCSETS) ".");
} }
std::ostream& operator<<(std::ostream& os, spot::acc_cond::mark_t m) std::ostream& operator<<(std::ostream& os, spot::acc_cond::mark_t m)

View file

@ -52,11 +52,12 @@ namespace spot
[[noreturn]] static void report_too_many_sets(); [[noreturn]] static void report_too_many_sets();
#endif #endif
public: public:
struct mark_t : public internal::_32acc<SPOT_NB_ACC == 8*sizeof(unsigned)> struct mark_t :
public internal::_32acc<SPOT_MAX_ACCSETS == 8*sizeof(unsigned)>
{ {
private: private:
// configure guarantees that SPOT_NB_ACC % (8*sizeof(unsigned)) == 0 // configure guarantees that SPOT_MAX_ACCSETS % (8*sizeof(unsigned)) == 0
typedef bitset<SPOT_NB_ACC / (8*sizeof(unsigned))> _value_t; typedef bitset<SPOT_MAX_ACCSETS / (8*sizeof(unsigned))> _value_t;
_value_t id; _value_t id;
mark_t(_value_t id) noexcept mark_t(_value_t id) noexcept
@ -564,7 +565,7 @@ namespace spot
if (n == 0) if (n == 0)
return inf({}); return inf({});
acc_cond::mark_t m = mark_t::all(); acc_cond::mark_t m = mark_t::all();
m >>= (SPOT_NB_ACC - n); m >>= (SPOT_MAX_ACCSETS - n);
return inf(m); return inf(m);
} }
@ -573,7 +574,7 @@ namespace spot
if (n == 0) if (n == 0)
return fin({}); return fin({});
acc_cond::mark_t m = mark_t::all(); acc_cond::mark_t m = mark_t::all();
m >>= (SPOT_NB_ACC - n); m >>= (SPOT_MAX_ACCSETS - n);
return fin(m); return fin(m);
} }
@ -1245,7 +1246,7 @@ namespace spot
return -1U; return -1U;
unsigned j = num_; unsigned j = num_;
num_ += num; num_ += num;
if (num_ > SPOT_NB_ACC) if (num_ > SPOT_MAX_ACCSETS)
report_too_many_sets(); report_too_many_sets();
all_ = all_sets_(); all_ = all_sets_();
return j; return j;
@ -1383,7 +1384,7 @@ namespace spot
protected: protected:
mark_t all_sets_() const mark_t all_sets_() const
{ {
return mark_t::all() >> (SPOT_NB_ACC - num_); return mark_t::all() >> (SPOT_MAX_ACCSETS - num_);
} }
unsigned num_; unsigned num_;

View file

@ -64,8 +64,8 @@ int main()
auto m1 = spot::acc_cond::mark_t({0, 2}); auto m1 = spot::acc_cond::mark_t({0, 2});
auto m2 = spot::acc_cond::mark_t({0, 3}); auto m2 = spot::acc_cond::mark_t({0, 3});
auto m3 = spot::acc_cond::mark_t({2, 1}); auto m3 = spot::acc_cond::mark_t({2, 1});
auto m4 = spot::acc_cond::mark_t({0, SPOT_NB_ACC-2}); auto m4 = spot::acc_cond::mark_t({0, SPOT_MAX_ACCSETS - 2});
if (!(m4.min_set() == 1 && m4.max_set() == SPOT_NB_ACC-1)) if (!(m4.min_set() == 1 && m4.max_set() == SPOT_MAX_ACCSETS - 1))
return 1; return 1;
spot::acc_cond::mark_t m0 = {}; spot::acc_cond::mark_t m0 = {};
@ -185,7 +185,7 @@ int main()
try try
{ {
spot::acc_cond a{SPOT_NB_ACC+1}; spot::acc_cond a{SPOT_MAX_ACCSETS + 1};
} }
catch (const std::runtime_error& e) catch (const std::runtime_error& e)
{ {
@ -195,7 +195,7 @@ int main()
try try
{ {
spot::acc_cond::mark_t m{0}; spot::acc_cond::mark_t m{0};
m <<= SPOT_NB_ACC + 1; m <<= SPOT_MAX_ACCSETS + 1;
} }
catch (const std::runtime_error& e) catch (const std::runtime_error& e)
{ {
@ -205,7 +205,7 @@ int main()
try try
{ {
spot::acc_cond::mark_t m{0}; spot::acc_cond::mark_t m{0};
m >>= SPOT_NB_ACC + 1; m >>= SPOT_MAX_ACCSETS + 1;
} }
catch (const std::runtime_error& e) catch (const std::runtime_error& e)
{ {