ltl: keep track of spin-compatible AP

* src/misc/bareword.cc, src/misc/bareword.hh (is_spin_ap): New function.
* src/ltlast/formula.cc, src/ltlast/formula.hh (is_spin_atomic_props):
New method and boolean.
* src/ltlast/atomic_prop.cc, src/ltlast/constant.cc: Update it.
* src/ltltest/kind.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-27 10:21:17 +01:00
parent 16a8c03143
commit a4a0cf3bb2
7 changed files with 143 additions and 108 deletions

View file

@ -23,6 +23,7 @@
#include "config.h"
#include "atomic_prop.hh"
#include "visitor.hh"
#include "misc/bareword.hh"
#include <cstddef>
#include <cassert>
#include <ostream>
@ -60,12 +61,14 @@ namespace spot
// is.lbt_atomic_props should be true if the name has the form
// pNN where NN is any number of digit.
std::string::const_iterator pos = name.begin();
is.lbt_atomic_props = (pos != name.end() && *pos++ == 'p');
while (is.lbt_atomic_props && pos != name.end())
bool lbtap = (pos != name.end() && *pos++ == 'p');
while (lbtap && pos != name.end())
{
char l = *pos++;
is.lbt_atomic_props = (l >= '0' && l <= '9');
lbtap = (l >= '0' && l <= '9');
}
is.lbt_atomic_props = lbtap;
is.spin_atomic_props = lbtap || is_spin_ap(name.c_str());
}
atomic_prop::~atomic_prop()