Commit 2e165f18 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

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.
parent cc2c4615
......@@ -11,7 +11,7 @@ debian-stable-gcc:
image: registry.lrde.epita.fr/spot-debuild:stable
script:
- autoreconf -vfi
- ./configure --enable-nb-acc=256
- ./configure --enable-max-accsets=256
- make
- make distcheck
artifacts:
......
......@@ -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
wish to use. This is a compile-time option, accessible through
option --with-nb-acc of the configure script. The default is
still 32, but this limit is no longer hardcoded.
option --enable-max-accsets of the configure script. The default
is still 32, but this limit is no longer hardcoded.
- Option "a" of print_dot(), for printing the acceptance condition,
is now enabled by default. Option "A", introduced in Spot 2.4,
......
......@@ -509,7 +509,7 @@ namespace
const spot::const_twa_graph_ptr& aut_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)
<< '*' << autname(j, true)
......
......@@ -649,7 +649,7 @@ static spot::twa_graph_ptr
product(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
{
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);
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)
{
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);
right = ensure_tba(right);
......@@ -965,7 +965,7 @@ parse_opt(int key, char* arg, struct argp_state*)
if (res < 0)
error(2, 0, "acceptance sets should be non-negative:"
" --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"
" acceptance sets: --mask-acc=%ld", res);
opt_mask_acc.set(res);
......
......@@ -691,7 +691,7 @@ namespace
const spot::const_twa_graph_ptr& aut_j,
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
// complemented, or the --verbose option is used,
......
......@@ -60,16 +60,18 @@ AC_ARG_ENABLE([doxygen],
AM_CONDITIONAL([ENABLE_DOXYGEN], [test "x${enable_doxygen:-no}" = xyes])
# Option to indicate the maximal number of acceptance marks
AC_COMPUTE_INT([default_nb_acc], [8*sizeof(unsigned)])
AC_ARG_ENABLE([nb-acc],
[AC_HELP_STRING([--enable-nb-acc=N],
[Use up to N acceptance marks])],
[enable_nb_acc=$enableval], [enable_nb_acc=$default_nb_acc])
if test 0 = `expr $enable_nb_acc % $default_nb_acc`
AC_COMPUTE_INT([default_max_accsets], [8*sizeof(unsigned)])
AC_ARG_ENABLE([max-accsets],
[AC_HELP_STRING([--enable-max-accsets=N],
[Support up to N acceptance sets])],
[enable_max_accsets=$enableval],
[enable_max_accsets=$default_max_accsets])
if test 0 -eq `expr $enable_max_accsets % $default_max_accsets`
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
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
# Activate C11 for gnulib tests
......
......@@ -772,7 +772,7 @@ header-item: "States:" INT
"acceptance condition...");
error(res.accset_loc, "... previously defined here.");
}
else if ($2 > SPOT_NB_ACC)
else if ($2 > SPOT_MAX_ACCSETS)
{
error(@1 + @2,
"this implementation cannot support such a large "
......
......@@ -37,7 +37,7 @@ namespace spot
#define STR(x) #x
#define VALUESTR(x) STR(x)
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)
......
......@@ -52,11 +52,12 @@ namespace spot
[[noreturn]] static void report_too_many_sets();
#endif
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:
// configure guarantees that SPOT_NB_ACC % (8*sizeof(unsigned)) == 0
typedef bitset<SPOT_NB_ACC / (8*sizeof(unsigned))> _value_t;
// configure guarantees that SPOT_MAX_ACCSETS % (8*sizeof(unsigned)) == 0
typedef bitset<SPOT_MAX_ACCSETS / (8*sizeof(unsigned))> _value_t;
_value_t id;
mark_t(_value_t id) noexcept
......@@ -564,7 +565,7 @@ namespace spot
if (n == 0)
return inf({});
acc_cond::mark_t m = mark_t::all();
m >>= (SPOT_NB_ACC - n);
m >>= (SPOT_MAX_ACCSETS - n);
return inf(m);
}
......@@ -573,7 +574,7 @@ namespace spot
if (n == 0)
return fin({});
acc_cond::mark_t m = mark_t::all();
m >>= (SPOT_NB_ACC - n);
m >>= (SPOT_MAX_ACCSETS - n);
return fin(m);
}
......@@ -1245,7 +1246,7 @@ namespace spot
return -1U;
unsigned j = num_;
num_ += num;
if (num_ > SPOT_NB_ACC)
if (num_ > SPOT_MAX_ACCSETS)
report_too_many_sets();
all_ = all_sets_();
return j;
......@@ -1383,7 +1384,7 @@ namespace spot
protected:
mark_t all_sets_() const
{
return mark_t::all() >> (SPOT_NB_ACC - num_);
return mark_t::all() >> (SPOT_MAX_ACCSETS - num_);
}
unsigned num_;
......
......@@ -64,8 +64,8 @@ int main()
auto m1 = spot::acc_cond::mark_t({0, 2});
auto m2 = spot::acc_cond::mark_t({0, 3});
auto m3 = spot::acc_cond::mark_t({2, 1});
auto m4 = spot::acc_cond::mark_t({0, SPOT_NB_ACC-2});
if (!(m4.min_set() == 1 && m4.max_set() == SPOT_NB_ACC-1))
auto m4 = spot::acc_cond::mark_t({0, SPOT_MAX_ACCSETS - 2});
if (!(m4.min_set() == 1 && m4.max_set() == SPOT_MAX_ACCSETS - 1))
return 1;
spot::acc_cond::mark_t m0 = {};
......@@ -185,7 +185,7 @@ int main()
try
{
spot::acc_cond a{SPOT_NB_ACC+1};
spot::acc_cond a{SPOT_MAX_ACCSETS + 1};
}
catch (const std::runtime_error& e)
{
......@@ -195,7 +195,7 @@ int main()
try
{
spot::acc_cond::mark_t m{0};
m <<= SPOT_NB_ACC + 1;
m <<= SPOT_MAX_ACCSETS + 1;
}
catch (const std::runtime_error& e)
{
......@@ -205,7 +205,7 @@ int main()
try
{
spot::acc_cond::mark_t m{0};
m >>= SPOT_NB_ACC + 1;
m >>= SPOT_MAX_ACCSETS + 1;
}
catch (const std::runtime_error& e)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment