randaut: new binary

* src/bin/randaut.cc, src/bin/man/randaut.x: New files.
* src/bin/Makefile.am, src/bin/man/Makefile.am: Adjust.
* src/tgbaalgos/randomgraph.hh, src/tgbaalgos/randomgraph.cc:
Add an option to output state-based acceptance, and update
the TGBA properties.
* src/tgbatest/randaut.test: New test.
* src/tgbatest/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2014-11-29 16:04:26 +01:00
parent 61dc1203ca
commit c5842c3a0a
8 changed files with 398 additions and 5 deletions

View file

@ -117,10 +117,15 @@ namespace spot
tgba_digraph_ptr
random_graph(int n, float d,
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
unsigned n_accs, float a, float t, bool deterministic)
unsigned n_accs, float a, float t,
bool deterministic, bool state_acc)
{
assert(n > 0);
auto res = make_tgba_digraph(dict);
if (deterministic)
res->prop_deterministic();
if (state_acc)
res->prop_state_based_acc();
int props_n = ap->size();
int* props = new int[props_n];
@ -181,9 +186,14 @@ namespace spot
int possibilities = n;
unsigned dst;
acc_cond::mark_t m = 0U;
if (state_acc)
m = random_acc_cond(res, n_accs, a);
for (auto& l: labels)
{
acc_cond::mark_t m = random_acc_cond(res, n_accs, a);
if (!state_acc)
m = random_acc_cond(res, n_accs, a);
// No connection to unreachable successors so far. This
// is our last chance, so force it now.

View file

@ -49,6 +49,8 @@ namespace spot
/// to an acceptance set.
/// \param t The probability (between 0.0 and 1.0) that an atomic proposition
/// is true.
/// \param deterministic build a complete and deterministic automaton
/// \param state_acc build an automaton with state-based acceptance
///
/// This algorithms is adapted from the one in Fig 6.2 page 48 of
/** \verbatim
@ -79,7 +81,7 @@ namespace spot
random_graph(int n, float d,
const ltl::atomic_prop_set* ap, const bdd_dict_ptr& dict,
unsigned n_accs = 0, float a = 0.1, float t = 0.5,
bool deterministic = false);
bool deterministic = false, bool state_acc = false);
}
#endif // SPOT_TGBAALGOS_RANDOMGRAPH_HH