lbtt: improve the LBTT output

Provide a way to output automata with state-based acceptance.  Also
print the guards using to_lbt_string() for consistency: as a
consequence, atomic proposition that do not match p[0-9]+ are now
double-quoted.

* src/tgbaalgos/lbtt.hh (lbtt_reachable): Add a sba option.
* src/tgbaalgos/lbtt.cc: Implement it, and use to_lbt_string().
* src/ltlvisit/lbt.cc (is_pnum): Reject 'p' without number.
* src/bin/ltl2tgba.cc: Activate the sba option of --ba was given.
Add an option --lbtt=t to get the old behavior.
* src/bin/man/ltl2tgba.x: Document the LBTT format we use with
some links and examples.
* src/tgbatest/lbttparse.test: More tests.
* src/tgbatest/ltlcross2.test: Add a check with --lbtt --ba.
* NEWS: Update.
This commit is contained in:
Alexandre Duret-Lutz 2013-05-09 19:13:51 +02:00
parent e2378b4904
commit eed7e2df8f
8 changed files with 225 additions and 60 deletions

View file

@ -33,10 +33,11 @@ namespace spot
{
namespace
{
// Does str match p[0-9]+ ?
static bool
is_pnum(const char* str)
{
if (str[0] != 'p')
if (str[0] != 'p' || str[1] == 0)
return false;
while (*++str)
if (*str < '0' || *str > '9')