gen: introduce a new automaton family

* spot/gen/automata.cc, spot/gen/automata.hh: Define AUT_L_NBA.
* bin/genaut.cc (--l-nba): New option.
* bin/man/genaut.x, doc/org/genaut.org, NEWS: Document it.
* tests/python/gen.py, tests/core/genaut.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2017-04-27 22:19:21 +02:00
parent 649793df75
commit ec51f976f8
8 changed files with 106 additions and 18 deletions

View file

@ -88,6 +88,39 @@ namespace spot
aut->prop_state_acc(true);
return aut;
}
static twa_graph_ptr
l_nba(unsigned n, bdd_dict_ptr dict)
{
if (n == 0)
throw std::runtime_error("l_nba expects a positive argument");
auto aut = make_twa_graph(dict);
bdd p1 = bdd_ithvar(aut->register_ap("a"));
bdd p2 = bdd_ithvar(aut->register_ap("b"));
bdd a = p1 - p2;
bdd b = p2 - p1;
bdd s = p1 & p2;
bdd all = p1 | p2;
aut->new_states(3 * n + 1);
aut->set_init_state(1);
aut->set_buchi();
aut->prop_state_acc(true);
aut->new_acc_edge(0, n + 1, a);
aut->new_edge(2 * n + 1, 0, b);
for (unsigned s = 1; s <= n; ++s)
{
aut->new_edge(s + n, std::min(s + n + 1, 2 * n), a);
aut->new_edge(s + n, s, b);
aut->new_edge(s, s, all);
aut->new_edge(s, s + 2 * n, a);
aut->new_edge(std::min(s + 2 * n + 1, 3 * n), s + 2 * n, a);
}
return aut;
}
}
twa_graph_ptr aut_pattern(aut_pattern_id pattern, int n, bdd_dict_ptr dict)
@ -105,6 +138,8 @@ namespace spot
// Keep this alphabetically-ordered!
case AUT_KS_COBUCHI:
return ks_cobuchi(n, dict);
case AUT_L_NBA:
return l_nba(n, dict);
case AUT_END:
break;
}
@ -116,6 +151,7 @@ namespace spot
static const char* const class_name[] =
{
"ks-cobuchi",
"l-nba",
};
// Make sure we do not forget to update the above table every
// time a new pattern is added.

View file

@ -31,23 +31,56 @@ namespace spot
AUT_BEGIN = 256,
/// \brief A family of co-Büchi automata.
///
/// ks_cobuchi(n) is a co-Büchi automaton of size 2n+1 that is
/// good-for-games and that has no equivalent deterministic co-Büchi
/// automaton with less than 2^n / (2n+1) states.
/// For details and other classes, see:
///
/// @InProceedings{kuperberg2015determinisation,
/// author={Kuperberg, Denis and Skrzypczak, Micha{\l}},
/// title={On Determinisation of Good-for-Games Automata},
/// booktitle={International Colloquium on Automata, Languages, and
/// Programming},
/// pages={299--310},
/// year={2015},
/// organization={Springer}
/// }
/// Builds a co-Büchi automaton of size 2n+1 that is
/// good-for-games and that has no equivalent deterministic
/// co-Büchi automaton with less than 2^n / (2n+1) states.
///
/// Only defined for n>0
///
/** \verbatim
@InProceedings{ kuperberg.15.icalp,
author = {Denis Kuperberg and Micha{\l} Skrzypczak },
title = {On Determinisation of Good-for-Games Automata},
booktitle = {Proceedings of the 42nd International Colloquium on
Automata, Languages, and Programming (ICALP'15)},
pages = {299--310},
year = {2015},
publisher = {Springer},
series = {Lecture Notes in Computer Science},
volume = 9135,
doi = {10.1007/978-3-662-47666-6_24}
}
\endverbatim */
AUT_KS_COBUCHI = AUT_BEGIN,
/// \brief Hard-to-complement non-deterministic Büchi automata
///
/// Build a non-deterministic Büchi automaton with 3n+1 states
/// and whose complementary language requires an automaton with
/// at least n! states if Streett acceptance is used.
///
/// Only defined for n>0. The automaton constructed corresponds
/// to the right part of Fig.1 in the following paper, except
/// that only state q_1 is initial. (The fact that states q_2,
/// q_3, ..., and q_n are not initial as in the paper does not
/// change the recognized language.)
///
/** \verbatim
@InProceedings{loding.99.fstts,
author = {Christof L{\"o}ding},
title = {Optimal Bounds for Transformations of
$\omega$-Automata},
booktitle = {Proceedings of the 19th Conference on Foundations of
Software Technology and Theoretical Computer Science
(FSTTCS'99)},
year = 1999,
publisher = {Springer},
pages = {97--109},
series = {Lecture Notes in Computer Science},
volume = 1738,
doi = {10.1007/3-540-46691-6_8}
}
\endverbatim */
AUT_L_NBA,
AUT_END
};