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:
parent
16a8c03143
commit
a4a0cf3bb2
7 changed files with 143 additions and 108 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue