randaut: better generation of acceptance conditions

* src/bin/randaut.cc: Replace the --acc-type and --acc-sets
options by a more general --acceptance option, that take either
an acceptance formula, or an acceptance name parametred by ranges.
Also accept a range for the number of atomic propositions.
* src/twaalgos/randomgraph.cc (random_acceptance): Move...
* src/twa/acc.cc, src/twa/acc.hh (random): ... here.
(parse_acc_code): Generalize to accept ranges instead of
numbers whenever sensible, and accept a 'random' acceptance.
* src/tests/randaut.test: Adjust tests and add more.
* wrap/python/tests/randaut.ipynb: Adjust call to randaut.
This commit is contained in:
Alexandre Duret-Lutz 2015-05-25 23:47:59 +02:00
parent d5598a9aaa
commit 88141b2711
6 changed files with 2150 additions and 1998 deletions

View file

@ -521,6 +521,11 @@ namespace spot
static acc_code parity(bool max, bool odd, unsigned sets);
// Number of acceptance sets to use, and probability to reuse
// each set another time after it has been used in the
// acceptance formula.
static acc_code random(unsigned n, double reuse = 0.0);
void append_and(acc_code&& r)
{
if (is_true() || r.is_false())